Package com.bazaarvoice.commons.data.model.json.schema

Examples of com.bazaarvoice.commons.data.model.json.schema.JSONSchema.validate()


            if (matchingSchema == null) {
                results.addResult(new ValidationResult().type(ResultType.CONSTRAINT_VIOLATION).path(path).message("Union schema not found: " + schemaID));
                return;
            }

            matchingSchema.validate(obj, buildPath(path, matchingSchema, 0), results);
            return;
        }

        List<ValidationResults> allUnionResults = Lists.newArrayList();
View Full Code Here


            Iterator collIter = coll.iterator();
            int index = 0;
            while (tupleIter.hasNext() && collIter.hasNext()) {
                JSONSchema tupleSchema = tupleIter.next();
                Object tupleObj = collIter.next();
                tupleSchema.validate(tupleObj, path + "[" + index + "]", results);

                index++;
            }

            if (_additionalItemsSchema != null) {
View Full Code Here

            }
        } else {
            int index = 0;
            JSONSchema itemSchema = getItem();
            for (final Object collObj : coll) {
                itemSchema.validate(collObj, path + "[" + index + "]", results);

                index++;
            }
        }
    }
View Full Code Here

            } else {
                valueSchema = _additionalPropertiesSchema;
            }

            if (valueSchema != null) {
                valueSchema.validate(value, path + "." + key, results);
            } else {
                results.addResult(new ValidationResult().type(ResultType.CONSTRAINT_VIOLATION).path(path + "." + key).message("Additional properties not supported: " + entry));
            }
        }
View Full Code Here

            int index = 0;
            while (tupleIter.hasNext() && collIter.hasNext()) {
                JSONSchema tupleSchema = tupleIter.next();
                Object tupleObj = collIter.next();
                hasDuplicates = hasDuplicates || !set.add(tupleObj);
                tupleSchema.validate(tupleObj, path + "[" + index + "]", results);

                index++;
            }

            if (_additionalItemsSchema != null) {
View Full Code Here

        } else {
            int index = 0;
            JSONSchema itemSchema = getItem();
            for (final Object collObj : coll) {
                hasDuplicates = hasDuplicates || !set.add(collObj);
                itemSchema.validate(collObj, path + "[" + index + "]", results);

                index++;
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.