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

Empty JSON should cause an exception, according to the grammar #9

Open
ssilverman opened this issue Oct 23, 2020 · 1 comment
Open
Assignees

Comments

@ssilverman
Copy link
Contributor

According to the JSON grammar, there needs to be at least one thing, be it an object, value, or array. Shouldn't a parsing exception (EOF) be thrown for these? hasNext(), in addition to next(), throws a JsonParsingException when it advances to the next event, and since the parser encounters an EOF before the next event, it's technically invalid JSON.

Ref: https://tools.ietf.org/html/rfc8259#section-2

JSON-text = ws value ws
@leadpony
Copy link
Owner

leadpony commented Nov 1, 2020

@ssilverman
I will check it.

@leadpony leadpony self-assigned this Nov 1, 2020
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

2 participants