validate_v1_document
Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.
- validate_v1_document(payload: Mapping[str, Any], workflow: str | None = None) None[source]
Validate the structure of a v1 document payload.
Structural checks: section types, the
versiontag, and – for habitat – that thespec/policysections parse intoHabitatSpec/RunPolicyand that every declared habitat component name is registered. ML documents still validate structure only; registry availability for ML components is checked when the modelling recipe assembles its pipeline.- Parameters:
payload – Top-level YAML mapping detected as v1.
workflow – Expected workflow alias; when given, the document’s
workflowtag must match.
- Raises:
HABITAPIError – On any structural violation.
ComponentNotFoundError – When a habitat spec names an unknown component.