Sergey Akhapkin
03/25/2020, 11:29 PM@KtorExperimentalLocationsAPI
@Location("/auth")
object Auth {
@Location("/phone")
object ByPhone {
@Location("/confirm")
object Confirmation
}
}
and I've a simple test:
@Test
fun authLocationsTest() {
withTestApplication {
assertEquals("/auth", application.locations.href(Auth))
assertEquals("/auth/phone", application.locations.href(Auth.ByPhone))
assertEquals("/auth/phone/confirm", application.locations.href(Auth.ByPhone.Confirmation))
}
}
which is failed with:
Expected :/auth/phone/confirm
Actual :/phone/confirm
Is that expected behavior and somehow related to https://github.com/ktorio/ktor/issues/1660 or I should file a bug report ?@KtorExperimentalLocationsAPI
@Location("/auth")
object Auth {
@Location("/phone")
object ByPhone {
@Location("/confirm")
class Confirmation(val byPhone: ByPhone = ByPhone)
}
}
this code (plus expected changes to test) works as expected. Perhaps it should be reflected better in documentation then.