fix(abstractions): give each RequestInformation its own path_parameters dict - #754
Merged
Vincent Biret (baywet) merged 2 commits intoSep 25, 2026
Conversation
…rs dict path_parameters defaulted to a dict literal that every RequestInformation created without one shared, so a path parameter set on one request reached the others and the url setter's clear() emptied them all. It now defaults to None and a new dict; a dict that is passed in is used as is. Fixes microsoft#753.
Vincent Biret (baywet)
approved these changes
Sep 25, 2026
|
Vincent Biret (baywet)
enabled auto-merge
September 25, 2026 19:17
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.



Overview
RequestInformation.__init__defaultedpath_parametersto a dict literal and stored it as is, so everyRequestInformationcreated without one shared a single dict. A path parameter set on one of them reached the others (the adapter writesbaseurlinto it on every request), and theurlsetter'spath_parameters.clear()emptied it under all of them, so one raw-URL request could leave another request's URL as/users//messages. It now defaults toNoneand creates a new dict per instance; a dict that is passed in, as the generated request builders do, is used as is.Related Issue
Fixes #753
Notes
The same default-argument pattern is in a few other signatures (
UrlReplaceHandlerOption,ParametersNameDecodingHandlerOption, thescopes/allowed_hostsarguments of the providers, theadditional_authentication_contextarguments). Kiota does not mutate those itself, so they are left for a follow-up if you want them consistent; details in #753.Testing Instructions
cd packages/abstractions && pytest tests/test_request_information.py: new tests for two instances getting their own dict, a path parameter not reaching another request, and a raw-URL request not clearing another request's parameters (all three fail on main), plus a passed dict being used as is.same dict: False, andthird.urlstayshttps://graph.microsoft.com/v1.0/users/bob/messages.