How to DRY when using Swagger UI and the ApiResponses annotations with Java Spring endpoints? : <p>I like <code>Swagger</code> because it makes your apis very user friendly. I use <code>Swagger</code> annotations like</p>

<ul>
<li>@ApiParam </li>
<li>@ApiResponse | @ApiResponses </li>
<li>@ApiOperation </li>
<li>Others </li>
</ul>

<p>On endpoints, query params, request params, request body and so on. </p>

<p>I like to keep my <code>POJO</code> classes clean and in general I try my best to follow <code>DRY</code> rule however, when it comes to swagger I noticed that I keep <strong>repeating</strong> myself over and over as shown below</p>

<pre><code>@ApiOperation(value = "Retrieve object by id")
@ApiResponses(value = {
    @ApiResponse(code = 200, message = "OK"),
    @ApiResponse(code = 404, message = "Not Found"),
    @ApiResponse(code = 400, message = "Bad Request"),
    @ApiResponse(code = 500, message = "ISE")
})
public Response retrieveById(@ApiParam(value = "Some id") @PathParam("sid") int id) {       
}

@ApiOperation(value = "Create object")
@ApiResponses(value = {
    @ApiResponse(code = 201, message = "Created"),
    @ApiResponse(code = 404, message = "Not Found"),
    @ApiResponse(code = 400, message = "Bad Request"),
    @ApiResponse(code = 500, message = "ISE")
})
public Response create(@ApiParam(value = "Request body") RequestBody body) {
}
</code></pre>

<p>How to avoid repeating yourself with <code>Swagger annotations</code>? </p>
