-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find a better JSON parser or implement our own #646
Comments
And perhaps support some extensions to JSON:
|
I'm not aiming to extend JSON, or make it suitable as a language for specifying schemas. I still think the proper way for that is via a graphical editor. I do agree that we shouldn't trip up on comments, but they should still be marked as errors. |
Sounds good to me. |
Some JSON parsers: |
Treating 1.0 as Int has bitten me in the ass today, any workaround for this? |
Our CLI and IDE plugins do not do this. You can use them for now as a workaround. |
@szotp we are publishing a fix, it should be live in 15 minutes. |
Have you considered porting |
jq is written in C, unless I’m not mistaken, and we need to run in the browser. I also don’t know whether it has all the features we’re looking for. I know, WASM is an option, but between extracting the parser from jq, integrating WASM and making the build work, I’d bet it’s less work to implement our own, and it’d be exactly what we want, too. |
Is this issue the reason that quicktype fails to generate a TypeScript file for my 4.9 MB file that has 200k lines? |
Possibly related? microsoft/TypeScript#42761 |
JSON with comments (aka jsonc) is nice to have. |
Required features:
Common errors:
{ foo: "bar" }
[1, 2, 3,]
[ "foo": "bar" ]
,{ 1, 2, 3 }
Other easily recoverable errors:
=
(or anything else) instead of:
in objects:{ "foo"="bar" }
.3
), leading zeros (0123
), hexadecimals (0xdeadbeef
)The text was updated successfully, but these errors were encountered: