Skip to content

Commit

Permalink
fix php ordering issue for CodegenSecurity (#5001)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-rosset authored and macjohnny committed Jan 15, 2020
1 parent 50f7e14 commit fe8775a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o
operations.put("controllerName", toControllerName((String) operations.get("pathPrefix")));
operations.put("symfonyService", toSymfonyService((String) operations.get("pathPrefix")));

HashSet<CodegenSecurity> authMethods = new HashSet<>();
List<CodegenSecurity> authMethods = new ArrayList<CodegenSecurity>();
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");

for (CodegenOperation op : operationList) {
Expand Down Expand Up @@ -431,7 +431,11 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o

// Add operation's authentication methods to whole interface
if (op.authMethods != null) {
authMethods.addAll(op.authMethods);
for (CodegenSecurity am : op.authMethods) {
if (!authMethods.contains(am)) {
authMethods.add(am);
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ interface PetApiInterface
{

/**
* Sets authentication method api_key
* Sets authentication method petstore_auth
*
* @param string $value Value of the api_key authentication method.
* @param string $value Value of the petstore_auth authentication method.
*
* @return void
*/
public function setapi_key($value);
public function setpetstore_auth($value);

/**
* Sets authentication method petstore_auth
* Sets authentication method api_key
*
* @param string $value Value of the petstore_auth authentication method.
* @param string $value Value of the api_key authentication method.
*
* @return void
*/
public function setpetstore_auth($value);
public function setapi_key($value);

/**
* Operation addPet
Expand Down

0 comments on commit fe8775a

Please sign in to comment.