bulk api result structure is different between xml and json #13117
Labels
RFC
Indicates the issue is a request for comments where the author is looking for feedback.
Milestone
Hi there,
calling the bulk API provides different result structures between XML and json. I think the json format is actually wrong. Here is an example:
Calling: https://test.homewantad.com:943/?module=API&method=API.getBulkRequest, query segments for a VisitSummary, with period year for the last two years
urls[0]=method=VisitsSummary.get&idSite=1&period=year&date=last2&format=JSON&segment=pageU=^test.homewantad.com/ad/show/AWQh3OKzf2k4jhougDPr&urls[1]=method=VisitsSummary.get&idSite=1&period=year&date=last2&format=JSON&segment=pageUrl=^test.homewantad.com/ad/show/AWQx2EBr2vnhxw_A_uUe
The correct XML result structure is:
The JSON structure does not match the xml structure (and has 3 problems, I think):
The following arguments are for an easy json to code mapping.
the whole json result structur is an array, it should be an json-object with an array inside like { [] }
the first json result-object has two fields. This is quitly difficult to map into a code representation. With an array instead, there are no problems:
{[ { "2017" : { } ], [ { "2018" : { } ]} instead of { { "2017" : { } }, { "2018" : { } } }
the null representation for an object is {} or null, not [] in this context. [] is an empty array. An empty [] causes another problem for a dynamic mapping, when an object is expected and suddenly an array (empty) will be delivered.
With regards,
Dirk
The text was updated successfully, but these errors were encountered: