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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -