Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Inconsistent response type for field per_page #64

Open
omani opened this issue Aug 4, 2023 · 1 comment
Open

Bug: Inconsistent response type for field per_page #64

omani opened this issue Aug 4, 2023 · 1 comment

Comments

@omani
Copy link

omani commented Aug 4, 2023

Passing query param per_page results in different type of said param. per_page is an integer in a normal response but suddenly a string in the response of a request where per_page is passed as a query param.

@omani
Copy link
Author

omani commented Aug 4, 2023

a little observation: if I pass a per_page > 250 (which seems to be a hard limit on the backend), I get a normal integer back, even though I passed the param. but param per_page set to eg. 10, gives back a string.

so it seems that a per_page that has been set, is being passed back as a string.

example returning an integer:
curl -X GET -G "https://openapi.nkn.org/api/v1/transactions" -H "Content-Type: application/json" -H "Accept: application/json" | jq

"first_page_url": "https://openapi.nkn.org/api/v1/transactions?page=1",
"from": 1,
"next_page_url": "https://openapi.nkn.org/api/v1/transactions?page=2",
"path": "https://openapi.nkn.org/api/v1/transactions",
"per_page": 10,
"prev_page_url": null,
"to": 10

example returning a string:
curl -X GET -G "https://openapi.nkn.org/api/v1/transactions?per_page=10" -H "Content-Type: application/json" -H "Accept: application/json" | jq

"first_page_url": "https://openapi.nkn.org/api/v1/transactions?page=1",
"from": 1,
"next_page_url": "https://openapi.nkn.org/api/v1/transactions?page=2",
"path": "https://openapi.nkn.org/api/v1/transactions",
"per_page": "10",
"prev_page_url": null,
"to": 10

notice the difference:
"per_page": 10, and "per_page": "10",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant