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 version tag, and – for habitat – that the spec/policy sections parse into HabitatSpec / RunPolicy and 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 workflow tag must match.

Raises: