2

I am setting up Koin DI on Ktor in this way:

But I am getting an error: No value passed for parameter 'clazz'

My implementation looks like this:

import io.ktor.application.*
import io.ktor.routing.*
import org.koin.java.KoinJavaComponent.inject
import services.SomeService

fun Application.registerPropertyRoutes() {
    routing {
        bodySectionRoute() // add more routes for Property page here
    }
}

fun Route.bodySectionRoute() {
    val someService by inject<SomeService>()

    get("/bodySection") {
        // business logic can be connected here
    }
}

Any ideas what I am missing?

Update:

enter image description here

FailedUnitTest
  • 1,637
  • 3
  • 20
  • 43

1 Answers1

1

You need to import org.koin.ktor.ext.inject

DragneelFPS
  • 453
  • 4
  • 12