Example 6 – Fail Fast Option
Setup
There are validation errors on lines 3, 6 and 9.
The schema sets the failFast option to true.
Due to the previous point, the result will contain only one validation error – on line 3.
The row count will not be correct – it will stop counting after an error occurs (for faster result).
Dataset
sku,label,price
1,BMW,10.35
2,AUDI,20
3,Skoda,1000000
4,Opel,99421
5,Opel,15
6,Seat,125000
7,Seat,10
8,Peugeot,20
9,Peugeot,150000
10,Peugeot,20
Schema
{
"title": "Pricefx data schema for set 1 - cars",
"name": "My Pricefx Schema 1",
"description": "Lorem ipsum",
"options": {
"failFast": true
},
"fields": [
{
"name": "sku",
"title": "Stock-keeping unit",
"description": "A stock-keeping unit (SKU) is a scannable bar code, most often seen printed on product labels in a retail store. The label allows vendors to automatically track the movement of inventory. The SKU is composed of an alphanumeric combination of eight-or-so characters.",
"constraints": {
"required": true,
"type": "POSITIVE_INTEGER",
"minLength": 1,
"minimum": 1,
"maximum": 100
}
},
{
"name": "label",
"title": "Car label",
"description": "Label of the car. Could be anything.",
"constraints": {
"required": false,
"type": "STRING",
"maxLength": 255
}
},
{
"name": "price",
"title": "Price of the car",
"description": "The price is important.",
"constraints": {
"required": true,
"type": "DOUBLE",
"maximum": 100000
}
}
]
}
Result
result.rows == 3
!result.valid
result.errors.size() == 1
result.errors[0].row == 3
IntegrationManager version 5.8.0