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)
Undocumented
| Class Method | _custom |
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 | parse |
Parse a msgspec validation error raised while converting a sub-value. |
| Static Method | _join |
Concatenate a base field path with a relative msgspec path. |
| Static Method | _match |
Identify the constraint type from a raw msgspec error message. |
| Static Method | _resolve |
Return the nested schema type for field_name within schema. |
| Static Method | _resolve |
Traverse the schema hierarchy and return (leaf_schema, leaf_field). |
| Class Variable | __slots__ |
Undocumented |
Return a custom error message for a failed constraint, if one is set.
| Parameters | |
schema:type | Root schema class. |
fieldstr | Dot-separated field path (e.g. "address.code" or "name") as produced by parsing the msgspec error. |
rawstr | The raw constraint error message emitted by msgspec. |
| Returns | |
str | None | The 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.ValidationError | Provide the original validation exception. |
schema:type | None | Optional schema class used to look up custom constraint messages. |
| Returns | |
ValidationFailure | Return 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.ValidationError | Provide the original validation exception. |
schema:type | None | Root schema class used to look up custom constraint messages. |
base:str | Dotted path of the value being converted, relative to the root schema ("" when the error comes from the root payload). |
| Returns | |
ValidationFailure | Return a single validation failure with a fully-qualified field. |
Identify the constraint type from a raw msgspec error message.
| Parameters | |
message:str | Raw msgspec constraint violation message (without the path suffix). |
| Returns | |
str | None | The constraint key (e.g. "min_length", "gt"), or None when no known pattern matches. |
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:type | Root schema class to start traversal from. |
fieldstr | Dot-separated field path. |
| Returns | |
tuple[type, str] | (leaf_schema_class, leaf_field_name) pair. |