@@ -6,7 +6,7 @@ from _typeshed import SupportsAllComparisons
66from typing_extensions import LiteralString , Self , TypeAlias
77
88from pydantic_core import ErrorDetails , ErrorTypeInfo , InitErrorDetails , MultiHostHost
9- from pydantic_core .core_schema import CoreConfig , CoreSchema , ErrorType
9+ from pydantic_core .core_schema import CoreConfig , CoreSchema , ErrorType , ExtraBehavior
1010
1111__all__ = [
1212 '__version__' ,
@@ -93,6 +93,7 @@ class SchemaValidator:
9393 input : Any ,
9494 * ,
9595 strict : bool | None = None ,
96+ extra : ExtraBehavior | None = None ,
9697 from_attributes : bool | None = None ,
9798 context : Any | None = None ,
9899 self_instance : Any | None = None ,
@@ -107,6 +108,8 @@ class SchemaValidator:
107108 input: The Python object to validate.
108109 strict: Whether to validate the object in strict mode.
109110 If `None`, the value of [`CoreConfig.strict`][pydantic_core.core_schema.CoreConfig] is used.
111+ extra: The behavior for handling extra fields.
112+ If `None`, the value of [`CoreConfig.extra_fields_behavior`][pydantic_core.core_schema.CoreConfig] is used.
110113 from_attributes: Whether to validate objects as inputs to models by extracting attributes.
111114 If `None`, the value of [`CoreConfig.from_attributes`][pydantic_core.core_schema.CoreConfig] is used.
112115 context: The context to use for validation, this is passed to functional validators as
@@ -131,6 +134,7 @@ class SchemaValidator:
131134 input : Any ,
132135 * ,
133136 strict : bool | None = None ,
137+ extra : ExtraBehavior | None = None ,
134138 from_attributes : bool | None = None ,
135139 context : Any | None = None ,
136140 self_instance : Any | None = None ,
@@ -151,6 +155,7 @@ class SchemaValidator:
151155 input : str | bytes | bytearray ,
152156 * ,
153157 strict : bool | None = None ,
158+ extra : ExtraBehavior | None = None ,
154159 context : Any | None = None ,
155160 self_instance : Any | None = None ,
156161 allow_partial : bool | Literal ['off' , 'on' , 'trailing-strings' ] = False ,
@@ -170,6 +175,8 @@ class SchemaValidator:
170175 input: The JSON data to validate.
171176 strict: Whether to validate the object in strict mode.
172177 If `None`, the value of [`CoreConfig.strict`][pydantic_core.core_schema.CoreConfig] is used.
178+ extra: The behavior for handling extra fields.
179+ If `None`, the value of [`CoreConfig.extra_fields_behavior`][pydantic_core.core_schema.CoreConfig] is used.
173180 context: The context to use for validation, this is passed to functional validators as
174181 [`info.context`][pydantic_core.core_schema.ValidationInfo.context].
175182 self_instance: An instance of a model set attributes on from validation.
@@ -191,6 +198,7 @@ class SchemaValidator:
191198 input : _StringInput ,
192199 * ,
193200 strict : bool | None = None ,
201+ extra : ExtraBehavior | None = None ,
194202 context : Any | None = None ,
195203 allow_partial : bool | Literal ['off' , 'on' , 'trailing-strings' ] = False ,
196204 by_alias : bool | None = None ,
@@ -206,6 +214,8 @@ class SchemaValidator:
206214 input: The input as a string, or bytes/bytearray if `strict=False`.
207215 strict: Whether to validate the object in strict mode.
208216 If `None`, the value of [`CoreConfig.strict`][pydantic_core.core_schema.CoreConfig] is used.
217+ extra: The behavior for handling extra fields.
218+ If `None`, the value of [`CoreConfig.extra_fields_behavior`][pydantic_core.core_schema.CoreConfig] is used.
209219 context: The context to use for validation, this is passed to functional validators as
210220 [`info.context`][pydantic_core.core_schema.ValidationInfo.context].
211221 allow_partial: Whether to allow partial validation; if `True` errors in the last element of sequences
@@ -228,6 +238,7 @@ class SchemaValidator:
228238 field_value : Any ,
229239 * ,
230240 strict : bool | None = None ,
241+ extra : ExtraBehavior | None = None ,
231242 from_attributes : bool | None = None ,
232243 context : Any | None = None ,
233244 by_alias : bool | None = None ,
@@ -242,6 +253,8 @@ class SchemaValidator:
242253 field_value: The value to assign to the field.
243254 strict: Whether to validate the object in strict mode.
244255 If `None`, the value of [`CoreConfig.strict`][pydantic_core.core_schema.CoreConfig] is used.
256+ extra: The behavior for handling extra fields.
257+ If `None`, the value of [`CoreConfig.extra_fields_behavior`][pydantic_core.core_schema.CoreConfig] is used.
245258 from_attributes: Whether to validate objects as inputs to models by extracting attributes.
246259 If `None`, the value of [`CoreConfig.from_attributes`][pydantic_core.core_schema.CoreConfig] is used.
247260 context: The context to use for validation, this is passed to functional validators as
0 commit comments