typespec icon indicating copy to clipboard operation
typespec copied to clipboard

[Bug]: API version parameters not preserved in pagination requests causing "resource not found" errors

Open radhgupta opened this issue 10 months ago • 0 comments

Describe the bug

API version parameters are not being reinjected during pagination requests, causing version mixing that results in "resource not found" errors.

When a client makes an initial request with api-version=2023-10-01, the server's next link may contain a different version like api-version=2023-08-01-preview, and subsequent pagination calls use the server's version instead of preserving the client's original version. This breaks pagination flows when the server's next link version differs from the client's intended API version.

The fix involves enhancing the parameter reinject mechanism to automatically preserve the client's original API version across all pagination requests.

Reproduction

Example:

First call: GET /items?api-version=2023-10-01&maxpagesize=2 (correct) Pagination call: GET /items?api-version=2023-08-01-preview&skip=2&top=2&maxpagesize=2 (wrong version)

Checklist

radhgupta avatar Jan 28 '26 19:01 radhgupta