FlowDrop Workflow Specification 1.0-draft

A JSONPath query never raises; it falls back to the caller's default

The rule

Normative: this is the rule
  1. JSONPath evaluation never raises.
  2. A query that is well-formed but matches nothing, and a query that cannot be compiled or cannot be run, both yield the default the caller supplied, null where none was supplied.
  3. The returned value does not tell the two apart.

What it means

A JSONPath query can fail in two quite different ways — the string never compiles at all, or it compiles and runs but matches nothing — and the engine treats both as the same outcome. Neither raises, and both hand back whatever default the caller supplied, null if none was given. The returned value carries no trace of which of the two happened, so a caller cannot use it to distinguish a typo in the query from a query that was simply looking in the wrong place.

Example

Two failing queries against the same data: $.[invalid, which cannot compile, and $.store.nonexistent, which compiles and runs but matches nothing — both evaluated with the same supplied default.

What both queries returnfallback
"fallback"
Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0-draft · LANG-9 · changed in spec 1.0