How to fix json error Expecting 'STRING', got '}' [closed]

After looking at the data, it looks like their are two problems.

  1. Your collection of orders and items are not closed.
  2. The main json object is not closed.

Let’s start with the Order and Item collection:

Order and Item Problem Area

The item collection in the order with recordId 3 is not closed properly. This is resulting in the order with recordId 4 being a child of record 3’s items. Additionally there is no closure to the order record itself (missing curly braces).

To fix this, place a square brace, then a curly brace, before the comma, at the end of the item properties.

How to Fix Order

Resulting in:

Fixed Orders

Now that we have the orders cleaned up, there are just a couple braces at the end of the file that need to be closed.

The order collection is missing its closing square brace, and the main json object is missing its closing curly brace:

Missing Closing Braces

Resulting in:

Fixed Closing Braces

So, this fixes the structural issues. As @Gixabel mentioned, you also need to enclose all the instances of shipDate as stings, since they are representations of dates.

Leave a Comment