public final class Example4 extends Object
This demonstrates two capabilities of JsonSchemaFactory
:
The implementation provides a resource
scheme which allows to Utils.load
JSON from files in the classpath. It is strictly equivalent to calling Class.getResourceAsStream(String)
.
The URI used is resource:/org/eel/kitchen/jsonschema/examples/fstab-sub.json
. Because we
want to validate against the fstab
subschema, we use JsonSchemaFactory.getJsonSchema(String)
to Utils.load the actual schema; the URI
used as an argument also has a JSON Pointer as a fragment.
Files validated, and the validation outputs, are the same as for Example2
.
Constructor and Description |
---|
Example4() |
public static void main(String... args) throws IOException, ProcessingException
IOException
ProcessingException