hurl
hurl copied to clipboard
Give an option to reformat straight json comparisons to per-field jsonpath ones
Problem to solve
Sometimes novices might just paste the dump of json expected and then suffer since hurl failure reporting for it doesn't tell what.
Proposal
Have hurlfmt take the json and convert it on a set jsonpath asserts, one per flattened json field.
Additional context and resources
It is something that can be done using creatively jq, but would be better to have it builtin.
Tasks to complete
- [ ] Implement the json object flattening logic ( nested-object to array of single field objects of
dot.and[].flattened.keyskeys and value) - [ ] Produce the jsonpath assertions going over the the array
- [ ] Add the option to the hurlfmt cli