Skip to content

An empty expression is not an error

The rule

Normative: this is the rule
  1. An empty expression MUST pass validation.
  2. It MUST produce a defined result rather than a failure.
  3. A mapper output whose expression is empty MUST be null, whatever the engine.
  4. An extractor whose path is empty MUST return its input unchanged and MUST report success as true: the empty path matches the evaluation context itself (LANG-20).

What it means

An empty expression is not treated as an author mistake in either direction a node can use one. What "empty" resolves to is fixed by which of the two families (LANG-1) the node belongs to, not by the engine selected: a node that writes an output from an expression gets null for an empty one, and a node that reads a value out of a context by path returns that context unchanged, still reporting success, when the path is empty. Neither shape depends on which engine is configured — the short-circuit happens before an engine ever runs.

Example

A mapping node produces one output whose expression is empty:

The value of a mapper output whose expression is emptynull
null

An extractor given a path of "" against an input of {"a": 1} never reaches an engine either. The empty path matches the context itself, so it reports success and delivers the context it was handed back unchanged:

The data an extractor with an empty path deliversunchanged
{"a": 1}

Why

Recorded under OPEN-25, OPEN-41.

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-3 · changed in spec 1.0