Skip to content

Commit 2932882

Browse files
committed
Nima - Fix for String request body when Jsonb present
1 parent 50cc404 commit 2932882

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ void writeHandler(boolean requestScoped) {
4848
if (bodyType != null) {
4949
if ("InputStream".equals(bodyType)) {
5050
writer.append(" var %s = req.content().inputStream();", method.bodyName()).eol();
51+
} else if ("String".equals(bodyType)) {
52+
writer.append(" var %s = req.content().as(String.class);", method.bodyName()).eol();
5153
} else if (useJsonB) {
5254
final String fieldName = fieldNameOfBody();
5355
writer.append(" var %s = %sJsonType.fromJson(req.content().inputStream());", method.bodyName(), fieldName).eol();

0 commit comments

Comments
 (0)