From 13efa49e1b1f1f922d1fbfef2d7537f6fc7008d3 Mon Sep 17 00:00:00 2001
From: Tiffany Marrel <tiffany.marrel@flowable.com>
Date: Fri, 14 Apr 2023 10:59:48 +0200
Subject: [PATCH] [dart] fix use of isBasic condition

---
 .../src/main/resources/dart/libraries/dio/README.mustache | 8 ++++++--
 .../main/resources/dart/libraries/dio/api_doc.mustache    | 4 ++--
 .../src/main/resources/dart2/README.mustache              | 3 +++
 .../petstore_client_lib_fake-json_serializable/README.md  | 4 ++--
 .../doc/FakeApi.md                                        | 6 ------
 .../petstore/dart-dio/petstore_client_lib_fake/README.md  | 4 ++--
 .../dart-dio/petstore_client_lib_fake/doc/FakeApi.md      | 6 ------
 .../petstore/dart2/petstore_client_lib_fake/README.md     | 1 +
 8 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache
index 4e0cfaf17862..52a731a4ae55 100644
--- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache
+++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache
@@ -104,8 +104,12 @@ Class | Method | HTTP request | Description
 - **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**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
+{{/isBasicBearer}}
+{{#isHttpSignature}}- **Type**: HTTP signature authentication
+{{/isHttpSignature}}
 {{#isOAuth}}- **Type**: OAuth
 - **Flow**: {{{flow}}}
 - **Authorization URL**: {{{authorizationUrl}}}
diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache
index 39e9163d75d8..9b2e8e72f769 100644
--- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache
+++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache
@@ -27,11 +27,11 @@ Method | HTTP request | Description
 import 'package:{{pubName}}/api.dart';
 {{#hasAuthMethods}}
 {{#authMethods}}
-{{#isBasic}}
+{{#isBasicBasic}}
 // TODO Configure HTTP basic authorization: {{{name}}}
 //defaultApiClient.getAuthentication<HttpBasicAuth>('{{{name}}}').username = 'YOUR_USERNAME'
 //defaultApiClient.getAuthentication<HttpBasicAuth>('{{{name}}}').password = 'YOUR_PASSWORD';
-{{/isBasic}}
+{{/isBasicBasic}}
 {{#isApiKey}}
 // TODO Configure API key authorization: {{{name}}}
 //defaultApiClient.getAuthentication<ApiKeyAuth>('{{{name}}}').apiKey = 'YOUR_API_KEY';
diff --git a/modules/openapi-generator/src/main/resources/dart2/README.mustache b/modules/openapi-generator/src/main/resources/dart2/README.mustache
index cab1887c577e..9a7ce1ceadb1 100644
--- a/modules/openapi-generator/src/main/resources/dart2/README.mustache
+++ b/modules/openapi-generator/src/main/resources/dart2/README.mustache
@@ -128,6 +128,9 @@ Class | Method | HTTP request | Description
 {{#isBasicBearer}}
 - **Type**: HTTP Bearer authentication
 {{/isBasicBearer}}
+{{#isHttpSignature}}
+- **Type**: HTTP signature authentication
+{{/isHttpSignature}}
 {{/isBasic}}
 {{#isOAuth}}- **Type**: OAuth
 - **Flow**: {{{flow}}}
diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md
index e9ab1f88f2df..3dc249537ee3 100644
--- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md
+++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md
@@ -191,11 +191,11 @@ Authentication schemes defined for the API:
 
 ### bearer_test
 
-- **Type**: HTTP basic authentication
+- **Type**: HTTP Bearer Token authentication (JWT)
 
 ### http_signature_test
 
-- **Type**: HTTP basic authentication
+- **Type**: HTTP signature authentication
 
 
 ## Author
diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md
index 3d408769d11e..5a7f451a4709 100644
--- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md
+++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md
@@ -73,9 +73,6 @@ test http signature authentication
 ### Example
 ```dart
 import 'package:openapi/api.dart';
-// TODO Configure HTTP basic authorization: http_signature_test
-//defaultApiClient.getAuthentication<HttpBasicAuth>('http_signature_test').username = 'YOUR_USERNAME'
-//defaultApiClient.getAuthentication<HttpBasicAuth>('http_signature_test').password = 'YOUR_PASSWORD';
 
 final api = Openapi().getFakeApi();
 final Pet pet = ; // Pet | Pet object that needs to be added to the store
@@ -635,9 +632,6 @@ Fake endpoint to test group parameters (optional)
 ### Example
 ```dart
 import 'package:openapi/api.dart';
-// TODO Configure HTTP basic authorization: bearer_test
-//defaultApiClient.getAuthentication<HttpBasicAuth>('bearer_test').username = 'YOUR_USERNAME'
-//defaultApiClient.getAuthentication<HttpBasicAuth>('bearer_test').password = 'YOUR_PASSWORD';
 
 final api = Openapi().getFakeApi();
 final int requiredStringGroup = 56; // int | Required String in group parameters
diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md
index 17d711efe34e..a70c0ef97df5 100644
--- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md
+++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md
@@ -190,11 +190,11 @@ Authentication schemes defined for the API:
 
 ### bearer_test
 
-- **Type**: HTTP basic authentication
+- **Type**: HTTP Bearer Token authentication (JWT)
 
 ### http_signature_test
 
-- **Type**: HTTP basic authentication
+- **Type**: HTTP signature authentication
 
 
 ## Author
diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md
index 4b1e2a2d5b17..28e3975dc6a0 100644
--- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md
+++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md
@@ -73,9 +73,6 @@ test http signature authentication
 ### Example
 ```dart
 import 'package:openapi/api.dart';
-// TODO Configure HTTP basic authorization: http_signature_test
-//defaultApiClient.getAuthentication<HttpBasicAuth>('http_signature_test').username = 'YOUR_USERNAME'
-//defaultApiClient.getAuthentication<HttpBasicAuth>('http_signature_test').password = 'YOUR_PASSWORD';
 
 final api = Openapi().getFakeApi();
 final Pet pet = ; // Pet | Pet object that needs to be added to the store
@@ -635,9 +632,6 @@ Fake endpoint to test group parameters (optional)
 ### Example
 ```dart
 import 'package:openapi/api.dart';
-// TODO Configure HTTP basic authorization: bearer_test
-//defaultApiClient.getAuthentication<HttpBasicAuth>('bearer_test').username = 'YOUR_USERNAME'
-//defaultApiClient.getAuthentication<HttpBasicAuth>('bearer_test').password = 'YOUR_PASSWORD';
 
 final api = Openapi().getFakeApi();
 final int requiredStringGroup = 56; // int | Required String in group parameters
diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md
index 22bf64b10f4f..d64e7ce298bb 100644
--- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md
+++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md
@@ -188,6 +188,7 @@ Authentication schemes defined for the API:
 
 ### http_signature_test
 
+- **Type**: HTTP signature authentication
 
 
 ## Author