if (concreteSchema == null) {
return JsonSchemaResults.create("", "No schema found for "
+ obj.toString());
}
JsonSchemaResults results = JsonSchemaValidator.validate(obj, concreteSchema);
if (!results.isValid()) {
return results;
}
if (DataBag.hasOwnProperty(obj, "children")) {
JsArray<JavaScriptObject> children = DataBag.getJSObjectProperty(obj,
"children");
for (int i = 0; i < children.length() && results.isValid(); i++) {
// TODO(conroy): make child validation incremental?
results = this.validate(children.get(i));
}
}
return results;