Closed
Description
The method @requestBody has a String parameter contents which I am converting into object but while generating the swagger.json it is converting it into String as type. So, what is the proper annotation for that?
@RequestMapping(value = "/{keyId}/{id}/content", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "")
public Model save(@PathVariable("keyId") String keyId,
@PathVariable("id") String id,
@RequestBody String contents) {
ObjectMapper om = new ObjectMapper();
contents = JsonSanitizer.sanitize(contents);
SaveFruitModel payload = om.readValue(contents, SaveFruitModel.class);
}
"post" : {
"tags" : [ "Model" ],
"summary" : "",
"description" : "",
"operationId" : "save",
"parameters" : [ {
"name" : "keyId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "id",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"type" : "string"
}
} ],
Here I am getting "type":"string"
under schema
but I want here the type object or the class name so what is the proper annotations for this.