Skip to main content

PydanticSerializationUnexpectedValue

No overview available.

Attributes

AttributeTypeDescription
messagestringCustom error message explaining why the serialization value was unexpected.
field_namestringThe name of the specific field that encountered the unexpected value during serialization.
field_typestringThe expected type definition of the field as a string representation.
input_valueanyThe actual Python object that was provided for serialization and caused the error.

Constructor

Signature

def PydanticSerializationUnexpectedValue(
message: Optional[str] = None,
field_name: Optional[str] = None,
field_type: Optional[str] = None,
input_value: Optional[Any] = None
) - > None

Parameters

NameTypeDescription
messageOptional[str] = NoneAn optional error message describing the serialization failure.
field_nameOptional[str] = NoneThe name of the field where the unexpected value was encountered.
field_typeOptional[str] = NoneThe expected type of the field.
input_valueOptional[Any] = NoneThe actual value provided that failed serialization.

Signature

def PydanticSerializationUnexpectedValue(
message: Optional[str] = None,
field_name: Optional[str] = None,
field_type: Optional[str] = None,
input_value: Optional[Any] = None
) - > None

Parameters

NameTypeDescription
messageOptional[str] = NoneThe error message describing why the serialization failed.
field_nameOptional[str] = NoneThe name of the model field that encountered the unexpected value.
field_typeOptional[str] = NoneThe expected type definition for the field being serialized.
input_valueOptional[Any] = NoneThe actual runtime value that was provided and caused the serialization conflict.