add check for default value being null
This commit is contained in:
parent
3fb8450fb5
commit
9e963338ef
@ -285,7 +285,8 @@ def true_type_for_pydantic_field(f: ModelField):
|
|||||||
type_ = f.outer_type_
|
type_ = f.outer_type_
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(isinstance(f.annotation, str) and f.annotation.startswith("Optional"))
|
f.field_info.default is None
|
||||||
|
or (isinstance(f.annotation, str) and f.annotation.startswith("Optional"))
|
||||||
or (
|
or (
|
||||||
isinstance(f.annotation, ForwardRef)
|
isinstance(f.annotation, ForwardRef)
|
||||||
and f.annotation.__forward_arg__.startswith("Optional")
|
and f.annotation.__forward_arg__.startswith("Optional")
|
||||||
|
Loading…
Reference in New Issue
Block a user