-
Notifications
You must be signed in to change notification settings - Fork 49
The 'page_size' parameter should allow 0 values #164
Comments
To disable pagination, set |
@Wilt thanks for your response. Ok, we can set For me, as a developer, disabling pagination means do not take into account any So if we suppose we have a $results = $this->userService->fetch($page - 1, $pageSize); Disabling pagination should be expressed by this call.
So i'm not sure setting What I want to be able to do is that.
Also if we consider the client side call why would it be forbidden to simply call something that |
I get you; so you don't want any items from your collection, but you are only interested in count. To achieve this you would like to set Sounds like an interesting idea, but not sure if this will work. About your last question:
I think because it didn't seem to make sense at first. But maybe you found a legitimate reason to allow this... |
Have you tried rendering collections off? |
Also, if you want a count just create an RPC to return just that value. |
This repository has been closed and moved to laminas-api-tools/api-tools-hal; a new issue has been opened at laminas-api-tools/api-tools-hal#6. |
Hi, we use PhlyRestfully and now Apigility since several years ;-).
We often need to call a Web Service to count a number of entities. The HAL standard and zf-hal allow to get a count very easily using the
total_items
property of the fetched HAL collection.For example...
Then on the client side its very simple (sample in JS / jQuery here).
It works, but I think this is "sub-optimal" because the library forbid
page_size
values equal to0
(seezf-hal/src/Collection.php
Line 295 in 7c164ef
In our case its has the following consequences
So, why the
page_size
parameter cannot be equal to0
? If their are good reasons what the best practices to count entities efficiently with REST / HAL ? If their are no good reasons could it be possible to authorizepage_size
0 values ?Thanks
The text was updated successfully, but these errors were encountered: