DoNotResolve

annotation class DoNotResolve

Mark an optional parameter to be ignored by dependency resolution

Note, there is no annotation to do the inverse, i.e. actually resolve an optional dependency

class WeirdlyTestedService(
@DoNotResolve private val testMonitorUrl: String? = null
)

val context = resolveDependencies(
// if the @DoNotResolve above is removed, this throws an exception
WeirdlyTestedService::class
)