From 8be6a47db7b50f2a92c235d8e8e655f666c8687d Mon Sep 17 00:00:00 2001 From: Artem Derevnjuk Date: Tue, 10 Mar 2020 15:33:08 +0300 Subject: [PATCH] fix(converter): handle security schemas according to spec (#24) --- package-lock.json | 6 +++--- package.json | 4 ++-- src/converter.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5148ca5..754953d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6216,9 +6216,9 @@ } }, "jstoxml": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/jstoxml/-/jstoxml-1.6.0.tgz", - "integrity": "sha512-vIq/Q1ats3TpMaqR6IhqFDRpMGLypCWsekHvsPGQhnkcicJZdpnPRLMFqXoefqajNsOQIv8RvW9U8WRj6M7bHQ==" + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/jstoxml/-/jstoxml-1.6.1.tgz", + "integrity": "sha512-gfgKycDwqSS15fPRN09dGJ+ixI/H7tt4PKvAB0rB7DKY5Vztj1NZx3veJalsspGdhL27KtPZtMYOsrf79jjycg==" }, "kind-of": { "version": "6.0.2", diff --git a/package.json b/package.json index c4d5e13..51ff313 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,10 @@ "dependencies": { "@neuralegion/openapi-sampler": "^0.7.2", "@types/har-format": "^1.2.4", - "@types/swagger-schema-official": "^2.0.18", + "@types/swagger-schema-official": "^2.0.20", "js-yaml": "^3.13.1", "url-template": "^2.0.8", - "jstoxml": "^1.6.0" + "jstoxml": "^1.6.1" }, "typings": "./src/index.d.ts", "repository": { diff --git a/src/converter.js b/src/converter.js index e666d79..6af5b08 100644 --- a/src/converter.js +++ b/src/converter.js @@ -297,7 +297,7 @@ var getHeadersArray = function(swagger, path, method) { let authType = secDefinition.type.toLowerCase() switch (authType) { case 'http': - let authScheme = secDefinition.toLowerCase() + let authScheme = secDefinition.scheme.toLowerCase() switch (authScheme) { case 'bearer': oauthDef = secScheme