public class JsonSchema extends BaseJsonValidator
applyDefaultsStrategy, failFast, parentSchema, schemaNode, schemaPath, validationContextAT_ROOT| Constructor and Description |
|---|
JsonSchema(ValidationContext validationContext,
String schemaPath,
URI currentUri,
com.fasterxml.jackson.databind.JsonNode schemaNode,
JsonSchema parent) |
JsonSchema(ValidationContext validationContext,
URI baseUri,
com.fasterxml.jackson.databind.JsonNode schemaNode) |
JsonSchema(ValidationContext validationContext,
URI baseUri,
com.fasterxml.jackson.databind.JsonNode schemaNode,
boolean suppressSubSchemaRetrieval) |
| Modifier and Type | Method and Description |
|---|---|
JsonSchema |
findAncestor() |
CollectorContext |
getCollectorContext() |
URI |
getCurrentUri() |
com.fasterxml.jackson.databind.JsonNode |
getRefSchemaNode(String ref)
Find the schema node for $ref attribute.
|
JsonValidator |
getRequiredValidator() |
Map<String,JsonValidator> |
getValidators() |
boolean |
hasRequiredValidator() |
void |
initializeValidators()
Initializes the validators'
JsonSchema instances. |
String |
toString() |
Set<ValidationMessage> |
validate(com.fasterxml.jackson.databind.JsonNode node)
START OF VALIDATE METHODS
|
Set<ValidationMessage> |
validate(com.fasterxml.jackson.databind.JsonNode jsonNode,
com.fasterxml.jackson.databind.JsonNode rootNode,
String at)
Validate the given JsonNode, the given node is the child node of the root node at given
data path.
|
ValidationResult |
validateAndCollect(com.fasterxml.jackson.databind.JsonNode node) |
ValidationResult |
walk(com.fasterxml.jackson.databind.JsonNode node,
boolean shouldValidateSchema)
Walk the JSON node
|
Set<ValidationMessage> |
walk(com.fasterxml.jackson.databind.JsonNode node,
com.fasterxml.jackson.databind.JsonNode rootNode,
String at,
boolean shouldValidateSchema)
This is default implementation of walk method.
|
ValidationResult |
walkAtNode(com.fasterxml.jackson.databind.JsonNode node,
com.fasterxml.jackson.databind.JsonNode rootNode,
String at,
boolean shouldValidateSchema) |
buildValidationMessage, checkDiscriminatorMatch, debug, equals, fetchSubSchemaNode, getNodeFieldType, getParentSchema, getSchemaNode, getSchemaPath, getValidatorType, greaterThan, isPartOfOneOfMultipleType, lessThan, parseErrorCode, preloadJsonSchemas, registerAndMergeDiscriminatorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpreloadJsonSchemapublic JsonSchema(ValidationContext validationContext, URI baseUri, com.fasterxml.jackson.databind.JsonNode schemaNode)
public JsonSchema(ValidationContext validationContext, String schemaPath, URI currentUri, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parent)
public JsonSchema(ValidationContext validationContext, URI baseUri, com.fasterxml.jackson.databind.JsonNode schemaNode, boolean suppressSubSchemaRetrieval)
public URI getCurrentUri()
public com.fasterxml.jackson.databind.JsonNode getRefSchemaNode(String ref)
ref - Stringpublic JsonSchema findAncestor()
public Set<ValidationMessage> validate(com.fasterxml.jackson.databind.JsonNode node)
validate in interface JsonValidatorvalidate in class BaseJsonValidatornode - JsonNodepublic Set<ValidationMessage> validate(com.fasterxml.jackson.databind.JsonNode jsonNode, com.fasterxml.jackson.databind.JsonNode rootNode, String at)
JsonValidatorjsonNode - JsonNoderootNode - JsonNodeat - Stringpublic ValidationResult validateAndCollect(com.fasterxml.jackson.databind.JsonNode node)
public ValidationResult walk(com.fasterxml.jackson.databind.JsonNode node, boolean shouldValidateSchema)
node - JsonNodeshouldValidateSchema - indicator on validationpublic ValidationResult walkAtNode(com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode rootNode, String at, boolean shouldValidateSchema)
public Set<ValidationMessage> walk(com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode rootNode, String at, boolean shouldValidateSchema)
BaseJsonValidatorwalk in interface JsonSchemaWalkerwalk in class BaseJsonValidatornode - JsonNoderootNode - JsonNodeat - StringshouldValidateSchema - booleanpublic CollectorContext getCollectorContext()
public boolean hasRequiredValidator()
public JsonValidator getRequiredValidator()
public Map<String,JsonValidator> getValidators()
public void initializeValidators()
JsonSchema instances.
For avoiding issues with concurrency, in 1.0.49 the JsonSchema instances affiliated with
validators were modified to no more preload the schema and lazy loading is used instead.
This comes with the issue that this way you cannot rely on validating important schema features, in particular
$ref resolution at instantiation from JsonSchemaFactory.
By calling initializeValidators you can enforce preloading of the JsonSchema
instances of the validators.
Copyright © 2022. All rights reserved.