top | item 31334060

(no title)

hassy | 3 years ago

Yeah so the JSON quoting part is something I’m pretty pleased with. We use a YAML parser (JSON is a subset of YAML) to parse those values, which is what allows for double quotes to be omitted.

Good point on iterating on the query! We already save the body into a temp file, so we can make Probe be able to run queries on a file. Adding it to the todo list. :)

(In my own workflow I use gron a lot for getting an overview of the shape of unfamiliar JSON, super handy tool)

As to an interactive shell… yes, 100%. Kicking ideas around something like that as well!

discuss

order

mdaniel|3 years ago

> We use a YAML parser (JSON is a subset of YAML)

I believe that has more sharp edges than one might suspect

      --json "{username: testuser, password: testpassword, birthdate: 2022-05-10}"

    ...,"birthdate":"2022-05-10T00:00:00.000Z"}
The user may be less surprised if the flag were named "--yaml-as-json" or whatever DX friendly variant one wishes, in order to more clearly mark that string as yaml. The user is actually told about the "JSON or YAML", but only if they try to include some scalar value that isn't legal yaml

Also, I appreciate that every service should strive to respond in 10s, but there wasn't an obvious way to get it to be more patient

    RequestError: Timeout awaiting 'request' for 10000ms
        at ClientRequest.<anonymous> (/home/node/node_modules/got/dist/source/core/index.js:962:65)
followed by a ginormous stacktrace and a console.error dump of some event object

hassy|3 years ago

thanks for trying it out! adding “make timeouts configurable” to the todo list.

you’re right on that YAML-as-JSON thing. If everything is quoted as JSON, those type conversions shouldn’t kick in. Otherwise there’s room for surprises - perhaps we can do something to make those cases more obvious.