Page 1 of 1

[Fixed in 2.0.5] API paginator

Posted: Mon Aug 24, 2020 12:43 pm
by ptorbjornsson
I am on version 2.0.2.

When doing API requests that return multipage results, the page and device count seems to be off.
When I do a request for e.g. device by description (http://unimus/api/v2/devices/findByDesc ... escription>), the pagination data seems to return the total number of devices in the database, and not the devices matching the search. The exemption being when I hit the last page, where it returns the correct results.

Example:

When searching for a description that should return 379 devices, with a result size of 50, page 0:
http://unimus/api/v2/devices/findByDesc ... =50&page=0
"paginator":{"totalCount":22728,"totalPages":455,"page":0,"size":50}}

Then page 7 (last page) for the same search:
http://unimus/api/v2/devices/findByDesc ... =50&page=7
"paginator":{"totalCount":379,"totalPages":8,"page":7,"size":50}}

Is there something I am doing wrong here, or is it a bug in the API?

Thank you in advance for any input.

Re: API paginator

Posted: Mon Aug 24, 2020 3:07 pm
by Sachtilah
Hi, thank you for reporting it.

This is definitely a bug in the API. It will be fixed in the next 2.0.5 release.

Re: API paginator

Posted: Tue Aug 25, 2020 6:12 am
by ptorbjornsson
Hi,

Perfect, thank you for your quick reply.
I'll work around it until the next update.