Skip to content

Commit 9ca7dbb

Browse files
committed
fix nima
1 parent 1f023ea commit 9ca7dbb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ void writeHandler(boolean requestScoped) {
4141
writer.append(" private void _%s(ServerRequest req, ServerResponse res) {", method.simpleName()).eol();
4242
final var bodyType = method.bodyType();
4343
if (bodyType != null) {
44-
if (useJsonB) {
44+
45+
if (bodyType.equals("InputStream")) {
46+
writer.append(" var %s = req.content().inputStream();", method.bodyName()).eol();
47+
} else if (useJsonB) {
4548
final var fieldName =
4649
method.params().stream()
4750
.filter(MethodParam::isBody)
@@ -60,11 +63,6 @@ void writeHandler(boolean requestScoped) {
6063
final var type = param.utype();
6164

6265
writer.append(" var %s = req.content()", method.bodyName());
63-
64-
if (type.full().startsWith("java.io.InputStream")) {
65-
writer.append(".inputStream();").eol();
66-
return;
67-
}
6866
writer.append(".as(");
6967
if (type.param0() != null) {
7068
writer.append("new io.helidon.common.GenericType<%s>() {}", type.full());

0 commit comments

Comments
 (0)