Skip to content

Commit

Permalink
fix: only import transform namespace if there are modeled operations (
Browse files Browse the repository at this point in the history
  • Loading branch information
lauzadis authored Oct 4, 2023
1 parent be453ba commit af125b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/598b7088-0032-4336-8aab-3c242876301c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "598b7088-0032-4336-8aab-3c242876301c",
"type": "bugfix",
"description": "Fix codegen of services with no operations"
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ abstract class HttpProtocolClientGenerator(

protected open fun importSymbols(writer: KotlinWriter) {
writer.addImport("${ctx.settings.pkg.name}.model", "*")
writer.addImport("${ctx.settings.pkg.name}.transform", "*")
if (TopDownIndex(ctx.model).getContainedOperations(ctx.service).isNotEmpty()) {
writer.addImport("${ctx.settings.pkg.name}.transform", "*")
}

val defaultClientSymbols = setOf(
RuntimeTypes.HttpClient.Operation.SdkHttpOperation,
Expand Down

0 comments on commit af125b7

Please sign in to comment.