Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using versioning is breaking the tags_metadata in the generated docs #66

Open
dk766 opened this issue Feb 11, 2022 · 0 comments
Open

Using versioning is breaking the tags_metadata in the generated docs #66

dk766 opened this issue Feb 11, 2022 · 0 comments

Comments

@dk766
Copy link

dk766 commented Feb 11, 2022

Describe the bug
Using the versioning breaks some of the tags_metadata functionality .

To Reproduce
Steps to reproduce the behavior:

  1. create a small app:
tags_metadata = [
    {
        "name": "users",
        "description": "Operations with users. The **login** logic is also here.",
    },
]


app = FastAPI(openapi_tags=tags_metadata)

@app.get("/users/", tags=["users"])
@version(1)
async def get_users():
    return [{"name": "Harry"}, {"name": "Ron"}]

app = VersionedFastAPI(
    app,
    version_format="{major}",
    prefix_format="/api/v{major}",
)

2.run it and check the generated documentation at:
/api/v1/docs

Expected behavior
Notice that above the get_users method you will see the expected tag
"Users"
but the description will not be displayed.
The expected behavior obtained if versioning is not used is that both the Tag and the Description will be displayed:
"Users Operations with users. The login logic is also here."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant