Commit c393dde
fixup: drop dead Array-kind branch, add import-from-mapping fallback tests
Address review feedback on the import-mapping single-vs-list fallback.
M1 — drop the `Kind == "Array"` branch from both fallback sites.
parseImportMappingElement only ever produces `Kind: "Object"` or
`Kind: "Value"` (any other `$Type` falls through to `default: return
nil` and the nil element is never appended). The Array branch was
unreachable from real MPR data, and the matching test asserted a state
the parser cannot produce. Repetition for the list-vs-singleton call
now comes purely from MaxOccurs ( -1 or > 1 ).
m3 — add the missing `im.Elements[0] != nil` guard before the
pre-existing entity lookup, matching the guard added two lines above.
M2 — two new tests for `addImportFromMappingAction` cover the
message-definition / XML-schema fallback path:
- `TestAddImportFromMappingFallsBackToImportMappingRootForListResult`
pins the Object root with MaxOccurs=-1 → list-typed result
- `TestAddImportFromMappingFallsBackToImportMappingRootForSingleObject`
pins the Object root with MaxOccurs=1 → singleton
The dead `TestAddRestCallAction_MappingFallsBackToArrayKindWhenJsonStructureMissing`
test is removed alongside the Array branch it exercised.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f30bd4c commit c393dde
3 files changed
Lines changed: 71 additions & 49 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1047 | 1047 | | |
1048 | 1048 | | |
1049 | 1049 | | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1055 | 1059 | | |
1056 | | - | |
| 1060 | + | |
1057 | 1061 | | |
1058 | 1062 | | |
1059 | 1063 | | |
| |||
1362 | 1366 | | |
1363 | 1367 | | |
1364 | 1368 | | |
1365 | | - | |
| 1369 | + | |
1366 | 1370 | | |
1367 | 1371 | | |
1368 | 1372 | | |
1369 | | - | |
| 1373 | + | |
1370 | 1374 | | |
1371 | 1375 | | |
1372 | 1376 | | |
| |||
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
43 | 102 | | |
44 | 103 | | |
45 | 104 | | |
| |||
Lines changed: 0 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
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 | | - | |
155 | | - | |
156 | 115 | | |
157 | 116 | | |
158 | 117 | | |
| |||
0 commit comments