kotlin-server.libraries.ktor.Paths.kt.mustache Maven / Gradle / Ivy
{{>licenseInfo}}
package {{packageName}}
import io.ktor.application.ApplicationCall
import io.ktor.http.HttpMethod
import io.ktor.locations.*
import io.ktor.pipeline.PipelineContext
import io.ktor.routing.Route
import io.ktor.routing.method
import {{modelPackage}}.*
{{#imports}}
import {{import}}
{{/imports}}
// NOTE: [email protected] is missing extension for Route.delete. This includes it.
inline fun Route.delete(noinline body: suspend PipelineContext.(T) -> Unit): Route {
return location(T::class) {
method(HttpMethod.Delete) {
handle(body)
}
}
}
{{#apiInfo}}
object Paths {
{{#apis}}
{{#operations}}
{{#operation}}
{{^bodyAllowed}}
/**
* {{summary}}
* {{#unescapedNotes}}{{.}}{{/unescapedNotes}}
{{#allParams}}* @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}*/
@Location("{{path}}") class {{operationId}}({{#allParams}}val {{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{{/bodyAllowed}}
{{/operation}}
{{/operations}}
{{/apis}}
}
{{/apiInfo}}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy