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.
class FailureCollector: (source)
Collect and organize validation failures by field path.
| Async Class Method | _blame |
Collect local and nested failures for a rejected field value. |
| Async Class Method | _blame |
Collect conversion and rule failures independently for each child. |
| Async Class Method | _collect |
Convert declared fields and accumulate their validation failures. |
| Async Class Method | _enforce |
Run nested and field rules over type-compatible values. |
| Class Method | _matching |
Select a nested annotation matching the value's shape and schema tag. |
| Async Class Method | _recover |
Recover a type-compatible value and collect its validation failures. |
| Async Class Method | collect |
Collect conversion, constraint and rule failures from a rejected payload. |
| Static Method | _constraints |
Collect independent constraint failures with their declared codes. |
| Static Method | _matching |
Match a schema's object or array representation and optional tag. |
| Class Variable | __slots__ |
Prevent per-instance dictionaries; the class is used statically. |
msgspec.ValidationError, value: object, nested: object | None, root: type, path: str) -> list[ ValidationFailure]:
(source)
¶
Collect local and nested failures for a rejected field value.
| Parameters | |
error:msgspec.ValidationError | Error raised while converting the field value. |
value:object | Rejected field value. |
nested:object | None | Annotation declared by the field being converted. |
root:type | Root schema class, used to resolve custom messages by path. |
path:str | Dotted path of the field relative to the root schema. |
| Returns | |
list[orionis.schemas.entities.failure.ValidationFailure] | Constraint and child failures, or the parsed original error. |
msgspec.ValidationError, value: object, annotation: object, root: type, path: str) -> list[ ValidationFailure]:
(source)
¶
Collect conversion and rule failures independently for each child.
| Parameters | |
error:msgspec.ValidationError | Error raised by converting the entire collection. |
value:object | Collection selected by _matchingType. |
annotation:object | Concrete collection annotation. |
root:type | Root schema used to resolve custom messages. |
path:str | Fully qualified collection path. |
| Returns | |
list[orionis.schemas.entities.failure.ValidationFailure] | Collection-level failures and failures from every child. |
Mapping | list | tuple, schema: type, root: type, base: str, failures: list[ ValidationFailure]) -> bool:
(source)
¶
Convert declared fields and accumulate their validation failures.
| Parameters | |
payload:collections.abc.Mapping | list | tuple | Field mapping or positional data for an array-like schema. |
schema:type | Schema class owning the fields being converted. |
root:type | Root schema class, used to resolve custom messages by path. |
base:str | Dotted path of payload relative to the root schema. |
failures:list[orionis.schemas.entities.failure.ValidationFailure] | Accumulator receiving every failure found. |
| Returns | |
bool | Whether a declared field explains the original conversion error. |
list[ tuple[ str, object, tuple, object | None]], converted_values: dict[ str, object], failures: list[ ValidationFailure]):
(source)
¶
Run nested and field rules over type-compatible values.
Supply converted sibling values through a namespace because the failed whole-payload conversion produced no schema instance.
| Parameters | |
pending:list[tuple[str, object, tuple, object | None]] | Entries of (path, value, rules, nested_annotation) to check. |
converteddict[str, object] | Type-compatible values, including defaults, keyed by attribute name. |
failures:list[orionis.schemas.entities.failure.ValidationFailure] | Accumulator receiving every failure found. |
| Returns | |
None | No return value. |
Select a nested annotation matching the value's shape and schema tag.
| Parameters | |
annotation:object | Field or element annotation, possibly annotated or a union. |
value:object | Rejected input used to match object or array-like representations. |
| Returns | |
object | None | Matching schema or collection annotation, if one applies. |
msgspec.ValidationError, value: object, annotation: object, root: type, path: str) -> tuple[ object, list[ ValidationFailure]]:
(source)
¶
Recover a type-compatible value and collect its validation failures.
| Parameters | |
error:msgspec.ValidationError | Error raised by the original field conversion. |
value:object | Rejected field value. |
annotation:object | Declared field type and metadata. |
root:type | Schema used to resolve custom messages. |
path:str | Field path relative to root. |
| Returns | |
tuple[object, list[orionis.schemas.entities.failure.ValidationFailure]] | Converted value and failures, or _INVALID and failures when the value remains structurally incompatible. |
object, schema: type, error: msgspec.ValidationError) -> tuple[ ValidationFailure, ...]:
(source)
¶
Collect conversion, constraint and rule failures from a rejected payload.
Inspect fields only after whole-payload conversion fails. Run custom rules on type-compatible values, even when their constraints fail.
| Parameters | |
payload:object | Raw input data that failed conversion. |
schema:type | Schema class the payload was converted against. |
error:msgspec.ValidationError | Original error raised by the whole-payload conversion. |
| Returns | |
tuple[orionis.schemas.entities.failure.ValidationFailure, ...] | Every failure found, including the original parsed error when no field could be blamed for it. |
object, probes: tuple, root: type, path: str) -> list[ ValidationFailure]:
(source)
¶
Collect independent constraint failures with their declared codes.
| Parameters | |
value:object | Field value checked by each constraint probe. |
probes:tuple | Entries of (rule_code, annotation, custom_message). |
root:type | Schema supplying fallback field messages. |
path:str | Field path used to locate messages and report failures. |
| Returns | |
list[orionis.schemas.entities.failure.ValidationFailure] | Local constraint failures, excluding type and child errors. |
type[ msgspec.Struct], value: object) -> type[ msgspec.Struct] | None:
(source)
¶
Match a schema's object or array representation and optional tag.
| Parameters | |
schema:type[msgspec.Struct] | Schema class whose representation is checked. |
value:object | Rejected input to compare with the schema configuration. |
| Returns | |
type[msgspec.Struct] | None | Schema when its shape and tag match, otherwise None. |