Skip to content

Invalid meta.last on empty items #59

Description

@lcarva

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions