diff --git a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache index 30147a1fc0e..a85ebf9fbdd 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache @@ -40,10 +40,18 @@ * The authentication methods to be included for all API calls. * @type {Array.} */ -{{/emitJSDoc}}{{=< >=}} this.authentications = {<#authMethods><#isBasic> - '': {type: 'basic'}<#isApiKey> - '': {type: 'apiKey', 'in': <#isKeyInHeader>'header'<^isKeyInHeader>'query', name: ''}<#isOAuth> - '': {type: 'oauth2'}<#hasMore>, +{{/emitJSDoc}}{{=< >=}} this.authentications = { +<#authMethods> +<#isBasic> + '': {type: 'basic'}<^-last>, + +<#isApiKey> + '': {type: 'apiKey', 'in': <#isKeyInHeader>'header'<^isKeyInHeader>'query', name: ''}<^-last>, + +<#isOAuth> + '': {type: 'oauth2'}<^-last>, + + }; <={{ }}=> {{#emitJSDoc}} /** diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index aab7a6ebf98..1ca3143bc09 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -65,8 +65,8 @@ */ this.authentications = { 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}, - 'http_basic_test': {type: 'basic'} - 'petstore_auth': {type: 'oauth2'}, + 'http_basic_test': {type: 'basic'}, + 'petstore_auth': {type: 'oauth2'} }; /** * The default HTTP headers to be included for all API calls.