I have a REST API that returns essentially a map (String, Object), where Object is also
- Custom bean (for example, a Bean class) or
- List of items, all types of Bean
In JSON, this is very well suited for:
{
"key1":{
"val1":"some string",
"val2":"some other string",
"val3":"another string"
},
"key2":[
{
"val1":"some string",
"val2":"some other string",
"val3":"another string"
},
{
"val1":"some string",
"val2":"some other string",
"val3":"another string"
}
]
}
Through swagger annotations, is there a way to specify this type of dynamic map as a response class?
thank
source
share