Fix bug introduced in #14482 which breaks openapi generation in special cases#14805
Fix bug introduced in #14482 which breaks openapi generation in special cases#14805ilovemesomeramen wants to merge 2 commits intofastapi:masterfrom
Conversation
|
@ilovemesomeramen, thank you for your interest and efforts! |
|
@YuriiMotov What do you mean exactly? The provided example is exactly the issue which this PR solved, this example worked in 0.124.0 but does not in 0.124.1 A little bit of context why this is needed: the provided test case is based on this test: tests/test_arbitrary_types.py The Problem is the Union with a single value in it this worked before and no longer works since the type is not properly extracted. |
#14482 added the model_config to the ModelField to support arbitrary types, however the if statement did not check for all the correct types.
This PR brings the check inline with the internal pydantic TypeAdapter check which would throw an error in some cases, e.g. Union fields with single Values.