forked from loafle/openapi-generator-original
Parameter.required flag implemented
Made the "required" flag for Parameter objects available to the code generator templates
This commit is contained in:
parent
053419234a
commit
0aa87cfbeb
@ -4,4 +4,10 @@ public class CodegenParameter {
|
|||||||
public Boolean hasMore = null, isContainer = null, secondaryParam = null;
|
public Boolean hasMore = null, isContainer = null, secondaryParam = null;
|
||||||
public String baseName, paramName, dataType, collectionFormat, description, baseType;
|
public String baseName, paramName, dataType, collectionFormat, description, baseType;
|
||||||
public Boolean isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam;
|
public Boolean isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam;
|
||||||
|
/**
|
||||||
|
* Determines whether this parameter is mandatory. If the parameter is in "path",
|
||||||
|
* this property is required and its value MUST be true. Otherwise, the property
|
||||||
|
* MAY be included and its default value is false.
|
||||||
|
*/
|
||||||
|
public boolean required;
|
||||||
}
|
}
|
@ -636,7 +636,8 @@ public class DefaultCodegen {
|
|||||||
CodegenParameter p = new CodegenParameter();
|
CodegenParameter p = new CodegenParameter();
|
||||||
p.baseName = param.getName();
|
p.baseName = param.getName();
|
||||||
p.description = param.getDescription();
|
p.description = param.getDescription();
|
||||||
|
p.required = param.getRequired();
|
||||||
|
|
||||||
if(param instanceof SerializableParameter) {
|
if(param instanceof SerializableParameter) {
|
||||||
SerializableParameter qp = (SerializableParameter) param;
|
SerializableParameter qp = (SerializableParameter) param;
|
||||||
Property property = null;
|
Property property = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user