Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.asyncapi.kotlinasyncapi.context.service.AsyncApiSerializer
import com.asyncapi.kotlinasyncapi.context.service.AsyncApiService
import com.asyncapi.kotlinasyncapi.context.service.DefaultAsyncApiSerializer
import com.asyncapi.kotlinasyncapi.context.service.DefaultAsyncApiService
import com.asyncapi.kotlinasyncapi.model.AsyncApi

class AsyncApiModule(
environment: ApplicationEnvironment,
Expand Down Expand Up @@ -69,8 +70,15 @@ class AsyncApiModule(
)
}

private val asyncApiAnnotationExtension =
annotationProvider.asyncApi?.let { AsyncApiExtension.from(order = -1, it) }
private val asyncApiAnnotationExtension: AsyncApiExtension? =
object : AsyncApiExtension {
override val order: Int = -1

override fun extend(asyncApi: AsyncApi): AsyncApi {
val annotated = annotationProvider.asyncApi ?: return asyncApi
return AsyncApiExtension.from(order = order, resource = annotated).extend(asyncApi)
}
}

private val scriptResourceProvider =
runCatching {
Expand Down
Loading