add vendorExtensions field in CodegenSecurity class (ref: #7236) (#7415)

This commit is contained in:
chiman-jang 2018-01-19 17:24:10 +09:00 committed by William Cheng
parent 7853308c8e
commit 8e270f4651
2 changed files with 5 additions and 0 deletions

View File

@ -7,6 +7,7 @@ public class CodegenSecurity {
public String name; public String name;
public String type; public String type;
public Boolean hasMore, isBasic, isOAuth, isApiKey; public Boolean hasMore, isBasic, isOAuth, isApiKey;
public Map<String, Object> vendorExtensions;
// ApiKey specific // ApiKey specific
public String keyParamName; public String keyParamName;
public Boolean isKeyInQuery, isKeyInHeader; public Boolean isKeyInQuery, isKeyInHeader;
@ -39,6 +40,8 @@ public class CodegenSecurity {
return false; return false;
if (isApiKey != null ? !isApiKey.equals(that.isApiKey) : that.isApiKey != null) if (isApiKey != null ? !isApiKey.equals(that.isApiKey) : that.isApiKey != null)
return false; return false;
if (vendorExtensions != null ? !vendorExtensions.equals(that.vendorExtensions) : that.vendorExtensions != null)
return false;
if (keyParamName != null ? !keyParamName.equals(that.keyParamName) : that.keyParamName != null) if (keyParamName != null ? !keyParamName.equals(that.keyParamName) : that.keyParamName != null)
return false; return false;
if (isKeyInQuery != null ? !isKeyInQuery.equals(that.isKeyInQuery) : that.isKeyInQuery != null) if (isKeyInQuery != null ? !isKeyInQuery.equals(that.isKeyInQuery) : that.isKeyInQuery != null)
@ -71,6 +74,7 @@ public class CodegenSecurity {
result = 31 * result + (isBasic != null ? isBasic.hashCode() : 0); result = 31 * result + (isBasic != null ? isBasic.hashCode() : 0);
result = 31 * result + (isOAuth != null ? isOAuth.hashCode() : 0); result = 31 * result + (isOAuth != null ? isOAuth.hashCode() : 0);
result = 31 * result + (isApiKey != null ? isApiKey.hashCode() : 0); result = 31 * result + (isApiKey != null ? isApiKey.hashCode() : 0);
result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0);
result = 31 * result + (keyParamName != null ? keyParamName.hashCode() : 0); result = 31 * result + (keyParamName != null ? keyParamName.hashCode() : 0);
result = 31 * result + (isKeyInQuery != null ? isKeyInQuery.hashCode() : 0); result = 31 * result + (isKeyInQuery != null ? isKeyInQuery.hashCode() : 0);
result = 31 * result + (isKeyInHeader != null ? isKeyInHeader.hashCode() : 0); result = 31 * result + (isKeyInHeader != null ? isKeyInHeader.hashCode() : 0);

View File

@ -2756,6 +2756,7 @@ public class DefaultCodegen {
sec.name = entry.getKey(); sec.name = entry.getKey();
sec.type = schemeDefinition.getType(); sec.type = schemeDefinition.getType();
sec.isCode = sec.isPassword = sec.isApplication = sec.isImplicit = false; sec.isCode = sec.isPassword = sec.isApplication = sec.isImplicit = false;
sec.vendorExtensions = schemeDefinition.getVendorExtensions();
if (schemeDefinition instanceof ApiKeyAuthDefinition) { if (schemeDefinition instanceof ApiKeyAuthDefinition) {
final ApiKeyAuthDefinition apiKeyDefinition = (ApiKeyAuthDefinition) schemeDefinition; final ApiKeyAuthDefinition apiKeyDefinition = (ApiKeyAuthDefinition) schemeDefinition;