--- id: LANG-19 family: GR-LANG level: extended profiles: [runtime] posture: normative-target added: "1.0" changed: "1.0" source: https://flowdrop.io/spec/rules/gr-lang/lang-19 specification: FlowDrop Workflow Specification 1.0 licence: CC BY 4.0 --- # LANG-19 — Extracting all matches for a property path always yields a list *GR-LANG (Part I) · level: extended · profiles: runtime · added in 1.0* ## The rule > **Normative.** This is the rule. > > 1. Extracting all matches for a property path MUST yield an array. > > 2. A single match MUST be wrapped in a one-element array. > > 3. A path that reads a stored `null` matches it, and MUST yield a one-element array holding `null`. > > 4. A path that matches nothing MUST yield the empty array. ## What it means Extracting all matches never hands back the bare value it found — even where the path can only ever match one thing, the result is still an array, so calling code does not need two shapes depending on what the path looked like. The sharper edge is the null case: a path that reads a stored null found something, so it comes back as a one-element array holding that null. Only a path that matched nothing at all gives the empty array. ## Example Extracting all matches for `store.name`, a path that can only ever match one value: ```json title="What extracting all matches returns for a single match" verdict="wrapped" ["Test Store"] ``` ```json title="A context whose path reads a stored null" verdict="matched" {"key": null} ``` ```json title="What extracting all matches returns for it" verdict="wrapped" [null] ``` ## Why Recorded under [OPEN-25](https://flowdrop.io/spec/rulings/open-25), [OPEN-26](https://flowdrop.io/spec/rulings/open-26). --- Rule identifiers are permanent and are never renumbered. This specification carries no implementation status: each implementation publishes its own standing against these rules. Licensed CC BY 4.0.