Skip to content

Commit

Permalink
fixes #28 upgrade json-schema-validator to 0.1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehu committed Feb 19, 2018
1 parent ebe5400 commit 95afd93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private Status doValidate(final Object value, final JsonNode schema) {
Status status = null;
Set<ValidationMessage> processingReport = null;
try {
JsonSchema jsonSchema = new JsonSchemaFactory(Config.getInstance().getMapper()).getSchema(schema);
JsonSchema jsonSchema = JsonSchemaFactory.getInstance().getSchema(schema);
final JsonNode content = Config.getInstance().getMapper().valueToTree(value);
processingReport = jsonSchema.validate(content);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private Status doValidate(final Object value, final Object schema) {
((ObjectNode)schemaObject).set(DEFINITIONS_FIELD, this.definitions);
}

JsonSchema jsonSchema = new JsonSchemaFactory(Config.getInstance().getMapper()).getSchema(schemaObject);
JsonSchema jsonSchema = JsonSchemaFactory.getInstance().getSchema(schemaObject);

final JsonNode content = Json.mapper().valueToTree(value);
processingReport = jsonSchema.validate(content);
Expand Down Expand Up @@ -168,7 +168,7 @@ private Status doValidate(final String value, final Object schema) {
((ObjectNode)schemaObject).set(DEFINITIONS_FIELD, this.definitions);
}

JsonSchema jsonSchema = new JsonSchemaFactory(Config.getInstance().getMapper()).getSchema(schemaObject);
JsonSchema jsonSchema = JsonSchemaFactory.getInstance().getSchema(schemaObject);

String normalisedValue = value;
if (schema instanceof StringProperty) {
Expand Down

0 comments on commit 95afd93

Please sign in to comment.