8000 Don't use default HTTPValidationError for HTTP_422 if custom one defined by divums · Pull Request #437 · fastapi/fastapi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

Don't use default HTTPValidationError for HTTP_422 if custom one defined #437

Merged
merged 2 commits into from
Aug 30, 2019
Merged

Don't use default HTTPValidationError for HTTP_422 if custom one defined #437

merged 2 commits into from
Aug 30, 2019

Conversation

divums
Copy link
Contributor
@divums divums commented Aug 14, 2019

Use the custom definitions for HTTP_422 is available, otherwise fall back to the default one.
And use the response_class.media_type for additional_responses.

Fixes #429

@codecov
Copy link
codecov bot commented Aug 14, 2019

Codecov Report

Merging #437 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #437   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files         240    243    +3     
  Lines        5626   5672   +46     
=====================================
+ Hits         5626   5672   +46
Impacted Files Coverage Δ
fastapi/openapi/utils.py 100% <100%> (ø) ⬆️
...st_additional_responses_default_validationerror.py 100% <100%> (ø)
tests/test_additional_responses_response_class.py 100% <100%> (ø)
...est_additional_responses_custom_validationerror.py 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 033bc2a...3166c86. Read the comment docs.

@tiangolo tiangolo merged commit 19c53b2 into fastapi:master Aug 30, 2019
@tiangolo
Copy link
Member

Excellent job! Thank you! 🚀 🍰

tsouvarev added a commit to tsouvarev/fastapi that referenced this pull request Sep 10, 2019
Code from fastapi#437 checks for custom schemas on response, 
but it missed the fact that all codes are uppercased in https://github.com/tiangolo/fastapi/blob/master/fastapi/openapi/utils.py#L196
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenAPI: HTTP_422 response does not use custom media_type
2 participants
0