A null config value is present, and its schema decides whether it is acceptable
The rule
Normative: this is the rule
- A config value of
nullis present, with no value. - It MUST satisfy a required key.
- It MUST be validated against the key's schema as JSON Schema validates it: it MUST fail
typeunless the type admitsnull, and MUST failenumunless the enumeration listsnull. - Constraints that apply only to strings, numbers, arrays or objects, such as bounds and
pattern, do not apply to anull.
What it means
Presence and value are judged separately, as JSON Schema judges them. A
required key set to null is present, so it satisfies the requirement. Its
value is then checked like any other: null is a type of its own, so it fails
a key whose type does not admit it, and it fails an enum that does not list
it. Bounds and pattern describe numbers and strings, and say nothing about a
null.
Example
A required key whose schema is { "type": "string", "minLength": 5 }:
{"url": null}The requirement is met, but type refuses the value. With
{ "type": ["string", "null"], "minLength": 5 } the same config is accepted.
Why
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.i · changed in spec 1.0