Skip to content

An extraction that matches nothing is a miss; a matched null is delivered

A path that matches nothing and a path that matches a null give different answers, and the extractor keeps them apart, as JSONPath does. Only a miss falls back to the default.

The rule

Normative: this is the rule
  1. An extraction that evaluates cleanly and matches nothing is a miss.
  2. On a miss, the configured default MUST be delivered, the extractor MUST report success as false, and the node MUST succeed.
  3. An extraction that matches a null MUST deliver null and report success as true.
  4. A matched false, 0, "", [] or {} MUST be delivered as found, and success reported as true.

Why

Recorded under OPEN-25, OPEN-26.

References

Further reading

  • RFC 9535JSONPath: Query Expressions for JSONTells a query that selects no node apart from one that selects a node whose value is null. This rule keeps the same distinction for every engine.

Fixtures

Test cases whose outcome this rule decides. A case compares absent, null and empty members exactly; the fixtures README defines each operation. Where a case and the rule disagree, the rule is right.

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