@@ -864,19 +864,21 @@ def model_dump(
864864 mode : Union [Literal ["json" , "python" ], str ] = "python" ,
865865 include : Union [IncEx , None ] = None ,
866866 exclude : Union [IncEx , None ] = None ,
867- context : Union [Dict [ str , Any ] , None ] = None ,
868- by_alias : bool = False ,
867+ context : Union [Any , None ] = None ,
868+ by_alias : Union [ bool , None ] = False ,
869869 exclude_unset : bool = False ,
870870 exclude_defaults : bool = False ,
871871 exclude_none : bool = False ,
872872 round_trip : bool = False ,
873873 warnings : Union [bool , Literal ["none" , "warn" , "error" ]] = True ,
874+ fallback : Union [Callable [[Any ], Any ], None ] = None ,
874875 serialize_as_any : bool = False ,
875876 ) -> Dict [str , Any ]:
876877 if PYDANTIC_MINOR_VERSION >= (2 , 7 ):
877878 extra_kwargs : Dict [str , Any ] = {
878879 "context" : context ,
879880 "serialize_as_any" : serialize_as_any ,
881+ "fallback" : fallback ,
880882 }
881883 else :
882884 extra_kwargs = {}
@@ -894,6 +896,7 @@ def model_dump(
894896 ** extra_kwargs ,
895897 )
896898 else :
899+ assert by_alias is not None
897900 return super ().dict (
898901 include = include ,
899902 exclude = exclude ,
0 commit comments