You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Selectors: JSONPath filters, recursive descent, negative index and multi-value headers #44
body.$.<path> is a gjson subset translated by ToGJSON (internal/selector/selector.go:79-111): dotted paths, [n], ["quoted"], # and *. Real JSONPath users (Hurl, Postman, Bruno) also write filters, recursive descent, negative indexes and slices, and those fail to parse today. Headers only expose the first value.
What
Support, with the same syntax in # @assert, # @capture, the BDD the response body "<path>" steps and MCP:
body.$..id (recursive descent; gjson has no .., so implement a small in-tree walker for this form and document the choice)
body.$.items[?(@.done == true)].id and [?(@.name =~ /^a/)] (map onto gjson #(done==true)#.id and #(name%"a*"))
body.$.items[-1], body.$.items[1:3]
.length as an alias of # for people arriving from JavaScript
header.<name>.# (count) and header.<name>[1] (n-th value) for multi-valued headers such as Set-Cookie and Link
Errors name the unsupported construct and the line. validate uses the same parser so a bad selector is caught before running.
Where
internal/selector/selector.go, selector_test.go; internal/bdd/steps.go (paths without $.).
Done in #114 (66832fb, review fixes in 42eaed0). Rather than mapping onto gjson queries, body.$ paths are read by a small in-tree JSONPath evaluator over gjson values (internal/selector/path.go): .., filters with == != < <= > >= =~ && || and presence, [-1], slices, wildcards, .length, and header.<name>.# / header.<name>[n]. gjson's items.0.id and items.#.id still select what they did. The choice is documented in docs/format.md#body-paths; validate uses the same parser.
Activity
Selectors: JSONPath filters, recursive descent, negative indexes, sli…
dataGriff commentedon Sep 24, 2026
Done in #114 (66832fb, review fixes in 42eaed0). Rather than mapping onto gjson queries,
body.$paths are read by a small in-tree JSONPath evaluator over gjson values (internal/selector/path.go):.., filters with== != < <= > >= =~ && ||and presence,[-1], slices, wildcards,.length, andheader.<name>.#/header.<name>[n]. gjson'sitems.0.idanditems.#.idstill select what they did. The choice is documented in docs/format.md#body-paths; validate uses the same parser.Generated by Claude Code