From 2f4e4f87ac9ec15ba96b6f2787a3079246edc993 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:34:22 +0000 Subject: [PATCH] Populate memberName as contextParams value --- .../amazon/smithy/typescript/codegen/CommandGenerator.java | 4 ++-- .../codegen/endpointsV2/RuleSetParameterFinder.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CommandGenerator.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CommandGenerator.java index 02388f69619..babd90a12a0 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CommandGenerator.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CommandGenerator.java @@ -291,11 +291,11 @@ private void generateEndpointParameterInstructionProvider() { }); Shape operationInput = model.getShape(operation.getInputShape()).get(); - parameterFinder.getContextParams(operationInput).forEach((name, type) -> { + parameterFinder.getContextParams(operationInput).forEach((name, memberName) -> { if (!paramNames.contains(name)) { writer.write( "$L: { type: \"contextParams\", name: \"$L\" },", - name, name); + name, memberName); } paramNames.add(name); }); diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParameterFinder.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParameterFinder.java index a76ad95d6be..93d9d4fb3b9 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParameterFinder.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParameterFinder.java @@ -122,7 +122,7 @@ public Map getContextParams(Shape operationInput) { String name = contextParamTrait.getName(); map.put( name, - "unknown" + member.getMemberName() ); } });