Skip to content

Commit 56a811e

Browse files
committed
Include optional dependencies on 'eventstream' and 'json' for smithy-aws-core when necessary
1 parent cf8840c commit 56a811e

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

codegen/core/src/main/java/software/amazon/smithy/python/codegen/ClientGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ raise ExpectationNotMetError("protocol and transport MUST be set on the config t
222222
private void generateEventStreamOperation(PythonWriter writer, OperationShape operation) {
223223
writer.pushState(new OperationSection(service, operation));
224224
writer.addDependency(SmithyPythonDependency.SMITHY_CORE);
225-
writer.addDependency(SmithyPythonDependency.SMITHY_AWS_EVENT_STREAM);
225+
writer.addDependency(SmithyPythonDependency.SMITHY_AWS_CORE.withOptionalDependencies("eventstream"));
226226
var operationSymbol = symbolProvider.toSymbol(operation);
227227
writer.putContext("operation", operationSymbol);
228228
var operationMethodSymbol = operationSymbol.expectProperty(OPERATION_METHOD);

codegen/core/src/main/java/software/amazon/smithy/python/codegen/integrations/RestJsonProtocolGenerator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ public ApplicationProtocol getApplicationProtocol(GenerationContext context) {
8383

8484
@Override
8585
public void initializeProtocol(GenerationContext context, PythonWriter writer) {
86-
writer.addDependency(SmithyPythonDependency.SMITHY_AWS_CORE);
87-
writer.addDependency(SmithyPythonDependency.SMITHY_JSON);
86+
writer.addDependency(SmithyPythonDependency.SMITHY_AWS_CORE.withOptionalDependencies("json"));
8887
writer.addImport("smithy_aws_core.aio.protocols", "RestJsonClientProtocol");
8988
var serviceSymbol = context.symbolProvider().toSymbol(context.settings().service(context.model()));
9089
var serviceSchema = serviceSymbol.expectProperty(SymbolProperties.SCHEMA);

0 commit comments

Comments
 (0)