Skip to content

Commit af125b7

Browse files
authored
fix: only import transform namespace if there are modeled operations (#970)
1 parent be453ba commit af125b7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": "598b7088-0032-4336-8aab-3c242876301c",
3+
"type": "bugfix",
4+
"description": "Fix codegen of services with no operations"
5+
}

codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpProtocolClientGenerator.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ abstract class HttpProtocolClientGenerator(
128128

129129
protected open fun importSymbols(writer: KotlinWriter) {
130130
writer.addImport("${ctx.settings.pkg.name}.model", "*")
131-
writer.addImport("${ctx.settings.pkg.name}.transform", "*")
131+
if (TopDownIndex(ctx.model).getContainedOperations(ctx.service).isNotEmpty()) {
132+
writer.addImport("${ctx.settings.pkg.name}.transform", "*")
133+
}
132134

133135
val defaultClientSymbols = setOf(
134136
RuntimeTypes.HttpClient.Operation.SdkHttpOperation,

0 commit comments

Comments
 (0)