TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON "Parse JSON" palette throws an output validation error when parsing a Single element structure JSON.
book
Article ID: KB0089517
calendar_today
Updated On:
Products
Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON
-
Not Applicable
-
Description
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.
Issue/Introduction
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON "Parse JSON" palette throws an output validation error when parsing a Single element structure JSON.
Resolution
Add the required root manually for a Single element structure JSON. For example, add a father node for '{"Param1": "Value1"}', change it to '{"JSONSingle":{"Param1": "Value1"}}', and then parse the JSON with the father node.
Attachments
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON "Parse JSON" palette throws an output validation error when parsing a Single element structure JSON.
get_app