Commit 534133b9 authored by Boris Kocherov's avatar Boris Kocherov

use external_reference marker for force create subgadget

parent 4bd32c11
......@@ -251,6 +251,7 @@
url,
download_url,
hash,
external_reference = false,
queue;
// XXX need use `id` property
if (!schema_path) {
......@@ -271,6 +272,7 @@
hash = url.hash;
url = url.href;
if (download_url.startsWith("urn:jio:")) {
external_reference = true;
queue = RSVP.Queue()
.push(function () {
return g.resolveExternalReference(download_url, schema_path, path);
......@@ -329,6 +331,7 @@
})
.push(function (schema_arr) {
checkAndMarkSoftCircular(g, schema_arr, schema_path, url);
schema_arr.external_reference = external_reference;
return schema_arr;
});
}
......
......@@ -1370,7 +1370,7 @@
schema_arr = properties[key];
filtered_schema_arr = schemaArrFilteredByDocument(schema_arr, json_document[key]);
// XXX need schema merge with patternProperties passed key
if (checkSchemaArrOneChoise(schema_arr)) {
if (checkSchemaArrOneChoise(schema_arr) && !schema_arr.external_reference) {
if (required.indexOf(key) >= 0) {
used_properties[key] = false;
q.push(render_field.bind(g, g, key, path,
......@@ -1390,13 +1390,15 @@
}
}
if (!used_properties.hasOwnProperty(key) &&
json_document.hasOwnProperty(key)) {
(json_document.hasOwnProperty(key) ||
schema_arr.external_reference)) {
used_properties[key] = "";
q.push(
addSubForm.bind(g, {
gadget: g,
property_name: key,
parent_path: path,
delete_button: !schema_arr.external_reference,
schema_arr: filtered_schema_arr,
json_document: json_document[key]
})
......
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