-
-
Notifications
You must be signed in to change notification settings - Fork 67
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 typing.Literal #435
Add support for typing.Literal #435
Conversation
…dictionary key, and add verbosity to exception messages
…s to bottom of file, and remove dead code
Codecov Report
@@ Coverage Diff @@
## master #435 +/- ##
=======================================
Coverage 99.29% 99.30%
=======================================
Files 26 26
Lines 1560 1578 +18
Branches 285 289 +4
=======================================
+ Hits 1549 1567 +18
Misses 3 3
Partials 8 8
|
… cases to increase code coverage
@marcosschroh unable to add you as a reviewer, so doing a manual ping. Whenever you have time |
… as unions when a default value is present
…rals as typehook was removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellen @OffByOnee. Thanks for your hard work!
@marcosschroh sure thing! Thanks for walking me through the changes. |
This change adds support for fields annotated with
typing.Literal
in line with PEP 586. It also adds support for dictionaries annotated with a key whose type is a class derived fromstr
(e.g.StrEnum
) and adds verbosity to exception messages to help with debugging (particularly in nested models when it's difficult to identify the problem field).