Aliases
Support for alias configurations.
A data class used by validation_alias as a convenience to create aliases.
A list of string or integer aliases.
def convert_to_aliases() -> list[str | int]
Converts arguments to a list of string or integer aliases.
list[str | int] — The list of aliases.
def search_dict_for_path(d: dict) -> Any
Searches a dictionary for the path specified by the alias.
Any — The value at the specified path, or PydanticUndefined if the path is not found.
A data class used by validation_alias as a convenience to create aliases.
A list containing a string or AliasPath.
def convert_to_aliases() -> list[list[str | int]]
Converts arguments to a list of lists containing string or integer aliases.
list[list[str | int]] — The list of aliases.
A data class used by alias_generator as a convenience to create various aliases.
A callable that takes a field name and returns an alias for it.
Type: Callable[[str], str] | None
A callable that takes a field name and returns a validation alias for it.
Type: Callable[[str], str | AliasPath | AliasChoices] | None
A callable that takes a field name and returns a serialization alias for it.
Type: Callable[[str], str] | None
def generate_aliases(
field_name: str,
) -> tuple[str | None, str | AliasPath | AliasChoices | None, str | None]
Generate alias, validation_alias, and serialization_alias for a field.
tuple[str | None, str | AliasPath | AliasChoices | None, str | None] — A tuple of three aliases - validation, alias, and serialization.