From a0884acb4e3df19bad296f1a34d51d68ff5cabaa Mon Sep 17 00:00:00 2001 From: Ales Pour <ales.pour@bonitoo.io> Date: Fri, 21 May 2021 14:10:27 +0200 Subject: [PATCH 1/3] fix: prefer_is_not_empty linter suggestion --- .../src/main/resources/dart2/api_helper.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/dart2/api_helper.mustache b/modules/openapi-generator/src/main/resources/dart2/api_helper.mustache index 92f394176f6..e99fbb0505d 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api_helper.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api_helper.mustache @@ -19,7 +19,7 @@ Iterable<QueryParam> _convertParametersForCollectionFormat( final params = <QueryParam>[]; // preconditions - if (name != null && !name.isEmpty && value != null) { + if (name != null && name.isNotEmpty && value != null) { if (value is List) { // get the collection format, default: csv collectionFormat = (collectionFormat == null || collectionFormat.isEmpty) -- GitLab From 20e4642707e2ab6c54b00eeacc2a2fe619d29c28 Mon Sep 17 00:00:00 2001 From: Ales Pour <ales.pour@bonitoo.io> Date: Fri, 21 May 2021 14:11:05 +0200 Subject: [PATCH 2/3] fix: annotate_overrides linter suggestion --- .../src/main/resources/dart2/api_exception.mustache | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/openapi-generator/src/main/resources/dart2/api_exception.mustache b/modules/openapi-generator/src/main/resources/dart2/api_exception.mustache index 40f4fda731e..28f734e5587 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api_exception.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api_exception.mustache @@ -10,6 +10,7 @@ class ApiException implements Exception { Exception innerException; StackTrace stackTrace; + @override String toString() { if (message == null) { return 'ApiException'; -- GitLab From 07f9e055d0a617a4e3ccf91d9b322b6fec65acbc Mon Sep 17 00:00:00 2001 From: Ales Pour <ales.pour@bonitoo.io> Date: Fri, 21 May 2021 14:11:29 +0200 Subject: [PATCH 3/3] chore: update samples --- .../petstore/dart2/petstore_client_lib/lib/api_exception.dart | 1 + .../petstore/dart2/petstore_client_lib/lib/api_helper.dart | 2 +- .../dart2/petstore_client_lib_fake/lib/api_exception.dart | 1 + .../petstore/dart2/petstore_client_lib_fake/lib/api_helper.dart | 2 +- .../lib/api_exception.dart | 1 + .../lib/api_helper.dart | 2 +- 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_exception.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_exception.dart index 1537c9769b2..86e2054bffe 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_exception.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_exception.dart @@ -19,6 +19,7 @@ class ApiException implements Exception { Exception innerException; StackTrace stackTrace; + @override String toString() { if (message == null) { return 'ApiException'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_helper.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_helper.dart index 4135dcf95b2..cb1db7f0a01 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_helper.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_helper.dart @@ -28,7 +28,7 @@ Iterable<QueryParam> _convertParametersForCollectionFormat( final params = <QueryParam>[]; // preconditions - if (name != null && !name.isEmpty && value != null) { + if (name != null && name.isNotEmpty && value != null) { if (value is List) { // get the collection format, default: csv collectionFormat = (collectionFormat == null || collectionFormat.isEmpty) diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_exception.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_exception.dart index 1537c9769b2..86e2054bffe 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_exception.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_exception.dart @@ -19,6 +19,7 @@ class ApiException implements Exception { Exception innerException; StackTrace stackTrace; + @override String toString() { if (message == null) { return 'ApiException'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_helper.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_helper.dart index 96214037944..474cfb4294f 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_helper.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_helper.dart @@ -28,7 +28,7 @@ Iterable<QueryParam> _convertParametersForCollectionFormat( final params = <QueryParam>[]; // preconditions - if (name != null && !name.isEmpty && value != null) { + if (name != null && name.isNotEmpty && value != null) { if (value is List) { // get the collection format, default: csv collectionFormat = (collectionFormat == null || collectionFormat.isEmpty) diff --git a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api_exception.dart b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api_exception.dart index 1537c9769b2..86e2054bffe 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api_exception.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api_exception.dart @@ -19,6 +19,7 @@ class ApiException implements Exception { Exception innerException; StackTrace stackTrace; + @override String toString() { if (message == null) { return 'ApiException'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api_helper.dart b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api_helper.dart index 51db433eb30..e88f8cc2987 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api_helper.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api_helper.dart @@ -28,7 +28,7 @@ Iterable<QueryParam> _convertParametersForCollectionFormat( final params = <QueryParam>[]; // preconditions - if (name != null && !name.isEmpty && value != null) { + if (name != null && name.isNotEmpty && value != null) { if (value is List) { // get the collection format, default: csv collectionFormat = (collectionFormat == null || collectionFormat.isEmpty) -- GitLab