Required, Validation, and Ordering options
Set the node to
if a node must display in the JSON message.Clear
on the JSON definition root node if you do not require Cloverleaf to validate the JSON message against the definition.Example definition:
{
"type": "object",
"properties": {
"name": { "type": "string" },
"id": { "type": "string" },
"address": { "type": "string }
}
}
Data:
{"name": "Mike", "address": "XXXX", "id":12345}
In this example, incorrect usage is when id
"
should be a string, not a number.
For example, each JSON node content must be validated by Cloverleaf and checked whether the nodes display in the same order as the defined definition. To do this, select
on the JSON definition root node.Example definition:
{
"type": "object",
"properties": {
"name": { "type": "string" },
"id": { "type": "string" },
"address": { "type": "string }
}
}
Data:
{"name": "Mike", "address": "XXXX", "id":"12345"}
In this example, incorrect usage is when
is selected ("id" should be between "name" and "address.")Undefined nodes in the JSON message causes the ordering check to fail even if
is enabled.If undefined nodes are used in a JSON message, then select
for object, or for array.in array does not effect ordering.
You can define the basic elements in a separate file, after which these elements can be referred to by other JSON definitions.
The element should be defined in the definitions section.
The referring node and referred node should have the same type.
The main JSON definition and reference files should be in the same package.
Ordering and Outbound Ordering
When the JSON Configurator is opened, the JSON Root node is displayed. When you select "JSON Root,"
is displayed as an option.orderEncoding
”.When
and are enabled, there is basic validation and advanced validation (order validation) for input messages.When
is enabled, the output message keeps the order as a schema definition.When
and are enabled, there is only basic validation for input messages.When
is enabled, the output message keeps the order as a schema definition.