Commit 9bb9c69c authored by Boris Kocherov's avatar Boris Kocherov

fix pattern properties schema_path

parent 65280151
...@@ -798,7 +798,7 @@ ...@@ -798,7 +798,7 @@
root.appendChild(child); root.appendChild(child);
} }
function addAdditional(schema) { function addAdditional(title, schema, s_path) {
var div, var div,
div_input, div_input,
input, input,
...@@ -824,10 +824,10 @@ ...@@ -824,10 +824,10 @@
queue queue
.push(function () { .push(function () {
return expandSchema(g, schema, schema_path + '/additionalProperties'); return expandSchema(g, schema, s_path);
}) })
.push(function (schema_arr) { .push(function (schema_arr) {
return render_schema_selector(g, "add custom property", schema_arr, function (value) { return render_schema_selector(g, "add " + title, schema_arr, function (value) {
return addSubForm({ return addSubForm({
gadget: g, gadget: g,
element: input, element: input,
...@@ -853,7 +853,7 @@ ...@@ -853,7 +853,7 @@
gadget: g, gadget: g,
property_name: property_name, property_name: property_name,
path: path, path: path,
schema_path: schema_path + '/additionalProperties', schema_path: s_path,
schema_part: schema, schema_part: schema,
default_dict: default_dict[property_name] default_dict: default_dict[property_name]
}) })
...@@ -948,8 +948,11 @@ ...@@ -948,8 +948,11 @@
}); });
if (json_field.patternProperties !== undefined) { if (json_field.patternProperties !== undefined) {
// XXX need loop on any pattern properties
if (json_field.patternProperties['.*'] !== undefined) { if (json_field.patternProperties['.*'] !== undefined) {
addAdditional(json_field.patternProperties['.*']); addAdditional(".* property",
json_field.patternProperties['.*'],
schema_path + '/patternProperties/.*');
} }
} }
...@@ -959,7 +962,7 @@ ...@@ -959,7 +962,7 @@
additionalProperties = json_field.additionalProperties; additionalProperties = json_field.additionalProperties;
} }
if (additionalProperties !== false) { if (additionalProperties !== false) {
addAdditional(additionalProperties); addAdditional("additional property", additionalProperties, schema_path + '/additionalProperties');
} }
for (key in default_dict) { for (key in default_dict) {
......
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