-
Notifications
You must be signed in to change notification settings - Fork 87
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
Clarification on limit parameter ... #368
Comments
My gut feeling is it should return 10000 records. You could write the spec to say either must return, must not return, or may return... the latter a bit like in existing (WMS, WFS..) OGC specifications with duplicate params. What behaviour is specified for requests larger than a specified bounding box or time period, that would be analogous. |
I agree it should return 10000 records, and then be sure to have numberReturned be 10000, so the client knows how many it got back. With numberMatched still reporting accurately, so they can page through if there's more. |
Meeting 2020-04-27: Nothing to clarify, this is already what is said in
|
What about the other way, say limit=-5, should you get 0 to 1 or 0 to 10? Using minimum/default values of 1/10. Or is this a bad request? |
Should we consider a |
As I mentioned in Common, I see it as a major interoperability issue that the server may potentially return an error because of a limit query parameter with a value larger than it can return. I suggest that Common and a future update to Features could upgrade that recommendation to return "something" regardless of the value of As I see it, the client specifying |
I think we don't allow servers to return an error if the value of limit parameter exceeds the server limit?
|
@jampukka From how I read it, I believe it still does not require the server to consider the request successful if the client requests a larger limit than the server supports:
I read this as meaning you might also not and get a 400 error, and we did run into servers implementing it this way (which were subsequently fixed based on the discussions in Common).
It's also not clear what the maximum limit means. I believe it should be clarified that the server cannot return an error if the client request a limit larger than that maximum limit, but that it is the maximum number of results the server can return regardless of any limit specified by the client. |
Maybe we do need a clarification then. Following the same pattern of the first two bullets, would Maybe declaring minimum/default/maximum values only in the OpenAPI document is not the best solution especially as we require the server not to validate the parameter against its' own OpenAPI definition/schema. Somewhat related #538 |
@jampukka I think that would be a good thing, but it is still only explanatory text though -- I think Requirement 21 would need something like:
Good point about the OpenAPI document and not rejecting a client's limit not conforming to maximum... I am not sure how acceptable it is to define a maximum but not respond with an error if the value exceeds that maximum? |
This might be better:
|
Consider that a server has specified that the min and max values for the limit parameter are 10000. If a client then makes a request for 50000 records should the server throw an exception (since 50000 is greater than 10000) or should it simply return 10000 records?
The text was updated successfully, but these errors were encountered: