ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

module documentation

Collect and organize validation failures by field path.

Class FailureCollector Collect and organize validation failures by field path.
Function _field_plan Return a class-owned plan for collecting field validation failures.
Function _nested_schema Return the Orionis schema wrapped by a field annotation, if any.
Function _payload_fields Map array-like schema positions to encoded field names.
Constant _INVALID Sentinel distinguishing invalid from ordinary values.
def _field_plan(schema: type) -> tuple: (source)

Return a class-owned plan for collecting field validation failures.

Retain field types and rules only through their schema owner. Look up the exact class so subclasses do not reuse a parent's incomplete field plan.

Parameters
schema:typeSchema class whose msgspec fields are inspected.
Returns
tupleEntries of (encode_name, field_type, required, nested_annotation, rules, attribute, default, factory), where rules holds the bound custom validators and attribute is the Python field name.
def _nested_schema(tp: object) -> type[msgspec.Struct] | None: (source)

Return the Orionis schema wrapped by a field annotation, if any.

Parameters
tp:objectField annotation, possibly wrapped in Annotated or a union.
Returns
type[msgspec.Struct] | NoneNested schema class, or None when the field holds no schema.
def _payload_fields(payload: Mapping | list | tuple, schema: type) -> Mapping: (source)

Map array-like schema positions to encoded field names.

Parameters
payload:collections.abc.Mapping | list | tupleField mapping or positional schema data, including any tag.
schema:typeSchema defining field order, encoded names and tag configuration.
Returns
collections.abc.MappingOriginal mapping or positional values keyed by encoded field name.
_INVALID = (source)

Sentinel distinguishing invalid from ordinary values.

Value
object()