OpenAPITools / OpenAPITools/openapi-generator
[BUG] [Python] Fast Api Generator Ignoring deprecated field
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
[BUG] [Python] Fast Api Generator Ignoring deprecated field
openapi-generator version
Name docker.io/openapitools/openapi-generator-cli
Tag latest
ID sha256:6aecb9a9366977b5cb48eb06a3e21b5a1dced7de8794acc052732ac7b0862604
Size 303.5 MB
Age 1 month
OpenAPI declaration file content or url
https://github.com/lek18/openapi-101/blob/main/openapi.json
Generation Details
sh scripts/reload_open_api_spec.sh
Steps to reproduce
- clone the above repo.
- run the above script
- inspect the file : src/openapi_server/apis/default_api.py
- the /deprecate-endpoint is not having deprecate=True
@router.get(
"/deprecated-endpoint",
responses={
200: {"model": DeprecatedEndpointGet200Response, "description": "Successful response"},
},
tags=["default"],
summary="Deprecated Endpoint",
response_model_by_alias=True,
)
async def deprecated_endpoint_get(
) -> DeprecatedEndpointGet200Response:
"""This endpoint is deprecated and will be removed in the future."""
if not BaseDefaultApi.subclasses:
raise HTTPException(status_code=500, detail="Not implemented")
return await BaseDefaultApi.subclasses[0]().deprecated_endpoint_get()
Related issues/PRs
Suggest a fix
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.
Research direction
Start with the OpenAPI declaration in the linked openapi.json repository and run scripts/reload_open_api_spec.sh. Inspect the generated src/openapi_server/apis/default_api.py for the deprecated endpoint and trace how its deprecated field is represented. Done means the generated route includes the expected deprecation setting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fastapi, openapi, python
- Domain
- api, backend-api-design, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 44/100