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

Invalid meta.last on empty items #59

Open
lcarva opened this issue Apr 13, 2020 · 0 comments
Open

Invalid meta.last on empty items #59

lcarva opened this issue Apr 13, 2020 · 0 comments

Comments

@lcarva
Copy link
Contributor

lcarva commented Apr 13, 2020

If there are no builds, the last attribute of meta points to an invalid URL:

🐚  curl http://localhost:8080/api/v1/builds
{
  "items": [], 
  "meta": {
    "first": "http://localhost:8080/api/v1/builds?page=1&per_page=20", 
    "last": "http://localhost:8080/api/v1/builds?page=0&per_page=20", 
    "next": null, 
    "page": 1, 
    "pages": 0, 
    "per_page": 20, 
    "previous": null, 
    "total": 0
  }
}

🐚  curl 'http://localhost:8080/api/v1/builds?page=0&per_page=20"'
{
  "error": "The requested resource was not found"
}

meta.last should have the same value as meta.first if there are not builds.

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