A config value must match 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
- A config value whose type does not match the
typeits schema declares is refused withR6_CONFIG_INVALIDatnode.{id}.config.{key}, where{id}is the node's id and{key}the config key. - A schema that declares no
type, or one that declares a type name the implementation does not recognise, imposes no type constraint and the value passes. - R6.d to R6.h all raise this same code at this same locator and are evaluated in one fixed order (type, then
enum, thenminimum,maximum,minLength,maxLength,pattern) stopping at the first violation, so one config key never yields more than one error. - The arms are distinguished by the error's message, not by its code.
What it means
The type check only bites when the schema names a type the implementation
recognises. A schema that leaves type out, or spells a name nothing checks
for, imposes no constraint at all — the value passes whatever it is, which
runs against the instinct that an unrecognised or missing declaration should
be treated as stricter, not looser.
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 exactly one error, for the constraint checked earliest.
Example
One key's schema names a type the checker has never heard of; another
declares no type at all:
{"weird": {"type": "uuid"}, "untyped": {}}{"weird": 42, "untyped": ["anything"]}Neither value is held to any type: an unrecognised type word and an absent one both impose no constraint.