hurl icon indicating copy to clipboard operation
hurl copied to clipboard

Give an option to reformat straight json comparisons to per-field jsonpath ones

Open lu-zero opened this issue 10 months ago • 0 comments

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.keys keys and value)
  • [ ] Produce the jsonpath assertions going over the the array
  • [ ] Add the option to the hurlfmt cli

lu-zero avatar Jan 29 '25 17:01 lu-zero