-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discovery makes implementation assumptions for listing TDs via pagination parameters #278
Comments
@farshidtz can you comment? I think at this point we are out of time to make big changes in how this is done, but we should definitely look into improving this in Discovery 2.0 (which we def need to do anyway for other reasons, i.e. to intercept the JSONPath spec when it is published by IETF). |
I'm also wondering if we can fix this in a way that preserves compatibility. Suppose we introduce a new way to do pagination, but keep the old API around. That gives compatibility, but forces a system to implement pagination twice, and one way is inefficient. Do we do that for 1.1 then deprecate the "old way" for 2.0? Or do we just drop the old way and go straight for a new, cursor-based approach and publish a 2.0 spec? |
The reason for using
For the
With that said, we could make the use of |
I just had a look of what to do in order to provide a WoT Discovery compliant Listing of TDs and wanted to provide feedback.
I think it is very problematic that this chapter has quite some bias of how a TD Directory implements its persistence:
limit
/offset
based pagination is a very inefficient mechanism for pagination (e.g. see articles here or here) which nowadays is replaced bycursor
based pagination instead"next"
page somehow"canonical"
Link header is specified to include an additional mandatoryetag
cursor
based pagination approach, the cursor for thenext
page would include an identifier for the first TD of the next page in its "where clause" - which would not be affected by adding new TDs during paginationetag
puts quite a lot of effort to the TD Directory, e.g. it would have to calculate a hash of all matching TDs for each "next" page, which could be a very expensive operationIn my opinion, the specification forces the implementer to choose an inefficient persistence.
Does it add much benefit of specifying something like
limit
andoffset
query parameters?Or would it not be sufficient to define (which even already is defined) that a
next
link header must be returned when there are more results to load than returned in the response? And that this link must be followed to load the next page?One other thing I noticed:
The query parameters which have to be provided by an implementation are very hidden in the text, I would have expected a table of the required/optional query parameters to support for the "Listing" API.
The text was updated successfully, but these errors were encountered: