Menu

FastAPI: Customize Your OpenAPI Docs — Change the Title, Tag Endpoints, and Hide Internal Routes in 5 Minutes
📰

FastAPI: Customize Your OpenAPI Docs — Change the Title, Tag Endpoints, and Hide Internal Routes in 5 Minutes

DEV Community: fastapi·Linh Fish Dev·16 days ago
#VsaCNPoE
#devtofastapi#devto#dev#fastapi#version
Long article (950 words) — no AI summary yet.
Reading 0:00
15s threshold

FastAPI generates Swagger UI and ReDoc documentation from your code automatically, but by default it carries the generic name “FastAPI” and lists every endpoint — including internal ones you would rather not show. Just pass title, description, version, and openapi_tags to FastAPI(), add tags to each route, and set include_in_schema=False on the endpoints you want to hide, and the docs become tidy and on-brand right away. This works for any FastAPI project, with no extra library to install.

The Problem

When you create an app with a bare FastAPI(), the /docs page shows the title “FastAPI”, a default description, and version “0.1.0”. Every endpoint lands in one “default” group with no description, so readers have to guess what each route does. Worse, internal endpoints such as /admin/stats or /internal/health also show up in the public docs — anyone who opens /docs can see how the system works.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.