@@ -119,16 +119,16 @@ public io.swagger.v3.oas.annotations.security.SecurityRequirement[] getSecurityR
119
119
HandlerMethod handlerMethod ) {
120
120
// class SecurityRequirements
121
121
Class <?> beanType = handlerMethod .getBeanType ();
122
- Set <io .swagger .v3 .oas .annotations .security .SecurityRequirement > allSecurityTags = getSecurityRequirementsForClass (beanType );
122
+ Set <io .swagger .v3 .oas .annotations .security .SecurityRequirement > allSecurityTags = getSecurityRequirementsForClass (beanType );
123
123
124
124
// handlerMethod SecurityRequirements
125
125
Method method = handlerMethod .getMethod ();
126
- allSecurityTags = getSecurityRequirementsForMethod (method ,allSecurityTags );
126
+ allSecurityTags = getSecurityRequirementsForMethod (method , allSecurityTags );
127
127
128
128
return (allSecurityTags != null ) ? allSecurityTags .toArray (new io .swagger .v3 .oas .annotations .security .SecurityRequirement [0 ]) : null ;
129
129
}
130
130
131
- private Set <io .swagger .v3 .oas .annotations .security .SecurityRequirement > getSecurityRequirementsForMethod (Method method ,Set <io .swagger .v3 .oas .annotations .security .SecurityRequirement > allSecurityTags ) {
131
+ private Set <io .swagger .v3 .oas .annotations .security .SecurityRequirement > getSecurityRequirementsForMethod (Method method , Set <io .swagger .v3 .oas .annotations .security .SecurityRequirement > allSecurityTags ) {
132
132
io .swagger .v3 .oas .annotations .security .SecurityRequirements methodSecurity = AnnotatedElementUtils .findMergedAnnotation (method , io .swagger .v3 .oas .annotations .security .SecurityRequirements .class );
133
133
if (methodSecurity != null )
134
134
allSecurityTags = addSecurityRequirements (allSecurityTags , new HashSet <>(Arrays .asList (methodSecurity .value ())));
@@ -143,7 +143,7 @@ private Set<io.swagger.v3.oas.annotations.security.SecurityRequirement> getSecur
143
143
}
144
144
145
145
public Set <io .swagger .v3 .oas .annotations .security .SecurityRequirement > getSecurityRequirementsForClass (Class <?> beanType ) {
146
- Set <io .swagger .v3 .oas .annotations .security .SecurityRequirement > allSecurityTags =null ;
146
+ Set <io .swagger .v3 .oas .annotations .security .SecurityRequirement > allSecurityTags = null ;
147
147
io .swagger .v3 .oas .annotations .security .SecurityRequirements classSecurity = AnnotatedElementUtils .findMergedAnnotation (beanType , io .swagger .v3 .oas .annotations .security .SecurityRequirements .class );
148
148
if (classSecurity != null )
149
149
allSecurityTags = new HashSet <>(Arrays .asList (classSecurity .value ()));
@@ -322,9 +322,6 @@ private Optional<OAuthFlow> getOAuthFlow(io.swagger.v3.oas.annotations.security.
322
322
* @return the scopes
323
323
*/
324
324
private Optional <Scopes > getScopes (OAuthScope [] scopes ) {
325
- if (isEmpty (scopes ))
326
- return Optional .empty ();
327
-
328
325
Scopes scopesObject = new Scopes ();
329
326
Arrays .stream (scopes ).forEach (scope -> scopesObject .addString (scope .name (), scope .description ()));
330
327
return Optional .of (scopesObject );
0 commit comments