Open Padmahas opened 5 years ago
Update. Hello,
I'm still getting the multiple fields error irrespective of whether I check, it's declared in parent or not. Either if I exclude a field only if it is declared in parent class, as described in this SO answer, OR I blindly exclude all "equalsCalc" and "hashCodeCalc", there's no difference.
Either way, somehow I need to tell Gson to consider child class field. How to achieve that.
Thank you.
any update??
Yeah. I excluded all "equalsCalc" and "hashCodeCalc", irrespective of whether it is parent or child class. Then I had to provide custom Deserialization for all classes which throws this error.
Thank you.
I was on a project to retire all the other JSON libraries and use GSON instead. I kept getting this error and had to leave some as they were. I don't want to use the exclusion strategy, either because there are many fields need to be excluded.
Hello,
We are using Google Ad Manager axis API in our project. While converting LineItem object, we are getting the below error.
As mentioned in this issue, using exclusion strategy will make those fields to be null. Since those fields are mandatory, if it's sent to Ad manager we will get exception.
Hence I'm look for a way to tell Gson, instead of completely excluding the field from Deserialization, how to force Gson to consider child class fields and child class setter methods?
When it's common for a field to override it's parent class field, why not Gson consider child class's field by default? How can I overcome this exception?
Thank you.