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

normalizePaging for jsonApi is not working as expected. #118

Open
jurcello opened this issue Nov 5, 2019 · 3 comments
Open

normalizePaging for jsonApi is not working as expected. #118

jurcello opened this issue Nov 5, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@jurcello
Copy link
Collaborator

jurcello commented Nov 5, 2019

const numPages = parseInt(query.page.number, 10);
const numPerPage = parseInt(query.page.size, 10);

It tries to read the paging using the page query parameter, but jsonAPI returns page[offset] and page[limit]

@mnugter
Copy link
Collaborator

mnugter commented Nov 5, 2019

Not always! JSON:API standard describes both actually. Any fix should be able to handle both situations.

@jurcello
Copy link
Collaborator Author

jurcello commented Nov 5, 2019

That's a good one. In that case we should write a dedicated parser for the Drupal one, because at the moment it fails at parsing the paging information for Drupal.

Maybe the best way to do this is to define parsers for both situations and let another function detect which parser to use.

@StevenButeneers
Copy link
Collaborator

In fact JSON:API is agnostic about the pagination strategy that is used by an API (server). Well know strategies include page, offset and cursor based, but are not limited to them.

I.m.o we should allow the client to specify which strategy Hyral should use.

@StevenButeneers StevenButeneers added the bug Something isn't working label Nov 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants