I was wondering if there is an already built in option in Gson to detect unparsed key value pairs of a JSONObjects. I have a Gson class setup that collects the following json string:
"data":{"type": "account", "id":"73891"}
I want to know if Gson will actually know what key value pairs have not been defined in the class but exist in the Json String. Like if for instance the string above had another key value pair "year":"2022"
that was not defined in the class, will Gson be able to tell me it didn't store that key value pair in a variable.
CodePudding user response:
No, unfortunately Gson does not support this at the moment, see issue #188. And it is not clear if that feature will ever be added since Gson is in maintenance mode.