apimodel.validation#

Validators used in fields and models.

Module Contents#

class apimodel.validation.Order[source]#

The order of a validator.

INITIAL_ROOT[source]#

Root Validator acting upon the completely raw data.

ROOT[source]#

Root Validator acting upon the data with converted names.

VALIDATOR[source]#

Validator acting upon a field before annotation conversion.

ANNOTATION[source]#

Annotation Validator. Not meant to be defined by the user.

POST_VALIDATOR[source]#

Validator acting upon a field after annotation conversion.

FINAL_ROOT[source]#

Root Validator acting upon the data after individual field conversion.

class apimodel.validation.Validator(callback: apimodel.tutils.AnyCallable, *, order: int = Order.VALIDATOR)[source]#

Basic validator for a single value.

class apimodel.validation.RootValidator(callback: apimodel.tutils.AnyCallable, *, order: int = Order.INITIAL_ROOT)[source]#

Root validator for an entire model.

apimodel.validation.validator(*fields: str, order: int = Order.VALIDATOR) apimodel.tutils.DecoratorCallable[Validator][source]#

Create a validator for one or more fields.

apimodel.validation.root_validator(order: int = Order.ROOT) apimodel.tutils.DecoratorCallable[RootValidator][source]#

Create a root validator.