Class ValidationMessage

java.lang.Object
com.networknt.schema.ValidationMessage

public class ValidationMessage extends Object
The output format.
See Also:
  • Field Details

    • type

      private final String type
    • code

      private final String code
    • evaluationPath

      private final JsonNodePath evaluationPath
    • schemaLocation

      private final SchemaLocation schemaLocation
    • instanceLocation

      private final JsonNodePath instanceLocation
    • property

      private final String property
    • arguments

      private final Object[] arguments
    • messageKey

      private final String messageKey
    • messageSupplier

      private final Supplier<String> messageSupplier
    • details

      private final Map<String,Object> details
    • instanceNode

      private final com.fasterxml.jackson.databind.JsonNode instanceNode
    • schemaNode

      private final com.fasterxml.jackson.databind.JsonNode schemaNode
  • Constructor Details

  • Method Details

    • getCode

      public String getCode()
    • getInstanceLocation

      public JsonNodePath getInstanceLocation()
      The instance location is the location of the JSON value within the root instance being validated.
      Returns:
      The path to the input json
    • getEvaluationPath

      public JsonNodePath getEvaluationPath()
      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.
      Returns:
      the evaluation path
    • getSchemaLocation

      public SchemaLocation getSchemaLocation()
      The schema location is the canonical IRI 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.
      Returns:
      the schema location
    • getInstanceNode

      public com.fasterxml.jackson.databind.JsonNode getInstanceNode()
      Returns the instance node which was evaluated.

      This corresponds with the instance location.

      Returns:
      the instance node
    • getSchemaNode

      public com.fasterxml.jackson.databind.JsonNode getSchemaNode()
      Returns the schema node which was evaluated.

      This corresponds with the schema location.

      Returns:
      the schema node
    • getProperty

      public String getProperty()
      Returns the property with the error.

      For instance, for the required validator the instance location does not contain the missing property name as the instance must refer to the input data.

      Returns:
      the property name
    • getArguments

      public Object[] getArguments()
    • getDetails

      public Map<String,Object> getDetails()
    • getMessage

      public String getMessage()
      Gets the formatted error message.
      Returns:
      the error message
    • getMessageKey

      public String getMessageKey()
    • isValid

      public boolean isValid()
    • getError

      public String getError()
      Gets the error.
      Returns:
      the error
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getType

      public String getType()
    • builder

      public static ValidationMessage.Builder builder()