Repository navigation
fix: omit unused Dart composed discriminator imports - #8346
Vincent Biret (baywet) merged 3 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The targeted change reuses established filtering behavior and includes coverage for composed and inherited models.
Review effort: Balanced
Findings: None
What changed in this PR
Updates Dart refinement to avoid invalid, unused discriminator imports in composed wrappers.
Changes:
- Disables discriminator-mapping imports for Dart composed types.
- Adds union, intersection, and inheritance regression coverage.
- Documents the fix for #7821.
| File | Description |
|---|---|
src/Kiota.Builder/Refiners/DartRefiner.cs |
Applies the composed-type import filter. |
tests/Kiota.Builder.Tests/Refiners/DartLanguageRefinerTests.cs |
Verifies retained and omitted imports. |
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.
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
5f8029f
|
Conflicts have been resolved. A maintainer will take a look shortly. |
There was a problem hiding this comment.
🟢 Approval recommended
The targeted change matches Dart factory behavior and includes coverage for all affected composition cases.
0 open findings
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Fixes #7821.
This addresses the missing model import reported as error type 4. Dart composed wrappers import every discriminator mapping even though their factories use their member types. In the GitHub contents response this adds an unused import of a model that was pruned, causing Dart analysis to fail with
uri_does_not_exist.Opt Dart into the shared helper's existing composed-type import filter, as Java already does. Member imports, inherited-model discriminator imports, and ParseNode correction remain covered by three refiner cases. This changes import hygiene without changing discriminator selection.
Merged current
main(b6f532aee) to resolve conflicts, preserving upstream changes and the focused three-file contribution.Validation of
5f8029f8eb42c2d91bef29a5c67aff44c9afebd4: