This commit is contained in:
Redkale
2016-09-13 16:07:26 +08:00
parent 95f4cd0634
commit 4e9b3f45fc

View File

@@ -92,7 +92,7 @@ public class RestDocs 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().getName()); fieldmap.put("type", field.getType().isArray() ? (field.getType().getComponentType().getName()+"[]") : field.getType().getName());
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());