wuzz icon indicating copy to clipboard operation
wuzz copied to clipboard

query json in response

Open ZwodahS opened this issue 8 years ago • 5 comments

One of the things I am interested in helping is to put a json query language similar to jq into wuzz.

There is already an existing parser at https://github.com/tidwall/gjson.

ZwodahS avatar Feb 08 '17 09:02 ZwodahS

Do you mean as an alternative method of searching (as opposed to the existing regex search)? If so, that sounds like a great idea - I'd definitely be interested in that. Not sure how else we could use a jq-like syntax in wuzz - I'd love to hear any suggestions you might have.

Benaiah avatar Feb 08 '17 09:02 Benaiah

so if the response body is a json like say

{
  "books": [
    { "id": "abc", "name": ... },
    { "id": "cde", "name": ...},
  ]
}

We should be able to query .books.[0] to get the first item or .books.[*].id to get all the id. This will allow us navigate big json easily.

ZwodahS avatar Feb 08 '17 09:02 ZwodahS

@ZwodahS agree, it would be useful. README's todo section already contains this feature but with xpath.

asciimoo avatar Feb 08 '17 09:02 asciimoo

@ZwodahS that's what I thought you meant - that's a great suggestion.

Benaiah avatar Feb 08 '17 09:02 Benaiah

alrighty, let me see what I can do =).

ZwodahS avatar Feb 08 '17 09:02 ZwodahS