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 class-owned 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 _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 MISSING_FIELD_RE Regular expressions for parsing msgspec error messages.
def _get_fields_map(schema: type) -> dict[str, object]: (source)

Return a class-owned mapping from encoded field names to declared types.

Keep recursive annotations with their owning class so discarded schema types remain collectable. Inspect the exact class to avoid inherited plans.

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
(('matching regex', 'pattern'),
 ('of length >=', 'min_length'),
 ('of length <=', 'max_length'),
 ('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()
_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>\'(?:\\.|[^\'\\])*\'|"(?:\\↵
.|[^"\\])*"|[^\]\'"]*)\]')
MISSING_FIELD_RE = (source)

Regular expressions for parsing msgspec error messages.

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