Commit 75c1683c authored by Boris Kocherov's avatar Boris Kocherov

generate correct schema if discover return empty

parent 358c35c2
...@@ -138,13 +138,9 @@ ...@@ -138,13 +138,9 @@
console.log(error); console.log(error);
}) })
.push(function (response) { .push(function (response) {
if (response && response.numRows > 0) { var arr = [],
schema.properties.dimension = {
title: " ",
oneOf: []
};
var arr = schema.properties.dimension.oneOf,
row; row;
if (response && response.numRows > 0) {
while (response.hasMoreRows()) { while (response.hasMoreRows()) {
row = response.readAsObject(); row = response.readAsObject();
if (row["DIMENSION_TYPE"] !== 2) { if (row["DIMENSION_TYPE"] !== 2) {
...@@ -158,6 +154,12 @@ ...@@ -158,6 +154,12 @@
response.nextRow(); response.nextRow();
} }
} }
if (arr.length !== 0) {
schema.properties.dimension = {
title: " ",
oneOf: arr
};
}
}); });
} }
...@@ -167,13 +169,9 @@ ...@@ -167,13 +169,9 @@
console.log(error); console.log(error);
}) })
.push(function (response) { .push(function (response) {
if (response && response.numRows > 0) { var arr = [],
schema.properties.hierarchy = {
title: " ",
oneOf: []
};
var arr = schema.properties.hierarchy.oneOf,
row; row;
if (response && response.numRows > 0) {
while (response.hasMoreRows()) { while (response.hasMoreRows()) {
row = response.readAsObject(); row = response.readAsObject();
arr.push({ arr.push({
...@@ -183,6 +181,12 @@ ...@@ -183,6 +181,12 @@
response.nextRow(); response.nextRow();
} }
} }
if (arr.length !== 0) {
schema.properties.hierarchy = {
title: " ",
oneOf: arr
};
}
}); });
} }
...@@ -192,13 +196,9 @@ ...@@ -192,13 +196,9 @@
console.log(error); console.log(error);
}) })
.push(function (response) { .push(function (response) {
if (response && response.numRows > 0) { var arr = [],
schema.properties.level = {
title: " ",
oneOf: []
};
var arr = schema.properties.level.oneOf,
row; row;
if (response && response.numRows > 0) {
while (response.hasMoreRows()) { while (response.hasMoreRows()) {
row = response.readAsObject(); row = response.readAsObject();
arr.push({ arr.push({
...@@ -208,6 +208,12 @@ ...@@ -208,6 +208,12 @@
response.nextRow(); response.nextRow();
} }
} }
if (arr.length !== 0) {
schema.properties.level = {
title: " ",
oneOf: arr
};
}
}); });
} }
......
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