I'm trying to use a mustache file to generate my API using the swagger codegen tool (maven plugin: https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen-maven-plugin) I've created the .mustache file, and I have the following values generated from my .yaml file:
"responses" : [ {
"code" : "200",
"message" : "Success"
},{
"code" : "500",
"message" : "Internal server error"
}]
I'm currently trying to write it in a .mustache file as:
@ApiResponses(value = {
{{#responses}}
@ApiResponse(code={{code}}, message="{{message}}"),
{{/responses}}
})
The problem is I have a trailing comma that causes the compilation to fail once the file is generated. Does anyone know of a way to get rid of the last comma?