diff --git a/src/main/java/es/elixir/bsc/json/schema/model/JsonSchema.java b/src/main/java/es/elixir/bsc/json/schema/model/JsonSchema.java index 4c7bb59..eea7edf 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/JsonSchema.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/JsonSchema.java @@ -45,9 +45,9 @@ public interface JsonSchema extends JsonSchemaElement { public final static String RECURSIVE_ANCHOR = "$recursiveAnchor"; public final static String VOCABULARY = "$vocabulary"; - void validate(JsonValue value, List errors, JsonSchemaValidationCallback callback) throws ValidationException; + boolean validate(JsonValue value, List errors, JsonSchemaValidationCallback callback) throws ValidationException; - default void validate(JsonValue value, List errors) { - validate(value, errors, null); + default boolean validate(JsonValue value, List errors) { + return validate(value, errors, null); } } diff --git a/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonSchema.java b/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonSchema.java index c03c3d7..e1d6b52 100644 --- a/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonSchema.java +++ b/src/main/java/es/elixir/bsc/json/schema/model/impl/AbstractJsonSchema.java @@ -65,9 +65,9 @@ public abstract boolean validate(String jsonPointer, JsonValue value, JsonValue throws ValidationException; @Override - public void validate(JsonValue value, List errors, + public boolean validate(JsonValue value, List errors, JsonSchemaValidationCallback callback) throws ValidationException { - validate("", value, null, new ArrayList(), errors, callback); + return validate("", value, null, new ArrayList(), errors, callback); } }