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(schema): JSON schema generation with a Literal of an enum member #2536

Merged
merged 2 commits into from May 9, 2021

Conversation

PrettyWood
Copy link
Member

@PrettyWood PrettyWood commented Mar 16, 2021

Change Summary

Support JSON schema generation with a Literal of an enum member

Related issue number

closes #2534
closes #2535

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)

@codecov
Copy link

codecov bot commented Mar 16, 2021

Codecov Report

Merging #2536 (accca08) into master (7b7e705) will not change coverage.
The diff coverage is 100.00%.

❗ Current head accca08 differs from pull request most recent head 0098070. Consider uploading reports for the commit 0098070 to get more accurate results

@@            Coverage Diff            @@
##            master     #2536   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines         5109      5110    +1     
  Branches      1050      1050           
=========================================
+ Hits          5109      5110    +1     
Impacted Files Coverage Δ
pydantic/schema.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 9cc6d44...0098070. Read the comment docs.

Copy link
Contributor

@Kilo59 Kilo59 left a comment

Choose a reason for hiding this comment

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

Made some very minor comments, but LGTM.

pydantic/schema.py Show resolved Hide resolved
tests/test_schema.py Show resolved Hide resolved
pydantic/schema.py Show resolved Hide resolved
@samuelcolvin samuelcolvin merged commit 4753901 into pydantic:master May 9, 2021
@PrettyWood PrettyWood deleted the fix/literal-enum-schema branch May 9, 2021 13:25
samuelcolvin added a commit that referenced this pull request May 11, 2021
#2536)

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V1 Bug related to Pydantic V1.X ready for review
Projects
None yet
3 participants