Overview
FastAPI provides advanced configuration options for path operation decorators that give you fine-grained control over your API’s behavior and OpenAPI documentation.Operation ID
You can set a custom operation ID for your path operation. This is particularly useful when generating API clients, as the operation ID becomes the function name in the generated client.Summary and Description
You can add a summary and description to your path operations:summary parameter provides a short title.
Response Description
Customize the description of the successful response:The default
response_description is “Successful Response”.Deprecation
Mark an endpoint as deprecated:Tags
Organize your endpoints with tags:Include in Schema
Exclude an endpoint from the OpenAPI schema:This is useful for internal endpoints that you don’t want to expose in your API documentation.
OpenAPI Extra
Add custom OpenAPI fields that aren’t directly supported:openapi_extra dictionary is merged into the OpenAPI schema for this path operation.