I have used retrofit with nested classes before, but the current api I'm tring to use has such a structure:
Request body:
{
"Id" : "a2",
"messageCode" : 1,
"bigNestedClass" : "{\"field1\":238,\"otherField\":246,\"ip\":\"10.255.130.154\",\"someOtherField\":15,\"Info\":1501069568}"
}
and a similar response body.
Note that bigNestedClass is a string.
I created different pojo classes for request and response. However, creating a nested BigNestedClass makes this field filled as JSON object, as expected, not a JSON string. And I have same problem parsing the response too.
My question: Is there a way in retrofit that enables encode, parse nested classes as strings?
I use Retrofit 2.0
I use gson (can be changed)