The `deprecated` field from OpenAPI operations is parsed but not exposed to templates
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 58/100
Research direction
Start with the Operation model in openapi_python_client/schema/openapi_schema_pydantic/operation.py and the Endpoint dataclass and constructor in openapi_python_client/parser/openapi.py. Trace how operation data reaches the endpoint passed to Jinja templates, then verify that a deprecated operation exposes endpoint.deprecated and defaults to false when unspecified.
Written by the indexing model from the issue text.
Description
Describe the bug
The deprecated field on OpenAPI operation objects is parsed into the Operation schema model (operation.py#L31), but it is never carried over to the Endpoint dataclass that is passed to Jinja templates (openapi.py#L132-L152).
This means there is no way to check endpoint.deprecated in a custom template to conditionally emit deprecation warnings, docstring annotations, or @deprecated decorators.
The Endpoint dataclass is missing a deprecated: bool field, and the constructor at openapi.py#L419-L427 does not pass data.deprecated through.
Expected behavior
The Endpoint dataclass should include a deprecated: bool = False field, populated from data.deprecated during construction, so that templates can use {% if endpoint.deprecated %} to customize output for deprecated operations.
OpenAPI Spec File
Any spec with a deprecated operation, for example:
paths:
/example:
get:
operationId: getExample
deprecated: true
responses:
'200':
description: OK
Desktop (please complete the following information):
- OS: macOS 26.3
- Python Version: 3.9.6
- openapi-python-client version: 0.28.2
- Dominant language
- Python
- Stars
- 2k
- Forks
- 293
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openapi-generators/openapi-python-client
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
openapi-generators/openapi-python-client#1451 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
openapi-generators/openapi-python-client#1435 · 1 comment ·
All issues in openapi-generators/openapi-python-client
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/skills#1811 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
speaches-ai/speaches#678 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
datalayer/mcp-compose#42 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
UKGovernmentBEIS/inspect_evals#2523 ·