Skip to content

Commit

Permalink
Merge pull request #34 from andrzejwp/patch-2
Browse files Browse the repository at this point in the history
Update apikey security handling
  • Loading branch information
ErikWittern authored Dec 22, 2019
2 parents ce20896 + e4bc522 commit d31d79a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion openapi-to-har.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,12 @@ const getHeadersArray = function (openApi, path, method) {
const secScheme = Object.keys(openApi.security[m])[0]
const secDefinition = openApi.components.securitySchemes[secScheme];
const authType = secDefinition.type.toLowerCase();
let authScheme = secDefinition.scheme.toLowerCase();
let authScheme = null;

if(authType !== 'apikey'){
let authScheme = secDefinition.scheme.toLowerCase();
}

switch (authType) {
case 'http':
switch(authScheme){
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openapi-snippet",
"version": "0.7.0",
"version": "0.7.1",
"description": "Generates code snippets from Open API (previously Swagger) documents.",
"repository": {
"type": "git",
Expand Down

0 comments on commit d31d79a

Please sign in to comment.