}
List<Map<String, Object>> apis = Lists.newArrayList();
for (Class<?> clazz : getAnnotatedClasses()) {
Api info = clazz.getAnnotation(Api.class);
Path path = clazz.getAnnotation(Path.class);
if (info == null || path == null) {
LOG.debug("Skipping REST resource with no Api or Path annotation: <{}>", clazz.getCanonicalName());
continue;
}
Map<String, Object> apiDescription = Maps.newHashMap();
apiDescription.put("name", info.value());
apiDescription.put("path", path.value());
apiDescription.put("description", info.description());
apis.add(apiDescription);
}
Collections.sort(apis, new Comparator<Map<String, Object>>() {