Skip to content

Conversation

@PrettyWood
Copy link
Collaborator

@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.

@PrettyWood PrettyWood force-pushed the fix/literal-enum-schema branch from accca08 to 6c87bda Compare April 7, 2021 08:43
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.

@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
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

Development

Successfully merging this pull request may close these issues.

Schema generated for Literal[MyEnum.MEMBER] is too lax? Cannot generate JSON schema anymore with Literal[MyEnum.MEMBER]

3 participants