You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Firstly a HUGE thanks for this.
Using tag metadata as per Metadata and Docs URLs
When implementing VersionedFastAPI, original openapi tags / tag metadata disappear from openapi.json
To Reproduce
from fastapi import FastAPI
from fastapi_versioning import VersionedFastAPI
import uvicorn
tags_metadata = [
{
"name":"root",
"description":"Root description here"
}
]
original_app = FastAPI(title="Items API", description="API for Items in the database.", openapi_tags=tags_metadata)
@original_app.get("/", tags=["root"])
def root():
return {"root":"hello"}
versioned_app = VersionedFastAPI(original_app, version_format='{major}', prefix_format='/v{major}', enable_latest=True, openapi_tags=tags_metadata)
if __name__== "__main__":
uvicorn.run(original_app, host="0.0.0.0", port=8000)
# uvicorn.run(versioned_app, host="0.0.0.0", port=8000)
If you run uvicorn.run(original_app, host="0.0.0.0", port=8000), Root description here appears in openapi.json as expected.
If you run uvicorn.run(versioned_app, host="0.0.0.0", port=8000), Root description here disappears from openapi.json
Expected behavior
Expected openapi tags to carry over to versioned api.
Additional context
Thanks for the versioning module - aside from this issue it has been awesome!
The text was updated successfully, but these errors were encountered:
Describe the bug
Firstly a HUGE thanks for this.
Using tag metadata as per Metadata and Docs URLs
When implementing VersionedFastAPI, original openapi tags / tag metadata disappear from openapi.json
To Reproduce
If you run
uvicorn.run(original_app, host="0.0.0.0", port=8000)
, Root description here appears in openapi.json as expected.If you run
uvicorn.run(versioned_app, host="0.0.0.0", port=8000)
, Root description here disappears from openapi.jsonExpected behavior
Expected openapi tags to carry over to versioned api.
Additional context
Thanks for the versioning module - aside from this issue it has been awesome!
The text was updated successfully, but these errors were encountered: