since extension functions aren't allowed on enum entry names, what is the better approach to implement this?
@Suppress("EnumEntryName")
enum class ConfigUri(val raw: String) {
login("/login"),
logout("/logout"),
register("/register"),
verify("/verify/{hash}"),
reset1("/reset"),
reset2("/reset/{hash}")
;
fun verify.build(hash: String): String = raw.replace("{hash}", hash)
}
in the endpoints where I declare the GET / POST handlers, I want to be able to do
GET(ConfigUri.login.raw)
and in places where I need to fill in the hashes for example when sending out an email with a verify link, I want to be able to do
ConfigUri.verify.build(hash = generatedRandomHash)
to generate something like
/verify/12344-1324234-sdfsdfs