An empty expression is not an error
The rule
- An empty expression MUST pass validation.
- It MUST produce a defined result rather than a failure.
- A mapper output whose expression is empty MUST be null, whatever the engine.
- 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:
nullAn 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:
{"a": 1}