Skip to content

API pagination issues #2111

@dated

Description

@dated

When the passed page value is bigger than the pageCount property the API still sets the previous property

https://explorer.ark.io/api/v2/delegates/dated/voters?page=100

{
  "meta": {
    "count": 0,
    "pageCount": 1,
    "totalCount": 52,
    "next": null,
    "previous": "/api/v2/delegates/dated/voters?page=99&limit=100",
    "self": "/api/v2/delegates/dated/voters?page=100&limit=100",
    "first": "/api/v2/delegates/dated/voters?page=1&limit=100",
    "last": "/api/v2/delegates/dated/voters?page=1&limit=100"
  },
  "data": []
}

pageCount and totalCount change value based on the passed page param

https://explorer.ark.io/api/v2/wallets/cryptology/transactions/received?page=2

{ pageCount: 1, totalCount: 100 }

https://explorer.ark.io/api/v2/wallets/cryptology/transactions/received?page=3

// correct values?

{ pageCount: 3, totalCount: 233 }

https://explorer.ark.io/api/v2/wallets/cryptology/transactions/received?page=4

// from here onwards:
// pageCount = page - 1
// totalCount = (page - 1) * 100

{ pageCount: 3, totalCount: 300 }

https://explorer.ark.io/api/v2/wallets/cryptology/transactions/received?page=1000

{ pageCount: 999, totalCount: 99900 }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions