java
java copied to clipboard
Possible to flat json object
Imagine we have some json
{ "id": "Bla", "name": "x", "source": { "id": "2" } }
And we wanna have this output:
public class Record{ public String id; public String name; public String sourceId; }
How could we do it? Right now I use constructor mapping with a temporary Source object which then is used to set the consponding String in the Record class but there has to be a better way or?