Regenerate hashCode, equals, toString (#4648)

* update hashCode, equals, toString in CodegenParameter

* update equals, hashCode, toString in CodegenProperty

* update toString, hashCode, equals in CodegenOperation

* update toString, hashCode, equals in CodegenResponse

* update toString, hashCode, equals in CodegenSecurity

* update hashCode, toString, equals in CodegenModel

* add hashCode, toString, equals to CodegenServer and more

* update hashCode, equals, toString in CodegenDiscriminator

* update testS

* update samples
This commit is contained in:
William Cheng
2019-12-04 10:07:33 +08:00
committed by GitHub
parent 06ba8317f9
commit e774db05b6
12 changed files with 827 additions and 850 deletions

View File

@@ -44,6 +44,7 @@ public class CodegenCallback {
public int hashCode() { public int hashCode() {
return Objects.hash(expression, hasMore, requests, vendorExtensions); return Objects.hash(expression, hasMore, requests, vendorExtensions);
} }
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@@ -64,10 +65,12 @@ public class CodegenCallback {
return Objects.equals(that.name, name) && Objects.equals(that.hasMore, hasMore) && return Objects.equals(that.name, name) && Objects.equals(that.hasMore, hasMore) &&
Objects.equals(that.urls, urls) && Objects.equals(that.vendorExtensions, vendorExtensions); Objects.equals(that.urls, urls) && Objects.equals(that.vendorExtensions, vendorExtensions);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(name, hasMore, urls, vendorExtensions); return Objects.hash(name, hasMore, urls, vendorExtensions);
} }
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@@ -77,4 +80,6 @@ public class CodegenCallback {
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }
} }

View File

@@ -91,21 +91,25 @@ public class CodegenDiscriminator {
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
CodegenDiscriminator that = (CodegenDiscriminator) o; CodegenDiscriminator that = (CodegenDiscriminator) o;
return Objects.equals(propertyName, that.propertyName) && return Objects.equals(propertyName, that.propertyName) &&
Objects.equals(propertyBaseName, that.propertyBaseName) &&
Objects.equals(mapping, that.mapping) && Objects.equals(mapping, that.mapping) &&
Objects.equals(mappedModels, that.mappedModels); Objects.equals(mappedModels, that.mappedModels);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(propertyName, mapping, mappedModels);
return Objects.hash(propertyName, propertyBaseName, mapping, mappedModels);
} }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this) final StringBuffer sb = new StringBuffer("CodegenDiscriminator{");
.append("propertyName", propertyName) sb.append("propertyName='").append(propertyName).append('\'');
.append("mapping", mapping) sb.append(", propertyBaseName='").append(propertyBaseName).append('\'');
.append("mappedModels", mappedModels) sb.append(", mapping=").append(mapping);
.toString(); sb.append(", mappedModels=").append(mappedModels);
sb.append('}');
return sb.toString();
} }
} }

View File

@@ -70,157 +70,6 @@ public class CodegenModel {
//The type of the value from additional properties. Used in map like objects. //The type of the value from additional properties. Used in map like objects.
public String additionalPropertiesType; public String additionalPropertiesType;
@Override
public String toString() {
return new ToStringBuilder(this)
.append("parent", parent)
.append("parentSchema", parentSchema)
.append("interfaces", interfaces)
.append("parentModel", parentModel)
.append("interfaceModels", interfaceModels)
.append("children", children)
.append("name", name)
.append("classname", classname)
.append("title", title)
.append("description", description)
.append("classVarName", classVarName)
.append("modelJson", modelJson)
.append("dataType", dataType)
.append("xmlPrefix", xmlPrefix)
.append("xmlNamespace", xmlNamespace)
.append("xmlName", xmlName)
.append("classFilename", classFilename)
.append("unescapedDescription", unescapedDescription)
.append("discriminator", discriminator)
.append("defaultValue", defaultValue)
.append("arrayModelType", arrayModelType)
.append("isAlias", isAlias)
.append("isString", isString)
.append("isNumeric", isNumeric)
.append("isInteger", isInteger)
.append("isLong", isLong)
.append("isNumber", isNumber)
.append("isFloat", isFloat)
.append("isDouble", isDouble)
.append("vars", vars)
.append("requiredVars", requiredVars)
.append("optionalVars", optionalVars)
.append("readOnlyVars", readOnlyVars)
.append("readWriteVars", readWriteVars)
.append("allVars", allVars)
.append("parentVars", parentVars)
.append("allowableValues", allowableValues)
.append("mandatory", mandatory)
.append("allMandatory", allMandatory)
.append("imports", imports)
.append("hasVars", hasVars)
.append("emptyVars", emptyVars)
.append("hasMoreModels", hasMoreModels)
.append("hasEnums", hasEnums)
.append("isEnum", isEnum)
.append("isNullable", isNullable)
.append("hasRequired", hasRequired)
.append("hasOptional", hasOptional)
.append("isArrayModel", isArrayModel)
.append("hasChildren", hasChildren)
.append("isMapModel", isMapModel)
.append("hasOnlyReadOnly", hasOnlyReadOnly)
.append("externalDocumentation", externalDocumentation)
.append("vendorExtensions", vendorExtensions)
.append("additionalPropertiesType", additionalPropertiesType)
.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenModel that = (CodegenModel) o;
return Objects.equals(parent, that.parent) &&
Objects.equals(parentSchema, that.parentSchema) &&
Objects.equals(interfaces, that.interfaces) &&
Objects.equals(allParents, that.allParents) &&
Objects.equals(parentModel, that.parentModel) &&
Objects.equals(interfaceModels, that.interfaceModels) &&
Objects.equals(name, that.name) &&
Objects.equals(classname, that.classname) &&
Objects.equals(title, that.title) &&
Objects.equals(description, that.description) &&
Objects.equals(classVarName, that.classVarName) &&
Objects.equals(modelJson, that.modelJson) &&
Objects.equals(dataType, that.dataType) &&
Objects.equals(xmlPrefix, that.xmlPrefix) &&
Objects.equals(xmlNamespace, that.xmlNamespace) &&
Objects.equals(xmlName, that.xmlName) &&
Objects.equals(classFilename, that.classFilename) &&
Objects.equals(unescapedDescription, that.unescapedDescription) &&
Objects.equals(discriminator, that.discriminator) &&
Objects.equals(defaultValue, that.defaultValue) &&
Objects.equals(vars, that.vars) &&
Objects.equals(requiredVars, that.requiredVars) &&
Objects.equals(optionalVars, that.optionalVars) &&
Objects.equals(allVars, that.allVars) &&
Objects.equals(allowableValues, that.allowableValues) &&
Objects.equals(mandatory, that.mandatory) &&
Objects.equals(allMandatory, that.allMandatory) &&
Objects.equals(imports, that.imports) &&
Objects.equals(hasVars, that.hasVars) &&
Objects.equals(emptyVars, that.emptyVars) &&
Objects.equals(hasMoreModels, that.hasMoreModels) &&
Objects.equals(hasEnums, that.hasEnums) &&
Objects.equals(isEnum, that.isEnum) &&
Objects.equals(externalDocumentation, that.externalDocumentation) &&
Objects.equals(hasOnlyReadOnly, that.hasOnlyReadOnly) &&
Objects.equals(hasChildren, that.hasChildren) &&
Objects.equals(parentVars, that.parentVars) &&
Objects.equals(vendorExtensions, that.vendorExtensions);
}
@Override
public int hashCode() {
return Objects.hash(
parent,
parentSchema,
interfaces,
allParents,
parentModel,
interfaceModels,
name,
classname,
title,
description,
classVarName,
modelJson,
dataType,
xmlPrefix,
xmlNamespace,
xmlName,
classFilename,
unescapedDescription,
discriminator,
defaultValue,
vars,
requiredVars,
optionalVars,
allVars,
allowableValues,
mandatory,
allMandatory,
imports,
hasVars,
emptyVars,
hasMoreModels,
hasEnums,
isEnum,
externalDocumentation,
vendorExtensions,
hasOnlyReadOnly,
hasChildren,
parentVars);
}
public String getParent() { public String getParent() {
return parent; return parent;
} }
@@ -601,4 +450,149 @@ public class CodegenModel {
} }
} }
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenModel that = (CodegenModel) o;
return isAlias == that.isAlias &&
isString == that.isString &&
isInteger == that.isInteger &&
isLong == that.isLong &&
isNumber == that.isNumber &&
isNumeric == that.isNumeric &&
isFloat == that.isFloat &&
isDouble == that.isDouble &&
hasVars == that.hasVars &&
emptyVars == that.emptyVars &&
hasMoreModels == that.hasMoreModels &&
hasEnums == that.hasEnums &&
isEnum == that.isEnum &&
isNullable == that.isNullable &&
hasRequired == that.hasRequired &&
hasOptional == that.hasOptional &&
isArrayModel == that.isArrayModel &&
hasChildren == that.hasChildren &&
isMapModel == that.isMapModel &&
hasOnlyReadOnly == that.hasOnlyReadOnly &&
Objects.equals(parent, that.parent) &&
Objects.equals(parentSchema, that.parentSchema) &&
Objects.equals(interfaces, that.interfaces) &&
Objects.equals(allParents, that.allParents) &&
Objects.equals(parentModel, that.parentModel) &&
Objects.equals(interfaceModels, that.interfaceModels) &&
Objects.equals(children, that.children) &&
Objects.equals(anyOf, that.anyOf) &&
Objects.equals(oneOf, that.oneOf) &&
Objects.equals(allOf, that.allOf) &&
Objects.equals(name, that.name) &&
Objects.equals(classname, that.classname) &&
Objects.equals(title, that.title) &&
Objects.equals(description, that.description) &&
Objects.equals(classVarName, that.classVarName) &&
Objects.equals(modelJson, that.modelJson) &&
Objects.equals(dataType, that.dataType) &&
Objects.equals(xmlPrefix, that.xmlPrefix) &&
Objects.equals(xmlNamespace, that.xmlNamespace) &&
Objects.equals(xmlName, that.xmlName) &&
Objects.equals(classFilename, that.classFilename) &&
Objects.equals(unescapedDescription, that.unescapedDescription) &&
Objects.equals(discriminator, that.discriminator) &&
Objects.equals(defaultValue, that.defaultValue) &&
Objects.equals(arrayModelType, that.arrayModelType) &&
Objects.equals(vars, that.vars) &&
Objects.equals(allVars, that.allVars) &&
Objects.equals(requiredVars, that.requiredVars) &&
Objects.equals(optionalVars, that.optionalVars) &&
Objects.equals(readOnlyVars, that.readOnlyVars) &&
Objects.equals(readWriteVars, that.readWriteVars) &&
Objects.equals(parentVars, that.parentVars) &&
Objects.equals(allowableValues, that.allowableValues) &&
Objects.equals(mandatory, that.mandatory) &&
Objects.equals(allMandatory, that.allMandatory) &&
Objects.equals(imports, that.imports) &&
Objects.equals(externalDocumentation, that.externalDocumentation) &&
Objects.equals(vendorExtensions, that.vendorExtensions) &&
Objects.equals(additionalPropertiesType, that.additionalPropertiesType);
}
@Override
public int hashCode() {
return Objects.hash(parent, parentSchema, interfaces, allParents, parentModel, interfaceModels, children,
anyOf, oneOf, allOf, name, classname, title, description, classVarName, modelJson, dataType,
xmlPrefix, xmlNamespace, xmlName, classFilename, unescapedDescription, discriminator, defaultValue,
arrayModelType, isAlias, isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble,
vars, allVars, requiredVars, optionalVars, readOnlyVars, readWriteVars, parentVars, allowableValues,
mandatory, allMandatory, imports, hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, isNullable,
hasRequired, hasOptional, isArrayModel, hasChildren, isMapModel, hasOnlyReadOnly,
externalDocumentation, vendorExtensions, additionalPropertiesType);
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("CodegenModel{");
sb.append("parent='").append(parent).append('\'');
sb.append(", parentSchema='").append(parentSchema).append('\'');
sb.append(", interfaces=").append(interfaces);
sb.append(", allParents=").append(allParents);
sb.append(", parentModel=").append(parentModel);
sb.append(", interfaceModels=").append(interfaceModels);
sb.append(", children=").append(children);
sb.append(", anyOf=").append(anyOf);
sb.append(", oneOf=").append(oneOf);
sb.append(", allOf=").append(allOf);
sb.append(", name='").append(name).append('\'');
sb.append(", classname='").append(classname).append('\'');
sb.append(", title='").append(title).append('\'');
sb.append(", description='").append(description).append('\'');
sb.append(", classVarName='").append(classVarName).append('\'');
sb.append(", modelJson='").append(modelJson).append('\'');
sb.append(", dataType='").append(dataType).append('\'');
sb.append(", xmlPrefix='").append(xmlPrefix).append('\'');
sb.append(", xmlNamespace='").append(xmlNamespace).append('\'');
sb.append(", xmlName='").append(xmlName).append('\'');
sb.append(", classFilename='").append(classFilename).append('\'');
sb.append(", unescapedDescription='").append(unescapedDescription).append('\'');
sb.append(", discriminator=").append(discriminator);
sb.append(", defaultValue='").append(defaultValue).append('\'');
sb.append(", arrayModelType='").append(arrayModelType).append('\'');
sb.append(", isAlias=").append(isAlias);
sb.append(", isString=").append(isString);
sb.append(", isInteger=").append(isInteger);
sb.append(", isLong=").append(isLong);
sb.append(", isNumber=").append(isNumber);
sb.append(", isNumeric=").append(isNumeric);
sb.append(", isFloat=").append(isFloat);
sb.append(", isDouble=").append(isDouble);
sb.append(", vars=").append(vars);
sb.append(", allVars=").append(allVars);
sb.append(", requiredVars=").append(requiredVars);
sb.append(", optionalVars=").append(optionalVars);
sb.append(", readOnlyVars=").append(readOnlyVars);
sb.append(", readWriteVars=").append(readWriteVars);
sb.append(", parentVars=").append(parentVars);
sb.append(", allowableValues=").append(allowableValues);
sb.append(", mandatory=").append(mandatory);
sb.append(", allMandatory=").append(allMandatory);
sb.append(", imports=").append(imports);
sb.append(", hasVars=").append(hasVars);
sb.append(", emptyVars=").append(emptyVars);
sb.append(", hasMoreModels=").append(hasMoreModels);
sb.append(", hasEnums=").append(hasEnums);
sb.append(", isEnum=").append(isEnum);
sb.append(", isNullable=").append(isNullable);
sb.append(", hasRequired=").append(hasRequired);
sb.append(", hasOptional=").append(hasOptional);
sb.append(", isArrayModel=").append(isArrayModel);
sb.append(", hasChildren=").append(hasChildren);
sb.append(", isMapModel=").append(isMapModel);
sb.append(", hasOnlyReadOnly=").append(hasOnlyReadOnly);
sb.append(", externalDocumentation=").append(externalDocumentation);
sb.append(", vendorExtensions=").append(vendorExtensions);
sb.append(", additionalPropertiesType='").append(additionalPropertiesType).append('\'');
sb.append('}');
return sb.toString();
}
} }

View File

@@ -244,134 +244,160 @@ public class CodegenOperation {
@Override @Override
public String toString() { public String toString() {
return String.format(Locale.ROOT, "%s(%s)", baseName, path); final StringBuffer sb = new StringBuffer("CodegenOperation{");
sb.append("responseHeaders=").append(responseHeaders);
sb.append(", hasAuthMethods=").append(hasAuthMethods);
sb.append(", hasConsumes=").append(hasConsumes);
sb.append(", hasProduces=").append(hasProduces);
sb.append(", hasParams=").append(hasParams);
sb.append(", hasOptionalParams=").append(hasOptionalParams);
sb.append(", hasRequiredParams=").append(hasRequiredParams);
sb.append(", returnTypeIsPrimitive=").append(returnTypeIsPrimitive);
sb.append(", returnSimpleType=").append(returnSimpleType);
sb.append(", subresourceOperation=").append(subresourceOperation);
sb.append(", isMapContainer=").append(isMapContainer);
sb.append(", isListContainer=").append(isListContainer);
sb.append(", isMultipart=").append(isMultipart);
sb.append(", hasMore=").append(hasMore);
sb.append(", isResponseBinary=").append(isResponseBinary);
sb.append(", isResponseFile=").append(isResponseFile);
sb.append(", hasReference=").append(hasReference);
sb.append(", isRestfulIndex=").append(isRestfulIndex);
sb.append(", isRestfulShow=").append(isRestfulShow);
sb.append(", isRestfulCreate=").append(isRestfulCreate);
sb.append(", isRestfulUpdate=").append(isRestfulUpdate);
sb.append(", isRestfulDestroy=").append(isRestfulDestroy);
sb.append(", isRestful=").append(isRestful);
sb.append(", isDeprecated=").append(isDeprecated);
sb.append(", isCallbackRequest=").append(isCallbackRequest);
sb.append(", path='").append(path).append('\'');
sb.append(", operationId='").append(operationId).append('\'');
sb.append(", returnType='").append(returnType).append('\'');
sb.append(", httpMethod='").append(httpMethod).append('\'');
sb.append(", returnBaseType='").append(returnBaseType).append('\'');
sb.append(", returnContainer='").append(returnContainer).append('\'');
sb.append(", summary='").append(summary).append('\'');
sb.append(", unescapedNotes='").append(unescapedNotes).append('\'');
sb.append(", notes='").append(notes).append('\'');
sb.append(", baseName='").append(baseName).append('\'');
sb.append(", defaultResponse='").append(defaultResponse).append('\'');
sb.append(", discriminator=").append(discriminator);
sb.append(", consumes=").append(consumes);
sb.append(", produces=").append(produces);
sb.append(", prioritizedContentTypes=").append(prioritizedContentTypes);
sb.append(", servers=").append(servers);
sb.append(", bodyParam=").append(bodyParam);
sb.append(", allParams=").append(allParams);
sb.append(", bodyParams=").append(bodyParams);
sb.append(", pathParams=").append(pathParams);
sb.append(", queryParams=").append(queryParams);
sb.append(", headerParams=").append(headerParams);
sb.append(", formParams=").append(formParams);
sb.append(", cookieParams=").append(cookieParams);
sb.append(", requiredParams=").append(requiredParams);
sb.append(", optionalParams=").append(optionalParams);
sb.append(", authMethods=").append(authMethods);
sb.append(", tags=").append(tags);
sb.append(", responses=").append(responses);
sb.append(", callbacks=").append(callbacks);
sb.append(", imports=").append(imports);
sb.append(", examples=").append(examples);
sb.append(", requestBodyExamples=").append(requestBodyExamples);
sb.append(", externalDocs=").append(externalDocs);
sb.append(", vendorExtensions=").append(vendorExtensions);
sb.append(", nickname='").append(nickname).append('\'');
sb.append(", operationIdOriginal='").append(operationIdOriginal).append('\'');
sb.append(", operationIdLowerCase='").append(operationIdLowerCase).append('\'');
sb.append(", operationIdCamelCase='").append(operationIdCamelCase).append('\'');
sb.append(", operationIdSnakeCase='").append(operationIdSnakeCase).append('\'');
sb.append('}');
return sb.toString();
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
CodegenOperation that = (CodegenOperation) o; CodegenOperation that = (CodegenOperation) o;
return hasAuthMethods == that.hasAuthMethods &&
return Objects.equals(responseHeaders, that.responseHeaders) && hasConsumes == that.hasConsumes &&
Objects.equals(hasAuthMethods, that.hasAuthMethods) && hasProduces == that.hasProduces &&
Objects.equals(hasConsumes, that.hasConsumes) && hasParams == that.hasParams &&
Objects.equals(hasProduces, that.hasProduces) && hasOptionalParams == that.hasOptionalParams &&
Objects.equals(hasParams, that.hasParams) && hasRequiredParams == that.hasRequiredParams &&
Objects.equals(hasOptionalParams, that.hasOptionalParams) && returnTypeIsPrimitive == that.returnTypeIsPrimitive &&
Objects.equals(returnTypeIsPrimitive, that.returnTypeIsPrimitive) && returnSimpleType == that.returnSimpleType &&
Objects.equals(returnSimpleType, that.returnSimpleType) && subresourceOperation == that.subresourceOperation &&
Objects.equals(subresourceOperation, that.subresourceOperation) && isMapContainer == that.isMapContainer &&
Objects.equals(isMapContainer, that.isMapContainer) && isListContainer == that.isListContainer &&
Objects.equals(isListContainer, that.isListContainer) && isMultipart == that.isMultipart &&
Objects.equals(isMultipart, that.isMultipart) && hasMore == that.hasMore &&
Objects.equals(hasMore, that.hasMore) && isResponseBinary == that.isResponseBinary &&
Objects.equals(isResponseBinary, that.isResponseBinary) && isResponseFile == that.isResponseFile &&
Objects.equals(hasReference, that.hasReference) && hasReference == that.hasReference &&
Objects.equals(isResponseFile, that.isResponseFile) && isRestfulIndex == that.isRestfulIndex &&
Objects.equals(isDeprecated, that.isDeprecated) && isRestfulShow == that.isRestfulShow &&
Objects.equals(isCallbackRequest, that.isCallbackRequest) && isRestfulCreate == that.isRestfulCreate &&
Objects.equals(path, that.path) && isRestfulUpdate == that.isRestfulUpdate &&
Objects.equals(operationId, that.operationId) && isRestfulDestroy == that.isRestfulDestroy &&
Objects.equals(returnType, that.returnType) && isRestful == that.isRestful &&
Objects.equals(httpMethod, that.httpMethod) && isDeprecated == that.isDeprecated &&
Objects.equals(returnBaseType, that.returnBaseType) && isCallbackRequest == that.isCallbackRequest &&
Objects.equals(returnContainer, that.returnContainer) && Objects.equals(responseHeaders, that.responseHeaders) &&
Objects.equals(summary, that.summary) && Objects.equals(path, that.path) &&
Objects.equals(unescapedNotes, that.unescapedNotes) && Objects.equals(operationId, that.operationId) &&
Objects.equals(notes, that.notes) && Objects.equals(returnType, that.returnType) &&
Objects.equals(baseName, that.baseName) && Objects.equals(httpMethod, that.httpMethod) &&
Objects.equals(defaultResponse, that.defaultResponse) && Objects.equals(returnBaseType, that.returnBaseType) &&
Objects.equals(discriminator, that.discriminator) && Objects.equals(returnContainer, that.returnContainer) &&
Objects.equals(consumes, that.consumes) && Objects.equals(summary, that.summary) &&
Objects.equals(produces, that.produces) && Objects.equals(unescapedNotes, that.unescapedNotes) &&
Objects.equals(servers, that.servers) && Objects.equals(notes, that.notes) &&
Objects.equals(bodyParam, that.bodyParam) && Objects.equals(baseName, that.baseName) &&
Objects.equals(allParams, that.allParams) && Objects.equals(defaultResponse, that.defaultResponse) &&
Objects.equals(bodyParams, that.bodyParams) && Objects.equals(discriminator, that.discriminator) &&
Objects.equals(pathParams, that.pathParams) && Objects.equals(consumes, that.consumes) &&
Objects.equals(queryParams, that.queryParams) && Objects.equals(produces, that.produces) &&
Objects.equals(headerParams, that.headerParams) && Objects.equals(prioritizedContentTypes, that.prioritizedContentTypes) &&
Objects.equals(formParams, that.formParams) && Objects.equals(servers, that.servers) &&
Objects.equals(cookieParams, that.cookieParams) && Objects.equals(bodyParam, that.bodyParam) &&
Objects.equals(requiredParams, that.requiredParams) && Objects.equals(allParams, that.allParams) &&
Objects.equals(optionalParams, that.optionalParams) && Objects.equals(bodyParams, that.bodyParams) &&
Objects.equals(authMethods, that.authMethods) && Objects.equals(pathParams, that.pathParams) &&
Objects.equals(tags, that.tags) && Objects.equals(queryParams, that.queryParams) &&
Objects.equals(responses, that.responses) && Objects.equals(headerParams, that.headerParams) &&
Objects.equals(callbacks, that.callbacks) && Objects.equals(formParams, that.formParams) &&
Objects.equals(imports, that.imports) && Objects.equals(cookieParams, that.cookieParams) &&
Objects.equals(examples, that.examples) && Objects.equals(requiredParams, that.requiredParams) &&
Objects.equals(externalDocs, that.externalDocs) && Objects.equals(optionalParams, that.optionalParams) &&
Objects.equals(vendorExtensions, that.vendorExtensions) && Objects.equals(authMethods, that.authMethods) &&
Objects.equals(nickname, that.nickname) && Objects.equals(tags, that.tags) &&
Objects.equals(prioritizedContentTypes, that.prioritizedContentTypes) && Objects.equals(responses, that.responses) &&
Objects.equals(operationIdOriginal, that.operationIdOriginal) && Objects.equals(callbacks, that.callbacks) &&
Objects.equals(operationIdLowerCase, that.operationIdLowerCase) && Objects.equals(imports, that.imports) &&
Objects.equals(operationIdCamelCase, that.operationIdCamelCase); Objects.equals(examples, that.examples) &&
Objects.equals(requestBodyExamples, that.requestBodyExamples) &&
Objects.equals(externalDocs, that.externalDocs) &&
Objects.equals(vendorExtensions, that.vendorExtensions) &&
Objects.equals(nickname, that.nickname) &&
Objects.equals(operationIdOriginal, that.operationIdOriginal) &&
Objects.equals(operationIdLowerCase, that.operationIdLowerCase) &&
Objects.equals(operationIdCamelCase, that.operationIdCamelCase) &&
Objects.equals(operationIdSnakeCase, that.operationIdSnakeCase);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(
responseHeaders, return Objects.hash(responseHeaders, hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams,
hasAuthMethods, hasRequiredParams, returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMapContainer,
hasConsumes, isListContainer, isMultipart, hasMore, isResponseBinary, isResponseFile, hasReference, isRestfulIndex,
hasProduces, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy, isRestful, isDeprecated,
hasParams, isCallbackRequest, path, operationId, returnType, httpMethod, returnBaseType, returnContainer,
hasOptionalParams, summary, unescapedNotes, notes, baseName, defaultResponse, discriminator, consumes, produces,
returnTypeIsPrimitive, prioritizedContentTypes, servers, bodyParam, allParams, bodyParams, pathParams, queryParams,
returnSimpleType, headerParams, formParams, cookieParams, requiredParams, optionalParams, authMethods, tags,
subresourceOperation, responses, callbacks, imports, examples, requestBodyExamples, externalDocs, vendorExtensions,
isMapContainer, nickname, operationIdOriginal, operationIdLowerCase, operationIdCamelCase, operationIdSnakeCase);
isListContainer,
isMultipart,
hasMore,
isResponseBinary,
isResponseFile,
hasReference,
isDeprecated,
isCallbackRequest,
path,
operationId,
returnType,
httpMethod,
returnBaseType,
returnContainer,
summary,
unescapedNotes,
notes,
baseName,
defaultResponse,
discriminator,
consumes,
produces,
servers,
bodyParam,
allParams,
bodyParams,
pathParams,
queryParams,
headerParams,
formParams,
cookieParams,
requiredParams,
optionalParams,
authMethods,
tags,
responses,
callbacks,
imports,
examples,
externalDocs,
vendorExtensions,
nickname,
prioritizedContentTypes,
operationIdOriginal,
operationIdLowerCase,
operationIdCamelCase);
} }
} }

View File

@@ -43,6 +43,167 @@ public class CodegenParameter {
public CodegenProperty mostInnerItems; public CodegenProperty mostInnerItems;
public Map<String, Object> vendorExtensions = new HashMap<String, Object>(); public Map<String, Object> vendorExtensions = new HashMap<String, Object>();
public boolean hasValidation; public boolean hasValidation;
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("CodegenParameter{");
sb.append("isFormParam=").append(isFormParam);
sb.append(", isQueryParam=").append(isQueryParam);
sb.append(", isPathParam=").append(isPathParam);
sb.append(", isHeaderParam=").append(isHeaderParam);
sb.append(", isCookieParam=").append(isCookieParam);
sb.append(", isBodyParam=").append(isBodyParam);
sb.append(", hasMore=").append(hasMore);
sb.append(", isContainer=").append(isContainer);
sb.append(", secondaryParam=").append(secondaryParam);
sb.append(", isCollectionFormatMulti=").append(isCollectionFormatMulti);
sb.append(", isPrimitiveType=").append(isPrimitiveType);
sb.append(", isModel=").append(isModel);
sb.append(", isExplode=").append(isExplode);
sb.append(", baseName='").append(baseName).append('\'');
sb.append(", paramName='").append(paramName).append('\'');
sb.append(", dataType='").append(dataType).append('\'');
sb.append(", datatypeWithEnum='").append(datatypeWithEnum).append('\'');
sb.append(", dataFormat='").append(dataFormat).append('\'');
sb.append(", collectionFormat='").append(collectionFormat).append('\'');
sb.append(", description='").append(description).append('\'');
sb.append(", unescapedDescription='").append(unescapedDescription).append('\'');
sb.append(", baseType='").append(baseType).append('\'');
sb.append(", defaultValue='").append(defaultValue).append('\'');
sb.append(", enumName='").append(enumName).append('\'');
sb.append(", style='").append(style).append('\'');
sb.append(", example='").append(example).append('\'');
sb.append(", jsonSchema='").append(jsonSchema).append('\'');
sb.append(", isString=").append(isString);
sb.append(", isNumeric=").append(isNumeric);
sb.append(", isInteger=").append(isInteger);
sb.append(", isLong=").append(isLong);
sb.append(", isNumber=").append(isNumber);
sb.append(", isFloat=").append(isFloat);
sb.append(", isDouble=").append(isDouble);
sb.append(", isByteArray=").append(isByteArray);
sb.append(", isBinary=").append(isBinary);
sb.append(", isBoolean=").append(isBoolean);
sb.append(", isDate=").append(isDate);
sb.append(", isDateTime=").append(isDateTime);
sb.append(", isUuid=").append(isUuid);
sb.append(", isUri=").append(isUri);
sb.append(", isEmail=").append(isEmail);
sb.append(", isFreeFormObject=").append(isFreeFormObject);
sb.append(", isListContainer=").append(isListContainer);
sb.append(", isMapContainer=").append(isMapContainer);
sb.append(", isFile=").append(isFile);
sb.append(", isEnum=").append(isEnum);
sb.append(", _enum=").append(_enum);
sb.append(", allowableValues=").append(allowableValues);
sb.append(", items=").append(items);
sb.append(", mostInnerItems=").append(mostInnerItems);
sb.append(", vendorExtensions=").append(vendorExtensions);
sb.append(", hasValidation=").append(hasValidation);
sb.append(", isNullable=").append(isNullable);
sb.append(", required=").append(required);
sb.append(", maximum='").append(maximum).append('\'');
sb.append(", exclusiveMaximum=").append(exclusiveMaximum);
sb.append(", minimum='").append(minimum).append('\'');
sb.append(", exclusiveMinimum=").append(exclusiveMinimum);
sb.append(", maxLength=").append(maxLength);
sb.append(", minLength=").append(minLength);
sb.append(", pattern='").append(pattern).append('\'');
sb.append(", maxItems=").append(maxItems);
sb.append(", minItems=").append(minItems);
sb.append(", uniqueItems=").append(uniqueItems);
sb.append(", multipleOf=").append(multipleOf);
sb.append('}');
return sb.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenParameter that = (CodegenParameter) o;
return isFormParam == that.isFormParam &&
isQueryParam == that.isQueryParam &&
isPathParam == that.isPathParam &&
isHeaderParam == that.isHeaderParam &&
isCookieParam == that.isCookieParam &&
isBodyParam == that.isBodyParam &&
hasMore == that.hasMore &&
isContainer == that.isContainer &&
secondaryParam == that.secondaryParam &&
isCollectionFormatMulti == that.isCollectionFormatMulti &&
isPrimitiveType == that.isPrimitiveType &&
isModel == that.isModel &&
isExplode == that.isExplode &&
isString == that.isString &&
isNumeric == that.isNumeric &&
isInteger == that.isInteger &&
isLong == that.isLong &&
isNumber == that.isNumber &&
isFloat == that.isFloat &&
isDouble == that.isDouble &&
isByteArray == that.isByteArray &&
isBinary == that.isBinary &&
isBoolean == that.isBoolean &&
isDate == that.isDate &&
isDateTime == that.isDateTime &&
isUuid == that.isUuid &&
isUri == that.isUri &&
isEmail == that.isEmail &&
isFreeFormObject == that.isFreeFormObject &&
isListContainer == that.isListContainer &&
isMapContainer == that.isMapContainer &&
isFile == that.isFile &&
isEnum == that.isEnum &&
hasValidation == that.hasValidation &&
isNullable == that.isNullable &&
required == that.required &&
exclusiveMaximum == that.exclusiveMaximum &&
exclusiveMinimum == that.exclusiveMinimum &&
uniqueItems == that.uniqueItems &&
Objects.equals(baseName, that.baseName) &&
Objects.equals(paramName, that.paramName) &&
Objects.equals(dataType, that.dataType) &&
Objects.equals(datatypeWithEnum, that.datatypeWithEnum) &&
Objects.equals(dataFormat, that.dataFormat) &&
Objects.equals(collectionFormat, that.collectionFormat) &&
Objects.equals(description, that.description) &&
Objects.equals(unescapedDescription, that.unescapedDescription) &&
Objects.equals(baseType, that.baseType) &&
Objects.equals(defaultValue, that.defaultValue) &&
Objects.equals(enumName, that.enumName) &&
Objects.equals(style, that.style) &&
Objects.equals(example, that.example) &&
Objects.equals(jsonSchema, that.jsonSchema) &&
Objects.equals(_enum, that._enum) &&
Objects.equals(allowableValues, that.allowableValues) &&
Objects.equals(items, that.items) &&
Objects.equals(mostInnerItems, that.mostInnerItems) &&
Objects.equals(vendorExtensions, that.vendorExtensions) &&
Objects.equals(maximum, that.maximum) &&
Objects.equals(minimum, that.minimum) &&
Objects.equals(maxLength, that.maxLength) &&
Objects.equals(minLength, that.minLength) &&
Objects.equals(pattern, that.pattern) &&
Objects.equals(maxItems, that.maxItems) &&
Objects.equals(minItems, that.minItems) &&
Objects.equals(multipleOf, that.multipleOf);
}
@Override
public int hashCode() {
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, hasMore,
isContainer, secondaryParam, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName,
paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription,
baseType, defaultValue, enumName, style, example, jsonSchema, isString, isNumeric, isInteger, isLong,
isNumber, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri,
isEmail, isFreeFormObject, isListContainer, isMapContainer, isFile, isEnum, _enum, allowableValues,
items, mostInnerItems, vendorExtensions, hasValidation, isNullable, required, maximum,
exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, maxItems, minItems,
uniqueItems, multipleOf);
}
public boolean isNullable; public boolean isNullable;
/** /**
@@ -179,222 +340,5 @@ public class CodegenParameter {
return output; return output;
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenParameter that = (CodegenParameter) o;
return Objects.equals(isEnum, that.isEnum) &&
Objects.equals(isFormParam, that.isFormParam) &&
Objects.equals(isQueryParam, that.isQueryParam) &&
Objects.equals(isPathParam, that.isPathParam) &&
Objects.equals(isHeaderParam, that.isHeaderParam) &&
Objects.equals(isCookieParam, that.isCookieParam) &&
Objects.equals(isBodyParam, that.isBodyParam) &&
Objects.equals(hasMore, that.hasMore) &&
Objects.equals(isContainer, that.isContainer) &&
Objects.equals(secondaryParam, that.secondaryParam) &&
Objects.equals(isCollectionFormatMulti, that.isCollectionFormatMulti) &&
Objects.equals(isPrimitiveType, that.isPrimitiveType) &&
Objects.equals(isModel, that.isModel) &&
Objects.equals(baseName, that.baseName) &&
Objects.equals(paramName, that.paramName) &&
Objects.equals(dataType, that.dataType) &&
Objects.equals(datatypeWithEnum, that.datatypeWithEnum) &&
Objects.equals(enumName, that.enumName) &&
Objects.equals(dataFormat, that.dataFormat) &&
Objects.equals(collectionFormat, that.collectionFormat) &&
Objects.equals(description, that.description) &&
Objects.equals(unescapedDescription, that.unescapedDescription) &&
Objects.equals(baseType, that.baseType) &&
Objects.equals(defaultValue, that.defaultValue) &&
Objects.equals(example, that.example) &&
Objects.equals(jsonSchema, that.jsonSchema) &&
Objects.equals(isString, that.isString) &&
Objects.equals(isNumeric, that.isNumeric) &&
Objects.equals(isInteger, that.isInteger) &&
Objects.equals(isLong, that.isLong) &&
Objects.equals(isNumber, that.isNumber) &&
Objects.equals(isFloat, that.isFloat) &&
Objects.equals(isDouble, that.isDouble) &&
Objects.equals(isByteArray, that.isByteArray) &&
Objects.equals(isBinary, that.isBinary) &&
Objects.equals(isBoolean, that.isBoolean) &&
Objects.equals(isDate, that.isDate) &&
Objects.equals(isDateTime, that.isDateTime) &&
Objects.equals(isUuid, that.isUuid) &&
Objects.equals(isUri, that.isUri) &&
Objects.equals(isEmail, that.isEmail) &&
Objects.equals(isFreeFormObject, that.isFreeFormObject) &&
Objects.equals(isListContainer, that.isListContainer) &&
Objects.equals(isMapContainer, that.isMapContainer) &&
Objects.equals(isFile, that.isFile) &&
Objects.equals(_enum, that._enum) &&
Objects.equals(allowableValues, that.allowableValues) &&
Objects.equals(items, that.items) &&
Objects.equals(mostInnerItems, that.mostInnerItems) &&
Objects.equals(vendorExtensions, that.vendorExtensions) &&
Objects.equals(hasValidation, that.hasValidation) &&
Objects.equals(isNullable, that.isNullable) &&
Objects.equals(required, that.required) &&
Objects.equals(maximum, that.maximum) &&
Objects.equals(exclusiveMaximum, that.exclusiveMaximum) &&
Objects.equals(minimum, that.minimum) &&
Objects.equals(exclusiveMinimum, that.exclusiveMinimum) &&
Objects.equals(maxLength, that.maxLength) &&
Objects.equals(minLength, that.minLength) &&
Objects.equals(pattern, that.pattern) &&
Objects.equals(maxItems, that.maxItems) &&
Objects.equals(minItems, that.minItems) &&
Objects.equals(uniqueItems, that.uniqueItems) &&
Objects.equals(multipleOf, that.multipleOf) &&
Objects.equals(isExplode, that.isExplode) &&
Objects.equals(style, that.style);
}
@Override
public int hashCode() {
return Objects.hash(
isFormParam,
isQueryParam,
isPathParam,
isHeaderParam,
isCookieParam,
isBodyParam,
hasMore,
isContainer,
secondaryParam,
isCollectionFormatMulti,
isPrimitiveType,
isModel,
baseName,
paramName,
dataType,
datatypeWithEnum,
enumName,
dataFormat,
collectionFormat,
description,
unescapedDescription,
baseType,
defaultValue,
example,
jsonSchema,
isString,
isNumeric,
isInteger,
isLong,
isFloat,
isNumber,
isDouble,
isByteArray,
isBinary,
isBoolean,
isDate,
isDateTime,
isUuid,
isUri,
isEmail,
isFreeFormObject,
isListContainer,
isMapContainer,
isFile,
isEnum,
_enum,
allowableValues,
items,
mostInnerItems,
vendorExtensions,
hasValidation,
isNullable,
required,
maximum,
exclusiveMaximum,
minimum,
exclusiveMinimum,
maxLength,
minLength,
pattern,
maxItems,
minItems,
uniqueItems,
multipleOf,
isExplode,
style);
}
@java.lang.Override
public java.lang.String toString() {
return "CodegenParameter{" +
"isFormParam=" + isFormParam +
", isQueryParam=" + isQueryParam +
", isPathParam=" + isPathParam +
", isHeaderParam=" + isHeaderParam +
", isCookieParam=" + isCookieParam +
", isBodyParam=" + isBodyParam +
", hasMore=" + hasMore +
", isContainer=" + isContainer +
", secondaryParam=" + secondaryParam +
", isCollectionFormatMulti=" + isCollectionFormatMulti +
", isPrimitiveType=" + isPrimitiveType +
", isModel=" + isModel +
", baseName='" + baseName + '\'' +
", paramName='" + paramName + '\'' +
", dataType='" + dataType + '\'' +
", datatypeWithEnum='" + datatypeWithEnum + '\'' +
", dataFormat='" + dataFormat + '\'' +
", collectionFormat='" + collectionFormat + '\'' +
", description='" + description + '\'' +
", unescapedDescription='" + unescapedDescription + '\'' +
", baseType='" + baseType + '\'' +
", defaultValue='" + defaultValue + '\'' +
", enumName='" + enumName + '\'' +
", example='" + example + '\'' +
", jsonSchema='" + jsonSchema + '\'' +
", isString=" + isString +
", isNumeric=" + isNumeric +
", isInteger=" + isInteger +
", isLong=" + isLong +
", isNumber=" + isNumber +
", isFloat=" + isFloat +
", isDouble=" + isDouble +
", isByteArray=" + isByteArray +
", isBinary=" + isBinary +
", isBoolean=" + isBoolean +
", isDate=" + isDate +
", isDateTime=" + isDateTime +
", isUuid=" + isUuid +
", isUri=" + isUri +
", isEmail=" + isEmail +
", isFreeFormObject=" + isFreeFormObject +
", isListContainer=" + isListContainer +
", isMapContainer=" + isMapContainer +
", isFile=" + isFile +
", isEnum=" + isEnum +
", _enum=" + _enum +
", allowableValues=" + allowableValues +
", items=" + items +
", mostInnerItems=" + mostInnerItems +
", vendorExtensions=" + vendorExtensions +
", hasValidation=" + hasValidation +
", isNullable=" + isNullable +
", required=" + required +
", maximum='" + maximum + '\'' +
", exclusiveMaximum=" + exclusiveMaximum +
", minimum='" + minimum + '\'' +
", exclusiveMinimum=" + exclusiveMinimum +
", maxLength=" + maxLength +
", minLength=" + minLength +
", pattern='" + pattern + '\'' +
", maxItems=" + maxItems +
", minItems=" + minItems +
", uniqueItems=" + uniqueItems +
", multipleOf=" + multipleOf +
", isExplode=" + isExplode +
", style='" + style + '\'' +
'}';
}
} }

View File

@@ -410,170 +410,6 @@ public class CodegenProperty implements Cloneable {
this.xmlNamespace = xmlNamespace; this.xmlNamespace = xmlNamespace;
} }
@Override
public int hashCode() {
return Objects.hash(
_enum,
allowableValues,
openApiType,
baseName,
baseType,
complexType,
containerType,
dataType,
datatypeWithEnum,
dataFormat,
defaultValue,
defaultValueWithParam,
description,
title,
example,
exclusiveMaximum,
exclusiveMinimum,
getter,
hasMore,
hasMoreNonReadOnly,
isContainer,
isEnum,
isPrimitiveType,
isModel,
isReadOnly,
isWriteOnly,
isNullable,
isSelfReference,
items,
mostInnerItems,
jsonSchema,
max,
maxLength,
maximum,
min,
minLength,
minimum,
name,
pattern,
required,
secondaryParam,
setter,
unescapedDescription,
vendorExtensions,
hasValidation,
isString,
isNumeric,
isInteger,
isLong,
isNumber,
isFloat,
isDouble,
isByteArray,
isBinary,
isFile,
isBoolean,
isDate,
isDateTime,
isUuid,
isUri,
isEmail,
isFreeFormObject,
isMapContainer,
isListContainer,
isInherited,
discriminatorValue,
nameInCamelCase,
nameInSnakeCase,
enumName,
maxItems,
minItems,
isXmlAttribute,
xmlPrefix,
xmlName,
xmlNamespace,
isXmlWrapped);
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CodegenProperty other = (CodegenProperty) obj;
return Objects.equals(baseName, other.baseName) &&
Objects.equals(openApiType, other.openApiType) &&
Objects.equals(complexType, other.complexType) &&
Objects.equals(getter, other.getter) &&
Objects.equals(setter, other.setter) &&
Objects.equals(description, other.description) &&
Objects.equals(title, other.title) &&
Objects.equals(dataType, other.dataType) &&
Objects.equals(datatypeWithEnum, other.datatypeWithEnum) &&
Objects.equals(dataFormat, other.dataFormat) &&
Objects.equals(name, other.name) &&
Objects.equals(min, other.min) &&
Objects.equals(max, other.max) &&
Objects.equals(defaultValue, other.defaultValue) &&
Objects.equals(baseType, other.baseType) &&
Objects.equals(containerType, other.containerType) &&
Objects.equals(maxLength, other.maxLength) &&
Objects.equals(minLength, other.minLength) &&
Objects.equals(pattern, other.pattern) &&
Objects.equals(example, other.example) &&
Objects.equals(jsonSchema, other.jsonSchema) &&
Objects.equals(minimum, other.minimum) &&
Objects.equals(maximum, other.maximum) &&
Objects.equals(exclusiveMinimum, other.exclusiveMinimum) &&
Objects.equals(exclusiveMaximum, other.exclusiveMaximum) &&
Objects.equals(required, other.required) &&
Objects.equals(secondaryParam, other.secondaryParam) &&
Objects.equals(isPrimitiveType, other.isPrimitiveType) &&
Objects.equals(isModel, other.isModel) &&
Objects.equals(isContainer, other.isContainer) &&
Objects.equals(isEnum, other.isEnum) &&
Objects.equals(isReadOnly, other.isReadOnly) &&
Objects.equals(isWriteOnly, other.isWriteOnly) &&
Objects.equals(isNullable, other.isNullable) &&
Objects.equals(isSelfReference, other.isSelfReference) &&
Objects.equals(_enum, other._enum) &&
Objects.equals(allowableValues, other.allowableValues) &&
Objects.equals(vendorExtensions, other.vendorExtensions) &&
Objects.equals(hasValidation, other.hasValidation) &&
Objects.equals(isString, other.isString) &&
Objects.equals(isNumeric, other.isNumeric) &&
Objects.equals(isInteger, other.isInteger) &&
Objects.equals(isLong, other.isLong) &&
Objects.equals(isNumber, other.isNumber) &&
Objects.equals(isFloat, other.isFloat) &&
Objects.equals(isDouble, other.isDouble) &&
Objects.equals(isByteArray, other.isByteArray) &&
Objects.equals(isBoolean, other.isBoolean) &&
Objects.equals(isDate, other.isDate) &&
Objects.equals(isDateTime, other.isDateTime) &&
Objects.equals(isUuid, other.isUuid) &&
Objects.equals(isUri, other.isUri) &&
Objects.equals(isEmail, other.isEmail) &&
Objects.equals(isFreeFormObject, other.isFreeFormObject) &&
Objects.equals(isBinary, other.isBinary) &&
Objects.equals(isFile, other.isFile) &&
Objects.equals(isListContainer, other.isListContainer) &&
Objects.equals(isMapContainer, other.isMapContainer) &&
Objects.equals(isInherited, other.isInherited) &&
Objects.equals(discriminatorValue, other.discriminatorValue) &&
Objects.equals(nameInCamelCase, other.nameInCamelCase) &&
Objects.equals(nameInSnakeCase, other.nameInSnakeCase) &&
Objects.equals(enumName, other.enumName) &&
Objects.equals(maxItems, other.maxItems) &&
Objects.equals(minItems, other.minItems) &&
Objects.equals(isXmlAttribute, other.isXmlAttribute) &&
Objects.equals(xmlPrefix, other.xmlPrefix) &&
Objects.equals(xmlName, other.xmlName) &&
Objects.equals(xmlNamespace, other.xmlNamespace) &&
Objects.equals(isXmlWrapped, other.isXmlWrapped);
}
@Override @Override
public CodegenProperty clone() { public CodegenProperty clone() {
try { try {
@@ -600,86 +436,185 @@ public class CodegenProperty implements Cloneable {
} }
} }
@java.lang.Override
public java.lang.String toString() { @Override
return "CodegenProperty{" + public String toString() {
"baseName='" + baseName + '\'' + final StringBuffer sb = new StringBuffer("CodegenProperty{");
", openApiType='" + openApiType + '\'' + sb.append("openApiType='").append(openApiType).append('\'');
", complexType='" + complexType + '\'' + sb.append(", baseName='").append(baseName).append('\'');
", getter='" + getter + '\'' + sb.append(", complexType='").append(complexType).append('\'');
", setter='" + setter + '\'' + sb.append(", getter='").append(getter).append('\'');
", description='" + description + '\'' + sb.append(", setter='").append(setter).append('\'');
", datatype='" + dataType + '\'' + sb.append(", description='").append(description).append('\'');
", datatypeWithEnum='" + datatypeWithEnum + '\'' + sb.append(", dataType='").append(dataType).append('\'');
", dataFormat='" + dataFormat + '\'' + sb.append(", datatypeWithEnum='").append(datatypeWithEnum).append('\'');
", name='" + name + '\'' + sb.append(", dataFormat='").append(dataFormat).append('\'');
", min='" + min + '\'' + sb.append(", name='").append(name).append('\'');
", max='" + max + '\'' + sb.append(", min='").append(min).append('\'');
", defaultValue='" + defaultValue + '\'' + sb.append(", max='").append(max).append('\'');
", defaultValueWithParam='" + defaultValueWithParam + '\'' + sb.append(", defaultValue='").append(defaultValue).append('\'');
", baseType='" + baseType + '\'' + sb.append(", defaultValueWithParam='").append(defaultValueWithParam).append('\'');
", containerType='" + containerType + '\'' + sb.append(", baseType='").append(baseType).append('\'');
", title='" + title + '\'' + sb.append(", containerType='").append(containerType).append('\'');
", unescapedDescription='" + unescapedDescription + '\'' + sb.append(", title='").append(title).append('\'');
", maxLength=" + maxLength + sb.append(", unescapedDescription='").append(unescapedDescription).append('\'');
", minLength=" + minLength + sb.append(", maxLength=").append(maxLength);
", pattern='" + pattern + '\'' + sb.append(", minLength=").append(minLength);
", example='" + example + '\'' + sb.append(", pattern='").append(pattern).append('\'');
", jsonSchema='" + jsonSchema + '\'' + sb.append(", example='").append(example).append('\'');
", minimum='" + minimum + '\'' + sb.append(", jsonSchema='").append(jsonSchema).append('\'');
", maximum='" + maximum + '\'' + sb.append(", minimum='").append(minimum).append('\'');
", exclusiveMinimum=" + exclusiveMinimum + sb.append(", maximum='").append(maximum).append('\'');
", exclusiveMaximum=" + exclusiveMaximum + sb.append(", exclusiveMinimum=").append(exclusiveMinimum);
", hasMore=" + hasMore + sb.append(", exclusiveMaximum=").append(exclusiveMaximum);
", required=" + required + sb.append(", hasMore=").append(hasMore);
", secondaryParam=" + secondaryParam + sb.append(", required=").append(required);
", hasMoreNonReadOnly=" + hasMoreNonReadOnly + sb.append(", secondaryParam=").append(secondaryParam);
", isPrimitiveType=" + isPrimitiveType + sb.append(", hasMoreNonReadOnly=").append(hasMoreNonReadOnly);
", isModel=" + isModel + sb.append(", isPrimitiveType=").append(isPrimitiveType);
", isContainer=" + isContainer + sb.append(", isModel=").append(isModel);
", isString=" + isString + sb.append(", isContainer=").append(isContainer);
", isNumeric=" + isNumeric + sb.append(", isString=").append(isString);
", isInteger=" + isInteger + sb.append(", isNumeric=").append(isNumeric);
", isLong=" + isLong + sb.append(", isInteger=").append(isInteger);
", isNumber=" + isNumber + sb.append(", isLong=").append(isLong);
", isFloat=" + isFloat + sb.append(", isNumber=").append(isNumber);
", isDouble=" + isDouble + sb.append(", isFloat=").append(isFloat);
", isByteArray=" + isByteArray + sb.append(", isDouble=").append(isDouble);
", isBinary=" + isBinary + sb.append(", isByteArray=").append(isByteArray);
", isFile=" + isFile + sb.append(", isBinary=").append(isBinary);
", isBoolean=" + isBoolean + sb.append(", isFile=").append(isFile);
", isDate=" + isDate + sb.append(", isBoolean=").append(isBoolean);
", isDateTime=" + isDateTime + sb.append(", isDate=").append(isDate);
", isUuid=" + isUuid + sb.append(", isDateTime=").append(isDateTime);
", isUri=" + isUri + sb.append(", isUuid=").append(isUuid);
", isEmail=" + isEmail + sb.append(", isUri=").append(isUri);
", isFreeFormObject=" + isFreeFormObject + sb.append(", isEmail=").append(isEmail);
", isListContainer=" + isListContainer + sb.append(", isFreeFormObject=").append(isFreeFormObject);
", isMapContainer=" + isMapContainer + sb.append(", isListContainer=").append(isListContainer);
", isEnum=" + isEnum + sb.append(", isMapContainer=").append(isMapContainer);
", isReadOnly=" + isReadOnly + sb.append(", isEnum=").append(isEnum);
", isWriteOnly=" + isWriteOnly + sb.append(", isReadOnly=").append(isReadOnly);
", isNullable=" + isNullable + sb.append(", isWriteOnly=").append(isWriteOnly);
", isSelfReference=" + isSelfReference + sb.append(", isNullable=").append(isNullable);
", _enum=" + _enum + sb.append(", isSelfReference=").append(isSelfReference);
", allowableValues=" + allowableValues + sb.append(", _enum=").append(_enum);
", items=" + items + sb.append(", allowableValues=").append(allowableValues);
", mostInnerItems=" + mostInnerItems + sb.append(", items=").append(items);
", vendorExtensions=" + vendorExtensions + sb.append(", mostInnerItems=").append(mostInnerItems);
", hasValidation=" + hasValidation + sb.append(", vendorExtensions=").append(vendorExtensions);
", isInherited=" + isInherited + sb.append(", hasValidation=").append(hasValidation);
", discriminatorValue='" + discriminatorValue + '\'' + sb.append(", isInherited=").append(isInherited);
", nameInCamelCase='" + nameInCamelCase + '\'' + sb.append(", discriminatorValue='").append(discriminatorValue).append('\'');
", enumName='" + enumName + '\'' + sb.append(", nameInCamelCase='").append(nameInCamelCase).append('\'');
", maxItems=" + maxItems + sb.append(", nameInSnakeCase='").append(nameInSnakeCase).append('\'');
", minItems=" + minItems + sb.append(", enumName='").append(enumName).append('\'');
", isXmlAttribute=" + isXmlAttribute + sb.append(", maxItems=").append(maxItems);
", xmlPrefix='" + xmlPrefix + '\'' + sb.append(", minItems=").append(minItems);
", xmlName='" + xmlName + '\'' + sb.append(", isXmlAttribute=").append(isXmlAttribute);
", xmlNamespace='" + xmlNamespace + '\'' + sb.append(", xmlPrefix='").append(xmlPrefix).append('\'');
", isXmlWrapped=" + isXmlWrapped + sb.append(", xmlName='").append(xmlName).append('\'');
'}'; sb.append(", xmlNamespace='").append(xmlNamespace).append('\'');
sb.append(", isXmlWrapped=").append(isXmlWrapped);
sb.append('}');
return sb.toString();
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenProperty that = (CodegenProperty) o;
return exclusiveMinimum == that.exclusiveMinimum &&
exclusiveMaximum == that.exclusiveMaximum &&
hasMore == that.hasMore &&
required == that.required &&
secondaryParam == that.secondaryParam &&
hasMoreNonReadOnly == that.hasMoreNonReadOnly &&
isPrimitiveType == that.isPrimitiveType &&
isModel == that.isModel &&
isContainer == that.isContainer &&
isString == that.isString &&
isNumeric == that.isNumeric &&
isInteger == that.isInteger &&
isLong == that.isLong &&
isNumber == that.isNumber &&
isFloat == that.isFloat &&
isDouble == that.isDouble &&
isByteArray == that.isByteArray &&
isBinary == that.isBinary &&
isFile == that.isFile &&
isBoolean == that.isBoolean &&
isDate == that.isDate &&
isDateTime == that.isDateTime &&
isUuid == that.isUuid &&
isUri == that.isUri &&
isEmail == that.isEmail &&
isFreeFormObject == that.isFreeFormObject &&
isListContainer == that.isListContainer &&
isMapContainer == that.isMapContainer &&
isEnum == that.isEnum &&
isReadOnly == that.isReadOnly &&
isWriteOnly == that.isWriteOnly &&
isNullable == that.isNullable &&
isSelfReference == that.isSelfReference &&
hasValidation == that.hasValidation &&
isInherited == that.isInherited &&
isXmlAttribute == that.isXmlAttribute &&
isXmlWrapped == that.isXmlWrapped &&
Objects.equals(openApiType, that.openApiType) &&
Objects.equals(baseName, that.baseName) &&
Objects.equals(complexType, that.complexType) &&
Objects.equals(getter, that.getter) &&
Objects.equals(setter, that.setter) &&
Objects.equals(description, that.description) &&
Objects.equals(dataType, that.dataType) &&
Objects.equals(datatypeWithEnum, that.datatypeWithEnum) &&
Objects.equals(dataFormat, that.dataFormat) &&
Objects.equals(name, that.name) &&
Objects.equals(min, that.min) &&
Objects.equals(max, that.max) &&
Objects.equals(defaultValue, that.defaultValue) &&
Objects.equals(defaultValueWithParam, that.defaultValueWithParam) &&
Objects.equals(baseType, that.baseType) &&
Objects.equals(containerType, that.containerType) &&
Objects.equals(title, that.title) &&
Objects.equals(unescapedDescription, that.unescapedDescription) &&
Objects.equals(maxLength, that.maxLength) &&
Objects.equals(minLength, that.minLength) &&
Objects.equals(pattern, that.pattern) &&
Objects.equals(example, that.example) &&
Objects.equals(jsonSchema, that.jsonSchema) &&
Objects.equals(minimum, that.minimum) &&
Objects.equals(maximum, that.maximum) &&
Objects.equals(_enum, that._enum) &&
Objects.equals(allowableValues, that.allowableValues) &&
Objects.equals(items, that.items) &&
Objects.equals(mostInnerItems, that.mostInnerItems) &&
Objects.equals(vendorExtensions, that.vendorExtensions) &&
Objects.equals(discriminatorValue, that.discriminatorValue) &&
Objects.equals(nameInCamelCase, that.nameInCamelCase) &&
Objects.equals(nameInSnakeCase, that.nameInSnakeCase) &&
Objects.equals(enumName, that.enumName) &&
Objects.equals(maxItems, that.maxItems) &&
Objects.equals(minItems, that.minItems) &&
Objects.equals(xmlPrefix, that.xmlPrefix) &&
Objects.equals(xmlName, that.xmlName) &&
Objects.equals(xmlNamespace, that.xmlNamespace);
}
@Override
public int hashCode() {
return Objects.hash(openApiType, baseName, complexType, getter, setter, description, dataType,
datatypeWithEnum, dataFormat, name, min, max, defaultValue, defaultValueWithParam, baseType,
containerType, title, unescapedDescription, maxLength, minLength, pattern, example, jsonSchema,
minimum, maximum, exclusiveMinimum, exclusiveMaximum, hasMore, required, secondaryParam,
hasMoreNonReadOnly, isPrimitiveType, isModel, isContainer, isString, isNumeric, isInteger,
isLong, isNumber, isFloat, isDouble, isByteArray, isBinary, isFile, isBoolean, isDate, isDateTime,
isUuid, isUri, isEmail, isFreeFormObject, isListContainer, isMapContainer, isEnum, isReadOnly,
isWriteOnly, isNullable, isSelfReference, _enum, allowableValues, items, mostInnerItems,
vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase, nameInSnakeCase,
enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName, xmlNamespace, isXmlWrapped);
}
} }

View File

@@ -43,46 +43,6 @@ public class CodegenResponse {
return "0".equals(code) || "default".equals(code); return "0".equals(code) || "default".equals(code);
} }
@Override
public String toString() {
return "CodegenResponse{" +
"headers=" + headers +
", code='" + code + '\'' +
", message='" + message + '\'' +
", hasMore=" + hasMore +
", examples=" + examples +
", dataType='" + dataType + '\'' +
", baseType='" + baseType + '\'' +
", containerType='" + containerType + '\'' +
", hasHeaders=" + hasHeaders +
", isString=" + isString +
", isNumeric=" + isNumeric +
", isInteger=" + isInteger +
", isLong=" + isLong +
", isNumber=" + isNumber +
", isFloat=" + isFloat +
", isDouble=" + isDouble +
", isByteArray=" + isByteArray +
", isBoolean=" + isBoolean +
", isDate=" + isDate +
", isDateTime=" + isDateTime +
", isUuid=" + isUuid +
", isEmail=" + isEmail +
", isFreeFormObject=" + isFreeFormObject +
", isModel=" + isModel +
", isDefault=" + isDefault +
", simpleType=" + simpleType +
", primitiveType=" + primitiveType +
", isMapContainer=" + isMapContainer +
", isListContainer=" + isListContainer +
", isBinary=" + isBinary +
", isFile=" + isFile +
", schema=" + schema +
", jsonSchema='" + jsonSchema + '\'' +
", vendorExtensions=" + vendorExtensions +
'}';
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
@@ -103,8 +63,8 @@ public class CodegenResponse {
isDateTime == that.isDateTime && isDateTime == that.isDateTime &&
isUuid == that.isUuid && isUuid == that.isUuid &&
isEmail == that.isEmail && isEmail == that.isEmail &&
isFreeFormObject == that.isFreeFormObject &&
isModel == that.isModel && isModel == that.isModel &&
isFreeFormObject == that.isFreeFormObject &&
isDefault == that.isDefault && isDefault == that.isDefault &&
simpleType == that.simpleType && simpleType == that.simpleType &&
primitiveType == that.primitiveType && primitiveType == that.primitiveType &&
@@ -126,9 +86,51 @@ public class CodegenResponse {
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(headers, code, message, hasMore, examples, dataType, baseType, containerType, hasHeaders,
isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBoolean, isDate, return Objects.hash(headers, code, message, hasMore, examples, dataType, baseType, containerType,
isDateTime, isUuid, isEmail, isFreeFormObject, isModel, isDefault, simpleType, primitiveType, isMapContainer, hasHeaders, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray,
isListContainer, isBinary, isFile, schema, jsonSchema, vendorExtensions); isBoolean, isDate, isDateTime, isUuid, isEmail, isModel, isFreeFormObject, isDefault, simpleType,
primitiveType, isMapContainer, isListContainer, isBinary, isFile, schema, jsonSchema, vendorExtensions);
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("CodegenResponse{");
sb.append("headers=").append(headers);
sb.append(", code='").append(code).append('\'');
sb.append(", message='").append(message).append('\'');
sb.append(", hasMore=").append(hasMore);
sb.append(", examples=").append(examples);
sb.append(", dataType='").append(dataType).append('\'');
sb.append(", baseType='").append(baseType).append('\'');
sb.append(", containerType='").append(containerType).append('\'');
sb.append(", hasHeaders=").append(hasHeaders);
sb.append(", isString=").append(isString);
sb.append(", isNumeric=").append(isNumeric);
sb.append(", isInteger=").append(isInteger);
sb.append(", isLong=").append(isLong);
sb.append(", isNumber=").append(isNumber);
sb.append(", isFloat=").append(isFloat);
sb.append(", isDouble=").append(isDouble);
sb.append(", isByteArray=").append(isByteArray);
sb.append(", isBoolean=").append(isBoolean);
sb.append(", isDate=").append(isDate);
sb.append(", isDateTime=").append(isDateTime);
sb.append(", isUuid=").append(isUuid);
sb.append(", isEmail=").append(isEmail);
sb.append(", isModel=").append(isModel);
sb.append(", isFreeFormObject=").append(isFreeFormObject);
sb.append(", isDefault=").append(isDefault);
sb.append(", simpleType=").append(simpleType);
sb.append(", primitiveType=").append(primitiveType);
sb.append(", isMapContainer=").append(isMapContainer);
sb.append(", isListContainer=").append(isListContainer);
sb.append(", isBinary=").append(isBinary);
sb.append(", isFile=").append(isFile);
sb.append(", schema=").append(schema);
sb.append(", jsonSchema='").append(jsonSchema).append('\'');
sb.append(", vendorExtensions=").append(vendorExtensions);
sb.append('}');
return sb.toString();
} }
} }

View File

@@ -41,67 +41,6 @@ public class CodegenSecurity {
public List<Map<String, Object>> scopes; public List<Map<String, Object>> scopes;
public Boolean isCode, isPassword, isApplication, isImplicit; public Boolean isCode, isPassword, isApplication, isImplicit;
@Override
public String toString() {
return String.format(Locale.ROOT, "%s(%s)", name, type);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenSecurity that = (CodegenSecurity) o;
return Objects.equals(name, that.name) &&
Objects.equals(type, that.type) &&
Objects.equals(hasMore, that.hasMore) &&
Objects.equals(isBasic, that.isBasic) &&
Objects.equals(isBasicBasic, that.isBasicBasic) &&
Objects.equals(isBasicBearer, that.isBasicBearer) &&
Objects.equals(bearerFormat, that.bearerFormat) &&
Objects.equals(isOAuth, that.isOAuth) &&
Objects.equals(isApiKey, that.isApiKey) &&
Objects.equals(vendorExtensions, that.vendorExtensions) &&
Objects.equals(keyParamName, that.keyParamName) &&
Objects.equals(isKeyInQuery, that.isKeyInQuery) &&
Objects.equals(isKeyInHeader, that.isKeyInHeader) &&
Objects.equals(flow, that.flow) &&
Objects.equals(authorizationUrl, that.authorizationUrl) &&
Objects.equals(tokenUrl, that.tokenUrl) &&
Objects.equals(isCode, that.isCode) &&
Objects.equals(isPassword, that.isPassword) &&
Objects.equals(isApplication, that.isApplication) &&
Objects.equals(isImplicit, that.isImplicit) &&
Objects.equals(scopes, that.scopes);
}
@Override
public int hashCode() {
return Objects.hash(
name,
type,
hasMore,
isBasic,
isBasicBasic,
isBasicBearer,
bearerFormat,
isOAuth,
isApiKey,
vendorExtensions,
keyParamName,
isKeyInQuery,
isKeyInHeader,
flow,
authorizationUrl,
tokenUrl,
isCode,
isPassword,
isApplication,
isImplicit,
scopes);
}
// Return a copy of the security object, filtering out any scopes from the passed-in list. // Return a copy of the security object, filtering out any scopes from the passed-in list.
public CodegenSecurity filterByScopeNames(List<String> filterScopes) { public CodegenSecurity filterByScopeNames(List<String> filterScopes) {
CodegenSecurity filteredSecurity = new CodegenSecurity(); CodegenSecurity filteredSecurity = new CodegenSecurity();
@@ -144,4 +83,72 @@ public class CodegenSecurity {
return filteredSecurity; return filteredSecurity;
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenSecurity that = (CodegenSecurity) o;
return Objects.equals(name, that.name) &&
Objects.equals(type, that.type) &&
Objects.equals(scheme, that.scheme) &&
Objects.equals(hasMore, that.hasMore) &&
Objects.equals(isBasic, that.isBasic) &&
Objects.equals(isOAuth, that.isOAuth) &&
Objects.equals(isApiKey, that.isApiKey) &&
Objects.equals(isBasicBasic, that.isBasicBasic) &&
Objects.equals(isBasicBearer, that.isBasicBearer) &&
Objects.equals(bearerFormat, that.bearerFormat) &&
Objects.equals(vendorExtensions, that.vendorExtensions) &&
Objects.equals(keyParamName, that.keyParamName) &&
Objects.equals(isKeyInQuery, that.isKeyInQuery) &&
Objects.equals(isKeyInHeader, that.isKeyInHeader) &&
Objects.equals(isKeyInCookie, that.isKeyInCookie) &&
Objects.equals(flow, that.flow) &&
Objects.equals(authorizationUrl, that.authorizationUrl) &&
Objects.equals(tokenUrl, that.tokenUrl) &&
Objects.equals(scopes, that.scopes) &&
Objects.equals(isCode, that.isCode) &&
Objects.equals(isPassword, that.isPassword) &&
Objects.equals(isApplication, that.isApplication) &&
Objects.equals(isImplicit, that.isImplicit);
}
@Override
public int hashCode() {
return Objects.hash(name, type, scheme, hasMore, isBasic, isOAuth, isApiKey, isBasicBasic, isBasicBearer,
bearerFormat, vendorExtensions, keyParamName, isKeyInQuery, isKeyInHeader, isKeyInCookie, flow,
authorizationUrl, tokenUrl, scopes, isCode, isPassword, isApplication, isImplicit);
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("CodegenSecurity{");
sb.append("name='").append(name).append('\'');
sb.append(", type='").append(type).append('\'');
sb.append(", scheme='").append(scheme).append('\'');
sb.append(", hasMore=").append(hasMore);
sb.append(", isBasic=").append(isBasic);
sb.append(", isOAuth=").append(isOAuth);
sb.append(", isApiKey=").append(isApiKey);
sb.append(", isBasicBasic=").append(isBasicBasic);
sb.append(", isBasicBearer=").append(isBasicBearer);
sb.append(", bearerFormat='").append(bearerFormat).append('\'');
sb.append(", vendorExtensions=").append(vendorExtensions);
sb.append(", keyParamName='").append(keyParamName).append('\'');
sb.append(", isKeyInQuery=").append(isKeyInQuery);
sb.append(", isKeyInHeader=").append(isKeyInHeader);
sb.append(", isKeyInCookie=").append(isKeyInCookie);
sb.append(", flow='").append(flow).append('\'');
sb.append(", authorizationUrl='").append(authorizationUrl).append('\'');
sb.append(", tokenUrl='").append(tokenUrl).append('\'');
sb.append(", scopes=").append(scopes);
sb.append(", isCode=").append(isCode);
sb.append(", isPassword=").append(isPassword);
sb.append(", isApplication=").append(isApplication);
sb.append(", isImplicit=").append(isImplicit);
sb.append('}');
return sb.toString();
}
} }

View File

@@ -1,9 +1,36 @@
package org.openapitools.codegen; package org.openapitools.codegen;
import java.util.List; import java.util.List;
import java.util.Objects;
public class CodegenServer { public class CodegenServer {
public String url; public String url;
public String description; public String description;
public List<CodegenServerVariable> variables; public List<CodegenServerVariable> variables;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenServer that = (CodegenServer) o;
return Objects.equals(url, that.url) &&
Objects.equals(description, that.description) &&
Objects.equals(variables, that.variables);
}
@Override
public int hashCode() {
return Objects.hash(url, description, variables);
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("CodegenServer{");
sb.append("url='").append(url).append('\'');
sb.append(", description='").append(description).append('\'');
sb.append(", variables=").append(variables);
sb.append('}');
return sb.toString();
}
} }

View File

@@ -1,6 +1,7 @@
package org.openapitools.codegen; package org.openapitools.codegen;
import java.util.List; import java.util.List;
import java.util.Objects;
public class CodegenServerVariable { public class CodegenServerVariable {
public String name; public String name;
@@ -8,4 +9,34 @@ public class CodegenServerVariable {
public String description; public String description;
public List<String> enumValues; public List<String> enumValues;
public String value; public String value;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenServerVariable that = (CodegenServerVariable) o;
return Objects.equals(name, that.name) &&
Objects.equals(defaultValue, that.defaultValue) &&
Objects.equals(description, that.description) &&
Objects.equals(enumValues, that.enumValues) &&
Objects.equals(value, that.value);
}
@Override
public int hashCode() {
return Objects.hash(name, defaultValue, description, enumValues, value);
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("CodegenServerVariable{");
sb.append("name='").append(name).append('\'');
sb.append(", defaultValue='").append(defaultValue).append('\'');
sb.append(", description='").append(description).append('\'');
sb.append(", enumValues=").append(enumValues);
sb.append(", value='").append(value).append('\'');
sb.append('}');
return sb.toString();
}
} }

View File

@@ -450,6 +450,7 @@ public class DefaultCodegenTest {
CodegenDiscriminator discriminator = animalModel.getDiscriminator(); CodegenDiscriminator discriminator = animalModel.getDiscriminator();
CodegenDiscriminator test = new CodegenDiscriminator(); CodegenDiscriminator test = new CodegenDiscriminator();
test.setPropertyName("className"); test.setPropertyName("className");
test.setPropertyBaseName("className");
test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Dog", "Dog")); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Dog", "Dog"));
test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Cat", "Cat")); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Cat", "Cat"));
Assert.assertEquals(discriminator, test); Assert.assertEquals(discriminator, test);
@@ -804,6 +805,7 @@ public class DefaultCodegenTest {
private void verifyPersonDiscriminator(CodegenDiscriminator discriminator) { private void verifyPersonDiscriminator(CodegenDiscriminator discriminator) {
CodegenDiscriminator test = new CodegenDiscriminator(); CodegenDiscriminator test = new CodegenDiscriminator();
test.setPropertyName("DollarUnderscoretype"); test.setPropertyName("DollarUnderscoretype");
test.setPropertyBaseName("$_type");
test.setMapping(new HashMap<>()); test.setMapping(new HashMap<>());
test.getMapping().put("a", "#/components/schemas/Adult"); test.getMapping().put("a", "#/components/schemas/Adult");
test.getMapping().put("c", "Child"); test.getMapping().put("c", "Child");

View File

@@ -43,15 +43,6 @@ use OpenAPI\Server\Model\Pet;
interface PetApiInterface interface PetApiInterface
{ {
/**
* Sets authentication method petstore_auth
*
* @param string $value Value of the petstore_auth authentication method.
*
* @return void
*/
public function setpetstore_auth($value);
/** /**
* Sets authentication method api_key * Sets authentication method api_key
* *
@@ -61,6 +52,15 @@ interface PetApiInterface
*/ */
public function setapi_key($value); public function setapi_key($value);
/**
* Sets authentication method petstore_auth
*
* @param string $value Value of the petstore_auth authentication method.
*
* @return void
*/
public function setpetstore_auth($value);
/** /**
* Operation addPet * Operation addPet
* *