Skip to content

Conversation

@radhgupta
Copy link
Member

This pull request refactors how special query parameters, particularly API version and max page size, are detected and handled in the RestClientProvider class. The changes improve the flexibility and accuracy of parameter updates, especially for paging operations, by relying on parameter metadata rather than hardcoded string comparisons.

Parameter handling improvements:

  • Refactored the logic for detecting API version and max page size parameters in ShouldUpdateReinjectedParameter to use parameter metadata (IsApiVersion and paging metadata) instead of comparing against hardcoded strings.
  • Updated the call to ShouldUpdateReinjectedParameter in AppendQueryParameters to pass the full InputParameter and InputPagingServiceMethod, enabling the new metadata-based logic.

@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Jan 29, 2026
@github-actions
Copy link
Contributor

No changes needing a change description found.

@radhgupta radhgupta marked this pull request as ready for review January 29, 2026 23:33
}

// Check if this is a max page size parameter
if (pagingServiceMethod?.PagingMetadata.PageSizeParameterSegments?.Count > 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we can probably consolidate this code that gets the MaxPageSizeParameter in a method as I believe it is used elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants