From a1c8e3c1b31cf785fc19389f0aa315fc1183283a Mon Sep 17 00:00:00 2001 From: Fabian Freund Date: Tue, 14 Apr 2020 18:22:13 +0200 Subject: [PATCH] fixed README/doc of bearer auth support for csharp-netcore --- .../main/resources/csharp-netcore/README.mustache | 14 ++++++++++---- .../main/resources/csharp-netcore/api_doc.mustache | 8 ++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache index 666e7933c0a9..b0f7b5cc2247 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache @@ -105,11 +105,15 @@ namespace Example config.BasePath = "{{{basePath}}}"; {{#hasAuthMethods}} {{#authMethods}} - {{#isBasic}} + {{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} config.Username = "YOUR_USERNAME"; config.Password = "YOUR_PASSWORD"; - {{/isBasic}} + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} {{#isApiKey}} // Configure API key authorization: {{{name}}} config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); @@ -193,8 +197,10 @@ Authentication schemes defined for the API: - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: Bearer Authentication +{{/isBasicBearer}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache index 544411db910f..7447e20594b5 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache @@ -36,11 +36,15 @@ namespace Example config.BasePath = "{{{basePath}}}"; {{#hasAuthMethods}} {{#authMethods}} - {{#isBasic}} + {{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} config.Username = "YOUR_USERNAME"; config.Password = "YOUR_PASSWORD"; - {{/isBasic}} + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} {{#isApiKey}} // Configure API key authorization: {{{name}}} config.AddApiKey("{{{keyParamName}}}", "YOUR_API_KEY");