Skip to content

Commit 25e1e76

Browse files
committed
fixed minor issues
1 parent f61f8ca commit 25e1e76

File tree

1 file changed

+6
-2
lines changed
  • kotlin-asyncapi-ktor/src/main/kotlin/com/asyncapi/kotlinasyncapi/ktor

1 file changed

+6
-2
lines changed

kotlin-asyncapi-ktor/src/main/kotlin/com/asyncapi/kotlinasyncapi/ktor/AsyncApiModule.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,17 @@ class AsyncApiModule(
7070
)
7171
}
7272

73-
private val asyncApiAnnotationExtension: AsyncApiExtension? =
73+
private val asyncApiAnnotationExtension: AsyncApiExtension =
7474
object : AsyncApiExtension {
7575
override val order: Int = -1
76+
private var delegate: AsyncApiExtension? = null
7677

7778
override fun extend(asyncApi: AsyncApi): AsyncApi {
7879
val annotated = annotationProvider.asyncApi ?: return asyncApi
79-
return AsyncApiExtension.from(order = order, resource = annotated).extend(asyncApi)
80+
val extension = delegate ?: AsyncApiExtension.from(order = order, resource = annotated).also {
81+
delegate = it
82+
}
83+
return extension.extend(asyncApi)
8084
}
8185
}
8286

0 commit comments

Comments
 (0)