Say I have a server exposing an api that let me retrieve 'things', there are a lot of things, and as such retrieving all things at once could take down the server, hence the exposed API returns paginated things instead. The exposed API is something like this:
Page<Thing> getThings(int pageSize, Optional<Token> previousPageToken) With Page<T> being like this:
class Page<T> { List<T> getValues(); Token nextPageToken(); boolean isLastPage(); } On the server side I want to protect myself against clients sending overly large pageSize, e.g. by doing something like min(pageSizeSentByClient, MAX_PAGE_SIZE_AS_CONFIGURED_BY_SERVER. There might be other circumstances where the server might decide to even more/less than MAX_PAGE_SIZE_AS_CONFIGURED_BY_SERVER things at once, point is the client pageSize argument isn't nothing more than a 'soft' request, and the only way to know all pages have been consumed is to check isLastPage, and the only way to consume n items is to read pages until you've seen n items (i.e. you can't be sure that requesting 10 pages of 10 items each will give you 100 things, let's assume for a moment that we know there's >> 100 things overall to begin with).
Now my question is how to document the pageSize argument, I could say something along the lines of 'pageSize is a hint used by the server to decide how many things to return per page, consecutive pages may contain different number of things that may be bigger/smaller than pageSize'. This is long winded and I was wondering if there's a succinct/broadly accepted way to convey the very same meaning, e.g. some adjective/noun that would clear this up and make it clear that the client shouldn't see pageSize as a hard requirement for the function/API to return successfully e.g. 'pageSize is advisory', 'pageSize is best-effort', or 'pageSize is a hint'.