I have a DTO:
public Foo { public int bar = 123; public Map<String, Object> params; // key1=v1, key2=v2 etc. }
I would like it to serialize to / from the following JSON:
{ "bar": 123, "key1": "v1", "key2": "v2" }
Does anyone know how to do this using Jackson or Genson? Basically I want automatic type conversion for fields declared in the DTO, but any "optional" ones to go to the params map.
java json jackson genson
David tinker
source share