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

Fix union body #400

Merged
merged 3 commits into from
Aug 7, 2019
Merged

Fix union body #400

merged 3 commits into from
Aug 7, 2019

Conversation

koxudaxi
Copy link
Contributor

The PR fix union body bug.

Detail

FastAPI can't handle a body as union type.
I found parameter detected condition is wrong, which don't care union type.

Related issue

#300

@codecov
Copy link

codecov bot commented Jul 22, 2019

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #400   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files         238    240    +2     
  Lines        5566   5626   +60     
=====================================
+ Hits         5566   5626   +60
Impacted Files Coverage Δ
tests/test_union_body.py 100% <100%> (ø)
tests/test_union_inherited_body.py 100% <100%> (ø)
fastapi/dependencies/utils.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 6ca3ce8...00e2bf2. Read the comment docs.

@tiangolo tiangolo merged commit 06eb421 into fastapi:master Aug 7, 2019
@tiangolo
Copy link
Member

tiangolo commented Aug 7, 2019

Thank you @koxudaxi ! Great job debugging and finding the problem. 🍰 🚀

I just updated the implementation a bit to avoid the internal declaration of a sub-function and added a couple of comments in the tests to clarify why Unions with inheritance are only supported in Python 3.7.

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.

None yet

2 participants