Commit 3ab82e9c authored by Boris Kocherov's avatar Boris Kocherov

fix recursive merging, if next recursion level contain schema with unresolved reference

parent 125d6972
......@@ -342,6 +342,22 @@
}
var key,
p;
if (x.hasOwnProperty("$ref") ||
y.hasOwnProperty("$ref")) {
if (doesntcopy) {
// we need reference resolve before merging
// so allOf schema returned and array item or object field
// run merging on next iteration.
return {
allOf: [
x,
y
]
};
} else {
throw new Error("all reference must be resolved before merge run on first recursion level");
}
}
if (x === true) {
x = {};
} else if (!doesntcopy) {
......
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