JsonSyntaxException Javadoc wrong or Gson.fromJson() throwing a wrong exception
Open
documentation
enhancement
- Dominant language
- Java
- Stars
- 24.2k
- Forks
- 4.5k
- Avg merge
- 6d 4h
- Merged PRs (30d)
- 12
Description
https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.1 says
> This exception is raised when Gson attempts to read (or write) a malformed JSON element.
However, it throws the exception even if an element or a JSON is well-formed and syntactically correct. For example, when de-serializing JSON input with `gson.fromJson(json, MyType.class)`, if a string type is given when an array type is expected, it will throw a syntax exception, even if the input is syntactically correct.
Contributor guide
Assessment
This issue has not been assessed yet.