Validate JSON activity
During run time, the Validate JSON activity determines if the input JSON or XML data is valid to the specified XML schema.
The Validate JSON activity has the following limitations:
- The Validate JSON activity only supports the validation of the selected root element of an XML schema. The validation of XML schema fragments is not supported. If the XML schema contains more than one root (or global element), you must select one of the root elements.
- The Validate JSON activity does not support the validation of JSON or XML data against a DTD.
Note: You must upload an XSD file (ends in the .xsd extension) that
contains the XML schema into the project before configuring the Validate
JSON activity. Upload the XML schema into the project that is
used to validate the JSON data during run time.
The following table describes the result when an error or warning
occurs when the Validate JSON activity is parsing JSON or XML
data against an XML schema.
Error/Warning Type | Description | Example | Result |
---|---|---|---|
Fatal Error | Parsing of the JSON data fails because of a severe problem and the parsing cannot continue. For example, the JSON or XML data is not valid to the XML schema. | The JSON or XML data is not valid to the XML schema. For example, the XML schema defines that there should be a root element called <d> but the JSON or XML data contains the root element called <a>. | When a fatal error occurs, the current orchestration job stops processing— even the processing of the Validate JSON activity does not complete. In addition, the activities in the orchestration after the Validate JSON activity are not processed. The value returned from the Validate JSON activity for the success output parameter is false but since the activity never completes, nothing is returned. |
Error (recoverable) | An error occurs during the parsing of JSON data but does not prevent parsing of the remaining data. | A JSON element in an integer but a string is provided as a value: <a><count>two</count></a> | If only recoverable errors or warnings occur during parsing, the processing of the Validate JSON activity completes and the activities in the orchestration after the Validate JSON activity are processed. The value of false is returned from the success output parameter. |
Warning | A warning occurs during the parsing of JSON data but does not prevent parsing of the remaining data | If only warnings occur during parsing, the processing of the Validate JSON activity completes and the activities in the orchestration after the Validate JSON activity are processed. The value of true is returned from the success output parameter. |