Fix InvalidOperationException in pagination when services return relative nextLink URIs#56249
Merged
JoshLove-msft merged 3 commits intotypespec/update-http-client-1.0.0-alpha.20260212.5from Feb 13, 2026
Conversation
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
| using System.ClientModel.Primitives; | ||
|
|
||
| namespace Server.Path.Single | ||
| { |
Copilot
AI
changed the title
[WIP] Update UnbrandedGeneratorVersion to 1.0.0-alpha.20260212.5
Fix InvalidOperationException in pagination when services return relative nextLink URIs
Feb 13, 2026
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
59e3459
into
typespec/update-http-client-1.0.0-alpha.20260212.5
8 checks passed
JoshLove-msft
added a commit
that referenced
this pull request
Feb 13, 2026
* Update UnbrandedGeneratorVersion to 1.0.0-alpha.20260212.5 * Fix InvalidOperationException in pagination when services return relative nextLink URIs (#56249) * Initial plan * Fix relative URI handling in pagination - use IsAbsoluteUri check Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> * Revert Spector and package-lock.json changes Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --------- Co-authored-by: Ubuntu <cloudtest@ff2ffbe4c000001.tkkhlgj2u51eln3mcb0lygmbye.dx.internal.cloudapp.net> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The TypeSpec generator update to support relative
nextLinkURIs (viaUriKind.RelativeOrAbsolute) introduced a bug where accessingnextPage.AbsoluteUrithrowsInvalidOperationExceptionwhen the URI is relative.Changes:
Generator: Updated
AzureCollectionResultDefinition.csto generate a ternary check before accessing URI properties:This preserves
AbsoluteUrifor absolute URIs (backward compatible) and safely handles relative URIs viaOriginalString.Test fixtures: Updated 12 NextLink test data files to reflect the new generated code pattern.
Generated code: Regenerated Basic-TypeSpec test project collection result files (16 files) to apply the fix.
All 186 Azure.Generator tests pass, including 14 NextLink-specific tests.
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
Testing Guidelines
SDK Generation Guidelines
*.csprojandAssemblyInfo.csfiles have been updated with the new version of the SDK.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.