8000 Add support for adding OpenAPI schema for GET requests with a body by victorphoenix3 · Pull Request #1626 · 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

Add support for adding OpenAPI schema for GET requests with a body #1626

Merged
merged 4 commits into from
Jul 19, 2020

Conversation

victorphoenix3
Copy link
Contributor
@victorphoenix3 victorphoenix3 commented Jun 25, 2020

Related to #713 .

@codecov
Copy link
codecov bot commented Jun 25, 2020

Codecov Report

Merging #1626 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            master     #1626    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          227       239    +12     
  Lines         6810      7047   +237     
==========================================
+ Hits          6810      7047   +237     
Impacted Files Coverage Δ
fastapi/dependencies/utils.py 100.00% <100.00%> (ø)
fastapi/openapi/constants.py 100.00% <100.00%> (ø)
tests/test_get_request_body.py 100.00% <100.00%> (ø)
tests/main.py 100.00% <0.00%> (ø)
fastapi/utils.py 100.00% <0.00%> (ø)
fastapi/params.py 100.00% <0.00%> (ø)
fastapi/routing.py 100.00% <0.00%> (ø)
tests/test_path.py 100.00% <0.00%> (ø)
fastapi/encoders.py 100.00% <0.00%> (ø)
tests/test_query.py 100.00% <0.00%> (ø)
... and 91 more

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 543ef77...7ba8167. Read the comment docs.

@victorphoenix3
Copy link
Contributor Author

@IamCathal could you take a look at this?


@app.get("/product")
async def create_item(product: Product):
pass
Copy link
Contributor
@rkbeatss rkbeatss Jun 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victorphoenix3 i think this is where the coverage is missing so try adding # pragma: no cover here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey thanks @rkbeatss . It worked!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the help @rkbeatss ! 🤓

@victorphoenix3 victorphoenix3 force-pushed the get branch 3 times, most recently from f416e25 to 065be3c Compare July 2, 2020 08:57
@victorphoenix3
Copy link
Contributor Author

@tiangolo The PR is ready for review.

@tiangolo tiangolo changed the title Add Test for get request body's openapi schema Add support for adding OpenAPI schema for GET requests with a body Jul 19, 2020
@tiangolo tiangolo merged commit 2b47f3e into fastapi:master Jul 19, 2020
@tiangolo
Copy link
Member

Awesome @victorphoenix3 ! 🚀 🎉

I updated the test to check that it actually can receive a body in a GET request and to keep the same style of testing OpenAPI from other tests.

Thanks for your contribution! 🍰 🎉

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.

3 participants
0