Skip to content

fix(abstractions): keep the caller's path parameters when a raw url i… - #902

Merged
Vincent Biret (baywet) merged 1 commit into
microsoft:mainfrom
Shriraj1901:fix-url-setter-keeps-path-parameters
Nov 19, 2026
Merged

Vincent Biret (baywet) merged 1 commit into
microsoft:mainfrom
Shriraj1901:fix-url-setter-keeps-path-parameters

Conversation

@Shriraj1901

Copy link
Copy Markdown
Contributor

…s set

RequestInformation stores the path_parameters dict it is given as is, and a generated request builder passes its own dict to every request it creates. The url setter emptied that dict with clear(), so setting a raw url on one request wiped the builder's path parameters for all of its later requests.

ApiKeyAuthenticationProvider with KeyLocation.QueryParameter sets the url on every request it authenticates, so a builder used twice sent its second request to the wrong place: a DELETE on /users/42 followed by a DELETE on /users/ (the collection). The setter now replaces query_parameters and path_parameters with new dicts instead of clearing the ones it was given.

Overview

Brief description of what this PR does, and why it is needed.

Related Issue

Fixes # (issue)

Demo

Optional. Screenshots, curl examples, etc.

Notes

Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.

Testing Instructions

  • How to test this PR
  • Prefer bulleted description
  • Start after checking out this branch
  • Include any setup required, such as bundling scripts, restarting services, etc.
  • Include test case, and expected output

…s set

RequestInformation stores the path_parameters dict it is given as is, and a
generated request builder passes its own dict to every request it creates.
The url setter emptied that dict with clear(), so setting a raw url on one
request wiped the builder's path parameters for all of its later requests.

ApiKeyAuthenticationProvider with KeyLocation.QueryParameter sets the url on
every request it authenticates, so a builder used twice sent its second
request to the wrong place: a DELETE on /users/42 followed by a DELETE on
/users/ (the collection). The setter now replaces query_parameters and
path_parameters with new dicts instead of clearing the ones it was given.
Copilot AI balanced review requested due to automatic review settings November 19, 2026 05:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the fix that preserves shared request parameters when assigning a raw URL.

No open issues 🎉

What changed in this PR

Fixes shared parameter mutation in the abstractions layer so setting a raw URL on one request preserves the builder’s path parameters for subsequent requests.

Changes:

  • Replace path and query parameter dictionaries instead of clearing them in place.
  • Add regression tests for raw URL assignment and query-based API key authentication with reused builder parameters.
File Description
packages/​abstractions/​tests/​test_request_information.py Verifies raw URL assignment preserves caller-owned path parameters.
packages/​abstractions/​tests/​authentication/​test_api_key_authentication_provider.py Verifies repeated authenticated requests retain the correct endpoint.
packages/​abstractions/​kiota_abstractions/​request_information.py Detaches parameter dictionaries when setting a raw URL.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this to In Progress 🚧 in Kiota Nov 19, 2026
@baywet
Vincent Biret (baywet) added this pull request to the merge queue Nov 19, 2026
Merged via the queue into microsoft:main with commit 1b5e479 Nov 19, 2026
67 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress 🚧 to Done ✔️ in Kiota Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done ✔️

Development

Successfully merging this pull request may close these issues.

3 participants