Skip to content

PydanticModelConfigDictProps

Keyword-style options for Pydantic v2 ConfigDict, using camelCase prop names that map to snake_case Python arguments (for example validateAssignmentvalidate_assignment).

aliasGeneratoroptional stringResolve field aliases from a configured alias generator.
arbitraryTypesAllowedoptional booleanAllow non-pydantic/arbitrary Python types in field annotations.
coerceNumbersToStroptional booleanCoerce numeric input values to strings for str fields.
extraoptional “allow” | “forbid” | “ignore”Behavior for unknown input keys: allow, forbid, or ignore.
fromAttributesoptional booleanPopulate models from object attributes (ORM-style) instead of mapping keys.
frozenoptional booleanMake models immutable (frozen=True).
hideInputInErrorsoptional booleanHide input values in validation error messages.
jsonSchemaExtraoptional Record<string, unknown>Include JSON schema extras via a plain JSON-serializable object.
locByAliasoptional booleanUse aliases in error locations instead of field names.
populateByNameoptional booleanAllow population by field name even when aliases are defined.
revalidateInstancesoptional “always” | “never” | “subclass-instances”Re-validate model/dataclass instances on assignment boundaries.
serJsonBytesoptional “utf8” | “base64” | “hex”JSON serialization format for bytes values.
serJsonInfNanoptional “null” | “constants” | “strings”JSON serialization behavior for Infinity/NaN values.
strictoptional booleanEnable strict validation globally for the model.
strMaxLengthoptional numberUpper-bound for constrained string lengths at model level.
strMinLengthoptional numberLower-bound for constrained string lengths at model level.
strStripWhitespaceoptional booleanStrip leading/trailing whitespace from all str fields.
strToLoweroptional booleanConvert all str values to lowercase.
strToUpperoptional booleanConvert all str values to uppercase.
useEnumValuesoptional booleanUse enum .value instead of enum instances during serialization.
validateAssignmentoptional booleanRe-validate when attributes are assigned after model creation.
validateDefaultoptional booleanValidate default values in addition to provided input values.
validateReturnoptional booleanValidate return values for call validators.
valJsonBytesoptional “utf8” | “base64” | “hex”JSON validation format for bytes values.