The JSON specification,
JSON.org states that forward slash, "solidus" can be escaped.
By default the IIB/ACE JSON serializer does escape forward slash, hence it is expected that your '/' become '\/' in the JSON output.
However IIB/ACE does provide a JSON configuration parameter "escapeMode" which can be set to change this behavior. Please see
Parameter values for the JSON parser------------------------------
Martin Boag
Software Developer
IBM
------------------------------
Original Message:
Sent: Tue June 02, 2020 09:42 PM
From: Partha Baidya
Subject: IIB JSON parser adding special character while writing to MQ
I have a flow where I get JOSN data from a HTTP Input node. I store the JSON data in Environment variable.
| Code: |
| CREATE LASTCHILD OF Environment DOMAIN ('JSON') FROM InputRoot.JSON; |
Later in the code I create a output from the environment variable and put to a file as well to a MQ Queue.
| Code: |
| SET OutputRoot.JSON = Environment.JSON; |
The JSON data has a date field as String.
| Code: |
| "startDate": "06/01/2020" |
The file gets created with proper JSON data but the MQ message has extra special character for the date field.
| Code: |
| startDate="06\/01\/2020" |
I am not getting the reason why the MQ message get special characters around the "/".
Any suggestion.
------------------------------
Partha Baidya
Bangalore
------------------------------