Class BaseJsonValidator

    • Field Detail

      • suppressSubSchemaRetrieval

        protected final boolean suppressSubSchemaRetrieval
      • schemaNode

        protected final com.fasterxml.jackson.databind.JsonNode schemaNode
    • Method Detail

      • equals

        protected static boolean equals​(double n1,
                                        double n2)
      • debug

        protected static void debug​(org.slf4j.Logger logger,
                                    com.fasterxml.jackson.databind.JsonNode node,
                                    com.fasterxml.jackson.databind.JsonNode rootNode,
                                    JsonNodePath instanceLocation)
      • checkDiscriminatorMatch

        protected static void checkDiscriminatorMatch​(DiscriminatorContext currentDiscriminatorContext,
                                                      com.fasterxml.jackson.databind.node.ObjectNode discriminator,
                                                      String discriminatorPropertyValue,
                                                      JsonSchema jsonSchema)
        Checks based on the current DiscriminatorContext whether the provided JsonSchema a match against against the current discriminator.
        Parameters:
        currentDiscriminatorContext - the currently active DiscriminatorContext
        discriminator - the discriminator to use for the check
        discriminatorPropertyValue - the value of the discriminator/propertyName field
        jsonSchema - the JsonSchema to check
      • registerAndMergeDiscriminator

        protected static void registerAndMergeDiscriminator​(DiscriminatorContext currentDiscriminatorContext,
                                                            com.fasterxml.jackson.databind.node.ObjectNode discriminator,
                                                            JsonSchema schema,
                                                            JsonNodePath instanceLocation)
        Rolls up all nested and compatible discriminators to the root discriminator of the type. Detects attempts to redefine the propertyName or mappings.
        Parameters:
        currentDiscriminatorContext - the currently active DiscriminatorContext
        discriminator - the discriminator to use for the check
        schema - the value of the discriminator/propertyName field
        instanceLocation - the logging prefix
      • getSchemaLocation

        public SchemaLocation getSchemaLocation()
        Description copied from interface: JsonValidator
        The schema location is the canonical URI of the schema object plus a JSON Pointer fragment indicating the subschema that produced a result. In contrast with the evaluation path, the schema location MUST NOT include by-reference applicators such as $ref or $dynamicRef.
        Specified by:
        getSchemaLocation in interface JsonValidator
        Returns:
        the schema location
      • getEvaluationPath

        public JsonNodePath getEvaluationPath()
        Description copied from interface: JsonValidator
        The evaluation path is the set of keys, starting from the schema root, through which evaluation passes to reach the schema object that produced a specific result.
        Specified by:
        getEvaluationPath in interface JsonValidator
        Returns:
        the evaluation path
      • getSchemaNode

        public com.fasterxml.jackson.databind.JsonNode getSchemaNode()
      • getParentSchema

        public JsonSchema getParentSchema()
        Gets the parent schema.

        This is the lexical parent schema.

        Returns:
        the parent schema
      • validate

        public <T> T validate​(ExecutionContext executionContext,
                              com.fasterxml.jackson.databind.JsonNode node,
                              OutputFormat<T> format)
        Validates to a format.
        Type Parameters:
        T - the result type
        Parameters:
        executionContext - the execution context
        node - the node
        format - the format
        Returns:
        the result
      • validate

        public <T> T validate​(ExecutionContext executionContext,
                              com.fasterxml.jackson.databind.JsonNode node,
                              OutputFormat<T> format,
                              ExecutionContextCustomizer executionCustomizer)
        Validates to a format.
        Type Parameters:
        T - the result type
        Parameters:
        executionContext - the execution context
        node - the node
        format - the format
        executionCustomizer - the customizer
        Returns:
        the result
      • getNodeFieldType

        protected String getNodeFieldType()
      • atRoot

        protected JsonNodePath atRoot()
        Get the root path.
        Returns:
        The path.