tag

Applies a tag to all children of this route. Parameter tag should be an enum that inherits from APITag, check APITag description for an explanation.

Return

the same route that received the call to chain multiple calls

Parameters

tag

the tag to apply


inline fun <TRoute : OpenAPIRoute<TRoute>> TRoute.tag(tag: APITag, crossinline fn: TRoute.() -> Unit)(source)

This method assigns an OpenAPI tag too all child routes defined inside fn. Parameter tag should be an enum that inherits from APITag, check APITag description for an explanation.

Usage example:

// Defined tags enum class Tags(override val description: String) : APITag { EXAMPLE("Wow this is a tag?!") }

... apiRouting { route("examples") { tag(Tags.EXAMPLE) { // <-- Applies the tag here route("getTextData").get { params -> respond(StringResponse(params.a)) } // Multiple routes can be specified here } } } ...

Parameters

tag

the tag to apply

fn

the block where the sub routes are defined