Commit a1268fb
fix: infer SingleObject from import mapping root when JsonStructure absent
addRestCallAction and addImportFromMappingAction decide whether the
mapping result is a single object or a list by looking up the JSON
structure the import mapping references. For mappings backed by an XML
schema or message definition the mapping has no JsonStructure, so the
JSON-structure lookup short-circuits and SingleObject defaults to false
(REST) or stays true (import-from-mapping). When the authored mapping
is rooted on an Object, the resulting BSON ResultHandling type
(ListType vs ObjectType) and Range.SingleObject flag mismatch the
microflow's ObjectType return, surfacing as CE0117 "Error in
expression" at the End event (and CE0019/CE0136/CE0243 cascades on any
downstream retrieve over the misclassified variable).
Fall back to the import mapping's own root element kind when
JsonStructure is empty: ImportMappingElement.Kind is "Object", "Array",
or "Value" — Studio Pro authors it the same way for both JSON-backed
and schema/message-definition mappings, so a single source of truth at
the mapping's first element correctly recovers the shape for both code
paths.
Two regression tests cover the new fallback (Object → SingleObject=true,
Array → SingleObject=false) using synthetic Module.Mapping names; the
existing JSON-structure-driven test still asserts the prior path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f96a037 commit a1268fb
2 files changed
Lines changed: 124 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1025 | 1025 | | |
1026 | 1026 | | |
1027 | 1027 | | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1031 | 1035 | | |
1032 | 1036 | | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1038 | 1046 | | |
1039 | 1047 | | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1040 | 1053 | | |
1041 | 1054 | | |
1042 | 1055 | | |
| |||
1318 | 1331 | | |
1319 | 1332 | | |
1320 | 1333 | | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
1321 | 1337 | | |
1322 | 1338 | | |
1323 | 1339 | | |
| 1340 | + | |
1324 | 1341 | | |
1325 | 1342 | | |
1326 | 1343 | | |
1327 | 1344 | | |
1328 | 1345 | | |
1329 | 1346 | | |
1330 | 1347 | | |
| 1348 | + | |
1331 | 1349 | | |
1332 | 1350 | | |
1333 | 1351 | | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1334 | 1355 | | |
1335 | 1356 | | |
1336 | 1357 | | |
| |||
Lines changed: 95 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 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 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 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 | + | |
61 | 156 | | |
62 | 157 | | |
63 | 158 | | |
| |||
0 commit comments