kotlindocumentationktorkdoc

Documenting Ktor routes with KDoc


Does anyone know whats the correct way to document Ktor routes, aiming to show it on KDoc? Example:

route(DogoBot.data.API.ROUTE){
    route("token"){
        route("add"){
            get("fromdiscord") { ... }
            get { ... }
        }
    }
    route("user"){
        route("{id}") {
            get { ... }
        }
    }
    route("guild"){
        route("{id}") {
            get { ... }
        }
     }
}

Well, if is it possible, how do I do this? Which type of information should I put in it? How do I implement that Ktor compatibility in other things? (I have another router made by my own for other things)


Solution

  • Dokka has no support for Ktor routes, and I'm not aware of any plans to add such support, so there's no way to include information about routes into the generated documentation.