Fix error messages for Literal types with multiple allowed values#770
Merged
samuelcolvin merged 2 commits intopydantic:v0.32.xfrom Aug 21, 2019
Merged
Fix error messages for Literal types with multiple allowed values#770samuelcolvin merged 2 commits intopydantic:v0.32.xfrom
samuelcolvin merged 2 commits intopydantic:v0.32.xfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## v0.32.x #770 +/- ##
======================================
Coverage 100% 100%
======================================
Files 15 15
Lines 2733 2736 +3
Branches 543 543
======================================
+ Hits 2733 2736 +3 |
|
|
||
|
|
||
| def multivalue_literal_field_for_schema(values: Tuple[Any, ...], field: Field) -> Field: | ||
| field = Field( |
Member
There was a problem hiding this comment.
Suggested change
| field = Field( | |
| return Field( |
Contributor
Author
There was a problem hiding this comment.
my dreams of a one-commit pull request dashed
Member
There was a problem hiding this comment.
sorry. 🙇♂️
I'll try to stop being such a pedant (pun intended).
Member
|
thanks so much. |
samuelcolvin
added a commit
that referenced
this pull request
Oct 1, 2019
* fix(validate-assignment): do not validate extra fields when `vaidate_assignment` is on * Update history * Fix `value` vs. `value_` * Add tests for `value` vs `value_` case * uprev * Fix generic required (#742) * Fix required fields on GenericModel * lint * version up * __post_init__ with inheritance, fix #739 (#740) * Fix custom Schema on GenericModel fields (#754) * Fix custom Schema on GenericModel fields * Add PR# * uprev * Fix error messages for Literal types with multiple allowed values (#770) * Fix error messages for Literal types with multiple allowed values * Incorporate feedback * update history
andreshndz
pushed a commit
to cuenca-mx/pydantic
that referenced
this pull request
Jan 17, 2020
* fix(validate-assignment): do not validate extra fields when `vaidate_assignment` is on * Update history * Fix `value` vs. `value_` * Add tests for `value` vs `value_` case * uprev * Fix generic required (pydantic#742) * Fix required fields on GenericModel * lint * version up * __post_init__ with inheritance, fix pydantic#739 (pydantic#740) * Fix custom Schema on GenericModel fields (pydantic#754) * Fix custom Schema on GenericModel fields * Add PR# * uprev * Fix error messages for Literal types with multiple allowed values (pydantic#770) * Fix error messages for Literal types with multiple allowed values * Incorporate feedback * update history
alexdrydew
pushed a commit
to alexdrydew/pydantic
that referenced
this pull request
Dec 23, 2023
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Fix error messages for Literal types with multiple allowed values
Related issue number
Fixes #768
Checklist
changes/<pull request or issue id>-<github username>.rstfile added describing change(see changes/README.md for details)