Open slifty opened 7 months ago
Ohh, that's a good point. So if I call a bundle endpoint with a filter, I can dictate how many results I want per page, and I can see the total number of entities in the table (excluding my filter), but I can't know if there are more results that match my filter than the _count
that I indicated.
Yes this would be a good addition. To be honest I was confused by the total
attribute the first time I saw it. I assumed it was basically a proxy for entries.length
(which it obviously isn't). Not that that's the point here, but just as a note.
So theoretically there are four relevant totals:
_count
total
, but now that we have auth scoping, this is arguably a data leak_count
but bound by my auth scope
_count
_count
)entries.length
and maybe that's good enough, but, I'll bet there's a REST spec somewhere that says you should say anyway
Several of our endpoints that return collections return a
Bundle
which includes a total number of entries (not just the amount returned). As we begin to add things like filters and user authentication this total is going to start to get a little confusing.Currently it returns the true total number of entries in the database, NOT the total that would be available based on the filters provided. For instance, this would expose the total number of bulk uploads across ALL users, rather than just the total number of uploads for a given user.
I think this is probably an incorrect implementation.