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

Translate validation exceptions into structured field errors.

Class ValidationErrorParser Translate validation exceptions into structured field errors.
Function _get_fields_map Return a cached mapping from encoded field names to declared types.
Constant _CONSTRAINT_PATTERNS Ordered patterns for identifying constraint types from msgspec error messages.
Constant _MISSING Sentinel for distinguishing "not in cache" from "cached result is None".
Constant _NESTED_TYPE_CACHE (schema_type, field_name) → nested schema type or None.
Constant _PATH_MARKER Suffix msgspec appends to report the location of the offending value.
Constant _PATH_MARKER_LEN Path marker len used by exception_parser.
Constant _PATH_PART_RE Keep quoted dictionary keys intact even when they contain dots or brackets.
Constant _STRUCT_FIELDS_MAP schema_type → {field_name: field_type} built from msgspec.structs.fields(). Avoids repeated C-level calls to fields() on the error path.
Constant MISSING_FIELD_RE Regular expressions for parsing msgspec error messages.
def _get_fields_map(schema: type) -> dict[str, object]: (source)

Return a cached mapping from encoded field names to declared types.

Parameters
schema:typeMsgspec struct class whose fields should be inspected.
Returns
dict[str, object]Encoded field names mapped to their declared types.
_CONSTRAINT_PATTERNS: tuple[tuple[str, str], ...] = (source)

Ordered patterns for identifying constraint types from msgspec error messages.

Value
(('of length >=', 'min_length'),
 ('of length <=', 'max_length'),
 ('matching regex', 'pattern'),
 ('multiple of', 'multiple_of'),
 ('no timezone', 'tz_naive'),
 ('timezone', 'tz_aware'),
 (' >= ', 'ge'),
...

Sentinel for distinguishing "not in cache" from "cached result is None".

Value
object()
_NESTED_TYPE_CACHE: dict[tuple[type, str], type | None] = (source)

(schema_type, field_name) → nested schema type or None.

Value
{}
_PATH_MARKER: str = (source)

Suffix msgspec appends to report the location of the offending value.

Value
' - at `$'
_PATH_MARKER_LEN = (source)

Path marker len used by exception_parser.

Value
len(_PATH_MARKER)
_PATH_PART_RE = (source)

Keep quoted dictionary keys intact even when they contain dots or brackets.

Value
re.compile(r'(?:^|\.)(?P<field>[^\.\[\]]+)|\[(?P<key>\'(?:\\.|[^\'\\])*\'|"(?:\\↵
.|[^"\\])*"|[^\]\'"]*)\]')
_STRUCT_FIELDS_MAP: dict[type, dict[str, object]] = (source)

schema_type → {field_name: field_type} built from msgspec.structs.fields(). Avoids repeated C-level calls to fields() on the error path.

Value
{}
MISSING_FIELD_RE = (source)

Regular expressions for parsing msgspec error messages.

Value
re.compile(r'missing required field `(?P<field>[^`]+)`')