Skip to content

Commit

Permalink
Merge pull request #11 from foxxyz/improved_combination_schema_display
Browse files Browse the repository at this point in the history
Improved allOf/anyOf/oneOf display
  • Loading branch information
jlblcc committed Dec 18, 2015
2 parents c14b538 + 400e943 commit f47e991
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions json-schema-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,34 +768,35 @@ if (typeof JSV === 'undefined') {
}

for (key in props) {
if (owns.call(props, key)) {
JSV.compileData(props[key], node, key, true, depth + 1);
if (!owns.call(props, key)) {
continue;
}
JSV.compileData(props[key], node, key, true, depth + 1);
}

for (key in all) {
if (owns.call(all, key)) {
if(all[key]) {
var allNode = {
name: key,
children: [],
opacity: 0.5,
parentSchema: parent,
schema: schema.$ref || parentSchema(parent)
};

if (node.name === 'item') {
node.parent.children.push(allNode);
} else {
node.children.push(allNode);
}

for (var i = 0; i < all[key].length; i++) {
JSV.compileData(all[key][i], allNode, s.title || key, false, depth + 1);
}
if (!owns.call(all, key)) {
continue;
}
if (!all[key]) {
continue;
}
var allNode = {
name: key,
children: [],
opacity: 0.5,
parentSchema: parent,
schema: schema.$ref || parentSchema(parent)
};

if (node.name === 'item') {
node.parent.children.push(allNode);
} else {
node.children.push(allNode);
}

}
for (var i = 0; i < all[key].length; i++) {
JSV.compileData(all[key][i], allNode, s.title || all[key][i].type, false, depth + 1);
}
}

Expand Down

0 comments on commit f47e991

Please sign in to comment.