Skip to content

Commit 3714c9e

Browse files
authored
Merge pull request #753 from ajcamilo/master
jooby raml ignore class hidden properties
2 parents 85cadf0 + 93c4d03 commit 3714c9e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

jooby-raml/src/main/java/org/jooby/internal/raml/RamlType.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,16 @@ private static RamlType parse(final Type type, final Map<Type, RamlType> ctx) {
150150
Field[] fields = rawType.getDeclaredFields();
151151
Map<String, RamlType> props = new LinkedHashMap<>();
152152
for (Field field : fields) {
153-
RamlType ftype = parse(field.getGenericType(), ctx);
154-
if (field.getType().isArray()) {
155-
String ctype = ramlTypeName(field.getType());
156-
ftype.type = (ctype == null ? ftype.type() : ctype) + "[]";
157-
ftype.name = null;
158-
ftype.properties = null;
153+
if(!field.getName().startsWith("_")) { // only not hidden properties
154+
RamlType ftype = parse(field.getGenericType(), ctx);
155+
if (field.getType().isArray()) {
156+
String ctype = ramlTypeName(field.getType());
157+
ftype.type = (ctype == null ? ftype.type() : ctype) + "[]";
158+
ftype.name = null;
159+
ftype.properties = null;
160+
}
161+
props.put(field.getName(), ftype);
159162
}
160-
props.put(field.getName(), ftype);
161163
}
162164
ramlType.properties = props;
163165
}

0 commit comments

Comments
 (0)