Package com.github.fge.jsonschema.main

Examples of com.github.fge.jsonschema.main.JsonValidator


      throw new ServiceException("Schema valid? " + invalidSchema
          + " Data valid?" + invalidData);
    }
    final JsonNode schemaNode = ret.remove(ValidateResponse.SCHEMA);
    final JsonNode data = ret.remove(ValidateResponse.DATA);
    final JsonValidator validator = JsonValidators.withOptions(useV3, useId);
    final ProcessingReport report = validator.validateUnchecked(schemaNode,
        data);

    return report;
  }
View Full Code Here


        throws IOException, ProcessingException, JsonPointerException
    {
        final JsonNode schemaNode
            = JsonLoader.fromResource("/other/issue102.json");
        final JsonSchemaFactory factory = JsonSchemaFactory.byDefault();
        final JsonValidator validator = factory.getValidator();
        final MessageBundle bundle
            = MessageBundles.getBundle(JsonSchemaValidationBundle.class);

        try {
            validator.validate(schemaNode,
                JacksonUtils.nodeFactory().nullNode());
            fail("No exception thrown!");
        } catch (ProcessingException e) {
            final URI uri = URI.create("#/oneOf/1");
            final ProcessingMessage message = e.getProcessingMessage();
View Full Code Here

        throws IOException, ProcessingException
    {
        final JsonNode node = JsonLoader.fromResource("/other/issue112.json");
        final JsonNode schemaNode = node.get("schema");
        final JsonSchemaFactory factory = JsonSchemaFactory.byDefault();
        final JsonValidator validator = factory.getValidator();

        final JsonNode instance = node.get("instance");

        assertTrue(validator.validate(schemaNode, instance).isSuccess());
        assertTrue(true);
    }
View Full Code Here

TOP

Related Classes of com.github.fge.jsonschema.main.JsonValidator

Copyright © 2018 www.massapicom. 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.