Meta-schema reference
This page is generated from schema/draft/2026-09/.schema.hcl
by hclschema docs — the same command you would run against your own schema.
Meta-schema
Draft 2026-09.
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
__id | string | yes | A stable identity for this document. | |
__schema | string | yes | The meta-schema this document is written against. Its draft/<id>/ path segment selects the draft. | |
__schema_sha256 | stringmatching ^[0-9a-fA-F]{64}$ | no | Pins the meta-schema to an exact digest. |
import
Makes another schema's ids available under an alias, as alias.block_header.<id>.
import "<alias>" { ... }
Labels must be unique among sibling blocks of this type.
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
source | string | yes | A path relative to this document, or an https URL. | |
sha256 | stringmatching ^[0-9a-fA-F]{64}$ | no | Pins the imported document to an exact digest. |
body
The root body every instance of this schema must match.
body { ... }
Occurrences: at most 1.
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
open | bool | no | Permit attributes and blocks this body does not declare. |
body.attribute
Declares an attribute. Mirrors hcl.AttributeSchema, extended with hcldec.AttrSpec's type and default.
attribute "<attribute_name>" { ... }
Labels must be unique among sibling blocks of this type.
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
at_least_one_of | list(string) | no | This attribute and the named siblings form a group of which at least one must be set. | |
conflicts_with | list(string) | no | Sibling attributes that must not be set alongside this one. | |
default | any | no | Substituted when the attribute is absent. Only meaningful when it is optional. | |
deprecated | string | no | Marks the attribute deprecated, with the reason. Using it produces a warning. | |
description | string | no | Documentation, surfaced as editor hover text and in generated reference docs. | |
enum | any | no | The permitted values. | |
exactly_one_of | list(string) | no | This attribute and the named siblings form a group of which exactly one must be set. | |
max | number | no | Upper bound on a number's value, a string's length, or a collection's element count. | |
min | number | no | Lower bound on a number's value, a string's length, or a collection's element count. | |
pattern | string | no | A regular expression a string value must match. | |
required | bool | no | The attribute must be present. | |
required_with | list(string) | no | Sibling attributes that must be set when this one is. | |
sensitive | bool | no | Keeps the value out of diagnostics. | |
type | any | no | A type constraint expression, as understood by ext/typeexpr. |
body.attribute.validation
A custom predicate over the attribute's value.
validation { ... }
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
condition | any | yes | A boolean expression with self bound to the value. | |
error_message | string | yes | Reported when the condition is false. |
body.block_header
Declares a block. Mirrors hcl.BlockHeaderSchema, extended with hcldec's cardinality.
block_header "<block_header_type>" { ... }
Labels must be unique among sibling blocks of this type.
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
deprecated | string | no | Marks the block deprecated, with the reason. | |
description | string | no | ||
id | any | no | Registers this block's body so that a ref elsewhere can reuse it. | |
label_names | list(string) | no | Names for the block's positional labels. Their count is the block's arity. | |
max_items | numberat least 0 | no | Most instances permitted. Zero means unbounded. | |
min_items | numberat least 0 | no | Fewest instances of this block permitted in its parent body. | |
open | bool | no | Permit content this block's body does not declare. | |
ref | any | no | Reuses the body registered under another declaration's id, as block_header.<id>. | |
required | bool | no | Shorthand for min_items = 1. | |
unique_labels | bool | no | Sibling blocks of this type must not repeat a label tuple. |
body.block_header.label
Constrains one positional label. Mirrors hcldec.BlockLabelSpec, extended with a pattern and an enum.
label "<label_name>" { ... }
Labels must be unique among sibling blocks of this type.
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
description | string | no | ||
enum | list(string) | no | The permitted labels. | |
pattern | string | no | A regular expression the label must match. |
body.block_header.body
body { ... }
Same contents as body.
body.one_of
A group of alternatives, exactly one of which the enclosing body must match.
one_of { ... }
body.one_of.variant
variant "<variant_name>" { ... }
Occurrences: at least 2.
Labels must be unique among sibling blocks of this type.
body.one_of.variant.body
body { ... }
Same contents as body.