Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Document if page is 0 or 1 indexed. #9

Closed
AndreasMadsen opened this issue May 18, 2018 · 6 comments
Closed

Document if page is 0 or 1 indexed. #9

AndreasMadsen opened this issue May 18, 2018 · 6 comments

Comments

@AndreasMadsen
Copy link

The error message for page = 0 is also not great.

{
  "statusCode": 422,
  "error": "Unprocessable Entity",
  "message": "Invalid input data.",
  "reasons": {}
}

PS: page is 1 indexed.

@ShogunPanda
Copy link
Contributor

@AndreasMadsen It was a typo on API spec. API use 1 by default. I should have treated zeros as "not-provided", which means defaulting to 1. Fixed now.

@AndreasMadsen
Copy link
Author

@ShogunPanda So it is 0 indexed? It is still not documented.

@ShogunPanda
Copy link
Contributor

It's 1 indexed, as all REST APIs. That's why is not explicitly documented. I just added the explicit documentation.

@AndreasMadsen
Copy link
Author

AndreasMadsen commented May 18, 2018

@ShogunPanda Great. So why is the minimum value 0 in a9eaae5?

@ShogunPanda
Copy link
Contributor

Well, I just wanted to provide a fallback in case users don't read the docs :)

@AndreasMadsen
Copy link
Author

@ShogunPanda It is up to you. But that sounds like a really bad idea because it teaches the wrong API.

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

2 participants