-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getSignature method #268
Comments
Can you please share the JSON representation of the model before it appears in swagger-ui? |
Below is the model element in the json generated by Swagger Spring mvc {
"Highlight": {
"properties": {
"id": {
"type": "int"
},
"annotation": {
"type": "string"
},
"resourceId": {
"type": "string"
},
"appId": {
"type": "string"
},
"ts": {
"type": "long"
},
"userId": {
"type": "string"
},
"highlight": {
"type": "string"
}
},
"type": "Highlight"
},
"DataContainer[Highlight]": {
"properties": {
"data": {
"items": {
"$ref": "Highlight"
},
"type": "List"
}
},
"type": "DataContainer[Highlight]"
}
} |
OK you have generics--that means you have to manually override the model definition. Take a look here on how to do that: https://github.com/wordnik/swagger-core/wiki/overriding-models |
This was referenced Dec 29, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I am returning DataContainer in one my my spring mvc methods where DataContainer is a generic class which holds a list(with the name 'data') of any type.
Swagger UI generates response Model like below ..it does not give the DataContainer attribute 'data' in the Model Schema
[
{
"id":0 --- Highlight attributes
.........
}
]
Looking at the swagger js code, it seems when the return type is in above format , it just ignores the container ('data' in above case) which seems odd since the json rexponse has the 'data' element.
Thanks
The text was updated successfully, but these errors were encountered: