Options¶
- Error builder: replace the body of the validation error with your own Pydantic model, in the response and in the schema.
- Media type: send and document the error under another content type, such as
application/problem+json. - Merge target response: what happens when a route already declares a response at the target code.
- Custom 422 response: keep a
422of your own next to the validation error. - Handle exceptions: patch the schema only, and send the response from your own handler.
- Custom
app.openapi: keep a custom OpenAPI function you already have. - Patch 422 responses: patch a schema you build yourself with
get_openapi(). - Webhooks and callbacks: the validation error in webhooks and callbacks.
- Reverse proxy and sub-apps:
root_path, and an override that applies to one mounted app only.