Package com.github.fge.jsonschema.report

Examples of com.github.fge.jsonschema.report.ProcessingReport


public class JsonSchemaUtil {

  public static boolean validData(final String rawSchema, final String rawData) {
    boolean valid = false;
    try {
      final ProcessingReport report = buildReport(rawSchema, rawData, true, false);
      valid = report.isSuccess();
    } catch (ServiceException e) {
      return valid;
    } catch (IOException e) {
      return valid;
    }
View Full Code Here


  public static JsonNode buildResult(final String rawSchema,
      final String rawData, final boolean useV3, final boolean useId)
      throws IOException {
    final ObjectNode ret = JsonNodeFactory.instance.objectNode();
    try {
      final ProcessingReport report = buildReport(rawSchema, rawData,
          useV3, useId);
      final boolean success = report.isSuccess();
      ret.put(ValidateResponse.VALID, success);
      ret.put(ValidateResponse.RESULTS, ((AsJson) report).asJson());
      return ret;

    } catch (ServiceException e) {
View Full Code Here

          + " 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

TOP

Related Classes of com.github.fge.jsonschema.report.ProcessingReport

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.