Requested
Add json query type for asserting structured JSON output.
Example
curl -s http://localhost/api/users
EXIT 0
[Asserts]
stdout.json $.items[0].name equals "foo"
stdout.json $.count greaterThan 0
stdout.json $.items length 3
Open questions
- JSONPath library? (e.g. github.com/ohler55/ojg, github.com/PaesslerAG/jsonpath)
- Syntax:
stdout.json <path> or json <path> as query?
- Which predicates make sense? (equals, contains, greaterThan, length, exists)
- Support for stderr.json?
- What about nested arrays/objects as expected value?
Requested
Add
jsonquery type for asserting structured JSON output.Example
Open questions
stdout.json <path>orjson <path>as query?