Skip to content

Commit 9a4193a

Browse files
committed
fix for #17, added inner type checking, nasty warning
1 parent 35f0721 commit 9a4193a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ public Property propertyFromTypedObject(ExtendedTypedObject obj) {
265265
if("array".equals(type)) {
266266
ArrayProperty am = new ArrayProperty();
267267
Items items = obj.getItems();
268+
if(items == null) {
269+
System.out.println("Error! Missing array type for property! Assuming `object` -- please fix your spec");
270+
Json.prettyPrint(obj);
271+
items = new Items();
272+
items.setType("object");
273+
}
268274
type = items.getType() == null ? null : items.getType().toString();
269275
format = items.getFormat() == null ? null : items.getFormat().toString();
270276

0 commit comments

Comments
 (0)