From 19884ec3abea40894012cc2af97636486fc3002a Mon Sep 17 00:00:00 2001 From: Gibah Joseph Date: Wed, 6 Nov 2024 08:10:29 +0000 Subject: [PATCH] chore: more cleanups --- example/github_issue_#137.yaml | 47 ---------------------- example/lib/main.dart | 4 +- example/pubspec.yaml | 4 +- openapi-generator-annotations/pubspec.yaml | 2 +- openapi-generator/build.yaml | 24 ++++++----- openapi-generator/pubspec.yaml | 2 +- 6 files changed, 19 insertions(+), 64 deletions(-) delete mode 100644 example/github_issue_#137.yaml diff --git a/example/github_issue_#137.yaml b/example/github_issue_#137.yaml deleted file mode 100644 index 01fff5b..0000000 --- a/example/github_issue_#137.yaml +++ /dev/null @@ -1,47 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "Test API", - "version": "1.0" - }, - "paths": { - "/Test": { - "get": { - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestDto" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "TestDto": { - "required": [ - "values" - ], - "type": "object", - "properties": { - "values": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "additionalProperties": false - } - } - } -} diff --git a/example/lib/main.dart b/example/lib/main.dart index bd326e1..0f78b83 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -11,9 +11,9 @@ void main() { inputSpec: RemoteSpec(path: 'https://petstore3.swagger.io/api/v3/openapi.json'), typeMappings: {'Pet': 'ExamplePet'}, - generatorName: Generator.dioAlt, - forceAlwaysRun: false, + generatorName: Generator.dio, runSourceGenOnOutput: true, + skipIfSpecIsUnchanged: false, outputDirectory: 'api/petstore_api', ) class MyApp extends StatelessWidget { diff --git a/example/pubspec.yaml b/example/pubspec.yaml index c624eb4..07d48a9 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -30,7 +30,7 @@ environment: dependencies: flutter: sdk: flutter - openapi_generator_annotations: + openapi_generator_annotations: ^6.0.0 petstore_api: path: ./api/petstore_api @@ -51,7 +51,7 @@ dev_dependencies: flutter_test: sdk: flutter build_runner: - openapi_generator: + openapi_generator: ^6.0.0 # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is diff --git a/openapi-generator-annotations/pubspec.yaml b/openapi-generator-annotations/pubspec.yaml index b519e9a..1214c97 100644 --- a/openapi-generator-annotations/pubspec.yaml +++ b/openapi-generator-annotations/pubspec.yaml @@ -9,7 +9,7 @@ environment: dependencies: crypto: '>=3.0.6 <=4.0.0' - meta: '>=1.16.0 <=2.0.0' + meta: '>=1.15.0 <=2.0.0' dev_dependencies: test: diff --git a/openapi-generator/build.yaml b/openapi-generator/build.yaml index fb0b466..d07e8ca 100755 --- a/openapi-generator/build.yaml +++ b/openapi-generator/build.yaml @@ -2,16 +2,18 @@ targets: $default: builders: openapi_generator: + enabled: true generate_for: - - test/utils.dart + - lib/** -# builders: -# openapi_generator: -# target: ":openapi_generator" -# import: "package:openapi_generator/src/builder.dart" -# builder_factories: ["openapiGenerator"] -# build_extensions: {".dart": [".g.part"]} -# auto_apply: dependents -# build_to: cache -# applies_builders: ["source_gen|combining_builder"] -# runs_before: ["source_gen|combining_builder"] + +builders: + openapi_generator: + target: ":openapi_generator" + import: "package:openapi_generator/src/builder.dart" + builder_factories: ["openapiGenerator"] + build_extensions: {".dart": [".g.part"]} + auto_apply: dependents + build_to: cache + applies_builders: ["source_gen|combining_builder"] + runs_before: ["source_gen|combining_builder"] diff --git a/openapi-generator/pubspec.yaml b/openapi-generator/pubspec.yaml index 8c585a8..c8dc5e3 100755 --- a/openapi-generator/pubspec.yaml +++ b/openapi-generator/pubspec.yaml @@ -14,7 +14,7 @@ dependencies: analyzer: '>=2.0.0 <7.0.0' openapi_generator_cli: ^6.0.0 crypto: '>=3.0.6 <=4.0.0' - meta: '>=1.16.0 <=2.0.0' + meta: '>=1.15.0 <=2.0.0' yaml: ^3.1.2 http: '>=0.13.1 <=2.0.0' logging: '>=1.0.0 <=2.0.0'