Open shrink opened 2 years ago
Hello,
You are right for the OR11 request example, the setPaginate(false)
does not make sense if max
and offset
parameters are specified. Thanks for your feedback, we will modify the example.
For some APIs like OR11, the paginate=false
parameter does make sense and will return all the results in a single API call like you mentioned.
This seems to be similar with getOffers() - I tried to disable pagination to get all offers (<400) but it doesn't work and I couldn't work out how to fetch the next page. With setPagination(true) I can setMax(10000) and then fetch all offers.
I've really struggled to use this SDK. The REST docs are easy to follow, but the lack of docs in the SDK has made it slow for me to implement. (I'd have been quicker by ignoring the SDK and just using the JSON.)
For
GetOrdersRequest::class
the example mentions pagination:However, if we look in
AbstractRequest::class
we can see thatsetPaginate(false)
means thatmax
andoffset
are ignored:I think the example is therefore misleading because
setPaginate(false)
is preventing the use of the values provided insetMax()
andsetOffset()
. I am creating this as an issue rather than with a proposed change in a Pull Request as I am not confident that my understanding is correct, because the API does accept apaginate
parameter which is described as...So it seems possible to completely disable pagination for this endpoint (and therefore get all results, independent of the max?) which would indicate that
setPaginate(false)
does have some intended influence on how the API responds. Unfortunately, we don't have enough orders in our Mirakl instance to test the behaviour of the API when there's more than 100 results.