Closed shipperizer closed 5 months ago
After trying it for a little, I found the following:
Even though the API docs state that page
must be >1
, the value can be <1
and if we set page=0
in our requests as default value then we get the expected behavior.
TBH their pagination logic seems really weird. Additionally, the Links
header that is returned does not contain the link to the first
page if you are on the first page and it does not contain the link to the last
page if you are on the last page.
We will need to set the default page
to 0
for this endpoint. I will have to look if this can work for the other endpoints or if we will need special logic for this one.
To add on this, Kratos and Hydra have different pagination logic.
page=10
, size=2
then we will get an empty response.page=10
, size=2
then we will get the last 2 entries (the final page).IMHO the hydra behavior is better. The page parameter should limit the returned values, but it should not cause the response to have no values. Are we OK with having different behaviors for different the hydra and kratos APIs?
We could make a second call if the Kratos response is empty so as to get the last page, but I don't think it is worth it. As long as the UI makes the calls correctly it should be fine.
Thank you for reporting us your feedback!
The internal ticket has been created: https://warthogs.atlassian.net/browse/IAM-782.
This message was autogenerated
This issue surfaced again on the ui implementation. It is currently not possible to read the page=0 of schemas. The endpoint skips the first page and responds with page=1 instead. It is exactly the same problem as described in #256 just for schemas here instead of identities there.
kratos public endpoints
/schema
and/schema/{id}
return successfully:the proxied
/api/v0/schema
is always empty unless you pass thesize==1
:the detailed view works all the time for all the schemas
as docs go https://github.com/ory/kratos-client-go/blob/v0.13.1/api_identity.go#L2188 pages don't necessarily follow each and i was not able to fund the second schema
investigate a solution on how to get a reliable behaviour