I have the following example object:
{
"manufacturer": "bla",
"model": "5901",
"metadata": {
"CommercialName" : "bla bla",
"Intername Name" : "bla bla"
},
"features": [
"a"
],
"profiles": 1
}
I wish to store the below metadata part without parsing it directly into Postgres SQL's "jsob" type.
"metadata": {
"CommercialName" : "bla bla",
"Intername Name" : "bla bla"
},
The DTO class looks like below now.
JsonInclude(JsonInclude.Include.NON_NULL)
public class device {
private Long id;
private String manufacturer;
private String model;
private Integer profiles;
private String metadata;
private List<String> feature;
+all the gettors/settors
}
However, I am getting an error. I do not know how to represent "metadata" (which in theory can contain any client specific JSON object) without having a separate object for it.