Skip to main content

ValidationAlias

This class represents a flexible mechanism for defining validation aliases, supporting single string keys, structured lookup paths, or multiple alternative alias choices. It enables the mapping of input data fields to internal model attributes using various path-based or choice-based strategies.

Attributes

AttributeTypeDescription
StrstrA single string representing the direct key used to look up data in the input source.
AliasPath`list[intstr]`
AliasChoices`list[list[intstr]]`

Constructor

Signature

def Str(
value: PyBackedStr
) - > [ValidationAlias](validationalias.md?sid=lookup_key_validationalias)

Parameters

NameTypeDescription
valuePyBackedStrThe string value to be used as the validation alias.

Signature

def AliasPath(
path: [LookupPath](lookuppath.md?sid=lookup_key_lookuppath)
) - > [ValidationAlias](validationalias.md?sid=lookup_key_validationalias)

Parameters

NameTypeDescription
path[LookupPath](lookuppath.md?sid=lookup_key_lookuppath)A list of integers or strings defining the sequence of keys or indices to traverse.

Signature

def AliasChoices(
choices: SmallVec< [LookupPath; 1] >
) - > [ValidationAlias](validationalias.md?sid=lookup_key_validationalias)

Parameters

NameTypeDescription
choicesSmallVec< [LookupPath; 1] >A collection of lookup paths, where each path is a list of integers or strings.