Products | Versions |
---|---|
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON | - |
Not Applicable | - |
Description:
Parse JSON palette throws, "An error occurred while validating output: validation error: unexpected content" output validation error when parsing a Single element structure JSON string. However, if parsing a Multiple elements structure JSON, no exception will be thrown.
Symptoms:
When parsing a Single element structure JSON string, for example {"Param1": "Value1"}, Parse JSON palette throws, "An error occurred while validating output: validation error: unexpected content..." output validation error. However if parsing a Multiple elements structure JSON, for example {"Param1": "Value1","Param2": "Value2"}, no error occurs.
Cause:
This is normal behavior. For a Multiple elements structure JSON, the Parse JSON activity will treat it as non root JSON. It will then add a root using the root of Output “JSONMultiple”, for example, so that the validation can pass through.
For a Single element structure JSON, the Parse JSON activity will consider that it has a root “Param1”, so it will not add additional root elements for JSON and the validation fails unless the required root is added manually.