forked from loafle/openapi-generator-original
fix 2.0 spec exception, fix NPE with Parameter
This commit is contained in:
@@ -197,16 +197,6 @@
|
||||
<diffutils-version>1.3.0</diffutils-version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.5.18</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-core</artifactId>
|
||||
<version>1.5.18</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
|
||||
@@ -343,5 +343,128 @@ public class CodegenParameter {
|
||||
result = 31 * result + (multipleOf != null ? multipleOf.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
public boolean getSecondaryParam() {
|
||||
return secondaryParam;
|
||||
}
|
||||
|
||||
public String getBaseName() {
|
||||
return baseName;
|
||||
}
|
||||
|
||||
public String getParamName() {
|
||||
return paramName;
|
||||
}
|
||||
|
||||
public String getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public String getDatatypeWithEnum() {
|
||||
return datatypeWithEnum;
|
||||
}
|
||||
|
||||
public String getDataFormat() {
|
||||
return dataFormat;
|
||||
}
|
||||
|
||||
public String getCollectionFormat() {
|
||||
return collectionFormat;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getUnescapedDescription() {
|
||||
return unescapedDescription;
|
||||
}
|
||||
|
||||
public String getBaseType() {
|
||||
return baseType;
|
||||
}
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public String getEnumName() {
|
||||
return enumName;
|
||||
}
|
||||
|
||||
public String getExample() {
|
||||
return example;
|
||||
}
|
||||
|
||||
public String getJsonSchema() {
|
||||
return jsonSchema;
|
||||
}
|
||||
|
||||
public boolean getIsNotFile() {
|
||||
return notFile;
|
||||
}
|
||||
|
||||
public List<String> get_enum() {
|
||||
return _enum;
|
||||
}
|
||||
|
||||
public Map<String, Object> getAllowableValues() {
|
||||
return allowableValues;
|
||||
}
|
||||
|
||||
public CodegenProperty getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public Map<String, Object> getVendorExtensions() {
|
||||
return vendorExtensions;
|
||||
}
|
||||
|
||||
public boolean getRequired() {
|
||||
return required;
|
||||
}
|
||||
|
||||
public String getMaximum() {
|
||||
return maximum;
|
||||
}
|
||||
|
||||
public boolean getExclusiveMaximum() {
|
||||
return exclusiveMaximum;
|
||||
}
|
||||
|
||||
public String getMinimum() {
|
||||
return minimum;
|
||||
}
|
||||
|
||||
public boolean getExclusiveMinimum() {
|
||||
return exclusiveMinimum;
|
||||
}
|
||||
|
||||
public Integer getMaxLength() {
|
||||
return maxLength;
|
||||
}
|
||||
|
||||
public Integer getMinLength() {
|
||||
return minLength;
|
||||
}
|
||||
|
||||
public String getPattern() {
|
||||
return pattern;
|
||||
}
|
||||
|
||||
public Integer getMaxItems() {
|
||||
return maxItems;
|
||||
}
|
||||
|
||||
public Integer getMinItems() {
|
||||
return minItems;
|
||||
}
|
||||
|
||||
public boolean getUniqueItems() {
|
||||
return uniqueItems;
|
||||
}
|
||||
|
||||
public Number getMultipleOf() {
|
||||
return multipleOf;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1955,6 +1955,9 @@ public class DefaultCodegen {
|
||||
op.vendorExtensions.putAll(operation.getExtensions());
|
||||
}
|
||||
|
||||
if (operation == null)
|
||||
throw new RuntimeException("operation cannnot be null in fromOperation");
|
||||
|
||||
// store the original operationId for plug-in
|
||||
op.operationIdOriginal = operation.getOperationId();
|
||||
|
||||
@@ -2282,7 +2285,7 @@ public class DefaultCodegen {
|
||||
codegenParameter.baseName = parameter.getName();
|
||||
codegenParameter.description = escapeText(parameter.getDescription());
|
||||
codegenParameter.unescapedDescription = parameter.getDescription();
|
||||
if (parameter.getRequired()) {
|
||||
if (parameter.getRequired() != null) {
|
||||
codegenParameter.required = parameter.getRequired();
|
||||
}
|
||||
codegenParameter.jsonSchema = Json.pretty(parameter);
|
||||
|
||||
Reference in New Issue
Block a user