Skip to content

fix: qualify shadowed Dart deserializer fields - #8233

Merged
Vincent Biret (baywet) merged 6 commits into
microsoft:mainfrom
Shubham-Padkonde:fix/dart-deserializer-field-shadowing
Sep 22, 2026
Merged

Vincent Biret (baywet) merged 6 commits into
microsoft:mainfrom
Shubham-Padkonde:fix/dart-deserializer-field-shadowing

Conversation

@Shubham-Padkonde

@Shubham-Padkonde Shubham Padkonde (Shubham-Padkonde) commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7822.

Dart deserializer lambdas assign to the wrong variable when a model property is named node (the lambda parameter) or deserializerMap (the local map). Qualify these two field assignments with this.; other generated assignments remain unchanged.

Four writer regression cases cover both names with and without inheritance. All four fail before the change. A reduced OpenAPI document with a nested object named node, a string named deserializerMap, and an ordinary control field generates two Dart analyzer errors before the fix.

Validation:

  • Full builder suite: 2,353 passed, two skipped.
  • Generator builds for .NET 8, 9 and 10 (existing WSL worktree SourceLink warnings).
  • Generated reduced client: Dart 3.13.4 analyzer reports no issues; JSON deserialization preserves the nested child, shadowed string and ordinary control field. These external checks use the repository integration-test dependencies.

Changed C# files pass dotnet format --verify-no-changes.

Developed with Codex assistance. Generated-code checks use a reduced reproduction of the reported collision, not the entire Meraki API. No live API calls were made.

Integration follow-up

Enabling the Meraki Dart integration exposed an override member/annotation collision. The existing Dart reserved-name escaping now renames that member to override_ while preserving its JSON key. The regression fails before the fix and passes afterward; 78 targeted Dart tests pass. The full current Meraki client generates and passes Dart 3.13.4 analysis with no issues. Hosted CI still needs to run on the latest head. Follow-up prepared with Codex assistance.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The targeted fix and regression coverage have no unresolved blocking issues.

Review effort: Lite
Findings: None

What changed in this PR

Fixes Dart deserializer field shadowing for properties named node or deserializerMap.

Changes:

  • Qualifies conflicting assignments with this..
  • Adds regression coverage for inheritance and non-inheritance cases.
  • Documents the fix in the changelog.
File Description
tests/​Kiota.Builder.Tests/​Writers/​Dart/​CodeMethodWriterTests.cs Adds regression coverage.
src/​Kiota.Builder/​Writers/​Dart/​CodeMethodWriter.cs Fixes generated deserializer assignments.
CHANGELOG.md Records the Dart fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@baywet

Copy link
Copy Markdown
Member

Shubham Padkonde (@Shubham-Padkonde) your behaviour is disruptive, opening about 30 PRs on the repos in a couple of hours time, most likely code that was AI generated and not tested/reviewed, will only clog our review pipeline. Please stop opening additional pull requests and work on the comments added to existing ones. We have turned on pull requests limits on this repository, and will proceed to blocking you at the organization level if additional pull requests are opened on other repositories before the already opened ones are reviewed and closed/or merged.

Copilot AI review requested due to automatic review settings September 21, 2026 16:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@baywet

Copy link
Copy Markdown
Member

Shubham Padkonde (@Shubham-Padkonde) can you remove the corresponding suppressions from it/config.json as well please?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@Shubham-Padkonde

Copy link
Copy Markdown
Contributor Author

Removed the Meraki Dart suppression for #7822 from it/config.json in 7f34a2b. The unrelated Go suppression for #7828 remains. Validated with it/get-is-suppressed.ps1: Dart returns false and Go returns true; git diff --check passes. The full Meraki Dart integration run has not been rerun locally in this configuration-only update.

Prepared with Codex assistance.

Copilot AI review requested due to automatic review settings September 21, 2026 19:53
auto-merge was automatically disabled September 21, 2026 19:53

Head branch was pushed to by a user without write access

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@Shubham-Padkonde

Copy link
Copy Markdown
Contributor Author

The newly enabled Meraki Dart job exposed another name collision: a model property named override hides the annotation, producing 18 undefined_annotation errors across six generated models. The original node shadowing error is gone.

Fixed in a2b72c6 using the existing Dart reserved-name escaping: the member becomes override_, while its JSON name remains override. The suppression stays removed.

Validation:

  • New refiner regression fails before the change and passes afterward, including JSON wire-name preservation.
  • All 78 targeted Dart refiner/method-writer tests pass; .NET 10 build succeeds without warnings.
  • Generated the complete current Meraki spec and analyzed the whole Dart lib with Dart 3.13.4 and the repository integration dependencies: No issues found.
  • Scoped formatting and whitespace checks pass (formatter reports workspace-loading warnings).

I also inspected the other error-bearing jobs in the run. They remain covered by existing per-language/API suppressions, including Meraki Go, Notion, Graph Beta, Stripe and Twitter combinations; I have not removed or expanded those suppressions. The separate surface-area comment jobs report missing optional artifacts but conclude successfully.

Please rerun the integration workflow on the updated head when convenient. These are local validation results, not a claim that the new hosted run has passed. Prepared with Codex assistance.

Copilot AI review requested due to automatic review settings September 22, 2026 01:35
@Shubham-Padkonde

Copy link
Copy Markdown
Contributor Author

Merged current main (c1bf067) and resolved the changelog conflict by preserving both the Dart entry and the newly merged Java entry. The Dart code fix and removed Meraki suppression remain intact.

Validation: .NET build succeeds with zero warnings/errors; all 78 targeted Dart refiner and method-writer tests pass; whitespace checks pass. Hosted integration results on this merge commit are not yet verified.

Prepared with Codex assistance.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Copilot AI review requested due to automatic review settings September 22, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The reviewed changes include regression coverage and no unresolved blocking issues.

Review effort: Lite
Findings: None

@baywet
Vincent Biret (baywet) added this pull request to the merge queue Sep 22, 2026
Merged via the queue into microsoft:main with commit 8f7ac42 Sep 22, 2026
313 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dart] variable name conflict for MERAKI.COM

3 participants