File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
main/java/org/example/web
test/java/org/example/web Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1616
1717 <properties >
1818 <main .class>org.example.myapp.Main</main .class>
19- <jex .version>1.0 </jex .version>
19+ <jex .version>1.2 </jex .version>
2020 <swagger .version>2.0.8</swagger .version>
2121 <jackson .version>2.12.0</jackson .version>
2222 <avaje-http-version >1.3-SNAPSHOT</avaje-http-version >
Original file line number Diff line number Diff line change 44import io .avaje .http .api .Get ;
55import io .avaje .http .api .Path ;
66import io .avaje .http .api .Produces ;
7+ import io .avaje .jex .Context ;
78
89@ Controller
910@ Path ("/" )
1011public class HelloController {
1112
1213 @ Get
1314 HelloDto getHello () {
14- HelloDto dto = new HelloDto ();
15+ HelloDto dto = new HelloDto ();
1516 dto .id = 42 ;
1617 dto .name = "rob" ;
1718 return dto ;
@@ -26,6 +27,12 @@ String getText() {
2627 @ Produces ("text/plain" )
2728 @ Get ("other/{name}" )
2829 String name (String name ) {
29- return "hi " +name ;
30+ return "hi " + name ;
31+ }
32+
33+ @ Produces ("text/plain" )
34+ @ Get ("splat/{name}/*/other/*" )
35+ String splat (String name , Context ctx ) {
36+ return "got name:" + name + " splat0:" + ctx .splat (0 ) + " splat1:" + ctx .splat (1 );
3037 }
3138}
Original file line number Diff line number Diff line change @@ -35,4 +35,9 @@ void getName() {
3535 assertEquals ("hi bazz" , client .request ().path ("other/bazz" ).get ().asString ().body ());
3636 assertEquals ("hi bax" , client .request ().path ("other/bax" ).get ().asString ().body ());
3737 }
38+
39+ @ Test
40+ void splat () {
41+ assertEquals ("got name:one splat0:a/b splat1:x/y/z" , client .request ().path ("splat/one/a/b/other/x/y/z" ).get ().asString ().body ());
42+ }
3843}
You can’t perform that action at this time.
0 commit comments