ValidatorInput

Definition of the validation rules. Those are the input to the validator logic and they are used to validate a document. Next ID: 3

JSON representation
{
  "validationRules": [
    {
      object (ValidationRule)
    }
  ]
}
Fields
validationRules[]

object (ValidationRule)

ValidationRule

Next ID: 9

JSON representation
{
  "ruleId": string,
  "name": string,
  "description": string,

  // Union field validation_rule can be only one of the following:
  "fieldOccurrences": {
    object (FieldOccurrences)
  },
  "fieldRegex": {
    object (FieldRegex)
  },
  "formValidation": {
    object (FormValidation)
  },
  "childAlignmentRule": {
    object (ChildAlignmentRule)
  },
  "entityAlignmentRule": {
    object (EntityAlignmentRule)
  }
  // End of list of possible types for union field validation_rule.
}
Fields
ruleId

string

Unique identifier of the rule. Optional.

name

string

Name of the validation rule.

description

string

Description of the validation rule. This has no use but for documentation.

Union field validation_rule.

validation_rule can be only one of the following:

fieldOccurrences

object (FieldOccurrences)

fieldRegex

object (FieldRegex)

formValidation

object (FormValidation)

childAlignmentRule

object (ChildAlignmentRule)

entityAlignmentRule

object (EntityAlignmentRule)

FieldOccurrences

JSON representation
{
  "field": {
    object (Field)
  },
  "minOccurrences": integer,
  "maxOccurrences": integer
}
Fields
field

object (Field)

minOccurrences

integer (uint32 format)

Min and max occurrences of the field. If not set, there is limit set. The defined interval is a closed-closed interval, that is, [min, max].

maxOccurrences

integer (uint32 format)

Field

JSON representation
{
  "fieldName": string,
  "defaultValue": {
    object (Constant)
  }
}
Fields
fieldName

string

The field name to validate. This can be a simple field name or a nested field one using the ':' (meant as an aggregator) or '*' (meant as foreach) operators.

defaultValue

object (Constant)

Default value to use if the field is not present. If the field is missing and the default value is not set, the validation run as if the field is not present in the validation logic.

Constant

The constant value used in the validation rules.

JSON representation
{
  "floatValue": number
}
Fields
floatValue

number

FieldRegex

JSON representation
{
  "field": {
    object (Field)
  },
  "pattern": string
}
Fields
field

object (Field)

pattern

string

Python regex to validate the field values.

FormValidation

JSON representation
{
  "leftOperand": {
    object (Operation)
  },
  "rightOperand": {
    object (Operation)
  },
  "validationOperator": enum (RelationalOperator)
}
Fields
leftOperand

object (Operation)

rightOperand

object (Operation)

validationOperator

enum (RelationalOperator)

The relational operator to be applied to the operands.

Operation

JSON representation
{
  "fields": [
    {
      object (Field)
    }
  ],
  "constants": [
    {
      object (Constant)
    }
  ],
  "operations": [
    {
      object (Operation)
    }
  ],
  "operationType": enum (OperationType)
}
Fields
fields[]

object (Field)

A list of fields to be used as operands.

constants[]

object (Constant)

A list of constants to be used as operands.

operations[]

object (Operation)

A list of recursive operations to be used as operands.

operationType

enum (OperationType)

The operation type to be applied to all the operands.

ChildAlignmentRule

A rule that aligns specified child fields with a parent field.

JSON representation
{
  "parentField": {
    object (Field)
  },
  "childFields": [
    {
      object (Field)
    }
  ],
  "alignmentRule": {
    object (AlignmentRule)
  }
}
Fields
parentField

object (Field)

The full path of the parent field.

childFields[]

object (Field)

The child fields to be aligned within the parent field.

alignmentRule

object (AlignmentRule)

The alignment rule to apply to the child fields.

AlignmentRule

A rule for checking field alignment. Horizontal alignment checks if fields are on the same row by comparing y-coordinates of bounding box centers, while vertical alignment checks if fields are on the same column by comparing x-coordinates of bounding box centers.

JSON representation
{
  "alignmentType": enum (AlignmentType),
  "tolerance": number
}
Fields
alignmentType

enum (AlignmentType)

tolerance

number

The tolerance to use when comparing coordinates.

EntityAlignmentRule

A rule that aligns specified fields with each other.

JSON representation
{
  "fields": [
    {
      object (Field)
    }
  ],
  "alignmentRule": {
    object (AlignmentRule)
  }
}
Fields
fields[]

object (Field)

The fields to be aligned.

alignmentRule

object (AlignmentRule)

The alignment rule to apply to the fields.