Hi,
I have a problem that is very much like the one posted here:
https://groups.google.com/forum/#!msg/swagger-swaggersocket/eO2d6qD9K9g/cOjfc2tzMVsJ . However, I am not able to find the final solution talked about in that thread. Since it is an old thread, I am reposting the question here.
I am trying to use Swagger for documenting the APIs of my Dropwizard WebService. Both the responses as well as requests in the API endpoints of my webservice use Java generics. For example, one of my "list" API returns a response of type PagedResponse<T>. In the Swagger UI, this shows up as follows under the Response Model heading:
PagedResponse {
totalEntries (integer, optional),
message (string, optional),
data (T, optional),
status (string, optional)
}
The object type of "data" field will vary depending upon the resource that is listed, hence I'd like to find a way to tell Swagger this information so that it can accordingly show the Response Model. From reading other threads, it seems like the only way to do this is to "manually map the class to a concrete representation.". Can someone please tell me how to go about doing that for Java generics in a Dropwizard WS?
Any help is greatly appreciated. Thanks in advance.