t3chnoboy / amazon-product-api

:credit_card: Amazon Product Advertising API client
366 stars 104 forks source link

Re-add support for multiple Items/BrowseNodes arrays in batch requests #102

Closed FdezRomero closed 4 years ago

FdezRomero commented 6 years ago

This PR re-adds support for batch requests, merged in master in #53:

The new results: { response, results } return object currently assumes that there is only one Items/BrowseNodes object in the response and returns respObj.Items[0] or respObj.BrowseNodes[0].

This is true for normal requests, however the Amazon PA API also supports Batch Requests where you can have a second Items/BrowseNodes object in respObj.Items[1] or respObj.BrowseNodes[1], which are currently never returned.

This PR returns the parent Items/BrowseNodes array in the response property (breaking change), and the combined Item/BrowseNode array in the results property (non-breaking change).

Since the API is being reworked in v1.0, now is a great time to get this fixed once and for all future versions. All tests and linters are passing.

lukepighetti commented 6 years ago

Did you guys end up adding batch request support? Is there any documentation?