write_validations
Write validation helpers for v2 API create and update operations.
assert_v2_write_enabled
assert_v2_write_enabled(
manager: ModelReferenceManager,
category: MODEL_REFERENCE_CATEGORY | str | None = None,
) -> None
Ensure writes are only attempted when the canonical v2 PRIMARY backend supports them.
Passing category exempts a category with no legacy representation (has_legacy_format=False) from the
v2 canonical-format requirement, since v2 is its only possible write path.
Source code in src/horde_model_reference/service/v2/routers/write_validations.py
assert_primary_write_enabled
Ensure the backend is PRIMARY, without requiring a specific canonical format.
Use for text utility metadata operations (schemas, aliases, families) that are v2-only endpoints but write to auxiliary stores, not model records.