Skip to content

Commit

Permalink
Add service and operation names to HandlerExecutionContext
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Yuan committed Sep 13, 2023
1 parent 709b934 commit 0864127
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private void generateClientCommand() {
writer.addImport("Handler", "Handler", TypeScriptDependency.SMITHY_TYPES);
writer.addImport("HandlerExecutionContext", "HandlerExecutionContext", TypeScriptDependency.SMITHY_TYPES);
writer.addImport("MiddlewareStack", "MiddlewareStack", TypeScriptDependency.SMITHY_TYPES);
writer.addImport("SMITHY_CONTEXT_KEY", null, TypeScriptDependency.SMITHY_TYPES);

String name = symbol.getName();

Expand Down Expand Up @@ -357,6 +358,10 @@ private void generateCommandMiddlewareResolver(String configType) {
},
() -> writer.writeInline("(_: any) => _"));
});
writer.openBlock("[SMITHY_CONTEXT_KEY]: {", "},", () -> {
writer.write("service: $S,", service.toShapeId().getName());
writer.write("operation: $S,", operation.toShapeId().getName());
});
});
writer.write("const { requestHandler } = configuration;");
writer.openBlock("return stack.resolve(", ");", () -> {
Expand Down

0 comments on commit 0864127

Please sign in to comment.