java icon indicating copy to clipboard operation
java copied to clipboard

Possible to flat json object

Open Prototype1 opened this issue 5 years ago • 0 comments

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?

Prototype1 avatar Jun 14 '19 09:06 Prototype1