java - Serialize nested object as String with Jackson -
i have simple dto has nested object, like:
public class { public string field; public b b; public static class b { public string stringfield; public int intfield; } }
when serialize jackson, like:
{ "field": "foo", "b": { "stringfield": "bar", "intfield": 42 } }
but due weird api of external system i'm integrating with, need following:
{ "field": "foo", "b": "{\"stringfield\":\"bar\",\"intfield\":42}" }
and should work on deserialization, incoming data looks same way. can done jackson?
Comments
Post a Comment