@@ -448,18 +448,10 @@ export class ApiMethodDocumentation extends AmfHelperMixin(LitElement) {
448
448
this . hasCustomProperties = this . _computeHasCustomProperties ( method ) ;
449
449
this . expects = this . _computeExpects ( method ) ;
450
450
this . returns = this . _computeReturns ( method ) ;
451
+
451
452
if ( this . _isAsyncAPI ( this . amf ) ) {
452
453
this . _overwriteExpects ( ) ;
453
-
454
- // find security from all servers for this endpoint
455
- this . serversSecurity = this . asyncSecurityServers ;
456
-
457
- // security that is defined by operation
458
- const methodSecurity = this . _computeSecurity ( method ) ;
459
-
460
- // method security that is defined by operation and is not defined by servers
461
- this . methodSecurity = this . _computeAsyncSecurityMethod ( methodSecurity , this . serversSecurity ) ;
462
- this . security = this . methodSecurity . length > 0 ?this . methodSecurity : this . serversSecurity ;
454
+ this . _computeAsyncApiSecurity ( )
463
455
} else {
464
456
this . security = this . _computeSecurity ( method ) || this . _computeSecurity ( this . server ) ;
465
457
}
@@ -473,6 +465,19 @@ export class ApiMethodDocumentation extends AmfHelperMixin(LitElement) {
473
465
this . deprecated = this . _computeIsDeprecated ( method ) ;
474
466
}
475
467
468
+ _computeAsyncApiSecurity ( ) {
469
+ const { method } = this ;
470
+ // find security from all servers for this endpoint
471
+ this . serversSecurity = this . asyncSecurityServers ;
472
+
473
+ // security that is defined by operation
474
+ const methodSecurity = this . _computeSecurity ( method ) ;
475
+
476
+ // method security that is defined by operation and is not defined by servers
477
+ this . methodSecurity = this . _computeAsyncSecurityMethod ( methodSecurity , this . serversSecurity ) ;
478
+ this . security = this . methodSecurity . length > 0 ? this . methodSecurity : this . serversSecurity ;
479
+ }
480
+
476
481
_computeIsDeprecated ( method ) {
477
482
return Boolean ( this . _getValue ( method , this . _getAmfKey ( this . ns . aml . vocabularies . core . deprecated ) ) ) ;
478
483
}
0 commit comments