FlowDrop Workflow Specification 1.0-draft

A string context is parsed as JSON where it parses

The rule

Normative: this is the rule
  1. Where the evaluation context is a string, it is parsed as JSON and the parsed value is what the path queries.
  2. A string that is not valid JSON is used as-is.
  3. The string null parses to null, like any other JSON document.

What it means

Whether a string context is parsed turns entirely on whether it parses, not on whether it looks like ordinary text or looks like data. The sharp edge is the four-character string "null": it reads like the kind of text a pass-through would leave alone, but it is itself a complete, valid JSON document, so it decodes to the JSON value null rather than surviving as the four-letter word. Nothing about the surrounding path decides this — the context alone does.

Example

The context is a string in both cases; only whether it parses as JSON decides what querying the root returns.

A context that is the word nullcontext
"null"
What querying the root of it returnsdecoded
null
A context that is a JSON object as textcontext
"{\"name\": \"Test\", \"value\": 123}"
What querying its name returnsdecoded
"Test"
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-16 · changed in spec 1.0