oasis-tcs / odata-specs

OASIS OData TC: Markdown sources for OData specification drafts. https://github.com/oasis-tcs/odata-specs
https://oasis-tcs.github.io/odata-specs/
Other
6 stars 2 forks source link

Allow $pagesize system query option #302

Open ralfhandl opened 8 months ago

ralfhandl commented 8 months ago

Using an HTTP Prefer header for client's preferred odata.pagesize is problematic, particularly when the client-specified query URL uses $expand.

While a server is free to ignore any client-specified pagesize, it is beneficial to be able to have the client indicate their preference for each "node" in a URL using that has one or more $expands, so that the server (if it is agreeable) may respect the client's intentions.

Suggestion is to introduce $pagesize system query option (a positive integer). Where present in the outermost level of a query (not inside a $expand) it would take preference over odata.pagesize in HTTP Prefer header.

Nested $pagesize would apply to $expand, e.g.

Customer?$pagesize=100&$expand=Orders($pagesize=10)

requests up to 100 customers each with up to 10 orders.

If a returned customer has some orders with a next-link, then following that next-link is not required to use the same $pagesize of 10. It only applies to the originally-returned nested orders.

Imported from ODATA-1261

ralfhandl commented 6 months ago

Feedback from Evan Ireland:

It isn’t an onerous requirement on servers at it would be optional just as the odata.pagesize preference is

ralfhandl commented 1 month ago

@HeikoTheissen This would need a new capability to express that servers support it.