Class BaseJsonValidator

    • Field Detail

      • suppressSubSchemaRetrieval

        protected final boolean suppressSubSchemaRetrieval
      • schemaNode

        protected 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,
                                    String at)
      • registerAndMergeDiscriminator

        protected static void registerAndMergeDiscriminator​(ValidationContext.DiscriminatorContext currentDiscriminatorContext,
                                                            com.fasterxml.jackson.databind.node.ObjectNode discriminator,
                                                            JsonSchema schema,
                                                            String at)
        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 ValidationContext.DiscriminatorContext
        discriminator - the discriminator to use for the check
        schema - the value of the discriminator/propertyName field
        at - the logging prefix
      • getSchemaPath

        public String getSchemaPath()
      • getSchemaNode

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

        public JsonSchema getParentSchema()
      • validate

        public Set<ValidationMessage> validate​(ExecutionContext executionContext,
                                               com.fasterxml.jackson.databind.JsonNode node)
        Description copied from interface: JsonValidator
        Validate the given root JsonNode, starting at the root of the data path.
        Specified by:
        validate in interface JsonValidator
        Parameters:
        executionContext - ExecutionContext
        node - JsonNode
        Returns:
        A list of ValidationMessage if there is any validation error, or an empty list if there is no error.
      • getNodeFieldType

        protected String getNodeFieldType()
      • getPathType

        protected PathType getPathType()
      • atRoot

        protected String atRoot()
        Get the root path.
        Returns:
        The path.
      • atPath

        protected String atPath​(String currentPath,
                                String token)
        Create the path for a given child token.
        Parameters:
        currentPath - The current path.
        token - The child token.
        Returns:
        The complete path.
      • atPath

        protected String atPath​(String currentPath,
                                int index)
        Create the path for a given child indexed item.
        Parameters:
        currentPath - The current path.
        index - The child index.
        Returns:
        The complete path.