chore: documentation (#76)

* chore: update docstring example to use python code block

* docs: add documentation

* feat: add docs build + fix other workdlows

* fix: add missing return type
This commit is contained in:
d3vyce
2026-02-19 16:43:38 +01:00
committed by GitHub
parent 73fae04333
commit 6714ceeb92
42 changed files with 2008 additions and 40 deletions

View File

@@ -12,6 +12,7 @@ class ApiException(Exception):
The exception handler will use api_error to generate the response.
Example:
```python
class CustomError(ApiException):
api_error = ApiError(
code=400,
@@ -19,6 +20,7 @@ class ApiException(Exception):
desc="The request was invalid.",
err_code="CUSTOM-400",
)
```
"""
api_error: ClassVar[ApiError]
@@ -114,6 +116,7 @@ def generate_error_responses(
Dict suitable for FastAPI's responses parameter
Example:
```python
from fastapi_toolsets.exceptions import generate_error_responses, UnauthorizedError, ForbiddenError
@app.get(
@@ -122,6 +125,7 @@ def generate_error_responses(
)
async def admin_endpoint():
...
```
"""
responses: dict[int | str, dict[str, Any]] = {}