Class DiscriminatorValidator

All Implemented Interfaces:
KeywordValidator, Validator, Walker

public class DiscriminatorValidator extends BaseKeywordValidator
KeywordValidator for discriminator.

Note that discriminator MUST NOT change the validation outcome of the schema.

Discriminator Object

  • Constructor Details

    • DiscriminatorValidator

      public DiscriminatorValidator(SchemaLocation schemaLocation, com.fasterxml.jackson.databind.JsonNode schemaNode, Schema parentSchema, SchemaContext schemaContext)
  • Method Details

    • validate

      public void validate(ExecutionContext executionContext, com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode rootNode, NodePath instanceLocation)
      Description copied from interface: Validator
      Validate the instance node which belongs to the instance document at the instance location.
      Parameters:
      executionContext - the execution context
      node - the instance node being processed
      rootNode - the instance document that the instance node belongs to
      instanceLocation - the location of the instance node being processed
    • getPropertyName

      public String getPropertyName()
      Gets the property name of the discriminator.
      Returns:
      the property name
    • getMapping

      public Map<String,String> getMapping()
      Gets the mapping to map the property name value to the schema name.
      Returns:
      the discriminator mappings