Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saran33/fastapi-docx
Extend a FastAPI OpenAPI spec to include all possible HTTPException or custom Exception response schemas..
https://github.com/saran33/fastapi-docx
fastapi openapi python
Last synced: 8 days ago
JSON representation
Extend a FastAPI OpenAPI spec to include all possible HTTPException or custom Exception response schemas..
- Host: GitHub
- URL: https://github.com/saran33/fastapi-docx
- Owner: Saran33
- License: mit
- Created: 2023-01-02T14:14:51.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-24T20:23:25.000Z (4 months ago)
- Last Synced: 2024-10-14T19:40:29.567Z (about 1 month ago)
- Topics: fastapi, openapi, python
- Language: Python
- Homepage:
- Size: 1.25 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](*https://github.com/pydantic/pydantic) model. An additional schema for app-specific custom Exceptions can also be included.##### Dependencies
* [Pydantic V2](https://github.com/pydantic/pydantic): 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.