@@ -30,7 +30,7 @@ class CoreConfig(TypedDict, total=False):
3030 config_choose_priority : int
3131 # if configs are merged, which should take precedence, default 0, default means child takes precedence
3232 config_merge_priority : int
33- # settings related to typed_dicts only
33+ # settings related to typed dicts, model fields, dataclass fields
3434 extra_fields_behavior : ExtraBehavior
3535 typed_dict_total : bool # default: True
3636 # used on typed-dicts and tagged union keys
@@ -2841,6 +2841,7 @@ class ModelSchema(TypedDict, total=False):
28412841 revalidate_instances : Literal ['always' , 'never' , 'subclass-instances' ] # default: 'never'
28422842 strict : bool
28432843 frozen : bool
2844+ extra_behavior : ExtraBehavior
28442845 config : CoreConfig
28452846 ref : str
28462847 metadata : Any
@@ -2855,6 +2856,7 @@ def model_schema(
28552856 revalidate_instances : Literal ['always' , 'never' , 'subclass-instances' ] | None = None ,
28562857 strict : bool | None = None ,
28572858 frozen : bool | None = None ,
2859+ extra_behavior : ExtraBehavior | None = None ,
28582860 config : CoreConfig | None = None ,
28592861 ref : str | None = None ,
28602862 metadata : Any = None ,
@@ -2894,6 +2896,7 @@ class MyModel:
28942896 should re-validate defaults to config.revalidate_instances, else 'never'
28952897 strict: Whether the model is strict
28962898 frozen: Whether the model is frozen
2899+ extra_behavior: The extra behavior to use for the model, used in serialization
28972900 config: The config to use for the model
28982901 ref: optional unique identifier of the schema, used to reference the schema in other places
28992902 metadata: Any other information you want to include with the schema, not used by pydantic-core
@@ -2907,6 +2910,7 @@ class MyModel:
29072910 revalidate_instances = revalidate_instances ,
29082911 strict = strict ,
29092912 frozen = frozen ,
2913+ extra_behavior = extra_behavior ,
29102914 config = config ,
29112915 ref = ref ,
29122916 metadata = metadata ,
0 commit comments