[FIXED] @PathParam: No value being passed


I’m building a REST api using Quarkus and Kotlin. I’m trying to include a path parameter in my function by using the @PathParam annotation. This is what I have:

    fun getUser(@PathParam userId: UUID) : GetUserResponse =
        try {
            GetUserSuccess(userRepository.find("id", userId))
        } catch (e: NotFoundException) {

Unfortunately I’m getting an error stating that there’s no value being passed for parameter value.

I googled some stuff, and most of what I found is about wrong imports. I double checked that part, but I import the correct one: import javax.ws.rs.*, which also includes the PathParam.

Anyone knows what’s wrong with this?


The answer would be to change it to:

fun getUser(@PathParam("userId") userId : UUID)

Inspirerd by Paul Samsotha’s answer.

Answered By – Ricardo de Vries

Answer Checked By – Cary Denson (Easybugfix Admin)

Leave a Reply

(*) Required, Your email will not be published