Extend a FastAPI OpenAPI spec to include all possible HTTPException or custom Exception response schemas.
Project description
fastapi-docx
Add HTTPException responses to a FastAPI OpenAPI spec
Documentation: https://saran33.github.io/fastapi-docx
Source Code: https://github.com/Saran33/fastapi-docx
FastAPI-docx extends the FastAPI OpenAPI spec to include all possible HTTPException
or custom Exception response schemas that may be raised within path operations.
The key features are:
- Document Exception Responses: Automatically find all possible respones within path operations, whether they originate from a
HTTPException
raised by the endpoint function directly, in a nested function, class method, or callable class instance, or by the fastAPI dependency-injection system. - Include Custom Exceptions: Optionally find and document any custom Exception types if using custom Exception handlers in your FastAPI application.
- Generate Exception schemas: A default
HTTPExceptionSchema
will be added to the OpenAPI specification. The default can be modified to use any other Pydantic model. An additional schema for app-specific custom Exceptions can also be included.
Dependencies
- Pydantic V2: From version 1.0 of fastapi-docx, Pydantic V2 is required. For Pydantic V1 support, use fastapi-docx version 0.2.
License
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastapi_docx-1.0.tar.gz
(8.6 kB
view hashes)
Built Distribution
Close
Hashes for fastapi_docx-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9164f3f639d8c5d053149ccef962830acf03eccb3b12b3c698a414086087113c |
|
MD5 | d10950dd5b94a0a537e9b141f71a2129 |
|
BLAKE2b-256 | 35cd76ffeee705dfd00ad4a3192df990ffa75254db6d2ea7649faf3d62d7ee61 |