IBM Support

Byte Order Mark in JSON data can cause parsing error when trying to use JSON as a native type tree

Troubleshooting


Problem

If the JSON data contains a Byte Order Mark (BOM) to indicate data encoding, then the JSON data may not actually be valid.  The IBM Transformation Extender (ITX) Design Studio will not allow use of the JSON file as a native type tree, resulting in the following error when trying to pick a type from the object explorer.

Unexpected character: [] while scanning JSON String for JSON type.  Invalid JSON.


Symptom

Error message pop-up shows:

Unexpected character: [] while scanning JSON String for JSON type.  Invalid JSON.

Cause

The JSON data contains a Byte Order Mark (BOM) as the first few bytes of data, such as:

{
    "label": "SAMPLE EDI",

Environment

Using IBM Transformation Extender (ITX) Design Studio on any supported platform.

Diagnosing The Problem

Edit the JSON data with a hex byte editor and remove illegal characters from the start of the file.  Note that Windows Notepad will not display the BOM characters.  Use a 3rd party JSON validator to ensure data conformity.

After removing the BOM characters from the JSON file, the JSON objects should be listed on the object explorer when displayed from the Input / Output card properties.

Resolving The Problem

Edit the JSON data with a hex byte editor and remove illegal characters from the start of the file.

Document Location

Worldwide


[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSVSD8","label":"IBM Transformation Extender"},"Component":"JSON Parser","Platform":[{"code":"PF033","label":"Windows"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

More support for:
IBM Transformation Extender

Software version:
All Versions

Operating system(s):
Windows

Document number:
872042

Modified date:
21 March 2019

UID

ibm10872042