From 6a39cf1e26081f30655b10279af44fb53197d26f Mon Sep 17 00:00:00 2001 From: Tiffany Marrel Date: Fri, 14 Apr 2023 10:59:48 +0200 Subject: [PATCH] [javascript] fix use of isBasicBasic and isBasicBearer conditions --- .../src/main/resources/Javascript-Apollo/README.mustache | 6 ++++++ .../src/main/resources/Javascript-Flowtyped/api.mustache | 4 ++-- .../src/main/resources/Javascript/README.mustache | 3 +++ samples/client/petstore/javascript-apollo/README.md | 1 + samples/client/petstore/javascript-es6/README.md | 1 + samples/client/petstore/javascript-promise-es6/README.md | 1 + 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache index a3365eff364e..e79ffcd8ddb5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache @@ -204,11 +204,17 @@ Class | Method | HTTP request | Description {{/isApiKey}} {{#isBasic}} {{#isBasicBasic}} + - **Type**: HTTP basic authentication {{/isBasicBasic}} {{#isBasicBearer}} + - **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} {{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{/isBasic}} {{#isOAuth}} diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache index 94c168b551bb..de67e921527a 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache @@ -117,12 +117,12 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur } {{/isKeyInQuery}} {{/isApiKey}} - {{#isBasic}} + {{#isBasicBasic}} // http basic authentication required if (configuration && (configuration.username || configuration.password)) { localVarHeaderParameter["Authorization"] = "Basic " + btoa(configuration.username + ":" + configuration.password); } - {{/isBasic}} + {{/isBasicBasic}} {{#isOAuth}} // oauth required if (configuration && configuration.accessToken) { diff --git a/modules/openapi-generator/src/main/resources/Javascript/README.mustache b/modules/openapi-generator/src/main/resources/Javascript/README.mustache index a3365eff364e..709782df7a00 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/README.mustache @@ -209,6 +209,9 @@ Class | Method | HTTP request | Description {{#isBasicBearer}} - **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} {{/isBasicBearer}} +{{#isHttpSignature}} +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{/isBasic}} {{#isOAuth}} diff --git a/samples/client/petstore/javascript-apollo/README.md b/samples/client/petstore/javascript-apollo/README.md index a37291187219..aee1d14dc038 100644 --- a/samples/client/petstore/javascript-apollo/README.md +++ b/samples/client/petstore/javascript-apollo/README.md @@ -258,4 +258,5 @@ Authentication schemes defined for the API: ### http_signature_test +- **Type**: HTTP signature authentication diff --git a/samples/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index a37291187219..aee1d14dc038 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -258,4 +258,5 @@ Authentication schemes defined for the API: ### http_signature_test +- **Type**: HTTP signature authentication diff --git a/samples/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index f82039820820..5dbc2e29f5f0 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -256,4 +256,5 @@ Authentication schemes defined for the API: ### http_signature_test +- **Type**: HTTP signature authentication