This commit is contained in:
@@ -35,7 +35,7 @@ public class RestDocs extends HttpBaseServlet {
|
|||||||
serverList.add(map);
|
serverList.add(map);
|
||||||
HttpServer server = node.getServer();
|
HttpServer server = node.getServer();
|
||||||
map.put("address", server.getSocketAddress());
|
map.put("address", server.getSocketAddress());
|
||||||
List<Map> servletsList = new ArrayList<>();
|
List<Map<String, Object>> servletsList = new ArrayList<>();
|
||||||
map.put("servlets", servletsList);
|
map.put("servlets", servletsList);
|
||||||
for (HttpServlet servlet : server.getPrepareServlet().getServlets()) {
|
for (HttpServlet servlet : server.getPrepareServlet().getServlets()) {
|
||||||
if (!(servlet instanceof HttpServlet)) continue;
|
if (!(servlet instanceof HttpServlet)) continue;
|
||||||
@@ -109,8 +109,14 @@ public class RestDocs extends HttpBaseServlet {
|
|||||||
}
|
}
|
||||||
actionsList.add(actionmap);
|
actionsList.add(actionmap);
|
||||||
}
|
}
|
||||||
|
actionsList.sort((o1, o2) -> ((String) o1.get("url")).compareTo((String) o2.get("url")));
|
||||||
servletsList.add(servletmap);
|
servletsList.add(servletmap);
|
||||||
}
|
}
|
||||||
|
servletsList.sort((o1, o2) -> {
|
||||||
|
String[] mappings1 = (String[]) o1.get("mappings");
|
||||||
|
String[] mappings2 = (String[]) o2.get("mappings");
|
||||||
|
return mappings1.length > 0 ? (mappings2.length > 0 ? mappings1[0].compareTo(mappings2[0]) : 1) : -1;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
Map<String, Object> resultmap = new LinkedHashMap<>();
|
Map<String, Object> resultmap = new LinkedHashMap<>();
|
||||||
resultmap.put("servers", serverList);
|
resultmap.put("servers", serverList);
|
||||||
|
|||||||
@@ -303,6 +303,7 @@ public final class Rest {
|
|||||||
String url = "/" + defmodulename.toLowerCase() + "/" + entry.name + (reqpath ? "/" : "");
|
String url = "/" + defmodulename.toLowerCase() + "/" + entry.name + (reqpath ? "/" : "");
|
||||||
av0.visit("url", url);
|
av0.visit("url", url);
|
||||||
av0.visit("actionid", entry.actionid);
|
av0.visit("actionid", entry.actionid);
|
||||||
|
av0.visit("comment", entry.comment);
|
||||||
|
|
||||||
AnnotationVisitor av1 = av0.visitArray("methods");
|
AnnotationVisitor av1 = av0.visitArray("methods");
|
||||||
for (String m : entry.methods) {
|
for (String m : entry.methods) {
|
||||||
@@ -330,6 +331,7 @@ public final class Rest {
|
|||||||
av0.visitEnd();
|
av0.visitEnd();
|
||||||
actionMap.put("url", url);
|
actionMap.put("url", url);
|
||||||
actionMap.put("actionid", entry.actionid);
|
actionMap.put("actionid", entry.actionid);
|
||||||
|
actionMap.put("comment", entry.comment);
|
||||||
actionMap.put("methods", entry.methods);
|
actionMap.put("methods", entry.methods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user