glideapps / quicktype

Generate types and converters from JSON, Schema, and GraphQL
https://app.quicktype.io
Apache License 2.0
12.44k stars 1.08k forks source link

Comments in json cause quicktype to hang up #1606

Open Zeutschler opened 3 years ago

Zeutschler commented 3 years ago

Although comments are not specified / supported in json, a lot of people use them and a lot of system accept them. Quicktype should either support comments or reject comments or show another behaviour. Currently it just causes an endless loop on "Analysing sample data...".

This works just fine:

{
    "foo": "brother" 
}

This fails / causes hang up:

{
    "foo": "brother" // comment
}

This error occurs over all levels of json complexity on all browsers I tested.

oxc commented 3 years ago

This would probably be fixed by #1144

weiliang903 commented 3 years ago

same situation