Commit 165e5f7a authored by Boris Kocherov's avatar Boris Kocherov

render patternProperties selector for every pattern and disable rendering

additionalProperty selector if exist ".*" "^.*$" ".*$" "^.* patterns
parent 200b786a
......@@ -1225,6 +1225,7 @@
if (properties.hasOwnProperty(key)) {
schema_arr = properties[key];
s_o = schemaArrFilteredByDocument(schema_arr, default_dict[key]);
// XXX need schema merge with patternProperties passed key
if (checkSchemaArrOneChoise(schema_arr)) {
if (required.indexOf(key) >= 0) {
used_properties[key] = false;
......@@ -1315,30 +1316,44 @@
})
.push(function () {
var queue = RSVP.Queue(),
key,
additionalProperties;
// XXX for pattern properties needs schemas merge for
// all passed patterns
if (json_field.patternProperties !== undefined) {
// XXX need loop on any pattern properties
if (json_field.patternProperties['.*'] !== undefined) {
queue
.push(render_object_additionalProperty.bind(g,
for (key in json_field.patternProperties) {
if (json_field.patternProperties.hasOwnProperty(key)) {
if (key === ".*" ||
key === "^.*$" ||
key === ".*$" ||
key === "^.*"
) {
// additionalProperties nether used in this case
additionalProperties = false;
}
queue
.push(render_object_additionalProperty.bind(g,
g,
".* property",
key + " property",
default_dict,
path,
json_field.patternProperties['.*'],
schema_path + '/patternProperties/.*',
json_field.patternProperties[key],
schema_path + '/patternProperties/' + key,
used_properties,
element_append
))
.push(root_append);
.push(root_append);
}
}
}
if (json_field.additionalProperties === undefined) {
additionalProperties = true;
} else {
additionalProperties = json_field.additionalProperties;
if (additionalProperties === undefined) {
if (json_field.additionalProperties === undefined) {
additionalProperties = true;
} else {
additionalProperties = json_field.additionalProperties;
}
}
if (additionalProperties !== false) {
queue
......
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