Skip to content
Snippets Groups Projects
Commit dab709a8 authored by Lars Trieloff's avatar Lars Trieloff
Browse files

[trivial] don't break when references cannot be resolved

parent 3d07a4bd
Branches
Tags
No related merge requests found
...@@ -83,7 +83,12 @@ function stringifyExamples(examples) { ...@@ -83,7 +83,12 @@ function stringifyExamples(examples) {
function simpletype(prop) { function simpletype(prop) {
const type = prop.type; const type = prop.type;
if (prop.$ref!==undefined) { if (prop.$ref!==undefined) {
prop.simpletype = prop.$linkVal; if (prop.$linkVal!==undefined) {
prop.simpletype = prop.$linkVal;
} else {
console.log('unresolved reference: ' + prop.$ref);
prop.simpletype = 'reference';
}
} else if (prop.enum!==undefined) { } else if (prop.enum!==undefined) {
prop.simpletype = '`enum`'; prop.simpletype = '`enum`';
if (prop['meta:enum']===undefined) { if (prop['meta:enum']===undefined) {
...@@ -113,9 +118,9 @@ function simpletype(prop) { ...@@ -113,9 +118,9 @@ function simpletype(prop) {
if (innertype.simpletype==='complex') { if (innertype.simpletype==='complex') {
prop.simpletype = '`array`'; prop.simpletype = '`array`';
} else { } else {
//console.log(prop.title);
prop.simpletype = innertype.simpletype.replace(/(`)$/, '[]$1'); prop.simpletype = innertype.simpletype.replace(/(`)$/, '[]$1');
} }
console.log();
} else { } else {
prop.simpletype = '`array`'; prop.simpletype = '`array`';
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment