https://kotlinlang.org logo
Title
h

hmole

03/11/2020, 1:47 PM
Can someone explain why this simple
Location
stops workingif I add an optional "packaging" parameter which is supposed to come from query? Uncommenting packaging property makes this location 404, works otherwise. Is there another hidded knowledge when attempting to work with locations besides incorrect imports? Ktor version is 1.1.2
@Location(path = "{artifact}/{version}")
  data class Request(
    val artifact: String,
    val version: String/*,
    val packaging: String*/
  )

  fun Application.init() {
    routing {
      route("myRoute") {
        get <Request> { request -> call.respond("") }
        head<Request> { request -> call.respond("") }
      }
    }
  }
e

Evan R.

03/11/2020, 8:31 PM
Does this occur on newer versions of Ktor? You’re 2 minor versions behind
Also, does the location still 404 if you actually provide a value for the
packaging
query param?