Troubleshooting invalid JSON format in SSIS

Problem

While using our JSON Source, you may encounter the following issue when trying to read a JSON:

Invalid document format detected - Make sure document data is in the correct format. Error parsing comment. Expected: *, got {. Path '', line 1, position 1. 
Error parsing comment. Expected: *, got {. Path '', line 1, position 1.

This error can occur when the JSON is in an incorrect format or the API is not sending a JSON.

Solution

Here are some possible solutions to resolve this issue:

Use a JSON Parser tool

You can use a JSON parser tool to check if your JSON data is valid.
The following link provides you with an online tool to check if your JSON does not have syntax errors.

Local File

If you are using a JSON file, try to use this article to Redirect the bad rows; it will show where the issue is in the JSON file.

You can get this message and modify the JSON file where the error is:

After parsing a value, an unexpected character was encountered: E. Path 'store.books[0].title', line 7, position 27.

JSON file example

You can use a webpage to validate the JSON or source-code editors like Visual Studio Code, Notepad++, and more.

JSON API

For an API, you can try to redirect the bad rows article and use the REST API task to check if you are getting a JSON response. It allows any type of response.

We can see the JSON format:

We can see the response and not only the error message:

Video Tutorial

If you need more help, please contact us via chat on our website so our support team can assist you further.


Let me know if you have any specific areas where you’d like more information or additional details!