Closed johndwells closed 7 years ago
And it would seem that, unless limit were explicitly set to null, that pagination is expected as part of the response.
I think you'd still want paginate
(maybe defaulting to true
). Just in case you only wanted x amount of results and didn't care about other pages.
But yeah - I'm not sure about why we can't just use the limit
from the ElementCriteriaModel
as well.
The response JSON is formatted differently if it’s paginated, so I definitely think that’s something that needs to be explicitly enabled via the paginate
param.
limit
vs elementsPerPage
… I could go either way, but by keeping elementsPerPage
around, we have the option to support offset
and limit
params down the road, independently of elementsPerPage
. For example, if you only wanted to expose the first 100 entries, and you want to paginate them @ 10 entries per page, you could do that by setting elemenstPerPage
to 10
and limit
to 100
. (Not possible right now but would be easily doable if/when someone needs it.)
When providing an endpoint with an ElementCriteriaModel, it already contains a
limit
attribute, which to my mind is exactly whatelementsPerPage
represents. And it would seem that, unlesslimit
were explicitly set tonull
, that pagination is expected as part of the response.With that in mind, are these configurations really necessary?