Repository navigation
fix(abstractions): keep the caller's path parameters when a raw url i… - #902
Merged
Vincent Biret (baywet) merged 1 commit intoNov 19, 2026
Conversation
…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.
There was a problem hiding this comment.
🟢 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
Vincent Biret (baywet)
approved these changes
Nov 19, 2026
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.
…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,
curlexamples, etc.Notes
Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.
Testing Instructions