Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🐛 Fix Enum handling with their own schema definitions#1463

Merged
tiangolo merged 5 commits into
masterfrom
enum-own-schema
May 23, 2020
Merged

🐛 Fix Enum handling with their own schema definitions#1463
tiangolo merged 5 commits into
masterfrom
enum-own-schema

Conversation

@tiangolo

Copy link
Copy Markdown
Member

🐛 Fix Enum handling with their own schema definitions.

I missed an error in #1461 , the story is a bit more complex. This currently breaks Swagger UI when using enums in other parts apart from bodies (e.g. path params).

It's necessary to add enums to the whole handling with OpenAPI of models to include the new definition in the components.

These changes plus a couple of updates in pydantic/pydantic#1432 work correctly in Swagger UI and generate an independent schema for enums (which was the original intention).

@github-actions

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented May 23, 2020

Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1463   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          227       227           
  Lines         6807      6810    +3     
=========================================
+ Hits          6807      6810    +3     
Impacted Files Coverage Δ
...test_tutorial/test_path_params/test_tutorial005.py 100.00% <ø> (ø)
fastapi/dependencies/utils.py 100.00% <100.00%> (ø)
fastapi/openapi/utils.py 100.00% <100.00%> (ø)
fastapi/utils.py 100.00% <100.00%> (ø)

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 98bb9f1...6751321. Read the comment docs.

@tiangolo tiangolo merged commit 5984233 into master May 23, 2020
@tiangolo tiangolo deleted the enum-own-schema branch May 23, 2020 16:56
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.

1 participant