I'm trying to connect to some server-side code generated from SwaggerHub, using swagger v2.0 syntax. While the server code seems to work fine, the client node only receives 403 denied responses, since the client never sends the X-API-Key
in the request header. I believe this is a bug in this code that I just commented on (the scheme
object has undefined "keyname" and "passAs" properties).
switch(scheme.type) {
case 'apiKey':
node.swaggerClient.clientAuthorizations.add(scheme.name,
new SwaggerClient.ApiKeyAuthorization(scheme.keyname, password, scheme.passAs));
break;
"securityDefinitions" : {
"BasicAuth" : {
"type" : "basic"
},
"ApiKeyAuth" : {
"type" : "apiKey",
"name" : "X-API-Key",
"in" : "header"
},
},
"security" : [ {
"ApiKeyAuth" : [ ]
} ],
Please let me know what is missing -- or how I can debug this missing header key!
__
Steve