Commit 26eb3f0
committed
Fix dart-dio webhook imports generating Map-style strings (issue #22586)
Webhook operations were generating broken import statements with Map-style
representation and HTML entity encoding:
import '{import=model.Pet, classname=Pet}';
Instead of proper Dart package imports:
import 'package:my-package/src/model/pet.dart';
This occurred because DartDioClientCodegen.postProcessOperationsWithModels()
applied import processing to regular operations, but postProcessWebhooksWithModels()
was missing the same logic.
Fix:
- Extracted shared import processing logic into processImports() method
- Added postProcessWebhooksWithModels() override to apply same logic
- Both operations and webhooks now use consistent import generation
Test:
- Added verifyWebhookImports() test using existing webhooks.yaml resource
- Verifies generated code does not contain Map-style imports
- Verifies generated code does not contain HTML entity encoding1 parent 570915e commit 26eb3f0
2 files changed
Lines changed: 58 additions & 5 deletions
File tree
- modules/openapi-generator/src
- main/java/org/openapitools/codegen/languages
- test/java/org/openapitools/codegen/dart/dio
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
649 | 650 | | |
650 | 651 | | |
651 | 652 | | |
652 | | - | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
653 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
654 | 672 | | |
655 | 673 | | |
656 | 674 | | |
| |||
687 | 705 | | |
688 | 706 | | |
689 | 707 | | |
690 | | - | |
| 708 | + | |
691 | 709 | | |
692 | 710 | | |
693 | 711 | | |
| |||
729 | 747 | | |
730 | 748 | | |
731 | 749 | | |
732 | | - | |
733 | | - | |
734 | | - | |
| 750 | + | |
735 | 751 | | |
736 | 752 | | |
737 | 753 | | |
| |||
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
118 | 155 | | |
0 commit comments