Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.21k stars 1.92k forks source link

[Feature Request] Less strict JSON parser in the editor (json5/comments/trailing comma) #2829

Open estar73 opened 3 years ago

estar73 commented 3 years ago

Nowadays, many APIs support a superset of JSON format that allows comments, unquoted object keys, single quotes, hanging trailing commas, etc. For example, services that use the popular "Newtonsoft Json.NET" library support such JSON by default.

Insomnia allows us to use such "malformed" JSON in requests but the error highlighting is a bit annoying. Can we have an option that will treat such JSON syntax as valid?

Maybe this can be useful: https://json5.org/

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dimitropoulos commented 3 years ago

Hi, I'm going to consider this ticket the (temporary, if nothing else) umbrella for having more permissive json.

movy commented 2 years ago

Is this still on the roadmap? Insomnia is super strict with quotation marks, gives a very XML'ish feel to the liberated JSON we're using today.

dimitropoulos commented 2 years ago

Which editor are you speaking of, to be clear. Are we talking about the environments editor, for example, or a request body?

estar73 commented 2 years ago

I'm about the request body.

image

endo64 commented 2 years ago

Even Insomnia doesn't support whole JSON5, supporting comments would help a lot.

Since most servers doesn't support JSON with comment, having an option for stripping comments out while sending the request or send them as it is would be a nice feature.

flux627 commented 1 year ago

This is the only thing keeping me in Postman

hendraptaksu commented 12 months ago

I really need this feature in Insomnia (able to strip some part of the json by commenting it out).