Skip to content

Commit add7015

Browse files
committed
Fix NPE & use correct mime for plain text
1 parent 9164b28 commit add7015

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2313,7 +2313,7 @@ public CodegenOperation fromOperation(String path,
23132313
op.isResponseFile = Boolean.TRUE;
23142314
}
23152315
if (Boolean.TRUE.equals(r.isString)
2316-
&& operation.getProduces().contains("plain/text") // otherwise if "application/json" => wrap text with "..", and escape
2316+
&& operation.getProduces() != null && operation.getProduces().contains("text/plain") // otherwise if "application/json" => wrap text with "..", and escape
23172317
&& Boolean.TRUE.equals(r.isDefault)){
23182318
op.isResponseText = Boolean.TRUE;
23192319
}

0 commit comments

Comments
 (0)