From 3518601cca86d409bfff604d3f606a2becca39a4 Mon Sep 17 00:00:00 2001 From: Razvan Bordeanu Date: Fri, 2 Feb 2018 14:35:13 +0200 Subject: [PATCH] fix swagger templates fix swagger templates to correctly handle code generation in case of token authorization --- templates/swagger/node.html.mustache | 4 ++-- templates/swagger/node.js.mustache | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/swagger/node.html.mustache b/templates/swagger/node.html.mustache index 61489b1..8c6ec57 100644 --- a/templates/swagger/node.html.mustache +++ b/templates/swagger/node.html.mustache @@ -288,8 +288,8 @@ {{#isSecure}} {{#isSecureToken}} -

Header: Variable name to set API key

-

Value: Value of API key

+

Header: Variable name to set token

+

Value: Value of token

{{/isSecureToken}} {{#isSecureApiKey}}

Header: Variable name to set API key

diff --git a/templates/swagger/node.js.mustache b/templates/swagger/node.js.mustache index 6baee06..ad9937b 100644 --- a/templates/swagger/node.js.mustache +++ b/templates/swagger/node.js.mustache @@ -26,11 +26,11 @@ module.exports = function (RED) { {{#isSecure}} {{#isSecureToken}} if (this.service.secureTokenIsQuery) { - client.setApiKey(this.service.credentials.secureTokenValue, - this.service.secureTokenHeaderOrQueryName, true); + client.setToken(this.service.credentials.secureTokenValue, + this.service.secureTokenHeaderOrQueryName, true); } else { - client.setApiKey(this.service.credentials.secureTokenValue, - this.service.secureTokenHeaderOrQueryName, false); + client.setToken(this.service.credentials.secureTokenValue, + this.service.secureTokenHeaderOrQueryName, false); } {{/isSecureToken}}