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.0.tar.gz
.
File metadata
- Download URL: known_problems_fastapi_router-0.1.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96d6895a9cd4eceb63f8076a498971cce7bf87d51ce4bf2bbb44ab2d694c5cdb |
|
MD5 | 58b13bce4049b3f9b0b0b35a2f776f77 |
|
BLAKE2b-256 | 6b2e450cf5450962b79d487396b91254ade23b8b02464b6273e469267536c26c |
File details
Details for the file known_problems_fastapi_router-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: known_problems_fastapi_router-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4db816b5b917068b5ba9033a9be808dc064c3bcbf72ef87de6f251331cc50d6e |
|
MD5 | cedb009d08a6fcc88720276cadfb4150 |
|
BLAKE2b-256 | 424c93e5673664bee5ab6127e07e54a8539aad66211df2560065cc269ae84117 |