From a0b2f80508686a278689ddec271d896df4d5e6f8 Mon Sep 17 00:00:00 2001 From: MrLuje Date: Sat, 11 Nov 2023 14:59:57 +0000 Subject: [PATCH] fix(openapi-import): spec security should be optional --- .../bruno-app/src/utils/importers/openapi-collection.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/bruno-app/src/utils/importers/openapi-collection.js b/packages/bruno-app/src/utils/importers/openapi-collection.js index 20a915bd..d317fdfe 100644 --- a/packages/bruno-app/src/utils/importers/openapi-collection.js +++ b/packages/bruno-app/src/utils/importers/openapi-collection.js @@ -267,12 +267,7 @@ const getDefaultUrl = (serverObject) => { }; const getSecurity = (apiSpec) => { - let supportedSchemes = apiSpec.security || []; - if (supportedSchemes.length === 0) { - return { - supported: [] - }; - } + let defaultSchemes = apiSpec.security || []; let securitySchemes = get(apiSpec, 'components.securitySchemes', {}); if (Object.keys(securitySchemes) === 0) { @@ -282,7 +277,7 @@ const getSecurity = (apiSpec) => { } return { - supported: supportedSchemes.map((scheme) => { + supported: defaultSchemes.map((scheme) => { var schemeName = Object.keys(scheme)[0]; return securitySchemes[schemeName]; }),