I am working on an API which generates client SDK using the swagger.json file. But I am manually editing the swagger.json due to some technical reasons. The issue is that I can receive dynamic response from the API side. 3 to 4 fields are fixed for all responses but the remaining fields may vary. For those remaining fields I need a Map that can contain all the keys of the response json into the key field of the Map and the value field of the response json into the value field of the Map. Currently, I am using the following definition:
"Annot": {
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"begin": {
"type": "integer",
"format": "int32"
},
"end": {
"type": "integer",
"format": "int32"
},
"text": {
"type": "string"
},
"additionalProperties": {
"type": "object"
}
}
}
]
}
But unfortunately what it's generates is:
private String type;
private Long begin;
private Long end;
private String text;
private Map additionalProperties;
Following definition is what I am expecting:
private String type;
private Long begin;
private Long end;
private String text;
private Map<String, Object> additionalProperties;
Any idea how can create a Map by manually editing the swagger.json or how the definition should look like?