When passing a bad $schema value, we now get an IllegalArgumentException, it should be a JsonSchemaException as it was before version 1.3.0.
Passing "$schema": "0" gives us
java.lang.IllegalArgumentException: URI is not absolute
at java.base/java.net.URL.fromURI(URL.java:721) ~[na:na]
at java.base/java.net.URI.toURL(URI.java:1139) ~[na:na]
at com.networknt.schema.resource.UriSchemaLoader.lambda$getSchema$0(UriSchemaLoader.java:35) ~[json-schema-validator.jar:na]
at com.networknt.schema.JsonSchemaFactory.getMappedSchema(JsonSchemaFactory.java:479) ~[json-schema-validator.jar:na]
at com.networknt.schema.JsonSchemaFactory.lambda$getSchema$3(JsonSchemaFactory.java:454) ~[json-schema-validator.jar:na]
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[na:na]
at com.networknt.schema.JsonSchemaFactory.getSchema(JsonSchemaFactory.java:453) ~[json-schema-validator.jar:na]
at com.networknt.schema.JsonSchemaFactory.loadMetaSchema(JsonSchemaFactory.java:359) ~[json-schema-validator.jar:na]
at com.networknt.schema.JsonSchemaFactory.lambda$getMetaSchema$2(JsonSchemaFactory.java:354) ~[json-schema-validator.jar:na]
at java.base/java.util.Optional.orElseGet(Optional.java:364) ~[na:na]
at com.networknt.schema.JsonSchemaFactory.getMetaSchema(JsonSchemaFactory.java:352) ~[json-schema-validator.jar:na]
at com.networknt.schema.JsonSchemaFactory.lambda$getMetaSchemaOrDefault$1(JsonSchemaFactory.java:344) ~[json-schema-validator.jar:na]
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[na:na]
at com.networknt.schema.JsonSchemaFactory.getMetaSchemaOrDefault(JsonSchemaFactory.java:344) ~[json-schema-validator.jar:na]
at com.networknt.schema.JsonSchemaFactory.createValidationContext(JsonSchemaFactory.java:326) ~[json-schema-validator.jar:na]
at com.networknt.schema.JsonSchemaFactory.newJsonSchema(JsonSchemaFactory.java:257) ~[json-schema-validator.jar:na]
at com.networknt.schema.JsonSchemaFactory.getSchema(JsonSchemaFactory.java:608) ~[json-schema-validator.jar:na]
When passing a bad $schema value, we now get an IllegalArgumentException, it should be a JsonSchemaException as it was before version 1.3.0.
Passing
"$schema": "0"
gives us