-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

FastAPI Cookbook
By :

FastAPI automatically generates documentation for your API using Swagger UI and Redoc, when spinning the server.
This documentation is derived from your route functions and Pydantic models, making it incredibly beneficial for both development and consumption by frontend teams or API consumers.
In this recipe, we will see how to customize the documentation’s specific needs.
By default, FastAPI provides two documentation interfaces:
/docs
endpoint (e.g., http://127.0.0.1:8000/docs
)/redoc
endpoint (e.g., http://127.0.0.1:8000/redoc
)These interfaces offer dynamic documentation where users can see and test the API endpoints and their details. However, both pieces of documentation can be modified.
FastAPI allows the customization of Swagger UI. You can add metadata, customize the look, and add additional documentation...