Metadata-Version: 2.1
Name: known-problems-fastapi-router
Version: 0.111.0
Summary: A known problem API router package
License: MIT
Author: Fabian Haenel
Author-email: fabian.haenel@fastlane.net
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: fastapi (==0.111)
Requires-Dist: pydantic (>=2.3,<3)
Description-Content-Type: text/markdown

### 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](https://datatracker.ietf.org/doc/html/rfc7807) 
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$`

```bash
 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](http://0.0.0.0:8000/docs)

- Redoc: [http://0.0.0.0:8000/redoc](http://0.0.0.0:8000/redoc)

- RapiDoc: [http://0.0.0.0:8000/rapidoc](http://0.0.0.0:8000/rapidoc)

### FastAPI validation error

FastAPI Validation Error has to be handled by the FastAPI exception handler middleware.

```python
@app.exception_handler(RequestValidationError)
build_validation_error_exception_handler("example.com")
```

