Skip to content

Commit

Permalink
Update JexAdapter.java
Browse files Browse the repository at this point in the history
  • Loading branch information
SentryMan committed Dec 8, 2024
1 parent 87fb971 commit 4b06090
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.avaje.http.generator.core.ControllerReader;
import io.avaje.http.generator.core.ParamType;
import io.avaje.http.generator.core.PlatformAdapter;
import io.avaje.http.generator.core.ProcessingContext;
import io.avaje.http.generator.core.UType;

class JexAdapter implements PlatformAdapter {
Expand All @@ -32,13 +33,14 @@ public boolean isBodyMethodParam() {
public String bodyAsClass(UType type) {

if ("java.io.InputStream".equals(type.full())) {
return "ctx.bodyInputStream()";
return "ctx.bodyAsInputStream()";
} else if ("java.lang.String".equals(type.full())) {
return "ctx.body()";
} else if ("byte[]".equals(type.full())) {
return "ctx.bodyAsBytes()";
} else if (ProcessingContext.useJsonb()) {
return type.shortName() + "JsonType.fromJson(ctx.bodyAsInputStream())";
}

return "ctx.bodyAsClass(" + type.mainType() + ".class)";
}

Expand Down

0 comments on commit 4b06090

Please sign in to comment.