protected List<SecurityRequirement> getSecurityRequirements(Api api) { List<SecurityRequirement> securities = new ArrayList<SecurityRequirement>(); if(api == null) { return securities; } for (Authorization auth : api.authorizations()) { if (auth.value().isEmpty()) { continue; } SecurityRequirement security = new SecurityRequirement(); security.setName(auth.value()); for (AuthorizationScope scope : auth.scopes()) { if (!scope.scope().isEmpty()) { security.addScope(scope.scope()); } } securities.add(security); } return securities; }