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

[Bug]: list operation with CollectionWithNextLink result should be a pageable operation #5491

Open
4 tasks done
lirenhe opened this issue Jan 6, 2025 · 1 comment
Open
4 tasks done
Assignees
Labels
docs Improvements or additions to documentation feature New feature or request needs-area triaged:core
Milestone

Comments

@lirenhe
Copy link
Member

lirenhe commented Jan 6, 2025

Describe the bug

When we define the operation like below:

): CollectionWithNextLink<Toy> | PetStoreError;

We should expect this operation returns pageable result.

However, if we looked at the definition in

@friendlyName("{name}CollectionWithNextLink", Resource)

@doc("Paged response of {name} items", Resource)
@friendlyName("{name}CollectionWithNextLink", Resource)
model CollectionWithNextLink<Resource extends {}> {
  @doc("The items on this page")
  value: Resource[];

  @doc("The link to the next page of items")
  nextLink?: ResourceLocation<Resource>;
}

There is no @pageItems for the value property so we don't treat it as pageable operation in the client side.

Expect: this should be a pageable operation

Reproduction

Described as above

Checklist

@lirenhe lirenhe added the bug Something isn't working label Jan 6, 2025
@lmazuel
Copy link
Member

lmazuel commented Jan 6, 2025

@lirenhe to be clear, what you ask is to update CollectionWithNextLink to:

@doc("Paged response of {name} items", Resource)
@friendlyName("{name}CollectionWithNextLink", Resource)
model CollectionWithNextLink<Resource extends {}> {
  @doc("The items on this page")
  @pageItems
  value: Resource[];

  @doc("The link to the next page of items")
  @nextLink
  nextLink?: ResourceLocation<Resource>;
}

Is that correct?

If that's the case, I agree with you :)

@markcowl markcowl added the docs Improvements or additions to documentation label Jan 7, 2025
@markcowl markcowl added this to the Backlog milestone Jan 7, 2025
@allenjzhang allenjzhang self-assigned this Jan 7, 2025
@markcowl markcowl added feature New feature or request and removed bug Something isn't working labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation feature New feature or request needs-area triaged:core
Projects
None yet
Development

No branches or pull requests

4 participants