forked from loafle/openapi-generator-original
Minor fix to body parameter in required parameter list (#6885)
* minor fix to required parameter list * better if then else block
This commit is contained in:
parent
cd1c2b13e3
commit
37184a1cd8
@ -2227,17 +2227,7 @@ public class DefaultCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
// set isPrimitiveType and baseType for allParams
|
||||
/*if (languageSpecificPrimitives.contains(p.baseType)) {
|
||||
p.isPrimitiveType = true;
|
||||
p.baseType = getSwaggerType(p);
|
||||
}*/
|
||||
|
||||
|
||||
allParams.add(p);
|
||||
if (p.required || p.isBodyParam) {
|
||||
requiredParams.add(p.copy());
|
||||
}
|
||||
// Issue #2561 (neilotoole) : Moved setting of is<Type>Param flags
|
||||
// from here to fromParameter().
|
||||
if (param instanceof QueryParameter) {
|
||||
@ -2257,7 +2247,10 @@ public class DefaultCodegen {
|
||||
} else if (param instanceof FormParameter) {
|
||||
formParams.add(p.copy());
|
||||
}
|
||||
if (!p.required) {
|
||||
|
||||
if (p.required) { //required parameters
|
||||
requiredParams.add(p.copy());
|
||||
} else { // optional parameters
|
||||
op.hasOptionalParams = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user