All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openapi4j.schema.validator.JsonValidator Maven / Gradle / Ivy

The newest version!
package org.openapi4j.schema.validator;

import com.fasterxml.jackson.databind.JsonNode;
import org.openapi4j.core.validation.ValidationException;

/**
 * Representation of a validator.
 */
public interface JsonValidator {
  /**
   * Validate the given value from the validation setup.
   *
   * @param valueNode The given value to check.
   * @param validation   The result stack to append any additional info from the validation.
   * @return {@code true} if chain should continue for the current keyword, {@code false} otherwise.
   */
  boolean validate(final JsonNode valueNode, final ValidationData validation);

  /**
   * Validate the given value from the validation setup.
   *
   * @param valueNode The given value to check.
   * @throws ValidationException The result stack info from the validation in case of error.
   */
  void validate(final JsonNode valueNode) throws ValidationException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy