Skip to content

Commit 70ffe31

Browse files
committed
add bytes test
1 parent ef8bae4 commit 70ffe31

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

http-generator-nima/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public void writeJsonBTypeFields() {
141141
param ->
142142
writer
143143
.append(
144-
" private final JsonType<%s> %sMethodBodyJsonType;",
144+
" private final JsonType<%s> %sBodyJsonType;",
145145
param.getUType().full(), methodReader.simpleName())
146146
.eol());
147147
}

tests/test-nima-jsonb/src/main/java/org/example/HelloController.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,35 @@
22

33
import io.avaje.http.api.Controller;
44
import io.avaje.http.api.Get;
5+
import io.avaje.http.api.Post;
6+
import io.avaje.http.api.Produces;
57

68
@Controller
79
public class HelloController {
810

11+
@Produces("image/png")
12+
@Get("/get")
13+
byte[] testBytes() {
14+
15+
return "not really an image but ok".getBytes();
16+
}
17+
918
@Get("hello")
1019
String helloWorld() {
1120
return "Hello world";
1221
}
1322

1423
@Get("person/{name}/{sortBy}")
1524
Person person(String name, String sortBy) {
16-
var p = new Person();
25+
final var p = new Person();
1726
p.setId(42);
1827
p.setName(name + " hello" + " sortBy:" + sortBy);
1928
return p;
2029
}
30+
31+
@Post("person/update")
32+
String add(Person newGuy) {
33+
34+
return "New Guy Added";
35+
}
2136
}

0 commit comments

Comments
 (0)