Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Link URis are mallformed when quried with "pagesize" parameter #186

Open
Channad opened this issue Mar 12, 2017 · 1 comment
Open

Link URis are mallformed when quried with "pagesize" parameter #186

Channad opened this issue Mar 12, 2017 · 1 comment

Comments

@Channad
Copy link

Channad commented Mar 12, 2017

The "_links" list of the GET method called with "page_size" parameter seems to be malformed as shown in output below. The paginator does not seem to be supporting the provided "Page Size" dynamic page size parameter properly. The URL which produced the output is;

http://localhost:8080/agri_equipment?listOnly=1

{
"_links": {
"self": {
"href": "http://localhost:8080/agri_equipment?page=1"
},
"first": {
"href": "http://localhost:8080/agri_equipment"
},
"last": {
"href": "http://localhost:8080/agri_equipment?page=3"
},
"next": {
"href": "http://localhost:8080/agri_equipment?page=2"
}
},
"_embedded": {
"agri_equipment": [
{
"equipmentId": "1",
"equipmentDesc": "Plough",
"remarks": "A manually operated Plough to be used to prepare paddy fields",
"created_on": "2017-03-11 00:00:00",
"created_by": "1",
"modified_on": "0000-00-00 00:00:00",
"modified_by": "0",
"_links": {
"self": {
"href": "http://localhost:8080/agri_equipment/1"
}
}
}
]
},
"page_count": 3,
"page_size": 1,
"total_items": 3,
"page": 1
}

If I use any of the URIs given in the "_Links" list for pagination I get the wrong data or following error due to lack of embedding the "listOnly" parameter in the URI. for ex. If I call URI for next,

http://localhost:8080/agri_equipment?page=2

I get;

{
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Conflict",
"status": 409,
"detail": "Invalid page provided"
}

However if I modify it to be as;
http://localhost:8080/agri_equipment?page=2&listOnly=1
then it works.

Hope this will help you guys to improve it.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools; a new issue has been opened at laminas-api-tools/api-tools#9.

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