Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fastapi_responses to include raised Exceptions in the openapi file #459

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

armanddidierjean
Copy link
Member

Description

Capture d’écran 2024-06-02 à 18 07 07

Notes

  • currently fastapi_responses does not support discovering custom HTTPExceptions (like ContentException from Add ContentHTTPException and AuthHTTPException #458)
  • the last fastapi_responses version has a bug which may create an infinite loop, this happens with /auth/token
  • only one exception can be included per status_code. This means that if an endpoint raise both HTTPException(404, "first error") and HTTPException(404, "second error"), only one of them will be included in the openapi schema

Checklist

  • All tests passing
  • Extended the documentation, if necessary

@armanddidierjean armanddidierjean added enhancement New feature or request core labels Jun 2, 2024
Copy link

codecov bot commented Jun 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.76%. Comparing base (4624083) to head (1aa741e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #459   +/-   ##
=======================================
  Coverage   82.76%   82.76%           
=======================================
  Files          98       98           
  Lines        6086     6088    +2     
=======================================
+ Hits         5037     5039    +2     
  Misses       1049     1049           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant