Required, Validation, and Ordering options

Set the node to Required if a node must display in the JSON message.

Clear Validation 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 Validation is selected. "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 Ordering 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 Ordering is selected ("id" should be between "name" and "address.")

Undefined nodes in the JSON message causes the ordering check to fail even if Additional Properties is enabled.

If undefined nodes are used in a JSON message, then select Additional Properties for object, or Additional Items for array.

Additional Items 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," Outbound Ordering is displayed as an option.

Note: Although the option name is "Outbound Ordering" on the user interface, in the schema file it is named “orderEncoding”.

When Ordering and Validation are enabled, there is basic validation and advanced validation (order validation) for input messages.

When Ordering is enabled, the output message keeps the order as a schema definition.

When Outbound Ordering and Validation are enabled, there is only basic validation for input messages.

When Outbound Ordering is enabled, the output message keeps the order as a schema definition.