This function throws a null pointer error if items isn't present for an array type.
var Property = function(name, obj, required) {
this.schema = obj;
this.required = required;
if(obj['$ref']) {
var refType = obj['$ref'];
refType = refType.indexOf('#/definitions') === -1 ? refType : refType.substring('#/definitions').length;
this['$ref'] = refType;
}
else if (obj.type === 'array') {
if(obj.items['$ref'])
this['$ref'] = obj.items['$ref'];
else
obj = obj.items;
}
this.name = name;
this.obj = obj;
this.optional = true;
this.example = obj.example || null;
}
But json schema does not require items:
http://json-schema.org/latest/json-schema-validation.html#anchor36
Is this a case of swagger-ui does require it, or just a bug?