g0di / fastapi-problem-details

Structure your FastAPI API error responses with consistent and machine readable format using the RFC 9457 "Problem Details for HTTP APIs" standard
MIT License
1 stars 0 forks source link

Register Problem responses in the API as default responses #3

Open g0di opened 3 months ago

g0di commented 3 months ago

Validation, unhandled and unexisting routes errors are currently automatically catched and returns Problem Details object with some extra properties (like errors for validation errors).

We should then register custom Problem schema for each in affected APIs so clients can see that routes may returns 500, 400 or 404 errors as Problem Details with some additional properties. This way, clients can be aware of those extra properties.