Skip to content

[WIP] Need Spector scenario for paging without nextlink/continuationToken #7651

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 16, 2025

  • Explore repository structure and understand how Spector scenarios work
  • Build and test the http-client-js package successfully
  • Examine existing paging scenarios (continuationToken and nextLink patterns)
  • Add new scenario for paging without nextlink/continuationToken
  • Test the new scenario to ensure it generates correct code
  • Validate that the changes work as expected

Successfully added a missing Spector scenario for paging without nextlink or continuationToken. The current paging.md file previously only covered scenarios with continuation mechanisms, but TypeSpec supports basic @list operations with just @pageItems and no continuation token.

Changes Made

Added a third scenario to packages/http-client-js/test/scenarios/http-operations/paging.md:

  • Scenario: "Should emit a paging operation if it is simple pagination without nextlink or continuationToken"
  • TypeSpec Operation: A simple @list operation with only @pageItems decorator and no continuation mechanism
  • Generated Code: Tests verify the correct TypeScript interfaces and functions are generated for this basic pagination pattern

The new scenario covers:

  • Simple TypeSpec operation: @list op simple(@query filter: string): { @pageItems pets: Pet[]; }
  • Generated paging function with proper PagedAsyncIterableIterator return type
  • Proper handling of pagination without continuation tokens (nextToken: undefined)
  • All required TypeScript interfaces (SimpleOptions, SimplePageSettings, SimplePageResponse)

All existing tests continue to pass, and the new scenario generates 7 additional test cases that all pass successfully.

Fixes #6732.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: iscai-msft <43154838+iscai-msft@users.noreply.github.com>
Copilot finished work on behalf of iscai-msft June 16, 2025 20:12
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.

Need Spector scenario for paging without nextlink/continuationToken
2 participants