@@ -196,10 +196,7 @@ export class OperationConverter extends AbstractOperationConverter {
196196 ) ,
197197 sdkRequest : undefined ,
198198 errors,
199- auth :
200- this . operation . security != null ||
201- this . context . spec . security != null ||
202- this . shouldApplyDefaultAuthOverrides ( ) ,
199+ auth : this . computeEndpointAuth ( ) ,
203200 security :
204201 this . operation . security ?? this . context . spec . security ?? this . getDefaultSecurityFromAuthOverrides ( ) ,
205202 availability : this . context . getAvailability ( {
@@ -463,6 +460,21 @@ export class OperationConverter extends AbstractOperationConverter {
463460 return convertedResponseBody ;
464461 }
465462
463+ private computeEndpointAuth ( ) : boolean {
464+ if ( this . operation . security != null && this . operation . security . length === 0 ) {
465+ return false ;
466+ }
467+
468+ if ( this . operation . security != null && this . operation . security . length > 0 ) {
469+ return true ;
470+ }
471+
472+ return (
473+ ( this . context . spec . security != null && this . context . spec . security . length > 0 ) ||
474+ this . shouldApplyDefaultAuthOverrides ( )
475+ ) ;
476+ }
477+
466478 /**
467479 * Converts security scheme IDs to HTTP headers
468480 * @param securitySchemeIds - List of security scheme IDs
@@ -474,7 +486,8 @@ export class OperationConverter extends AbstractOperationConverter {
474486 }
475487
476488 const hasGlobalSecurity = this . context . spec . security != null && this . context . spec . security . length > 0 ;
477- const hasEndpointSecurity = this . operation . security != null ;
489+ // Check for non-empty endpoint security (empty array means explicit no-auth, not "has security")
490+ const hasEndpointSecurity = this . operation . security != null && this . operation . security . length > 0 ;
478491
479492 // If there's already security defined (global or endpoint), don't apply defaults
480493 return ! ( hasGlobalSecurity || hasEndpointSecurity ) ;
0 commit comments