httk.core.schema_check

Structural compatibility checks for record dataclasses and entry schemas.

This is a structural compatibility check: it compares property/field names, nullability, and shallow Python type shape. It deliberately does not check units, requirements or sortable flags, dictionary value schemas, nested required keys, enums or patterns, or cross-field constraints. A passing check therefore does not mean that two models are semantically equivalent.

Functions

check_record_matches_definition(record, definition, *)

Return structural mismatches between a dataclass and an entry definition.

Module Contents

httk.core.schema_check.check_record_matches_definition(record, definition, *, property_keys=None, internal_fields=(), ignore_properties=('id', 'type'))[source]

Return structural mismatches between a dataclass and an entry definition.

property_keys maps dataclass field names to served property names; it is the inverse of property_keys(), which maps served property names to record keys. An omitted mapping uses identity for every field. internal_fields are skipped on the dataclass side, and ignore_properties are skipped on the definition side. Messages are sorted for stable output.

Parameters:
Returns:

Sorted descriptions of structural mismatches, or an empty list when compatible.

Return type:

list[str]