Skip to content
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

Conflict in response schema, when retrieving collections with paging #180

Closed
trusanen-solibri opened this issue Oct 22, 2018 · 3 comments
Closed
Assignees
Milestone

Comments

@trusanen-solibri
Copy link

As discussed briefly in the BCF telecom, there is a slight conflict in the response schema between the BCF API and the OData v4 standard, when retrieving collections.

For example, to retrieve the collection of topics related to a project, the client can issue a request to the /topics-service. The server will then respond with a collection of topics, but the client has no way of knowing, if that collection includes all the topics, or if paging has been applied.

The OData v4 standard includes the odata.nextLink-annotation (link) that can be used to indicate that the response is only a subset of the actual collection and it's value is the location, where the client can retrieve the next subset.

The issue is that the odata.nextLink-annotation is embedded in the response JSON payload as a field, but in the BCF API, we have specified that the endpoint returns a plain list of topics. This creates a conflict with the BCF API schema and the annotation.

To avoid breaking the schema, my suggestion is that we add the odata.nextLink as a response header, which the client could then read and use to retrieve the next subset. If the header is not present, that would mean that all the subsets have been retrieved.

@jasollien
Copy link
Contributor

jasollien commented Nov 26, 2018

Could also be specified in Content-Range.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range

Example: Content-Range: items 200-300/67589

@jasollien
Copy link
Contributor

#230

@ykulbak ykulbak added this to the V2.3 milestone Nov 2, 2020
@ykulbak ykulbak modified the milestones: V2.3, V4.0 Nov 25, 2020
@GeorgDangl
Copy link
Member

This should be resolved along with #187.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants