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

Search endpoint ignores parameters "limit" #429

Open
shyim opened this issue Dec 15, 2021 · 2 comments
Open

Search endpoint ignores parameters "limit" #429

shyim opened this issue Dec 15, 2021 · 2 comments
Assignees

Comments

@shyim
Copy link

shyim commented Dec 15, 2021

EN:

When calling the search endpoint and passing the parameter "limit" it is ignored and limit=10 is assumed

DE:

Beim Aufrufen des Search-Endpunktes und übergeben des Parameters "limit" wird dieser Ignoriert und limit=10 angenommen

Schritte zur Reproduktion:

url: ... "api/v1/search/product?limit=1"
requestbody =
{
"filter" : [

{ "type" : "equals", "field" : "coverId", "value" : null }

]
}

Erwartetes Ergebnis:

Rückgabe von einem Produkt.
"links" :

{ "first" : "http://www.ldbs-shop.de.cloud8-vm556.de-nserver.de/api/v1/search/product?limit=1&page=1", "last" : "http://www.ldbs-shop.de.cloud8-vm556.de-nserver.de/api/v1/search/product?limit=1&page=701", "next" : "http://www.ldbs-shop.de.cloud8-vm556.de-nserver.de/api/v1/search/product?limit=1&page=2", "self" : "http://www.ldbs-shop.de.cloud8-vm556.de-nserver.de/api/v1/search/product?limit=1" }

,
"meta" :

{ "totalCountMode" : 1, "total" : 701 }

,

Tatsächliches Ergebnis:

Rückgabe von 10 Produkten.
"links" :

{ "first" : "http://www.ldbs-shop.de.cloud8-vm556.de-nserver.de/api/v1/search/product?limit=10&page=1", "last" : "http://www.ldbs-shop.de.cloud8-vm556.de-nserver.de/api/v1/search/product?limit=10&page=71", "next" : "http://www.ldbs-shop.de.cloud8-vm556.de-nserver.de/api/v1/search/product?limit=10&page=2", "self" : "http://www.ldbs-shop.de.cloud8-vm556.de-nserver.de/api/v1/search/product?limit=1" }

,
"meta" :

{ "totalCountMode" : 1, "total" : 701 }

,

@sebi007
Copy link

sebi007 commented Dec 16, 2021

Shouldn't the limit parameter also be in the request body?

@shyim
Copy link
Author

shyim commented Dec 16, 2021

The limit parameter can be in request body or in the query. It depends on the used http method

@manuelselbach manuelselbach self-assigned this Dec 16, 2021
manuelselbach added a commit that referenced this issue Dec 16, 2021
With this change the request parameter and the request body are merged
for http methods other than GET. This is needed to e.g. have the
"limit=1" available in the payload for the search of products, etc.

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

No branches or pull requests

3 participants