Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Querying the maximum value for limit #173

Closed
jerstlouis opened this issue Oct 5, 2020 · 11 comments
Closed

Querying the maximum value for limit #173

jerstlouis opened this issue Oct 5, 2020 · 11 comments
Assignees
Labels
Collections Applicable to Collections (consider to use Part 2 instead) Progress: solution merged

Comments

@jerstlouis
Copy link
Member

jerstlouis commented Oct 5, 2020

Features has a default limit of 10, and specifying a limit larger than the maximum may result in a 400 error.
There is currently no other way to query the maximum limit other than parsing the OpenAPI definition.

Clients should not be forced to parse OpenAPI definition to make use of the API.

A standard mechanism to query the maximum value of limit is necessary, so that a client could use that value if it prefers not to use paging.

While paging makes sense for an HTML representation, why do programmatic clients have to bother with the added complexity of paging when HTTP already has chunked transfer encoding which serves that streaming purpose?

@cmheazel
Copy link
Contributor

Suggestion - allow limit values that exceed the servers max, but only return the servers max limit number of features (etc.). - Parameter values which exceed the limit will be accepted, but the results would be truncated and paged.

@cmheazel
Copy link
Contributor

Approve suggestion approved by the SWG on the October 26, 2020 telecon.

@cmheazel cmheazel self-assigned this Oct 26, 2020
@cmheazel cmheazel added the Collections Applicable to Collections (consider to use Part 2 instead) label Nov 22, 2020
@cmheazel
Copy link
Contributor

Added a permission allowing servers to impose limits on the size of responses
Added a recommendation that clients be prepared to handle paged responses even when not asked for.

@cmheazel
Copy link
Contributor

5/10/21 SWG - discussion continued about whether it should be a requirement that a server may not return a 400. If a server is configured with a maximum size and it does not support paging then it should clip the response to fit within that maximum response size.

@jerstlouis
Copy link
Member Author

jerstlouis commented May 10, 2021

and it does not support requested paging limit * then it should clip the response to fit within the supported maximum response size.

@cportele
Copy link
Member

There is already a related issue in Features: opengeospatial/ogcapi-features#368

@joanma747
Copy link
Contributor

joanma747 commented May 17, 2021

We contributed to 368 what we believe is the right solution.

C) The server SHALL return the maximum possible number of items if the limit 
parameter values greater than the one the server supports, rather than responding with an error.

The response will include a link on how to get the rest of the items after this ones with a "link rel=next"

What is "an invalid value" in this case?
http://docs.opengeospatial.org/DRAFTS/19-072.html#query-parameter-requirements
Are we contradicting this requirements?

Could we have a maxlimits in the metadata of the collection to avoid this issue completely?.

@jerstlouis
Copy link
Member Author

One thing to check is whether the server indicating its OWN maximum limit in the OpenAPI definition could potentially conflict with requirement 3 of Common:

http://docs.opengeospatial.org/DRAFTS/19-072.html#query-parameter-requirements

i.e. whether if the client specifies a larger limit that IT is able to support larger than the server, will be interpreted as an invalid value.

@cmheazel
Copy link
Contributor

Created separate sections for parameter names and parameter values. Added /per/core/query-param-value-tolerance based on /per/core/query-param-tolerance. Updated /per/core/query-param-invalid to accommodate /per/core/query-param-value-tolerance.

@cmheazel
Copy link
Contributor

May 24, 2021 SWG - In text above recommendation 7 - the word page should not be quoted. It should be in normal text format.
Once this change has been made this issue can be closed.

@cmheazel
Copy link
Contributor

cmheazel commented Jun 1, 2021

Change merged June 1, 2021

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Collections Applicable to Collections (consider to use Part 2 instead) Progress: solution merged
Projects
Development

No branches or pull requests

4 participants