adaptix.integrations.pydantic package¶
Module contents¶
- adaptix.integrations.pydantic.native_pydantic(
- *preds: str | Pattern | type | Any | LocStackChecker | LocStackPattern,
- config: ConfigDict | None = None,
- validate_python: ValidatePythonParams | None = None,
- to_python: ToPythonParams | None = None,
Provider that represents value via pydantic. You can use this function to validate or serialize pydantic models via pydantic itself. Provider constructs
TypeAdapterfor a type to load and dump data.- Parameters:
preds – Predicates specifying where the provider should be used. The provider will be applied if any predicates meet the conditions, if no predicates are passed, the provider will be used for all Enums. See Predicate system for details.
validate_python – Dict directly unpacked to
.validate_python()methodto_python – Dict directly unpacked to
.to_python()methodconfig – Parameter passed directly to
configparameter ofTypeAdapterconstructor
- Returns:
Desired provider