jooby-project / jooby

The modular web framework for Java and Kotlin
https://jooby.io
Apache License 2.0
1.7k stars 199 forks source link

@Param name attribute is being ignored by MVC APT code generator. #3466

Closed agentgt closed 3 months ago

agentgt commented 3 months ago
@Path("/simple")
public class SimpleController {

    @POST("/test")
    public String post(@Param(value = { ParamSource.QUERY, ParamSource.FORM }, name = "client_id") UUID clientId) {
        return "hello";
    }
}

Notice how clientId is actually "client_id"

Will generate code:

    public String post(io.jooby.Context ctx) {
      return this.factory.apply(ctx).post(ctx.lookup("clientId", io.jooby.ParamSource.QUERY, io.jooby.ParamSource.FORM).to(java.util.UUID.class));
    }

clientId is being used on ctx.lookup

agentgt commented 3 months ago

@jknack Happy to do a PR but because of 4th of July I cannot get a PR till probably next week.