Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

More than one sort-parameter are supported by API but not by SDK #386

Closed
ghost opened this issue Mar 1, 2018 · 1 comment
Closed

More than one sort-parameter are supported by API but not by SDK #386

ghost opened this issue Mar 1, 2018 · 1 comment
Milestone

Comments

@ghost
Copy link

ghost commented Mar 1, 2018

$search = InventoryQueryRequest::of();
$search->sort('masterData.staged.masterVariant.sku')->sort('id asc');

should produce a query with "..&sort=..sku&sort=id%20asc" and not "id asc" in the first place.
AFAICS the reason is that AbstractApiRequest::convertToString sorts the parameters before placing the request.

I tried to produce a small PR, but failed because the parameters are stored intentionally this way and my changes broke some test-cases.

We would like to iterate over whole bunches of products and inventories and do so in a streaming (and over sku-synchronized) fashion, which isn't possible ATM.

Viele Grüße // David

@jenschude jenschude added this to the v2.3 milestone Mar 1, 2018
@jenschude
Copy link
Contributor

jenschude commented Mar 1, 2018

You are right. The sorting is the issue. This was done for canonical URIs but for the sort parameter it's problematic. Will fix this and also add it to the next release. If necessary I could also fix it afterwards for previous versions

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant