I have not converted my 5 year old perl scripts over to json yet but found with xml I needed to do a type check on a object that could return more than one value. I found a single item was “generally” returned as a scalar and multiple values were returned as a hash or array depending on the object I was processing.
Thing is in json both these are multiple value objects… one is a key value pair and the other is just the value understanding that “id” is unneeded info in the context.
what i should have given as an example
“isrcs”:[{“id”:“GBAMC9900024”}, {“id”:“GBAMC9900025”}]
rather than
“isrcs”:[{“id”:“GBAMC9900024”}]
But i didn’t want to try and write json syntax by hand as its easy to make mistakes and throw confusion in the discussion…
Anyway my application is crapping out at random places and ive traced the problem down to the isrcs, having trouble breaking down exactly when one is returned or the other is.
It just seems to me as an entirely unnecessary oversite.
Also if it was meant to be singular wouldnt the property be just isrc with no s
Can you give an example of requests that gave you these results? All requests I usually do return the second form, I don’t know which kind of request gives you the first one.
Sure.
Firstly let me make one correction I am only finding the kvp form in “Search” request and and not both forms in the Browse requests as I initially reported.
Browse and Lookup requests (afaik) do only return the array of values form.