Fastapi: Tags metadata is missing from docs

Created on 26 Jun 2020  路  3Comments  路  Source: tiangolo/fastapi

First check

  • [x] I added a very descriptive title to this issue.
  • [x] I used the GitHub search to find a similar issue and didn't find it.
  • [x] I searched the FastAPI documentation, with the integrated search.
  • [x] I already searched in Google "How to X in FastAPI" and didn't find any information.
  • [x] I already read and followed all the tutorial in the docs and didn't find an answer.
  • [x] I already checked if it is not related to FastAPI but to Pydantic.
  • [ ] I already checked if it is not related to FastAPI but to Swagger UI.
  • [ ] I already checked if it is not related to FastAPI but to ReDoc.
  • [x] After submitting this, I commit to one of:

    • Read open issues with questions until I find 2 issues where I can help someone and add a comment to help there.

    • I already hit the "watch" button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future.

    • Implement a Pull Request for a confirmed bug.


First of all, thank you for producing such an awesome project! Working with FastAPI has been an absolute pleasure so far!

Example

Following the the FastAPI example

from fastapi import FastAPI

tags_metadata = [
    {
        "name": "users",
        "description": "Operations with users. The **login** logic is also here.",
    },
    {
        "name": "items",
        "description": "Manage items. So _fancy_ they have their own docs.",
        "externalDocs": {
            "description": "Items external docs",
            "url": "https://fastapi.tiangolo.com/",
        },
    },
]

app = FastAPI(openapi_tags=tags_metadata)


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


@app.get("/items/", tags=["items"])
async def get_items():
    return [{"name": "wand"}, {"name": "flying broom"}]

Description

  • When running the example above and accessing the generated docs (both /docs and /redoc), the tag descriptions are not visible (e.g. "description": "Operations with users. The **login** logic is also here." is missing).

Environment

  • OS: Ubuntu 20.04 LTS:
  • FastAPI Version: 0.55.1
  • Python version: 3.6.9
  • Both Firefox and Chromium

Additional context

  • I also tried the solution here which does work.
question

Most helpful comment

Everyone here, it is now natively supported in FastAPI from version 0.57.0. 馃帀

Could you upgrade your FastAPI version?

All 3 comments

Everyone here, it is now natively supported in FastAPI from version 0.57.0. 馃帀

Could you upgrade your FastAPI version?

Thanks @phy25 will try this tomorrow and close

For reference: If you're using docker you're probably here because of tiangolo/uvicorn-gunicorn-fastapi-docker/issues/53. See that ticket for a temporary solution.

Was this page helpful?
0 / 5 - 0 ratings