Commit 363830cf authored by Boris Kocherov's avatar Boris Kocherov

remove callback trees

parent 5c7e7eaf
...@@ -111,14 +111,16 @@ ...@@ -111,14 +111,16 @@
full_schema, full_schema,
base_url base_url
); );
}).push(function (referencedx) { })
.push(function (referencedx) {
extend(expanded_json_schema, referencedx); extend(expanded_json_schema, referencedx);
delete expanded_json_schema.$ref; delete expanded_json_schema.$ref;
return true; return true;
}); });
} }
return true; return true;
}).push(function () { })
.push(function () {
var property, queue = RSVP.Queue(); var property, queue = RSVP.Queue();
...@@ -222,11 +224,11 @@ ...@@ -222,11 +224,11 @@
}) })
.declareMethod("validateJSONForSoftwareType", function (schema_url, software_type, generated_json) { .declareMethod("validateJSONForSoftwareType", function (schema_url, software_type, generated_json) {
var base_url = getBaseUrl(schema_url);
return getJSON(schema_url) return getJSON(schema_url)
.push(function (json_object) { .push(function (json_object) {
var parameter_schema_url, var parameter_schema_url,
st, st;
base_url = getBaseUrl(schema_url);
for (st in json_object["software-type"]) { for (st in json_object["software-type"]) {
if (json_object["software-type"].hasOwnProperty(st)) { if (json_object["software-type"].hasOwnProperty(st)) {
...@@ -236,13 +238,13 @@ ...@@ -236,13 +238,13 @@
} }
} }
return getJSON(parameter_schema_url, base_url) return getJSON(parameter_schema_url, base_url);
.push(function (schema) { })
return expandSchema(schema, schema, base_url) .push(function (schema) {
.push(function (loaded_json) { return expandSchema(schema, schema, base_url);
return tv4.validateMultiple(generated_json, loaded_json); })
}); .push(function (loaded_json) {
}); return tv4.validateMultiple(generated_json, loaded_json);
}); });
}) })
...@@ -251,9 +253,9 @@ ...@@ -251,9 +253,9 @@
.push(function (schema) { .push(function (schema) {
var base_url = getBaseUrl(schema_url); var base_url = getBaseUrl(schema_url);
return expandSchema(schema, schema, base_url) return expandSchema(schema, schema, base_url)
.push(function (loaded_schema) { })
return tv4.validateMultiple(generated_json, loaded_schema); .push(function (loaded_schema) {
}); return tv4.validateMultiple(generated_json, loaded_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