forked from loafle/openapi-generator-original
fix php ordering issue for CodegenSecurity (#5001)
This commit is contained in:
parent
50f7e14a99
commit
fe8775a5a5
@ -386,7 +386,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
|
||||
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) {
|
||||
@ -431,7 +431,11 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,15 +43,6 @@ use OpenAPI\Server\Model\Pet;
|
||||
interface PetApiInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Sets authentication method api_key
|
||||
*
|
||||
* @param string $value Value of the api_key authentication method.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setapi_key($value);
|
||||
|
||||
/**
|
||||
* Sets authentication method petstore_auth
|
||||
*
|
||||
@ -61,6 +52,15 @@ interface PetApiInterface
|
||||
*/
|
||||
public function setpetstore_auth($value);
|
||||
|
||||
/**
|
||||
* Sets authentication method api_key
|
||||
*
|
||||
* @param string $value Value of the api_key authentication method.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setapi_key($value);
|
||||
|
||||
/**
|
||||
* Operation addPet
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user