Commit 200b786a authored by Boris Kocherov's avatar Boris Kocherov

base schema used in anyOf schema compilation

parent 47648601
...@@ -489,13 +489,14 @@ ...@@ -489,13 +489,14 @@
}); });
} }
function anyOf(g, schema_array, schema_path) { function anyOf(g, schema, schema_path) {
var schema_array = schema.anyOf;
return RSVP.Queue() return RSVP.Queue()
.push(function () { .push(function () {
var i, var i,
arr = []; arr = [];
for (i = 0; i < schema_array.length; i += 1) { for (i = 0; i < schema_array.length; i += 1) {
arr.push(expandSchema(g, schema_array[i], schema_path + '/anyOf/' + i.toString())); arr.push(expandSchema(g, mergeSchemas(schema_array[i], schema), schema_path + '/anyOf/' + i.toString()));
} }
return RSVP.all(arr); return RSVP.all(arr);
}) })
...@@ -525,7 +526,7 @@ ...@@ -525,7 +526,7 @@
schema = true; schema = true;
} }
if (schema.anyOf !== undefined) { if (schema.anyOf !== undefined) {
return anyOf(g, schema.anyOf, schema_path); return anyOf(g, schema, schema_path);
} }
if (schema.allOf !== undefined) { if (schema.allOf !== undefined) {
return allOf(g, schema.allOf, schema_path, schema); return allOf(g, schema.allOf, schema_path, schema);
......
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