I'm facing similar issue than the one described in that thread :
Can Enunciate generate docs for an API that handles generic types?
I am using enunciate 1.28 with spring and swagger modules enabled.
So considering an abstract resource class like :
public abstract class AbstractResource<T> {
@Autowired
private SomeService<T> service;
@Path("/{id}")
@GET
public T get(@PathParam("id") String id) {
return service.get(id);
}
@POST
public Response post(T entity) {
return service.post(entity);
}
}
and one concrete implementation :
@Path("/authors")
public class AuthorResource extends AbstractResource<Author> { }
For GET I have :
Response Body element: (custom)`
and POST :
Request Body element: entity`
However the Author model is listed in the AuthorResource.json generated in swagger/ui directory. The responseClass and dataType fields are just missing the link to the model.
Manually replacing :
"responseClass" : "string"` by `"responseClass" : "ns0_Author" (GET)
"dataType" : "string"` by `"dataType" : "ns0_Author" (POST)
does the trick.
Note : I confirm that on my side Author is annotated with @XmlRootElement and the Author class is included in my <api-import pattern="com.my.package.**"/>
which is located in a jar file on the classpath.
Any ideas on how to tweak the Enunciate/Swagger documentation generation in that case ?
Thanks
Smells like a bug. Tracking it here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.