-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
JsonWriter.name
does not throw exception when not inside JSON object
#2407
Comments
Seems like we should fix this. You will get an exception if you write pretty much anything else after the |
Hi, just wanted to ask, if anyone not working on this, would like to contribute on this issue |
@shivam-sehgal, thanks for asking! To my knowledge no one is working on this yet. Though before you start, please have a look at the contributing guide and also at the pull request checklist. |
Thanks @Marcono1234 , for letting me know the status of the bug, and the docs, have done the needful by signing the CLA and going through the PR checklist, and will look into this issue. |
Hello @Marcono1234, |
Gson version
2.10.1
Java / Android version
Java 17
Description
Calling
JsonWriter.name
(and maybe alsoJsonTreeWriter.name
) when not inside a JSON object does not fail.Expected behavior
An
IllegalStateException
should be thrownActual behavior
No exception is thrown
Reproduction steps
The text was updated successfully, but these errors were encountered: