Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP] fix php codegen ordering issue with CodegenSecurity #5001

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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