public final class Example10 extends ExampleBase
In this example, we register a custom schema with a given URI, and
initiate the JsonSchema
instance using that URI. This is done by
customizing a LoadingConfiguration
and registering schemas using
LoadingConfigurationBuilder.preloadSchema(String, JsonNode)
.
The only necessary condition for the URI is for it to be an absolute JSON
reference (see JsonRef.isAbsolute()
), and you can register as many
schemas as you want. Here, we register both schemas from Example5
.
You will notice that the scheme for these URIs is xxx
: it does not
matter in the slightest that it is not a supported scheme by default, the
schema is registered all the same.
This also shows that reference resolution still works in such a case,
since the mntent
schema is referred to via a relative URI from the
fstab
schema.
Constructor and Description |
---|
Example10() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String... args) |
loadResource, printReport
public static void main(String... args) throws IOException, com.github.fge.jsonschema.exceptions.ProcessingException
IOException
com.github.fge.jsonschema.exceptions.ProcessingException
Copyright © 2014. All Rights Reserved.