Merge branch 'oas3_support2' of https://github.com/wing328/generate_test into oas3_support2

This commit is contained in:
wing328
2018-04-01 17:57:45 +08:00
8 changed files with 138 additions and 97 deletions

View File

@@ -3942,6 +3942,11 @@ public class DefaultCodegen implements CodegenConfig {
// value => property schema
codegenParameter = fromFormProperty(entry.getKey(), entry.getValue(), imports);
// Set 'required' flag defined in the schema element
if (!codegenParameter.required && schema.getRequired() != null) {
codegenParameter.required = schema.getRequired().contains(entry.getKey());
}
parameters.add(codegenParameter);
}
}