Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP_JSON Keys

I have JSON from a provider endpoint I need to parse, however where you would normally use a product array, they have used keyed objects with an ID, example below, need to work out how to iterate over and get the list of products out without knowing the keys to the products first.

If I was doing it in JS, would use something like LoDash or Underscore to extract the keys but having just coded 90% of the parsing using the SRP method, would be good to keep this in the same format.

{
"order_id": 12345,
"products": {
"34329439": {product_id: "1", "product": "some product"},
"39347847": {product_id: "2", "product": "some other product"}
}
}
Have attempted to GET the products array into an handler then GETMEMBERS, but that just returns "???????????" so not sure what to do there...

Comments

Sign In or Register to comment.