Commit e5d7ec71 authored by Boris Kocherov's avatar Boris Kocherov

fix expandProperties()

parent f2c8b82e
......@@ -302,9 +302,13 @@
var i;
for (i = 0; i < schema_array.length; i += 1) {
// add propertyName to title
schema_array[i].title = p_name + ' / ' + schema_array[i].title;
if (schema_array[i].title && schema_array.length > 1) {
schema_array[i].title = p_name + ' /' + schema_array[i].title;
} else {
schema_array[i].title = p_name;
}
// add propertyName to schemaItem
schema_array[i].property_name = property_name;
schema_array[i].property_name = p_name;
}
return schema_array;
};
......@@ -313,7 +317,7 @@
if (properties.hasOwnProperty(property_name)) {
arr.push(
expandSchema(g, properties[property_name], schema_path +
'/properties/' + encodeJsonPointer(property_name))
encodeJsonPointer(property_name))
.push(addPropertyName(property_name))
);
}
......@@ -322,9 +326,12 @@
})
.push(function (arr) {
var i,
z,
schema_arr = [];
for (i = 0; i < arr.length; i += 1) {
schema_arr.concat(arr[i]);
for (z = 0; z < arr[i].length; z += 1) {
schema_arr.push(arr[i][z]);
}
}
return schema_arr;
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment