Skip to main content

Field

No overview available.

Attributes

AttributeTypeDescription
namePyBackedStrThe identifier of the field used for mapping data during validation and serialization.
lookup_path_collection[LookupPathCollection](../../../lookup/key/lookuppathcollection.md?sid=lookup_key_lookuppathcollection)A collection of paths used to locate the field's value within a source data structure.
validatorArc< CombinedValidator >The core validation logic used to enforce constraints and types on the field's input data.
frozenboolA flag indicating whether the field's value is immutable after the initial assignment.

Constructor

Signature

def Field(
name: PyBackedStr,
lookup_path_collection: [LookupPathCollection](../../../lookup/key/lookuppathcollection.md?sid=lookup_key_lookuppathcollection),
validator: Arc< CombinedValidator >,
frozen: bool
) - > null

Parameters

NameTypeDescription
namePyBackedStrThe name of the field.
lookup_path_collection[LookupPathCollection](../../../lookup/key/lookuppathcollection.md?sid=lookup_key_lookuppathcollection)The collection of paths used for looking up the field value.
validatorArc< CombinedValidator >The validator used to validate the field's data.
frozenboolIndicates whether the field is immutable.

Methods


name()

def name() - > PyBackedStr

The name of the field as defined in the schema.

Returns

TypeDescription
PyBackedStrThe string identifier for the field.

lookup_path_collection()

def lookup_path_collection() - > [LookupPathCollection](../../../lookup/key/lookuppathcollection.md?sid=lookup_key_lookuppathcollection)

The collection of paths used to look up values for this field in the input data.

Returns

TypeDescription
[LookupPathCollection](../../../lookup/key/lookuppathcollection.md?sid=lookup_key_lookuppathcollection)A collection of lookup paths.

validator()

def validator() - > Arc< CombinedValidator >

The validator used to validate and coerce the input data for this field.

Returns

TypeDescription
Arc< CombinedValidator >An atomic reference-counted pointer to the combined validator.

frozen()

def frozen() - > bool

Indicates whether the field is frozen and cannot be modified after initialization.

Returns

TypeDescription
boolTrue if the field is immutable, False otherwise.