List<ValidationResults> allUnionResults = Lists.newArrayList();
// it's not an object, so just validate against all of them and see if there is a schema that's found without errors
int index = 1;
for (final JSONSchema unionSchema : getSchemas()) {
ValidationResults testResults = new ValidationResults();
unionSchema.validate(obj, buildPath(path, unionSchema, index++), testResults);
if (!testResults.hasWarningsOrErrors()) {
// found a good one, so short circuit
return;
}
allUnionResults.add(testResults);