Skip to content

Commit fc6a12f

Browse files
committed
fix enum path
1 parent d7a9678 commit fc6a12f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

http-generator-core/src/main/java/io/avaje/http/generator/core/TypeMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public String toMethod() {
315315

316316
@Override
317317
public String asMethod() {
318-
return "java.util.Objects.toString(";
318+
return "asEnum(" + type.shortType() + ".class,";
319319
}
320320
}
321321

tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/test/TestController2.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ String enumQueryImplied(String s, @QueryParam ServerType type) {
4343
return type.name();
4444
}
4545

46+
@Post("/enumPath/{type}")
47+
String enumQueryImplied(ServerType type) {
48+
return type.name();
49+
}
50+
4651
@Get("/mapTest")
4752
String mapTest(Map<String, List<String>> strings) {
4853
return strings.toString();

0 commit comments

Comments
 (0)