Skip to content

fix(abstractions): give each RequestInformation its own path_parameters dict - #754

Merged
Vincent Biret (baywet) merged 2 commits into
microsoft:mainfrom
HardMax71:fix/request-information-own-path-parameters
Sep 25, 2026
Merged

Vincent Biret (baywet) merged 2 commits into
microsoft:mainfrom
HardMax71:fix/request-information-own-path-parameters

Conversation

@HardMax71

Copy link
Copy Markdown
Contributor

Overview

RequestInformation.__init__ defaulted path_parameters to a dict literal and stored it as is, so every RequestInformation created without one shared a single dict. A path parameter set on one of them reached the others (the adapter writes baseurl into it on every request), and the url setter's path_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 to None and 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, the scopes / allowed_hosts arguments of the providers, the additional_authentication_context arguments). 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.
  • Full abstractions package: 145 passed; yapf, isort, mypy and pylint (10/10) clean. The http package's tests pass against it (156).
  • The repro in RequestInformation shares one path_parameters dict between instances created without one #753 against this branch: same dict: False, and third.url stays https://graph.microsoft.com/v1.0/users/bob/messages.

…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.
Copilot AI lite review requested due to automatic review settings September 25, 2026 15:03
@HardMax71
Max Azatian (HardMax71) requested a review from a team as a code owner September 25, 2026 15:03

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@HardMax71 Max Azatian (HardMax71) changed the title fix(abstractions): give each RequestInformation its own ath_parameters dict fix(abstractions): give each RequestInformation its own path_parameters dict Sep 25, 2026
@sonarqubecloud

Copy link
Copy Markdown

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.

Copilot review overview

🟢 Approval recommended

No unresolved issues were identified.

Review effort: Lite
Findings: None

@baywet
Vincent Biret (baywet) merged commit e336ff8 into microsoft:main Sep 25, 2026
54 checks passed
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.

RequestInformation shares one path_parameters dict between instances created without one

3 participants