(Quick Reference)

SwaggyUpdate

Purpose

Documents a method as a Update action for an entity. This is shortcode for a couple of Swagger Annotations.

Examples

This is the shortcode:

@SwaggyUpdate
def update() {
  // …
}

Detailed version

This is the effect of SwaggyUpdate

@ApiOperation(value = "Update #Demo", response = #Demo)
@ApiResponses([
    @ApiResponse(code = 400, message = 'Bad Id provided'),
    @ApiResponse(code = 404, message = 'Could not find #Demo with that Id'),
    @ApiResponse(code = 422, message = 'Bad Entity Received'),
])
@ApiImplicitParams([
    @ApiImplicitParam(name = 'id', value = 'Id to update', paramType = 'path',
        dataType = 'int', required = true),
    @ApiImplicitParam(name = 'body', paramType = 'body', required = true,
        dataType = '#Demo')
])