Skip to content

A config value matches its declared type

R6.d through R6.h are one check with several arms. They share a code and a locator and stop at the first violation, so a reader of the result sees at most one error per config key.

The rule

Normative: this is the rule
  1. A config value whose type does not match the type its schema declares MUST be refused with R6_CONFIG_INVALID at node.{id}.config.{key}, where {id} is the node's id and {key} the config key.
  2. A schema that declares no type imposes no type constraint, and the value MUST NOT be refused for its type, as in JSON Schema.
  3. A type that names no JSON Schema type makes the schema invalid; that is the node type's failure (SCH-24), and R6.j applies.
  4. R6.d to R6.h MUST all raise this same code at this same locator.
  5. They MUST be evaluated in one fixed order (type, then enum, then minimum, maximum, minLength, maxLength, pattern), stopping at the first violation, so one config key never yields more than one error.
  6. Stopping early decides which error is reported, never whether the value is refused.
  7. The arms are distinguished by the error's message, not by its code.

What it means

The type check follows JSON Schema. A schema that leaves type out imposes no type constraint, so any value passes it. A schema whose type names something JSON Schema does not know, such as "uuid", is not a valid schema at all. That is a defect in the node type, not in the workflow: the node type cannot be built (SCH-24), and its config is not judged against a schema it does not have (R6.j). The author is never charged with an error they cannot fix.

R6.d shares its code and locator with R6.e through R6.h, and all five run in one fixed order, type first, stopping at the first violation. A value that breaks two of them at once is charged with one error, for the constraint checked earliest. Stopping early changes which error the author reads, never whether the value is refused.

Example

A key's declared schema with no typestored
{"untyped": {}}
The config value assigned to itaccepted
{"untyped": ["anything"]}

A schema with no type holds the value to no type, as JSON Schema does.

Why

Recorded under OPEN-25, OPEN-28.

Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · R6.d · changed in spec 1.0