File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
__tests__/fixtures/request-security Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,20 @@ paths:
146146 description : unauthenticated
147147 " 403 " :
148148 description : unauthorized
149+ /empty :
150+ get :
151+ summary : Default authenticated endpoint
152+ description : Empty securit requirement
153+ responses :
154+ " 200 " :
155+ description : successful operation
156+ " 401 " :
157+ description : unauthenticated
158+ " 403 " :
159+ description : unauthorized
160+ security :
161+ - {}
162+
149163security :
150164 - BasicAuth : [Admin]
151165components :
Original file line number Diff line number Diff line change 248248 "response" : {
249249 "status" : 200
250250 }
251+ },
252+ {
253+ "description" : " should pass on successful request using empty security" ,
254+ "request" : {
255+ "method" : " GET" ,
256+ "path" : " /empty"
257+ },
258+ "response" : {
259+ "status" : 200
260+ }
251261 }
252262 ]
253263}
Original file line number Diff line number Diff line change @@ -182,6 +182,10 @@ export function* compareReqHeader(
182182 let isSecured = false ;
183183 const maybeResults : Result [ ] = [ ] ;
184184 for ( const scheme of operation . security || [ ] ) {
185+ if ( Object . keys ( scheme ) . length === 0 ) {
186+ isSecured = true ;
187+ break ;
188+ }
185189 for ( const schemeName of Object . keys ( scheme ) ) {
186190 const scheme = securitySchemes [ schemeName ] ;
187191 switch ( scheme ?. type ) {
You can’t perform that action at this time.
0 commit comments