java - deserialize json field into plain string with gson -
i trying deserialize json object java bean. main issue facing i'd treat field object
of json string plain string, if contains potentially correct json object. json structure this:
{ "type":"user", "object":{ "id":"1", ...} }
how can tell gson ignore object
value doesn't deserialized object? i'd mapped plain string
field in bean can dispose proper deserialization it, once got type type
field.
just declare of type jsonobject
class examplejsonmodel { @serializedname("type") public string type; @serializedname("object") public jsonobject object; }
Comments
Post a Comment