Skip to content

Commit 85791e9

Browse files
committed
add custom Content-Types to nima
1 parent 8fc3fa2 commit 85791e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ private void writeContextReturn() {
166166
case APPLICATION_JSON -> writer.append(contentTypeString + "APPLICATION_JSON);").eol();
167167
case TEXT_HTML -> writer.append(contentTypeString + "TEXT_HTML);").eol();
168168
case TEXT_PLAIN -> writer.append(contentTypeString + "TEXT_PLAIN);").eol();
169-
case UNKNOWN -> writer.append(contentTypeString + "create(\"%s\"));", produces).eol();
169+
case UNKNOWN -> writer
170+
.append(contentTypeString + "create(\"%s\"));", producesOp.orElse("UNKNOWN"))
171+
.eol();
170172
}
171173
}
172174

0 commit comments

Comments
 (0)