LOG.debug("Method <{}> has no Path annotation. Skipping.", method.toGenericString());
continue;
}
}
Produces produces = null;
if (clazz.isAnnotationPresent(Produces.class) || method.isAnnotationPresent(Produces.class)) {
produces = clazz.getAnnotation(Produces.class);
if (method.isAnnotationPresent(Produces.class)) {
produces = method.getAnnotation(Produces.class);
}
}
api.put("path", methodPath);
Map<String, Object> operation = Maps.newHashMap();
operation.put("method", determineHttpMethod(method));
operation.put("summary", apiOperation.value());
operation.put("notes", apiOperation.notes());
operation.put("nickname", method.getName());
if (produces != null) {
operation.put("produces", produces.value());
}
// skip Response.class because we can't reliably infer any schema information from its payload anyway.
if (! method.getReturnType().isAssignableFrom(Response.class)) {
operation.put("type", method.getReturnType().getSimpleName());
modelTypes.add(method.getReturnType());