I have a spring GET REST API with custom class as request param as below. I
want to annotate this api with swagger 2. But custom object is not exported in
swagger.json definitions. I tried adding ApiImplicitParams annotations still it
didn't reflect my changes in the swagger.json. Please let me know if there is a
better way to document this. It is difficult to decompose the custom object to
series of params so I have to make swagger define my custom object in
swagger.json
@ApiOperation(value = "Returns a list of Actions")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = List.class),
@ApiResponse(code = 400, message = "Bad Request", response =
String.class),
@ApiResponse(code = 500, message = "Internal Server Error",
response = String.class) })
//I tried to ApiImplicitParams to override swagger default behavior according
to swagger docs, but didn't override
@ApiImplicitParams({
@ApiImplicitParam(name = "actionId", required = true, dataType =
"integer", paramType = "query"),
@ApiImplicitParam(name = "actionName", required = true, dataType =
"string", paramType = "query"),
})
@ResponseBody
@RequestMapping(value = "/v1/myAction", method = GET)
public List<String> myAction(MyObject myObject)
/*sample MyObject Class - Actual MyObject has lot more fields*/
class MyObject {
Integer[] actionId;
String[] actionName;
}
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.