@@ -148,37 +148,33 @@ def _deconstruct_config(self, kwargs):
148148 kwargs .update (self .export_params , config = self .config )
149149
150150
151+ if t .TYPE_CHECKING :
152+ OptSchemaT = t .Optional [base .SchemaT ]
153+
151154@t .overload
152155def SchemaField (
153- schema : t .Union [t .Type [" base.ST" ], " t.ForwardRef" , str ] = ...,
156+ schema : " t.Union[t.Type[base.ST], t.ForwardRef, str]" = ...,
154157 config : "base.ConfigType" = ...,
155- default : t .Union ["base.ST" , t .Type [NOT_PROVIDED ], None ] = ...,
156- null : t .Literal [True ] = ...,
158+ default : "t.Union[OptSchemaT, t.Callable[[], OptSchemaT]]" = ...,
157159 * args ,
160+ null : "t.Literal[True]" ,
158161 ** kwargs ,
159- ) -> t . Any :
162+ ) -> "t.Optional[base.ST]" :
160163 ...
161164
162-
163165@t .overload
164166def SchemaField (
165- schema : t .Union [t .Type [" base.ST" ], " t.ForwardRef" , str ] = ...,
167+ schema : " t.Union[t.Type[base.ST], t.ForwardRef, str]" = ...,
166168 config : "base.ConfigType" = ...,
167- default : t .Union ["base.ST" , t .Type [NOT_PROVIDED ]] = ...,
168- null : t .Literal [False ] = ...,
169+ default : "t.Union[base.SchemaT, t.Callable[[], base.SchemaT]]" = ...,
169170 * args ,
171+ null : "t.Literal[False]" = ...,
170172 ** kwargs ,
171- ) -> t . Any :
173+ ) -> "base.ST" :
172174 ...
173175
174176
175- def SchemaField (
176- schema : t .Union [t .Type ["base.ST" ], "t.ForwardRef" , str ] = None ,
177- config : "base.ConfigType" = None ,
178- default : t .Union ["base.ST" , t .Type [NOT_PROVIDED ], None ] = NOT_PROVIDED ,
179- * args ,
180- ** kwargs ,
181- ) -> t .Any :
177+ def SchemaField (schema = None , config = None , default = NOT_PROVIDED , * args , ** kwargs ) -> t .Any :
182178 kwargs .update (schema = schema , config = config , default = default )
183179 return PydanticSchemaField (* args , ** kwargs )
184180
0 commit comments