KtorGenFunction

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class KtorGenFunction(val generate: Boolean = true, val customHeader: String = "")(source)

Indicates that a method within a @KtorGen-annotated interface should participate in code generation.

Example

interface UserRoutes {
@GET("/users")
suspend fun getUsers(): List<User>

@KtorGenFunction(generate = false)
@JvmSynthetic
@ExperimentalApi
fun getUsersBlocking(): List<User> = runBlocking { getUsers() }
}

In the above example, the getUsersBlocking function will not be overridden by KtorGen.

See also

Properties

Link copied to clipboard

Custom KDoc comment for the generated implementation class.

Link copied to clipboard
val generate: Boolean = true

Indicate the annotated function going to generate the code or not.