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

[doc] client code of paging operation #2269

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

tadelesh
Copy link
Member

@tadelesh tadelesh commented Feb 26, 2025

resolve: #2138

@azure-sdk
Copy link
Collaborator

No changes needing a change description found.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 26, 2025

You can try these changes here

🛝 Playground 🌐 Website

@markcowl markcowl self-assigned this Mar 6, 2025

## Using next link to indicate how to get the next page

Next link is an absolute url that returned by paging operation, which indicate how to get the next page.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Next link is an absolute url that returned by paging operation, which indicate how to get the next page.
Next link is an absolute url returned by the paging operation, which indicates how to get the next page.

## Using next link to indicate how to get the next page

Next link is an absolute url that returned by paging operation, which indicate how to get the next page.
If the response does not return next link, it should be the last page.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If the response does not return next link, it should be the last page.
If the response does not return a next link, it indicates the last page of results.


Next link is an absolute url that returned by paging operation, which indicate how to get the next page.
If the response does not return next link, it should be the last page.
Next link should be annotated in response model with `@nextLink`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Next link should be annotated in response model with `@nextLink`.
Next link should be annotated in the response model with `@nextLink`.

If the response does not return next link, it should be the last page.
Next link should be annotated in response model with `@nextLink`.

There are two ways to indicate the paging operation with `@nextLink`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There are two ways to indicate the paging operation with `@nextLink`:
There are two ways to indicate a paging operation with `@nextLink`:


</ClientTabs>

2. Use `@list` and `@pageItems` in core.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Use `@list` and `@pageItems` in core.
2. Use the `@list` and `@pageItems` decorators from TypeSpec core.


## Using continuation token to indicate how to get the next page

Continuation token is a string that returned by paging operation, which could be used as a parameter value for the paging operation to get the next page.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Continuation token is a string that returned by paging operation, which could be used as a parameter value for the paging operation to get the next page.
A continuation token is a string returned by a paging operation, which is used as a parameter value for the paging operation to get the next page.

## Using continuation token to indicate how to get the next page

Continuation token is a string that returned by paging operation, which could be used as a parameter value for the paging operation to get the next page.
If the response does not return continuation token, it should be the last page.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If the response does not return continuation token, it should be the last page.
If the response does not return a continuation token, it indicates the last page of results.


Continuation token is a string that returned by paging operation, which could be used as a parameter value for the paging operation to get the next page.
If the response does not return continuation token, it should be the last page.
Continuation token should be annotated in one of the request parameter with `@continuationToken`, as well as response model with `@continuationToken`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Continuation token should be annotated in one of the request parameter with `@continuationToken`, as well as response model with `@continuationToken`.
The request parameter that corresponds to the continuation token value in the paging operation should be decorated with `@continuationToken`. Similarly, the response property that contains the continuation token value should also be decorated with `@continuationToken`.

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

Successfully merging this pull request may close these issues.

Paging ContinuationToken TCGC Author doc
4 participants