Skip to content
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

non-finite numbers are written as invalid JSON #98

Open
Tillerino opened this issue Apr 17, 2024 · 0 comments
Open

non-finite numbers are written as invalid JSON #98

Tillerino opened this issue Apr 17, 2024 · 0 comments

Comments

@Tillerino
Copy link
Contributor

So it appears that non-finite numbers produce invalid JSON, as far as I can tell. For example, the following round trip crashes:

String json = JsonWriter.string().value(Double.NaN).done();
JsonReader.from(json).doubleVal();

The reason is that the produced JSON is simply NaN. I think it should be "NaN" - this is at least what Jackson does. Either that, or the parser should be able to read unquoted non-finite values.

Not a blocker for me, but I thought you would want to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant