Update how property schemas are returned

This commit is contained in:
toasted-nutbread 2020-02-02 11:13:26 -05:00
parent ea808024d7
commit b1fc9c024a

View File

@ -126,8 +126,9 @@ class JsonSchemaProxyHandler {
{ {
const properties = schema.properties; const properties = schema.properties;
if (JsonSchemaProxyHandler.isObject(properties)) { if (JsonSchemaProxyHandler.isObject(properties)) {
if (Object.prototype.hasOwnProperty.call(properties, property)) { const propertySchema = properties[property];
return properties[property]; if (JsonSchemaProxyHandler.isObject(propertySchema)) {
return propertySchema;
} }
} }
@ -148,7 +149,10 @@ class JsonSchemaProxyHandler {
} }
if (Array.isArray(items)) { if (Array.isArray(items)) {
if (property >= 0 && property < items.length) { if (property >= 0 && property < items.length) {
return items[property]; const propertySchema = items[property];
if (JsonSchemaProxyHandler.isObject(propertySchema)) {
return propertySchema;
}
} }
} }