Skip to content

Commit 1e7e865

Browse files
committed
Use map for hash wildcard expressions
1 parent f022101 commit 1e7e865

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParameterFinder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,17 @@ public Map<String, String> getOperationContextParamValues(OperationShape operati
187187
if (part.endsWith("[*]")) {
188188
// Get key to run hash wildcard on.
189189
String key = part.substring(0, part.length() - 3);
190-
value = "Object.values(" + value + separator + key + ")";
190+
value = value + separator + key + separator + "map(obj => obj";
191191
continue;
192192
}
193193

194194
// Treat remaining part as identifier without spaces https://jmespath.org/specification.html#identifiers
195195
value += separator + part;
196196
}
197197

198+
// Close all open brackets.
199+
value += ")".repeat((int) value.chars().filter(ch -> ch == '(').count());
200+
198201
map.put(name, value);
199202
});
200203
}

0 commit comments

Comments
 (0)