Skip to content

Javalin 4 path variable switched from ':param' to '{param}' #67

@ponyjoy

Description

@ponyjoy

Javalin version 4.1.1
avaje-http-javalin-generator 1.11
Controller code like this:

    @Get("/movie/{id}")
    public void movie(Context ctx, Integer id){
       ....
    }

avaje-http-javalin-generator generate route

 ApiBuilder.get("/movie/:id", ctx -> {
     ctx.status(200);
     Integer id = asInteger(ctx.pathParam("id"));
     controller.movie(ctx, id);
   });

so I got exception
Exception in thread "main" java.lang.IllegalArgumentException: Path '/api/v1/movie/:id' invalid - Javalin 4 switched from ':param' to '{param}'.
at io.javalin.core.PathParser.(PathParser.kt:15)
at io.javalin.http.HandlerEntry.(PathMatcher.kt:19)
at io.javalin.http.JavalinServlet.addHandler(JavalinServlet.kt:114)
....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions