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.

class documentation

class ValidationErrorParser: (source)

View In Hierarchy

Undocumented

Class Method _customMessage Return a custom error message for a failed constraint, if one is set.
Class Method parse Parse a msgspec validation error into framework failures.
Class Method parseAt Parse a msgspec validation error raised while converting a sub-value.
Static Method _joinPath Concatenate a base field path with a relative msgspec path.
Static Method _matchConstraintKey Identify the constraint type from a raw msgspec error message.
Static Method _resolveNestedType Return the nested schema type for field_name within schema.
Static Method _resolveSchema Traverse the schema hierarchy and return (leaf_schema, leaf_field).
Class Variable __slots__ Undocumented
def _customMessage(cls, schema: type, field_path: str, raw_msg: str) -> str | None: (source)

Return a custom error message for a failed constraint, if one is set.

Parameters
schema:typeRoot schema class.
field_path:strDot-separated field path (e.g. "address.code" or "name") as produced by parsing the msgspec error.
raw_msg:strThe raw constraint error message emitted by msgspec.
Returns
str | NoneThe custom message, or None when none is configured.
def parse(cls, error: msgspec.ValidationError, schema: type | None = None) -> ValidationFailure: (source)

Parse a msgspec validation error into framework failures.

Parameters
error:msgspec.ValidationErrorProvide the original validation exception.
schema:type | NoneOptional schema class used to look up custom constraint messages.
Returns
ValidationFailureReturn a single validation failure describing the parsed error.
def parseAt(cls, error: msgspec.ValidationError, schema: type | None, base: str) -> ValidationFailure: (source)

Parse a msgspec validation error raised while converting a sub-value.

Parameters
error:msgspec.ValidationErrorProvide the original validation exception.
schema:type | NoneRoot schema class used to look up custom constraint messages.
base:strDotted path of the value being converted, relative to the root schema ("" when the error comes from the root payload).
Returns
ValidationFailureReturn a single validation failure with a fully-qualified field.
def _joinPath(base: str, relative: str) -> str: (source)

Concatenate a base field path with a relative msgspec path.

Parameters
base:strDotted path of the value being converted.
relative:strPath reported by msgspec, relative to that value.
Returns
strFully-qualified dotted field path.
def _matchConstraintKey(message: str) -> str | None: (source)

Identify the constraint type from a raw msgspec error message.

Parameters
message:strRaw msgspec constraint violation message (without the path suffix).
Returns
str | NoneThe constraint key (e.g. "min_length", "gt"), or None when no known pattern matches.
def _resolveNestedType(schema: type, field_name: str) -> type | None: (source)

Return the nested schema type for field_name within schema.

Parameters
schema:typeParent schema class to inspect.
field_name:strName of the field whose nested schema type is needed.
Returns
type | NoneThe nested schema class, or None when not found.
def _resolveSchema(schema: type, field_path: str) -> tuple[type, str]: (source)

Traverse the schema hierarchy and return (leaf_schema, leaf_field).

For a path like "address.zip_code" starting from UserSchema this returns (AddressSchema, "zip_code").

Parameters
schema:typeRoot schema class to start traversal from.
field_path:strDot-separated field path.
Returns
tuple[type, str](leaf_schema_class, leaf_field_name) pair.
__slots__: tuple = (source)

Undocumented