diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index ea06ae7..3691970 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -32,6 +32,13 @@ jobs: uses: dart-lang/setup-dart@v1.5.0 with: sdk: stable + + - name: Install Melos + run: dart pub global activate melos + + - name: Bootstrap packages with Melos + run: melos bootstrap + - name: Install Dependencies run: dart pub get - name: Build runner diff --git a/.github/workflows/release_please.yml b/.github/workflows/release_please.yml index 65f2f91..4baa87b 100644 --- a/.github/workflows/release_please.yml +++ b/.github/workflows/release_please.yml @@ -10,6 +10,7 @@ permissions: jobs: release-please: + if: github.event.pull_request.merged == true && !startsWith(github.event.pull_request.title, 'chore(release):') runs-on: ubuntu-latest steps: - uses: google-github-actions/release-please-action@v3 diff --git a/.gitignore b/.gitignore index 75097ad..24db6e3 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ doc/api/ .DS_Store **/coverage + +pubspec_overrides.yaml +!pubspec.lock diff --git a/README.md b/README.md index ad670dc..b0f6150 100755 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ Check out the known issues article here [Known Issues](openapi-generator-annotat ## Contributing -All contributions are welcome. Please ensure to read through our [contributing guidelines](Contributing.md) before +All contributions are welcome. Please ensure to read through our [contributing guidelines](CONTRIBUTING.md) before sending your PRs. ## Features and bugs diff --git a/example/lib/main.dart b/example/lib/main.dart index 1775543..3de4cdb 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,4 +1,4 @@ -// Openapi Generator last run: : 2024-01-16T03:54:39.346434 +// Openapi Generator last run: : 2024-10-31T23:11:13.130123 import 'package:flutter/material.dart'; import 'package:openapi_generator_annotations/openapi_generator_annotations.dart'; @@ -8,11 +8,12 @@ void main() { @Openapi( additionalProperties: - DioProperties(pubName: 'petstore_api', pubAuthor: 'Johnny dep..'), + DioProperties(pubName: 'petstore_api', pubAuthor: 'Johnny dep.'), inputSpec: RemoteSpec(path: 'https://petstore3.swagger.io/api/v3/openapi.json'), typeMappings: {'Pet': 'ExamplePet'}, - generatorName: Generator.dio, + generatorName: Generator.dioAlt, + updateAnnotatedFile: true, runSourceGenOnOutput: true, outputDirectory: 'api/petstore_api', ) @@ -112,7 +113,7 @@ class _MyHomePageState extends State { ), Text( '$_counter', - style: Theme.of(context).textTheme.headline4, + style: Theme.of(context).textTheme.bodyMedium, ), ], ), diff --git a/example/openapi-spec.yaml b/example/openapi-spec.yaml index 0bd3de6..acf1382 100644 --- a/example/openapi-spec.yaml +++ b/example/openapi-spec.yaml @@ -1,6 +1,6 @@ openapi: 3.0.1 info: - title: OpenAPI Petstore + title: OpenAPI Petstore. description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. license: diff --git a/example/openapi.yaml b/example/openapi.yaml index c66eeca..d911d19 100644 --- a/example/openapi.yaml +++ b/example/openapi.yaml @@ -1,7 +1,7 @@ --- openapi: "3.0.3" info: - title: "OpenAPI definition" + title: "OpenAPI definition." version: "v0.1" paths: /v0.1/transactions: diff --git a/melos.yaml b/melos.yaml new file mode 100644 index 0000000..efa48f3 --- /dev/null +++ b/melos.yaml @@ -0,0 +1,7 @@ +name: openapi_generator_dart + +packages: + - example + - openapi-generator + - openapi-generator-annotations + - openapi-generator-cli diff --git a/openapi-generator-annotations/lib/src/openapi_generator_annotations_base.dart b/openapi-generator-annotations/lib/src/openapi_generator_annotations_base.dart index 4121d9f..e9e109a 100644 --- a/openapi-generator-annotations/lib/src/openapi_generator_annotations_base.dart +++ b/openapi-generator-annotations/lib/src/openapi_generator_annotations_base.dart @@ -51,9 +51,9 @@ class Openapi { final String? outputDirectory; /// Defines whether the output directory should be cleaned up before generating the output. - /// + /// /// e.g [''], ['lib/src'] - final List? cleanSubOutputDirectory; + final List? cleanSubOutputDirectory; /// Skips the default behavior of validating an input specification. /// diff --git a/openapi-generator-annotations/pubspec.yaml b/openapi-generator-annotations/pubspec.yaml index f635e4e..b2ce713 100644 --- a/openapi-generator-annotations/pubspec.yaml +++ b/openapi-generator-annotations/pubspec.yaml @@ -5,11 +5,9 @@ homepage: https://github.com/gibahjoe/openapi-generator-dart environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.12.0 <4.0.0' dependencies: - crypto: '>=3.0.0 <4.0.0' - meta: '>=1.3.0 <2.0.0' dev_dependencies: test: diff --git a/openapi-generator-annotations/test/additional_properties_test.dart b/openapi-generator-annotations/test/additional_properties_test.dart index a0d7814..dfe3d17 100644 --- a/openapi-generator-annotations/test/additional_properties_test.dart +++ b/openapi-generator-annotations/test/additional_properties_test.dart @@ -223,8 +223,6 @@ void main() { props.pubAuthor, props.pubAuthorEmail, props.sourceFolder, - props.nullSafe, - props.nullSafeArrayDefault, props.listAnyOf, props.pubspecDevDependencies, props.pubspecDependencies @@ -266,8 +264,6 @@ void main() { pubDescription: 'test', pubAuthorEmail: 'test@test.test', pubAuthor: 'test', - nullSafe: true, - nullSafeArrayDefault: true, listAnyOf: false, pubspecDevDependencies: 'something', pubspecDependencies: 'test', @@ -289,8 +285,6 @@ void main() { 'sortParamsByRequiredFlag': props.sortParamsByRequiredFlag, 'sourceFolder': props.sourceFolder, 'wrapper': 'none', - 'nullSafe': props.nullSafe, - 'nullSafeArrayDefault': props.nullSafeArrayDefault, 'listAnyOf': props.listAnyOf, 'pubspecDevDependencies': props.pubspecDevDependencies, 'pubspecDependencies': props.pubspecDependencies, @@ -314,8 +308,6 @@ void main() { expect(actual.pubAuthor, props.pubAuthor); expect(actual.pubAuthorEmail, props.pubAuthorEmail); expect(actual.sourceFolder, props.sourceFolder); - expect(actual.nullSafe, props.nullSafe); - expect(actual.nullSafeArrayDefault, props.nullSafeArrayDefault); expect(actual.listAnyOf, props.listAnyOf); expect(actual.pubspecDevDependencies, props.pubspecDevDependencies); expect(actual.pubspecDependencies, props.pubspecDependencies); diff --git a/openapi-generator-annotations/test/openapi_generator_annotations_test.dart b/openapi-generator-annotations/test/openapi_generator_annotations_test.dart index 97fdf21..1c5c6ad 100644 --- a/openapi-generator-annotations/test/openapi_generator_annotations_test.dart +++ b/openapi-generator-annotations/test/openapi_generator_annotations_test.dart @@ -28,6 +28,7 @@ void main() { expect(props.cachePath, isNull); expect(props.projectPubspecPath, isNull); expect(props.debugLogging, isFalse); + expect(props.nameMappings, isNull); }); group('NextGen', () { test('Sets cachePath', () { diff --git a/openapi-generator-cli/bin/main.dart b/openapi-generator-cli/bin/main.dart index 7055520..b69e987 100644 --- a/openapi-generator-cli/bin/main.dart +++ b/openapi-generator-cli/bin/main.dart @@ -1,26 +1,208 @@ +import 'dart:async'; +import 'dart:convert'; import 'dart:io'; -import 'dart:isolate'; -/// Proxies commandline ars from openapi-generator to the build [arguments] the commandline arguments to proxy -void main(List arguments) async { - exitCode = 0; // presume success +import 'package:http/http.dart' as http; +import 'package:path/path.dart' as p; + +const baseDownloadUrl = + 'https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli'; + +/// Default configuration values +class ConfigDefaults { + static const openapiGeneratorVersion = '7.9.0'; + static const additionalCommands = ''; + static const downloadUrlOverride = null; + static const jarCacheDir = '.dart_tool/openapi_generator_cache'; + static const customGeneratorUrls = [ + 'https://repo1.maven.org/maven2/com/bluetrainsoftware/maven/openapi-dart-generator/7.2/openapi-dart-generator-7.2.jar' + ]; +} + +/// Configuration keys as static constants +class ConfigKeys { + static const openapiGeneratorVersion = 'openapiGeneratorVersion'; + static const additionalCommands = 'additionalCommands'; + static const downloadUrlOverride = 'downloadUrlOverride'; + static const jarCachePath = 'jarCacheDir'; + static const customGeneratorUrls = 'customGeneratorUrls'; +} + +/// Resolves a given path to an absolute path, handling both relative and absolute inputs +String resolvePath(String path) { + return p.isAbsolute(path) ? path : p.absolute(Directory.current.path, path); +} + +/// Loads configuration from JSON file or creates it with default values if not found +Future> loadOrCreateConfig(String configPath) async { + _logOutput('[info] Loading config $configPath'); + configPath = resolvePath(configPath); + final configFile = File(configPath); + if (await configFile.exists()) { + final contents = await configFile.readAsString(); + return jsonDecode(contents); + } else { + _logOutput('[info] Config $configPath not found. Creating...'); + final defaultConfig = { + ConfigKeys.openapiGeneratorVersion: + ConfigDefaults.openapiGeneratorVersion, + ConfigKeys.additionalCommands: ConfigDefaults.additionalCommands, + ConfigKeys.downloadUrlOverride: ConfigDefaults.downloadUrlOverride, + ConfigKeys.jarCachePath: ConfigDefaults.jarCacheDir, + ConfigKeys.customGeneratorUrls: ConfigDefaults.customGeneratorUrls, + }; + final encoder = JsonEncoder.withIndent(' '); + final beautifiedJson = encoder.convert(defaultConfig); + await configFile.writeAsString(beautifiedJson); + return defaultConfig; + } +} + +void _logOutput(String message) { + stdout.writeln(message); + print(message); +} + +/// Constructs the default OpenAPI Generator JAR file download URL based on the version +String constructJarUrl(String version) { + return '$baseDownloadUrl/$version/openapi-generator-cli-$version.jar'; +} + +/// Downloads a JAR file to the specified output path if it doesn't already exist +Future downloadJar(String url, String outputPath) async { + outputPath = resolvePath(outputPath); + final file = File(outputPath); + if (!await file.exists()) { + _logOutput('Downloading $url...'); + + final request = http.Request('GET', Uri.parse(url)); + final response = await request.send(); - var binPath = (await Isolate.resolvePackageUri( - Uri.parse('package:openapi_generator_cli/openapi-generator.jar')))! - .toFilePath(windows: Platform.isWindows); - var javaOpts = Platform.environment['JAVA_OPTS'] ?? ''; + if (response.statusCode == 200) { + final contentLength = response.contentLength ?? 0; + final output = file.openWrite(); + var downloadedBytes = 0; - var commands = [ - '-jar', - "${"$binPath"}", + // Listen to the stream and write to the file in smaller chunks + await response.stream.listen( + (chunk) { + downloadedBytes += chunk.length; + output.add(chunk); + + // Display progress if content length is known + if (contentLength != 0) { + final progress = (downloadedBytes / contentLength) * 100; + stdout.write('\rProgress: ${progress.toStringAsFixed(2)}%'); + } + }, + onDone: () async { + await output.close(); + print('\nDownloaded to $outputPath\n'); + }, + onError: (e) { + print('\nDownload failed: $e\n'); + }, + cancelOnError: true, + ).asFuture(); + } else { + throw Exception( + 'Failed to download $url. Status code: ${response.statusCode}'); + } + } else { + print('[info] $outputPath found. No need to download'); + } +} + +/// Executes the OpenAPI Generator using all JARs in the classpath +Future executeWithClasspath( + List jarPaths, List arguments) async { + final javaOpts = Platform.environment['JAVA_OPTS'] ?? ''; + final classpath = jarPaths.join(Platform.isWindows ? ';' : ':'); + final commands = [ + '-cp', + classpath, + 'org.openapitools.codegen.OpenAPIGenerator', ...arguments, ]; + if (javaOpts.isNotEmpty) { commands.insert(0, javaOpts); } - await Process.run('java', commands).then((ProcessResult pr) { - print(pr.exitCode); - print(pr.stdout); - print(pr.stderr); - }); + + final result = await Process.run('java', commands); + print(result.stdout); + print(result.stderr); +} + +/// Main function handling config loading, JAR downloading, and command execution +Future main(List arguments) async { + exitCode = 0; // presume success + + // Determine config path from arguments or default to 'openapi_generator_config.json' + final configArgIndex = arguments.indexOf('--config'); + final configFilePath = + (configArgIndex != -1 && configArgIndex + 1 < arguments.length) + ? arguments[configArgIndex + 1] + : 'openapi_generator_config.json'; + + print('Using config file: $configFilePath'); + + final config = await loadOrCreateConfig(configFilePath); + final String version = (config[ConfigKeys.openapiGeneratorVersion] ?? + ConfigDefaults.openapiGeneratorVersion); + final String additionalCommands = config[ConfigKeys.additionalCommands] ?? + ConfigDefaults.additionalCommands; + final String? overrideUrl = config[ConfigKeys.downloadUrlOverride]; + final cachePath = resolvePath( + config[ConfigKeys.jarCachePath] ?? ConfigDefaults.jarCacheDir); + + final customGeneratorUrls = List.from( + config[ConfigKeys.customGeneratorUrls] ?? + ConfigDefaults.customGeneratorUrls); + try { + // Load or create configuration + + // Ensure the cache directory exists + await Directory(cachePath).create(recursive: true); + + // Define paths for the OpenAPI Generator JAR and custom generator JARs + final openapiJarPath = '$cachePath/openapi-generator-cli-$version.jar'; + final customJarPaths = []; + + // Download the OpenAPI Generator JAR if it doesn't exist + await downloadJar(overrideUrl ?? constructJarUrl(version), openapiJarPath); + + // Download each custom generator JAR if it doesn't exist and store in `customJarPaths` + for (var i = 0; i < customGeneratorUrls.length; i++) { + final customJarUrl = customGeneratorUrls[i]; + final originalFileName = customJarUrl.split('/').last; + final customJarPath = '$cachePath/custom-$originalFileName'; + await downloadJar(customJarUrl, customJarPath); + customJarPaths.add(customJarPath); + } + + // Combine all JAR paths (OpenAPI Generator + custom generators) for the classpath + final jarPaths = [openapiJarPath, ...customJarPaths]; + + // Prepare additional arguments, excluding the --config flag and its value + final filteredArguments = [ + ...additionalCommands.split(' '), + ...arguments.where((arg) => arg != '--config' && arg != configFilePath), + ]; + + // Execute using all JARs in the classpath + await executeWithClasspath( + jarPaths, + filteredArguments + .map( + (e) => e.trim(), + ) + .where( + (element) => element.isNotEmpty, + ) + .toList()); + } catch (e) { + _logOutput('Error: $e'); + exitCode = 1; + } } diff --git a/openapi-generator-cli/lib/openapi-generator.jar b/openapi-generator-cli/lib/openapi-generator.jar deleted file mode 100644 index 08114c8..0000000 Binary files a/openapi-generator-cli/lib/openapi-generator.jar and /dev/null differ diff --git a/openapi-generator-cli/pom.xml b/openapi-generator-cli/pom.xml deleted file mode 100644 index 2be3743..0000000 --- a/openapi-generator-cli/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - 4.0.0 - - openpitools - openapi-generator-patched - jar - 1.0.8 - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.4 - - - - shade - - - - - - org.openapitools.codegen.OpenAPIGenerator - - - - - com.bluetrainsoftware.maven:openapi-dart-generator - - META-INF/MANIFEST.MF - - - - ${basedir}/lib/openapi-generator.jar - - - - - - - - - - - org.openapitools - openapi-generator-cli - 7.7.0 - - - - com.bluetrainsoftware.maven - openapi-dart-generator - 8.1 - - - - - diff --git a/openapi-generator-cli/pubspec.yaml b/openapi-generator-cli/pubspec.yaml index 8f85eda..fbb3ff2 100644 --- a/openapi-generator-cli/pubspec.yaml +++ b/openapi-generator-cli/pubspec.yaml @@ -4,7 +4,11 @@ version: 5.0.2 homepage: https://github.com/gibahjoe/openapi-generator-dart environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.12.0 <4.0.0' + +dependencies: + http: '>=1.2.2 <=2.0.0' + path: '>=1.9.0 <=2.0.0' dev_dependencies: pedantic: diff --git a/openapi-generator/build.yaml b/openapi-generator/build.yaml index c9670a3..1759318 100755 --- a/openapi-generator/build.yaml +++ b/openapi-generator/build.yaml @@ -1,16 +1,16 @@ targets: $default: builders: - openapi_generator|openapi_generator_annotations: + openapi_generator: enabled: true builders: openapi_generator: -# runs_before: ["jaguarRetrofitBuilder"] target: ":openapi_generator" import: "package:openapi_generator/src/builder.dart" - builder_factories: ["openApiClientSdk"] + 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/example/pubspec.yaml b/openapi-generator/example/pubspec.yaml index daf75f0..f16cc50 100644 --- a/openapi-generator/example/pubspec.yaml +++ b/openapi-generator/example/pubspec.yaml @@ -14,7 +14,7 @@ description: A new Flutter application. version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" dependency_overrides: # analyzer: '0.39.14' diff --git a/openapi-generator/lib/src/builder.dart b/openapi-generator/lib/src/builder.dart index c2d5038..ac7e285 100644 --- a/openapi-generator/lib/src/builder.dart +++ b/openapi-generator/lib/src/builder.dart @@ -3,6 +3,6 @@ import 'package:openapi_generator/src/openapi_generator_runner.dart'; import 'package:openapi_generator/src/process_runner.dart'; import 'package:source_gen/source_gen.dart'; -Builder openApiClientSdk(BuilderOptions options) => +Builder openapiGenerator(BuilderOptions options) => LibraryBuilder(OpenapiGenerator(ProcessRunner()), generatedExtension: '.openapi_generator'); diff --git a/openapi-generator/lib/src/openapi_generator_runner.dart b/openapi-generator/lib/src/openapi_generator_runner.dart index c72b702..6250b20 100755 --- a/openapi-generator/lib/src/openapi_generator_runner.dart +++ b/openapi-generator/lib/src/openapi_generator_runner.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'dart:isolate'; import 'package:analyzer/dart/element/element.dart'; import 'package:build/build.dart'; @@ -117,20 +116,13 @@ class OpenapiGenerator extends GeneratorForAnnotation { }); } - var binPath = (await Isolate.resolvePackageUri( - Uri.parse('package:openapi_generator_cli/openapi-generator.jar')))! - .toFilePath(windows: Platform.isWindows); - - // Include java environment variables in openApiCliCommand - var javaOpts = Platform.environment['JAVA_OPTS'] ?? ''; - +// Name of the package and path to the CLI script (typically just the package name if it's set up correctly) ProcessResult result; result = await _processRunner.run( - 'java', + 'dart', [ - if (javaOpts.isNotEmpty) javaOpts, - '-jar', - binPath, + 'run', + 'openapi_generator_cli:main', ...args, ], workingDirectory: Directory.current.path, @@ -384,6 +376,7 @@ class OpenapiGenerator extends GeneratorForAnnotation { ); if (results.exitCode != 0) { + print('===> args ${await args.jarArgs}'); return Future.error( OutputMessage( message: 'Failed to generate source code. Build Command output:', diff --git a/openapi-generator/pubspec.yaml b/openapi-generator/pubspec.yaml index 43acc8f..f2027ec 100755 --- a/openapi-generator/pubspec.yaml +++ b/openapi-generator/pubspec.yaml @@ -10,9 +10,9 @@ dependencies: build: '>=1.0.0 <=3.0.0' source_gen: '>=1.0.0 <=2.0.0' path: '>=1.0.0 <=2.0.0' - openapi_generator_annotations: '>=4.13.0 <7.0.0' + openapi_generator_annotations: '>5.0.2 <7.0.0' analyzer: '>=2.0.0 <7.0.0' - openapi_generator_cli: '>=4.13.0 <7.0.0' + openapi_generator_cli: '>5.0.2 <7.0.0' yaml: ^3.1.2 http: '>=0.13.1 <=2.0.0' build_runner: '>=1.0.0 <3.0.0' @@ -21,12 +21,7 @@ dependencies: dev_dependencies: test: ^1.24.2 mockito: ^5.4.4 - test_process: build_test: '>=1.2.0 <3.0.0' source_gen_test: pedantic: coverage: ^1.6.3 - -# dependency_overrides: -# openapi_generator_annotations: -# path: ../openapi-generator-annotations diff --git a/openapi-generator/test/generator_arguments_test.dart b/openapi-generator/test/generator_arguments_test.dart index 747cb8c..10cd68c 100644 --- a/openapi-generator/test/generator_arguments_test.dart +++ b/openapi-generator/test/generator_arguments_test.dart @@ -275,12 +275,7 @@ void main() { expect(args.shouldGenerateSources, isTrue); expect(args.updateAnnotatedFile, isTrue); expect(args.additionalProperties?.useEnumExtension, isTrue); - expect( - (args.additionalProperties as DioAltProperties?)?.nullSafe, isTrue); - expect( - (args.additionalProperties as DioAltProperties?) - ?.nullSafeArrayDefault, - isTrue); + expect(await args.jarArgs, [ 'generate', '-o=${args.outputDirectory}', @@ -336,12 +331,6 @@ void main() { expect(args.shouldGenerateSources, isTrue); expect(args.updateAnnotatedFile, isTrue); expect(args.additionalProperties?.useEnumExtension, isTrue); - expect( - (args.additionalProperties as DioAltProperties?)?.nullSafe, isTrue); - expect( - (args.additionalProperties as DioAltProperties?) - ?.nullSafeArrayDefault, - isTrue); }); }); }); diff --git a/openapi-generator/test/specs/dio_alt_properties_test_config.dart b/openapi-generator/test/specs/dio_alt_properties_test_config.dart index 3f2e015..b3938ff 100644 --- a/openapi-generator/test/specs/dio_alt_properties_test_config.dart +++ b/openapi-generator/test/specs/dio_alt_properties_test_config.dart @@ -16,10 +16,7 @@ import 'package:openapi_generator_annotations/openapi_generator_annotations.dart reservedWordsMappings: {'const': 'final'}, additionalProperties: DioAltProperties( wrapper: Wrapper.fvm, - useEnumExtension: true, - pubAuthor: 'test author', - nullSafe: true, - nullSafeArrayDefault: true), + useEnumExtension: true, pubAuthor: 'test author'), inlineSchemaNameMappings: {'200resp': 'OkResp'}, projectPubspecPath: './test/specs/dart_pubspec.test.yaml', updateAnnotatedFile: true, diff --git a/openapi-generator/test/specs/input_remote_properties_test_config.dart b/openapi-generator/test/specs/input_remote_properties_test_config.dart index fdf9e89..a7f6699 100644 --- a/openapi-generator/test/specs/input_remote_properties_test_config.dart +++ b/openapi-generator/test/specs/input_remote_properties_test_config.dart @@ -17,10 +17,7 @@ import 'package:openapi_generator_annotations/openapi_generator_annotations.dart reservedWordsMappings: {'const': 'final'}, additionalProperties: DioAltProperties( wrapper: Wrapper.fvm, - useEnumExtension: true, - pubAuthor: 'test author', - nullSafe: true, - nullSafeArrayDefault: true), + useEnumExtension: true, pubAuthor: 'test author'), inlineSchemaNameMappings: {'200resp': 'OkResp'}, projectPubspecPath: './test/specs/dart_pubspec.test.yaml', updateAnnotatedFile: true, diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..7d3f8dc --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,341 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + ansi_styles: + dependency: transitive + description: + name: ansi_styles + sha256: "9c656cc12b3c27b17dd982b2cc5c0cfdfbdabd7bc8f3ae5e8542d9867b47ce8a" + url: "https://pub.dev" + source: hosted + version: "0.3.2+1" + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" + async: + dependency: transitive + description: + name: async + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + url: "https://pub.dev" + source: hosted + version: "2.12.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + charcode: + dependency: transitive + description: + name: charcode + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" + source: hosted + version: "1.3.1" + cli_launcher: + dependency: transitive + description: + name: cli_launcher + sha256: "5e7e0282b79e8642edd6510ee468ae2976d847a0a29b3916e85f5fa1bfe24005" + url: "https://pub.dev" + source: hosted + version: "0.3.1" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + conventional_commit: + dependency: transitive + description: + name: conventional_commit + sha256: dec15ad1118f029c618651a4359eb9135d8b88f761aa24e4016d061cd45948f2 + url: "https://pub.dev" + source: hosted + version: "0.6.0+1" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + http: + dependency: transitive + description: + name: http + sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + url: "https://pub.dev" + source: hosted + version: "1.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" + url: "https://pub.dev" + source: hosted + version: "4.1.1" + intl: + dependency: transitive + description: + name: intl + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.dev" + source: hosted + version: "0.19.0" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + melos: + dependency: "direct dev" + description: + name: melos + sha256: a62abfa8c7826cec927f8585572bb9adf591be152150494d879ca2c75118809d + url: "https://pub.dev" + source: hosted + version: "6.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + mustache_template: + dependency: transitive + description: + name: mustache_template + sha256: a46e26f91445bfb0b60519be280555b06792460b27b19e2b19ad5b9740df5d1c + url: "https://pub.dev" + source: hosted + version: "2.0.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + process: + dependency: transitive + description: + name: process + sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" + url: "https://pub.dev" + source: hosted + version: "5.0.2" + prompts: + dependency: transitive + description: + name: prompts + sha256: "3773b845e85a849f01e793c4fc18a45d52d7783b4cb6c0569fad19f9d0a774a1" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pub_updater: + dependency: transitive + description: + name: pub_updater + sha256: "54e8dc865349059ebe7f163d6acce7c89eb958b8047e6d6e80ce93b13d7c9e60" + url: "https://pub.dev" + source: hosted + version: "0.4.0" + pubspec: + dependency: transitive + description: + name: pubspec + sha256: f534a50a2b4d48dc3bc0ec147c8bd7c304280fff23b153f3f11803c4d49d927e + url: "https://pub.dev" + source: hosted + version: "2.3.0" + quiver: + dependency: transitive + description: + name: quiver + sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + url: "https://pub.dev" + source: hosted + version: "0.7.3" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uri: + dependency: transitive + description: + name: uri + sha256: "889eea21e953187c6099802b7b4cf5219ba8f3518f604a1033064d45b1b8268a" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + web: + dependency: transitive + description: + name: web + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + yaml_edit: + dependency: transitive + description: + name: yaml_edit + sha256: e9c1a3543d2da0db3e90270dbb1e4eebc985ee5e3ffe468d83224472b2194a5f + url: "https://pub.dev" + source: hosted + version: "2.2.1" +sdks: + dart: ">=3.5.0 <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..7e56670 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,6 @@ +name: openapi_generator_dart + +environment: + sdk: '>=3.0.0 <4.0.0' +dev_dependencies: + melos: ^6.2.0 diff --git a/release-please-config.json b/release-please-config.json index c3651b5..f9d9ff3 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,5 +1,6 @@ { "include-component-in-tag": false, + "versioning": "", "packages": { "openapi-generator": { "release-type": "dart",