Skip to content

Commit

Permalink
add vendorExtensions field in CodegenSecurity class (ref: #7236) (#7415)
Browse files Browse the repository at this point in the history
  • Loading branch information
chiman-jang authored and wing328 committed Jan 19, 2018
1 parent 7853308 commit 8e270f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class CodegenSecurity {
public String name;
public String type;
public Boolean hasMore, isBasic, isOAuth, isApiKey;
public Map<String, Object> vendorExtensions;
// ApiKey specific
public String keyParamName;
public Boolean isKeyInQuery, isKeyInHeader;
Expand Down Expand Up @@ -39,6 +40,8 @@ public boolean equals(Object o) {
return false;
if (isApiKey != null ? !isApiKey.equals(that.isApiKey) : that.isApiKey != null)
return false;
if (vendorExtensions != null ? !vendorExtensions.equals(that.vendorExtensions) : that.vendorExtensions != null)
return false;
if (keyParamName != null ? !keyParamName.equals(that.keyParamName) : that.keyParamName != null)
return false;
if (isKeyInQuery != null ? !isKeyInQuery.equals(that.isKeyInQuery) : that.isKeyInQuery != null)
Expand Down Expand Up @@ -71,6 +74,7 @@ public int hashCode() {
result = 31 * result + (isBasic != null ? isBasic.hashCode() : 0);
result = 31 * result + (isOAuth != null ? isOAuth.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 + (isKeyInQuery != null ? isKeyInQuery.hashCode() : 0);
result = 31 * result + (isKeyInHeader != null ? isKeyInHeader.hashCode() : 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2756,6 +2756,7 @@ public List<CodegenSecurity> fromSecurity(Map<String, SecuritySchemeDefinition>
sec.name = entry.getKey();
sec.type = schemeDefinition.getType();
sec.isCode = sec.isPassword = sec.isApplication = sec.isImplicit = false;
sec.vendorExtensions = schemeDefinition.getVendorExtensions();

if (schemeDefinition instanceof ApiKeyAuthDefinition) {
final ApiKeyAuthDefinition apiKeyDefinition = (ApiKeyAuthDefinition) schemeDefinition;
Expand Down

0 comments on commit 8e270f4

Please sign in to comment.