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)
Undocumented
| Class Method | _blame |
Describe every failure behind a single rejected field value. |
| Async Class Method | _blame |
Describe a rejected value, awaiting valid fields of nested schemas. |
| Class Method | _collect |
Convert each declared field of a mapping and accumulate its failures. |
| Async Class Method | _collect |
Convert fields before awaiting rules that inspect their valid siblings. |
| Class Method | _enforce |
Run custom rules over the field values that converted successfully. |
| Class Method | collect |
Collect every conversion and rule failure contained in a payload. |
| Async Class Method | collect |
Collect conversion failures together with asynchronous rule failures. |
| Async Static Method | _enforce |
Await custom rules only for fields that converted successfully. |
| Class Variable | __slots__ |
Undocumented |
msgspec.ValidationError, value: object, nested: type | None, root: type, path: str) -> list[ ValidationFailure]:
(source)
¶
Describe every failure behind a single rejected field value.
| Parameters | |
error:msgspec.ValidationError | Error raised while converting the field value. |
value:object | Rejected field value. |
nested:type | None | Schema declared by the field, when it holds a nested schema. |
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[ValidationFailure] | Failures of the nested schema, or a single parsed failure. |
msgspec.ValidationError, value: object, nested: type | None, root: type, path: str) -> list[ ValidationFailure]:
(source)
¶
Describe a rejected value, awaiting valid fields of nested schemas.
| Parameters | |
error:msgspec.ValidationError | Error raised by the field conversion. |
value:object | Rejected input value. |
nested:type | None | Nested schema declared for the field. |
root:type | Root schema used to resolve error messages. |
path:str | Fully qualified field path. |
| Returns | |
list[ValidationFailure] | Nested failures or the parsed field conversion error. |
Mapping, schema: type, root: type, base: str, failures: list[ ValidationFailure]) -> bool:
(source)
¶
Convert each declared field of a mapping and accumulate its failures.
| Parameters | |
payload:Mapping | Mapping holding the values for 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[ValidationFailure] | Accumulator receiving every failure found. |
| Returns | |
bool | Return True when at least one declared field was blamed for a conversion error, so the original error needs no separate report. |
Mapping, schema: type, root: type, base: str, failures: list[ ValidationFailure]) -> bool:
(source)
¶
Convert fields before awaiting rules that inspect their valid siblings.
| Parameters | |
payload:Mapping | Values supplied for the current schema. |
schema:type | Schema whose fields are being converted. |
root:type | Root schema used to resolve custom error messages. |
base:str | Dot-terminated path prefix. |
failures:list[ValidationFailure] | Accumulator for conversion and rule failures. |
| Returns | |
bool | Whether a declared field explains the original conversion failure. |
list[ tuple[ str, object, tuple, type | None]], converted_values: dict[ str, object], failures: list[ ValidationFailure]):
(source)
¶
Run custom rules over the field values that converted successfully.
Type errors abort the whole-payload conversion, so no schema instance exists on this path. Rules receive a namespace holding only the fields that converted cleanly, which keeps cross-field rules usable while still reporting type and rule failures together.
| Parameters | |
pending:list[tuple[str, object, tuple, type | None]] | Entries of (path, value, rules, nested_schema) to check. |
converteddict[str, object] | Successfully converted values, keyed by encoded field name. |
failures:list[ValidationFailure] | Accumulator receiving every failure found. |
| Returns | |
None | Return None after running every pending rule. |
object, schema: type, error: msgspec.ValidationError) -> tuple[ ValidationFailure, ...]:
(source)
¶
Collect every conversion and rule failure contained in a payload.
msgspec stops at the first offending value, so the payload is re-converted field by field to report all of them at once. Fields that convert cleanly still run their custom rules, so type and rule errors are reported together. This runs only after a whole-payload conversion has already failed, keeping the successful path at full msgspec speed.
| 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[ValidationFailure, ...] | Every failure found, including the original parsed error when no field could be blamed for it. |
object, schema: type, error: msgspec.ValidationError) -> tuple[ ValidationFailure, ...]:
(source)
¶
Collect conversion failures together with asynchronous rule failures.
| Parameters | |
payload:object | Raw input rejected by whole-object conversion. |
schema:type | Target schema class. |
error:msgspec.ValidationError | Original conversion failure. |
| Returns | |
tuple[ValidationFailure, ...] | Conversion and rule failures in the same order as synchronous checks. |
list[ tuple[ str, object, tuple, type | None]], converted_values: dict[ str, object], failures: list[ ValidationFailure]):
(source)
¶
Await custom rules only for fields that converted successfully.
| Parameters | |
pending:list[tuple[str, object, tuple, type | None]] | Qualified paths, values, rules and nested schema declarations. |
converteddict[str, object] | Valid field values available to cross-field rules. |
failures:list[ValidationFailure] | Accumulator for rule failures. |
| Returns | |
None | Every applicable rule has completed in declaration order. |