From 433f1b0da42f70abed4cb5e76eefad3f821e89ce Mon Sep 17 00:00:00 2001 From: Tadas Krivickas Date: Thu, 29 Feb 2024 14:58:02 +0200 Subject: [PATCH] Support both dart 2.x and 3.x --- bin/utils/dart-keywords/pubspec.yaml | 2 +- docs/generators/dart.md | 2 +- .../org/openapitools/codegen/languages/AbstractDartCodegen.java | 2 +- .../src/main/resources/dart/libraries/dio/pubspec.mustache | 2 +- .../openapi-generator/src/main/resources/dart2/pubspec.mustache | 2 +- samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml | 2 +- .../dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml | 2 +- .../client/petstore/dart-dio/oneof_primitive/pubspec.yaml | 2 +- .../petstore_client_lib_fake-json_serializable/pubspec.yaml | 2 +- .../petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml | 2 +- .../dart-dio/petstore_client_lib_fake_tests/pubspec.yaml | 2 +- .../client/petstore/dart2/petstore_client_lib/pubspec.yaml | 2 +- .../client/petstore/dart2/petstore_client_lib_fake/pubspec.yaml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bin/utils/dart-keywords/pubspec.yaml b/bin/utils/dart-keywords/pubspec.yaml index addb99241682..e074bb50c2b4 100644 --- a/bin/utils/dart-keywords/pubspec.yaml +++ b/bin/utils/dart-keywords/pubspec.yaml @@ -4,7 +4,7 @@ description: Use the Dart SDK to generate Dart keywords. version: 1.0.0+1 environment: - sdk: ">=2.6.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" dependencies: analyzer: diff --git a/docs/generators/dart.md b/docs/generators/dart.md index 45972f5e65bc..d3c65d22371e 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -11,7 +11,7 @@ title: Documentation for the dart Generator | generator type | CLIENT | | | generator language | Dart | | | generator default templating engine | mustache | | -| helpTxt | Generates a Dart 2.x client library. | | +| helpTxt | Generates a Dart client library. | | ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java index 62c55f904d80..4f5ecb904dfa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java @@ -212,7 +212,7 @@ public String getName() { @Override public String getHelp() { - return "Generates a Dart 2.x client library."; + return "Generates a Dart client library."; } @Override diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache index 03255f3eee86..f49fdceaf7f2 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache @@ -10,7 +10,7 @@ publish_to: {{.}} {{/pubPublishTo}} environment: - sdk: '>={{#useJsonSerializable}}2.17.0{{/useJsonSerializable}}{{^useJsonSerializable}}2.15.0{{/useJsonSerializable}} <3.0.0' + sdk: '>={{#useJsonSerializable}}2.17.0{{/useJsonSerializable}}{{^useJsonSerializable}}2.15.0{{/useJsonSerializable}} <4.0.0' dependencies: dio: '^5.2.0' diff --git a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache index af522867b034..eeeb79b59296 100644 --- a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache @@ -13,7 +13,7 @@ repository: {{.}} publish_to: {{.}} {{/pubPublishTo}} environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.12.0 <4.0.0' dependencies: collection: '^1.17.0' http: '>=0.13.0 <0.14.0' diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml index de93663746d0..efc0d4ccd702 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml @@ -4,7 +4,7 @@ description: OpenAPI API client homepage: homepage environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.15.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml index de93663746d0..efc0d4ccd702 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml @@ -4,7 +4,7 @@ description: OpenAPI API client homepage: homepage environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.15.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml index de93663746d0..efc0d4ccd702 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml @@ -4,7 +4,7 @@ description: OpenAPI API client homepage: homepage environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.15.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml index dc16507435f0..8a32778ad38a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml @@ -4,7 +4,7 @@ description: OpenAPI API client homepage: homepage environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml index de93663746d0..efc0d4ccd702 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml @@ -4,7 +4,7 @@ description: OpenAPI API client homepage: homepage environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.15.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml index 8475e362b888..5b4ebb1c5c09 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml @@ -5,7 +5,7 @@ description: OpenAPI API Dart DIO client tests for petstore_client_lib_fake publish_to: none environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.15.0 <4.0.0' dev_dependencies: built_collection: 5.1.1 diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/pubspec.yaml b/samples/openapi3/client/petstore/dart2/petstore_client_lib/pubspec.yaml index f03302843292..72a2cdd8d138 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/pubspec.yaml @@ -7,7 +7,7 @@ version: '1.0.0' description: 'OpenAPI API client' homepage: 'homepage' environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.12.0 <4.0.0' dependencies: collection: '^1.17.0' http: '>=0.13.0 <0.14.0' diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/pubspec.yaml b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/pubspec.yaml index f03302843292..72a2cdd8d138 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/pubspec.yaml @@ -7,7 +7,7 @@ version: '1.0.0' description: 'OpenAPI API client' homepage: 'homepage' environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.12.0 <4.0.0' dependencies: collection: '^1.17.0' http: '>=0.13.0 <0.14.0'