public final class SyntaxValidator extends Object
This is the syntax validator built, and returned, by JsonSchemaFactory.getSyntaxValidator()
. It can be used to validate schemas
independently of the validation chain. Among other features, it detects
$schema
and acts accordingly.
Note that the reports used are always ListProcessingReport
s.
Constructor and Description |
---|
SyntaxValidator(ValidationConfiguration cfg)
Constructor
|
Modifier and Type | Method and Description |
---|---|
com.github.fge.jsonschema.processing.Processor<com.github.fge.jsonschema.processors.data.SchemaHolder,com.github.fge.jsonschema.processors.data.SchemaHolder> |
getProcessor()
Return the underlying processor
|
boolean |
schemaIsValid(com.fasterxml.jackson.databind.JsonNode schema)
Tell whether a schema is valid
|
com.github.fge.jsonschema.report.ProcessingReport |
validateSchema(com.fasterxml.jackson.databind.JsonNode schema)
Validate a schema and return a report
|
public SyntaxValidator(ValidationConfiguration cfg)
cfg
- the validation configuration to usepublic boolean schemaIsValid(com.fasterxml.jackson.databind.JsonNode schema)
schema
- the schemapublic com.github.fge.jsonschema.report.ProcessingReport validateSchema(com.fasterxml.jackson.databind.JsonNode schema)
schema
- the schemapublic com.github.fge.jsonschema.processing.Processor<com.github.fge.jsonschema.processors.data.SchemaHolder,com.github.fge.jsonschema.processors.data.SchemaHolder> getProcessor()
You can use this processor to chain it with your own.
Copyright © 2014. All Rights Reserved.