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
HTTPExceptionraised 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
HTTPExceptionSchemawill 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_docx-1.0.3.tar.gz.
File metadata
- Download URL: fastapi_docx-1.0.3.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.11.4 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca8c7616e5a54d670b21bcba841b305d2b2f2ac3a762bd751b73e77efcb96e20
|
|
| MD5 |
a7a6d211f9b705f7c63c0837135ecca4
|
|
| BLAKE2b-256 |
3de0588217aeb85834756a0df06964a235cb0240c652cf264e26b5f084adf0e2
|
File details
Details for the file fastapi_docx-1.0.3-py3-none-any.whl.
File metadata
- Download URL: fastapi_docx-1.0.3-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.11.4 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5aab2c817a6b4c480329fc4b937c59679110d98d23161cd8681c2f384759a798
|
|
| MD5 |
95b8d04f536e5e2f9bb03b369d7168de
|
|
| BLAKE2b-256 |
29e7a071ba6ca0dde4d9f3a066637a5de20e27e5a5a417d37822026d32226446
|