org.http4k.contract.openapi.ext.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http4k-contract Show documentation
Show all versions of http4k-contract Show documentation
http4k typesafe HTTP contracts and OpenApi support
package org.http4k.contract.openapi
import org.http4k.contract.ContractRoute
import org.http4k.contract.PathSegments
fun ContractRoute.operationId(contractRoot: PathSegments) =
meta.operationId ?: method.name.toLowerCase() + describeFor(contractRoot)
.split('/').joinToString("") { it.capitalize() }.replace('{', '_').replace('}', '_').trimEnd('_')