Replies: 4 comments
|
This is due to the JSON specification not allowing trailing commas. An idea we could explore is treating it as a JS Object, rather than using the notation form. This way trailing commas could be supported. The issue then becomes that this opens up a security vulnerability vector. Another idea is that instead of warning the user or berating the user, we could attempt to format the document and clean it up to the standards the linter seeks. |
|
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. |
|
Pretty please? Copy & paste continues to be a massive pain without trailing commas. |
|
I totalllllly feel yah on this one. It's too bad that JSON was developed before ES5 when trailing commas were added, otherwise JSON would likely have trailing commas, itself. There is a third option, which is to use a json parser that will accept the trailing comma. If we do this, I'd like us to use https://github.com/json5/json5. Would you be open to making a PR for this? I could help. The thing to keep in mind here is the we need to keep the environment natively serializable to actual json for exports ( |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When I tweak my environment, I'm constantly cutting and pasting lines of JSON here and there. Having to worry about adding/removing trailing commas just to keep the tool happy is really quite annoying.
Is there a reason why Insomnia won't just allow and ignore trailing commas?
This is similar to issue #770 but that one is about JSON request body so I felt it's best to submit a separate request.
All reactions