Data format in Item.json

imerlswimerlsw Member Posts: 4

Hi, in the previous version of Item.json, there are two square brackets for an item, for example:

"Item": [{"ItemID":"xxxx", "systemSku":...}],

But now in the current version, in some cases it returns:

"Item": {"ItemID":"xxxx", "systemSku":...},

So basically, the square brackets are missing, and it becomes a single object instead of a set.

We are wondering if there's any way to make it consistent and keep a set (with square brackets even if it is a single object) for all the cases? Thanks!

1 comment

  • gregaricangregarican Member Posts: 998 

    I ran into this years ago when I started working with the R-Series API. It breaks conventional JSON standards, in that an element that can be an array should always be passed back in the response as an array. Even if it contains a single member.

    You will likely need to create a custom response handler that will inspect the element being passed back. And conditionally parse it. If you search these forums I think I provided a C# example of an API wrapper awhile back. And just an FYI that this gotcha isn't only present in the Items API endpoint. It's all over the place in there. 😕

Sign In or Register to comment.