swagger-core
swagger-core copied to clipboard
JAX-RS incorrect reference name when using ApiModel annotation
When a response class contains a property that references a second class, an @ApiModel(value="...") annotation on the second class will cause errors in the reference path.
The sample java-jaxrs project can be modified to demonstrate the error. On the Category class add the following annotation:
@com.wordnik.swagger.annotations.ApiModel("MyCategory")
This produces the following incorrect JSON:
"definitions" : {
"MyCategory" : { // this part is correct
// snip
},
"Pet" : {
"properties" : {
"category" : {
"$ref" : "#/definitions/Category" // this part is incorrect. It should be MyCategory.
},
// etc...
I tested this in version 1.5.1-M2.