Links

Validator V2

Learn how to use the XML Schema Validator to validate XML files on the Digibee iPaaS. The Documentation Portal provides configuration parameters of this component below.
Validator V2 (JSON Schema) validates JSON content based on a JSON Schema.
JSON Schema is a market standard language for annotating and validating JSON documents that acts as a "contract" that must be followed by the component. For more information about it, refer to the official JSON documentation.
Take a look at the configuration parameters of the component:
  • Schema Draft version: Schema Draft version. Supported versions: v4, v6, v7, v2019-09 and v2020-12.
  • Detect Draft version: if this option is active, the Schema Draft version will be based on the version inserted in the JSON Schema parameter.
  • JSON Payload: the JSON content to be validated. This field supports Double Braces expressions.
  • JSON Schema: the JSON Schema to be used as the basis for validating the JSON content. This field supports Double Braces expressions.
  • Simplify validation results: if this option is active, validation errors will be shown in a simplified way; otherwise, they will be displayed in a detailed way.
  • Fail on Error: if the option is active, the execution of the pipeline with error will be interrupted. Otherwise, the pipeline execution proceeds, but the result will show a false value for the “success” property.

Messages flow

Output

If Validator V2 successfully validates the JSON content, it outputs the JSON configured in the JSON Payload parameter.
In case of error, the component outputs a JSON content with the following structure by default:
{
"success": false,
"validation": [
{
"type": "type",
"code": "1029",
"path": "$.code",
"schemaPath": "#/properties/code/type",
"arguments": [
"string",
"integer"
],
"details": null,
"message": "$.code: string found, integer expected"
},
{
"type": "required",
"code": "1028",
"path": "$",
"schemaPath": "#/required",
"arguments": [
"field"
],
"details": null,
"message": "$.field: is missing but it is required"
}
]
}
The "validation" array contains an JSON object for each validation performed. Each JSON object has the following properties:
  • type: the type of the applied validation.
  • code: internal validation code.
  • path: path where the validated property is configured on the JSON content.
  • schemaPath: path where the validated property is configured on the JSON Schema.
  • arguments: data of the analyzed property during validation.
  • details: additional validation details.
  • message: message of the validation error found.
If the Simplify validation results parameter is active, the “validation” array will contain only error messages, like this:
{
"success": false,
"validation": [
"$.code: string found, integer expected",
"$.field: is missing but it is required"
]
}