🐛 Fix support for query parameters with list types, handle JSON encoding Pydantic UndefinedType#9929
Merged
tiangolo merged 4 commits intoApr 18, 2024
Conversation
iudeen
approved these changes
Aug 22, 2023
|
Thanks @arjwilliams! I would love to get that fix! |
YuriiMotov
approved these changes
Feb 20, 2024
Member
There was a problem hiding this comment.
Reviewed this PR. Looks good!
I confirm, that the issue is still relevant to Fatsapi 0.109.2.
This PR fixes problem and does it the right way.
New test fails before changes and passes after.
I also think this issue is quite important, as encountering this problem can lead to a lot of confusion.
UndefinedType
Member
|
Great, thank you @arjwilliams! 🚀 I added a couple of extra tests for that specific use case from the issue. 🤓 Thanks all for the feedback and conversation here everyone! ☕ This will be available in FastAPI version 0.110.2 in the next few hours. 🚀 |
1 task
hsuanchi
pushed a commit
to hsuanchi/fastapi
that referenced
this pull request
May 26, 2024
…ing Pydantic `UndefinedType` (fastapi#9929) Co-authored-by: Andrew Williams <[email protected]> Co-authored-by: Sebastián Ramírez <[email protected]>
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.
Related to #9920.
Pydantic recently added new field
inputto the validation error details. The FastAPI JSON encoder wasn't able to encode theinputfield when the value wasPydanticUndefined, such as the case shown in #9920.Fix is to encode
PydanticUndefinedvalues asNone.