Skip to content

Commit 363457f

Browse files
authored
Merge pull request #333 from swagger-api/fix_npe
fixed NPE on getRequired boolean value
2 parents a7d33a6 + 57acff6 commit 363457f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/io/swagger/codegen/v3/generators/DefaultCodegenConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation
20412041
// todo: this segment is only to support the "older" template design. it should be removed once all templates are updated with the new {{#contents}} tag.
20422042
formParameter.getVendorExtensions().put(CodegenConstants.IS_FORM_PARAM_EXT_NAME, Boolean.TRUE);
20432043
formParams.add(formParameter.copy());
2044-
if (body.getRequired()) {
2044+
if (body.getRequired() != null && body.getRequired()) {
20452045
requiredParams.add(formParameter.copy());
20462046
}
20472047
allParams.add(formParameter);

0 commit comments

Comments
 (0)