This commit is contained in:
@@ -92,7 +92,7 @@ public class ApiDocs extends HttpBaseServlet {
|
|||||||
if (Modifier.isStatic(field.getModifiers())) continue;
|
if (Modifier.isStatic(field.getModifiers())) continue;
|
||||||
|
|
||||||
Map<String, String> fieldmap = new LinkedHashMap<>();
|
Map<String, String> fieldmap = new LinkedHashMap<>();
|
||||||
fieldmap.put("type", field.getType().isArray() ? (field.getType().getComponentType().getName() + "[]") : field.getType().getName());
|
fieldmap.put("type", field.getType().isArray() ? (field.getType().getComponentType().getName() + "[]") : field.getGenericType().getTypeName());
|
||||||
|
|
||||||
Comment comment = field.getAnnotation(Comment.class);
|
Comment comment = field.getAnnotation(Comment.class);
|
||||||
if (comment != null) fieldmap.put("comment", comment.value());
|
if (comment != null) fieldmap.put("comment", comment.value());
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
html.push(' <tr><td colspan="5"><table class="typetable">');
|
html.push(' <tr><td colspan="5"><table class="typetable">');
|
||||||
for (var fieldname in classmap[type]) {
|
for (var fieldname in classmap[type]) {
|
||||||
var field = classmap[type][fieldname];
|
var field = classmap[type][fieldname];
|
||||||
var t = field.type.substring(field.type.lastIndexOf('.') + 1);
|
var t = field.type.replace(/</g,"<").replace(/>/g,">").replace(/([a-zA-Z0-9_\$]+\.)+/g, "");
|
||||||
html.push(' <tr class="l"><td>' + fieldname + '</td><td>' + t + '</td><td colspan="2">' + (field.comment || '') + '</td></tr>');
|
html.push(' <tr class="l"><td>' + fieldname + '</td><td>' + t + '</td><td colspan="2">' + (field.comment || '') + '</td></tr>');
|
||||||
}
|
}
|
||||||
html.push(' </table></td></tr>');
|
html.push(' </table></td></tr>');
|
||||||
|
|||||||
Reference in New Issue
Block a user