JsonInput FormatΒΆ
The provided input must be structured as follow:
- Each entry must contain an object with either
fieldsand/orgroups. - Optionally the object can contain
'logical-case' => 'AND'to make it AND-cased.
The groups must have array one or more arrays with the structure as
described above (fields and/or groups).
The fields array is an associative array where each key is the field-name and the values as follow (all the keys are optional, but at least one must exists):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | {
"simple-values": [
"value1",
"value2"
],
"excluded-values": [
"my value1",
"my value2"
],
"ranges": [
{
"lower": 10,
"upper": 20
}
],
"excluded-ranges": [
{
"lower": 25,
"upper": 30
}
],
"comparisons": [
{
"value": 50,
"operator": ">"
}
],
"pattern-matchers": [
{
"value": "foo",
"type": "STARTS_WITH"
}
]
}
|
The type of pattern-matchers must either one of the following:
CONTAINS`STARTS_WITHENDS_WITHNOT_CONTAINSNOT_STARTS_WITHNOT_ENDS_WITH
Full example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | {
"logical-case": "AND",
"fields": {
"field1": {
"ranges": [
{
"lower": 10,
"upper": 20
},
{
"lower": 30,
"upper": 40
},
{
"lower": 50,
"upper": 60,
"inclusive-lower": false
},
{
"lower": 70,
"upper": 80,
"inclusive-upper": false
}
]
}
},
"groups": [
{
"logical-case": "AND",
"fields": {
"field1": {
"simple-values": [
"value",
"value2",
"value3",
"value4",
"value5"
]
}
},
"groups": [...]
}
]
}
|
Note
Internally the JsonInput processor uses the same input structure as array.
The advantage of using the JsonInput processor instead decoding the JSON object yourself is that the JsonInput processor does a linting on the provided input, ensuring the JSON input is valid and will give a more detail message on whats wrong.