A known problem API router package
Project description
FastAPI Known Problems API router
Override the FastAPI APIRouter to handle endpoints' known problems at router level. For known problems a response following the RFC 7807 is be returned.
Examples
To run the examples execute the uvicorn command from the examples
directory of the project.
e.g. known-problems-fastapi-router/examples$
uvicorn basic_usage.web:app --host 0.0.0.0 --port 8000
After running the example code through the CLI three example documentations will be available at the following URLs:
-
Swagger: http://0.0.0.0:8000/docs
-
Redoc: http://0.0.0.0:8000/redoc
-
RapiDoc: http://0.0.0.0:8000/rapidoc
FastAPI validation error
FastAPI Validation Error has to be handled by the FastAPI exception handler middleware.
@app.exception_handler(RequestValidationError)
async def custom_exception_handler(
request: Request, exc: RequestValidationError
):
return standard_validation_exception_handler(request, exc)
Project details
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
File details
Details for the file known_problems_fastapi_router-0.1.2.tar.gz
.
File metadata
- Download URL: known_problems_fastapi_router-0.1.2.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62f4908a718fa4b2f595469109721c62381b4c9aa472b6556dd3be61ac1297fc |
|
MD5 | 0ae0557e868169052b6feea54609b11b |
|
BLAKE2b-256 | da796a0d9634518ebbe1a43251eac1873fcfaee4c53112c1bdad8145fb8a7ed7 |
File details
Details for the file known_problems_fastapi_router-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: known_problems_fastapi_router-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4917b9b1dd08116def5e4e4a64081d163e9d682bfa6d51796bfd602e1bd95f51 |
|
MD5 | 95140ce914fc01b506413948f2475e25 |
|
BLAKE2b-256 | d91b843acf44a41dafd2e7a200ad98ef75692795db05f88f3014d42a0040d19f |