From 330526f1a88b54570a3c60e4934831c24ad3ab46 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 20 Jul 2021 13:15:19 +0930 Subject: [PATCH 01/34] PoC json_serializable in dart-dio-next --- .../languages/DartDioNextClientCodegen.java | 73 +-- .../libraries/dio/analysis_options.mustache | 2 +- .../resources/dart/libraries/dio/api.mustache | 4 +- .../dart/libraries/dio/build.yaml.mustache | 18 + .../dart/libraries/dio/class.mustache | 2 +- .../dart/libraries/dio/enum.mustache | 2 +- .../dart/libraries/dio/pubspec.mustache | 9 +- .../api/deserialize.mustache | 1 + .../json_serializable/api/imports.mustache | 2 + .../api/query_param.mustache | 1 + .../json_serializable/api/serialize.mustache | 1 + .../json_serializable/class.mustache | 74 ++++ .../dart_constructor.mustache | 10 + .../json_serializable/deserialize.mustache | 63 +++ .../json_serializable/enum.mustache | 8 + .../json_serializable/enum_inline.mustache | 8 + .../src/main/resources/dart2/pubspec.mustache | 3 + .../petstore/dart2/petstore/pubspec.lock | 418 ++++++++++++++++++ 18 files changed, 668 insertions(+), 31 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/build.yaml.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache create mode 100644 samples/openapi3/client/petstore/dart2/petstore/pubspec.lock diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index e231fc54ccce..9c980d05d02f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -56,6 +56,7 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { public static final String DATE_LIBRARY_DEFAULT = DATE_LIBRARY_CORE; public static final String SERIALIZATION_LIBRARY_BUILT_VALUE = "built_value"; + public static final String SERIALIZATION_LIBRARY_JSON_SERIALIZABLE = "json_serializable"; public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE; private static final String DIO_IMPORT = "package:dio/dio.dart"; @@ -88,6 +89,7 @@ public DartDioNextClientCodegen() { modelPackage = "lib.src.model"; supportedLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); + supportedLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "json_serializable"); final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); serializationLibrary.setEnum(supportedLibraries); serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); @@ -181,6 +183,10 @@ public void processOpts() { private void configureSerializationLibrary(String srcFolder) { switch (library) { + case SERIALIZATION_LIBRARY_JSON_SERIALIZABLE: + additionalProperties.put("useJsonSerializable", "true"); + configureSerializationLibraryJsonSerializable(srcFolder); + break; default: case SERIALIZATION_LIBRARY_BUILT_VALUE: additionalProperties.put("useBuiltValue", "true"); @@ -233,6 +239,18 @@ private void configureSerializationLibraryBuiltValue(String srcFolder) { imports.put("MultipartFile", DIO_IMPORT); } + private void configureSerializationLibraryJsonSerializable(String srcFolder) { + supportingFiles.add(new SupportingFile("build.yaml.mustache", "" /* main project dir */, "build.yaml")); + supportingFiles.add(new SupportingFile("serialization/json_serializable/deserialize.mustache", srcFolder, + "deserialize.dart")); + + // most of these are defined in AbstractDartCodegen, we are overriding + // just the binary / file handling + languageSpecificPrimitives.add("Object"); + imports.put("Uint8List", "dart:typed_data"); + imports.put("MultipartFile", DIO_IMPORT); + } + private void configureDateLibrary(String srcFolder) { switch (dateLibrary) { case DATE_LIBRARY_TIME_MACHINE: @@ -254,6 +272,7 @@ private void configureDateLibrary(String srcFolder) { typeMapping.put("date", "Date"); typeMapping.put("Date", "Date"); importMapping.put("Date", "package:" + pubName + "/src/model/date.dart"); + supportingFiles.add(new SupportingFile("serialization/built_value/date.mustache", srcFolder + File.separator + "model", "date.dart")); supportingFiles.add(new SupportingFile("serialization/built_value/date_serializer.mustache", srcFolder, "date_serializer.dart")); } @@ -366,35 +385,37 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, Listserialization/built_value/deserialize}}{{/useBuiltValue}} +{{#useJsonSerializable}} +_responseData = deserialize<{{{returnType}}}, {{{returnBaseType}}}>(_response.data!, '{{{returnType}}}', growable: true);{{/useJsonSerializable}} } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/build.yaml.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/build.yaml.mustache new file mode 100644 index 000000000000..89a4dd6e1c2e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/build.yaml.mustache @@ -0,0 +1,18 @@ +targets: + $default: + builders: + json_serializable: + options: + # Options configure how source code is generated for every + # `@JsonSerializable`-annotated class in the package. + # + # The default value for each is listed. + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: true + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache index 228fcf5826d1..634f16ce936b 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache @@ -1 +1 @@ -{{#includeLibraryTemplate}}class{{/includeLibraryTemplate}} \ No newline at end of file +{{#includeLibraryTemplate}}class{{/includeLibraryTemplate}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache index a47e780c2b57..2a11fc8eedc8 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache @@ -1 +1 @@ -{{#includeLibraryTemplate}}enum{{/includeLibraryTemplate}} \ No newline at end of file +{{#includeLibraryTemplate}}enum{{/includeLibraryTemplate}} 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 6bf879a48973..950f6cd669f4 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 @@ -12,6 +12,9 @@ dependencies: built_value: '>=8.1.0 <9.0.0' built_collection: '>=5.1.0 <6.0.0' {{/useBuiltValue}} +{{#useJsonSerializable}} + json_annotation: '^4.0.0' +{{/useJsonSerializable}} {{#useDateLibTimeMachine}} time_machine: ^0.9.16 {{/useDateLibTimeMachine}} @@ -21,4 +24,8 @@ dev_dependencies: built_value_generator: '>=8.1.0 <9.0.0' build_runner: any {{/useBuiltValue}} - test: '>=1.16.0 <1.17.0' +{{#useJsonSerializable}} + build_runner: any + json_serializable: '^4.1.0' +{{/useJsonSerializable}} + test: 'any' diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache new file mode 100644 index 000000000000..8b3c794cc4eb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache @@ -0,0 +1 @@ +_responseData = deserialize<{{{returnType}}}, {{{returnBaseType}}}>(_response.data!, '{{{returnType}}}', growable: true); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache new file mode 100644 index 000000000000..c9df06d0bfaa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache @@ -0,0 +1,2 @@ +import 'dart:convert'; +import 'package:{{pubName}}/src/deserialize.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache new file mode 100644 index 000000000000..a83489f9e91c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache @@ -0,0 +1 @@ +{{{paramName}}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache new file mode 100644 index 000000000000..93aed695e980 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache @@ -0,0 +1 @@ +{{#bodyParam}}_bodyData=jsonEncode({{{paramName}}});{{/bodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache new file mode 100644 index 000000000000..c9199d60c448 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache @@ -0,0 +1,74 @@ +import 'package:json_annotation/json_annotation.dart'; + +part '{{classFilename}}.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class {{{classname}}} { +{{>serialization/json_serializable/dart_constructor}} + +{{#vars}} + {{#description}} + /// {{{description}}} + {{/description}} + {{^isEnum}} + {{#minimum}} + // minimum: {{{minimum}}} + {{/minimum}} + {{#maximum}} + // maximum: {{{maximum}}} + {{/maximum}} + {{/isEnum}} + {{^isBinary}} + @JsonKey( + {{#defaultValue}}defaultValue: {{{defaultValue}}},{{/defaultValue}} + name: r'{{{baseName}}}', + required: {{#required}}true{{/required}}{{^required}}false{{/required}}, + ) + {{/isBinary}} + {{#isBinary}} + @JsonKey(ignore: true) + {{/isBinary}} + {{{datatypeWithEnum}}}{{^isNullable}}?{{/isNullable}} {{{name}}}; + +{{/vars}} + @override + bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && + {{#vars}} + other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + + @override + int get hashCode => + {{#vars}} + ({{{name}}} == null ? 0 : {{{name}}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + + factory {{{classname}}}.fromJson(Map json) => _${{{classname}}}FromJson(json); + + Map toJson() => _${{{classname}}}ToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} +{{#vars}} + {{#isEnum}} + {{^isContainer}} + +{{>serialization/json_serializable/json_serializable_enum_inline}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} + +{{>serialization/json_serializable/json_serializable_enum_inline}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} +{{/vars}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache new file mode 100644 index 000000000000..91e8548cd494 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache @@ -0,0 +1,10 @@ + /// Returns a new [{{{classname}}}] instance. + {{{classname}}}({ + {{#vars}} + {{! + A field is @required in Dart when it is + required && !nullable && !defaultValue in OAS + }} + {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}this.{{{name}}}{{^isNullable}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}{{/isNullable}}, + {{/vars}} + }); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache new file mode 100644 index 000000000000..5855820cc212 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache @@ -0,0 +1,63 @@ +{{#models}} + {{#model}} +import 'package:{{pubName}}/src/model/{{classFilename}}.dart'; +{{/model}} +{{/models}} + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + + ReturnType deserialize(dynamic value, String targetType, {bool growable= true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + break; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + {{#models}} + {{#model}} + case '{{{classname}}}': + {{#isEnum}} + {{#native_serialization}}return {{{classname}}}TypeTransformer().decode(value);{{/native_serialization}} + {{#json_serializable}} return _$enumDecode(_${{{classname}}}EnumMap, value);{{/json_serializable}} + {{/isEnum}} + {{^isEnum}} + return {{{classname}}}.fromJson(value as Map) as ReturnType; + {{/isEnum}} + {{/model}} + {{/models}} + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((v) => deserialize(v, targetType, growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((v) => deserialize(v, targetType, growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((v) => deserialize(v, targetType, growable: growable)), + ) as ReturnType; + } + break; + } + throw Exception('Cannot deserialize'); + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache new file mode 100644 index 000000000000..5249f86b398e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache @@ -0,0 +1,8 @@ +{{#description}}/// {{{description}}}{{/description}} +enum {{{enumName}}} { +{{#allowableValues}} +{{#enumVars}} + {{{name}}}, +{{/enumVars}} +{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache new file mode 100644 index 000000000000..5249f86b398e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache @@ -0,0 +1,8 @@ +{{#description}}/// {{{description}}}{{/description}} +enum {{{enumName}}} { +{{#allowableValues}} +{{#enumVars}} + {{{name}}}, +{{/enumVars}} +{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache index 186986237424..e963eea9ea45 100644 --- a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache @@ -14,3 +14,6 @@ dependencies: meta: '^1.1.8' dev_dependencies: test: '>=1.16.0 <1.18.0' +{{#json_serializable}} + build_runner: '^1.10.9' + json_serializable: '^3.5.1'{{/json_serializable}} diff --git a/samples/openapi3/client/petstore/dart2/petstore/pubspec.lock b/samples/openapi3/client/petstore/dart2/petstore/pubspec.lock new file mode 100644 index 000000000000..dd5bbc89254b --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore/pubspec.lock @@ -0,0 +1,418 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "14.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "0.41.2" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.7.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.2" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.0" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.1" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "3.7.0" + collection: + dependency: "direct dev" + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + coverage: + dependency: transitive + description: + name: coverage + url: "https://pub.dartlang.org" + source: hosted + version: "0.15.2" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.12" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + http: + dependency: "direct dev" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.3" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + intl: + dependency: transitive + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: "direct dev" + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + mockito: + dependency: "direct dev" + description: + name: mockito + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.4" + node_preamble: + dependency: transitive + description: + name: node_preamble + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.13" + openapi: + dependency: "direct main" + description: + path: "../petstore_client_lib" + relative: true + source: path + version: "1.0.0" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + shelf_static: + dependency: transitive + description: + name: shelf_static + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.10+3" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.10" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test: + dependency: "direct dev" + description: + name: test + url: "https://pub.dartlang.org" + source: hosted + version: "1.16.5" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19" + test_core: + dependency: transitive + description: + name: test_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.15" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + vm_service: + dependency: transitive + description: + name: vm_service + url: "https://pub.dartlang.org" + source: hosted + version: "6.2.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" +sdks: + dart: ">=2.12.0 <3.0.0" From eef247de4e5fd7c15906a47c1cb2410835abab14 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 27 Jul 2021 08:44:06 +0930 Subject: [PATCH 02/34] Move build.yaml template into json_serializable dir --- .../languages/DartDioNextClientCodegen.java | 42 ++++++++++--------- .../json_serializable}/build.yaml.mustache | 0 2 files changed, 23 insertions(+), 19 deletions(-) rename modules/openapi-generator/src/main/resources/dart/libraries/dio/{ => serialization/json_serializable}/build.yaml.mustache (100%) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 9c980d05d02f..cd85fb9fc5f0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -71,15 +71,9 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { public DartDioNextClientCodegen() { super(); - modifyFeatureSet(features -> features - .includeClientModificationFeatures( - ClientModificationFeature.Authorizations, - ClientModificationFeature.UserAgent - ) - ); - generatorMetadata = GeneratorMetadata.newBuilder() - .stability(Stability.EXPERIMENTAL) - .build(); + modifyFeatureSet(features -> features.includeClientModificationFeatures( + ClientModificationFeature.Authorizations, ClientModificationFeature.UserAgent)); + generatorMetadata = GeneratorMetadata.newBuilder().stability(Stability.EXPERIMENTAL).build(); outputFolder = "generated-code/dart-dio-next"; embeddedTemplateDir = "dart/libraries/dio"; @@ -90,7 +84,8 @@ public DartDioNextClientCodegen() { supportedLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); supportedLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "json_serializable"); - final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); + final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, + "Specify serialization library"); serializationLibrary.setEnum(supportedLibraries); serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); cliOptions.add(serializationLibrary); @@ -100,7 +95,8 @@ public DartDioNextClientCodegen() { final Map dateOptions = new HashMap<>(); dateOptions.put(DATE_LIBRARY_CORE, "[DEFAULT] Dart core library (DateTime)"); - dateOptions.put(DATE_LIBRARY_TIME_MACHINE, "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing."); + dateOptions.put(DATE_LIBRARY_TIME_MACHINE, + "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing."); dateOption.setEnum(dateOptions); cliOptions.add(dateOption); } @@ -136,8 +132,10 @@ public void processOpts() { super.processOpts(); if (StringUtils.isEmpty(System.getenv("DART_POST_PROCESS_FILE"))) { - LOGGER.info("Environment variable DART_POST_PROCESS_FILE not defined so the Dart code may not be properly formatted. To define it, try `export DART_POST_PROCESS_FILE=\"/usr/local/bin/dartfmt -w\"` (Linux/Mac)"); - LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + LOGGER.info( + "Environment variable DART_POST_PROCESS_FILE not defined so the Dart code may not be properly formatted. To define it, try `export DART_POST_PROCESS_FILE=\"/usr/local/bin/dartfmt -w\"` (Linux/Mac)"); + LOGGER.info( + "NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); } if (!additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { @@ -218,8 +216,10 @@ private void configureSerializationLibrary(String srcFolder) { } private void configureSerializationLibraryBuiltValue(String srcFolder) { - supportingFiles.add(new SupportingFile("serialization/built_value/serializers.mustache", srcFolder, "serializers.dart")); - supportingFiles.add(new SupportingFile("serialization/built_value/api_util.mustache", srcFolder, "api_util.dart")); + supportingFiles.add( + new SupportingFile("serialization/built_value/serializers.mustache", srcFolder, "serializers.dart")); + supportingFiles + .add(new SupportingFile("serialization/built_value/api_util.mustache", srcFolder, "api_util.dart")); typeMapping.put("Array", "BuiltList"); typeMapping.put("array", "BuiltList"); @@ -240,7 +240,8 @@ private void configureSerializationLibraryBuiltValue(String srcFolder) { } private void configureSerializationLibraryJsonSerializable(String srcFolder) { - supportingFiles.add(new SupportingFile("build.yaml.mustache", "" /* main project dir */, "build.yaml")); + supportingFiles.add(new SupportingFile("serialization/json_serializable/build.yaml.mustache", + "" /* main project dir */, "build.yaml")); supportingFiles.add(new SupportingFile("serialization/json_serializable/deserialize.mustache", srcFolder, "deserialize.dart")); @@ -262,7 +263,8 @@ private void configureDateLibrary(String srcFolder) { imports.put("OffsetDate", "package:time_machine/time_machine.dart"); imports.put("OffsetDateTime", "package:time_machine/time_machine.dart"); if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { - supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", srcFolder, "local_date_serializer.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", + srcFolder, "local_date_serializer.dart")); } break; default: @@ -273,8 +275,10 @@ private void configureDateLibrary(String srcFolder) { typeMapping.put("Date", "Date"); importMapping.put("Date", "package:" + pubName + "/src/model/date.dart"); - supportingFiles.add(new SupportingFile("serialization/built_value/date.mustache", srcFolder + File.separator + "model", "date.dart")); - supportingFiles.add(new SupportingFile("serialization/built_value/date_serializer.mustache", srcFolder, "date_serializer.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/date.mustache", + srcFolder + File.separator + "model", "date.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/date_serializer.mustache", + srcFolder, "date_serializer.dart")); } break; } diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/build.yaml.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/build.yaml.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/build.yaml.mustache rename to modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/build.yaml.mustache From acddd8054f6b34a38a6fb79268a2a548b47cd2cb Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 27 Jul 2021 08:48:26 +0930 Subject: [PATCH 03/34] Undo implicit-dynamic change --- .../main/resources/dart/libraries/dio/analysis_options.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache index d80194005942..a611887d3acf 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache @@ -3,7 +3,7 @@ analyzer: strict-inference: true strict-raw-types: true strong-mode: - implicit-dynamic: true + implicit-dynamic: false implicit-casts: false exclude: - test/*.dart From cabdbda6e2cbbada3b070a556df0a5764f82b9bf Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 27 Jul 2021 16:12:09 +0930 Subject: [PATCH 04/34] Fix automatic formatting --- .../languages/DartDioNextClientCodegen.java | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index cd85fb9fc5f0..5f6227eba022 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -71,9 +71,15 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { public DartDioNextClientCodegen() { super(); - modifyFeatureSet(features -> features.includeClientModificationFeatures( - ClientModificationFeature.Authorizations, ClientModificationFeature.UserAgent)); - generatorMetadata = GeneratorMetadata.newBuilder().stability(Stability.EXPERIMENTAL).build(); + modifyFeatureSet(features -> features + .includeClientModificationFeatures( + ClientModificationFeature.Authorizations, + ClientModificationFeature.UserAgent + ) + ); + generatorMetadata = GeneratorMetadata.newBuilder() + .stability(Stability.EXPERIMENTAL) + .build(); outputFolder = "generated-code/dart-dio-next"; embeddedTemplateDir = "dart/libraries/dio"; @@ -84,8 +90,7 @@ public DartDioNextClientCodegen() { supportedLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); supportedLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "json_serializable"); - final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, - "Specify serialization library"); + final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); serializationLibrary.setEnum(supportedLibraries); serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); cliOptions.add(serializationLibrary); @@ -95,8 +100,7 @@ public DartDioNextClientCodegen() { final Map dateOptions = new HashMap<>(); dateOptions.put(DATE_LIBRARY_CORE, "[DEFAULT] Dart core library (DateTime)"); - dateOptions.put(DATE_LIBRARY_TIME_MACHINE, - "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing."); + dateOptions.put(DATE_LIBRARY_TIME_MACHINE, "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing."); dateOption.setEnum(dateOptions); cliOptions.add(dateOption); } @@ -132,10 +136,8 @@ public void processOpts() { super.processOpts(); if (StringUtils.isEmpty(System.getenv("DART_POST_PROCESS_FILE"))) { - LOGGER.info( - "Environment variable DART_POST_PROCESS_FILE not defined so the Dart code may not be properly formatted. To define it, try `export DART_POST_PROCESS_FILE=\"/usr/local/bin/dartfmt -w\"` (Linux/Mac)"); - LOGGER.info( - "NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + LOGGER.info("Environment variable DART_POST_PROCESS_FILE not defined so the Dart code may not be properly formatted. To define it, try `export DART_POST_PROCESS_FILE=\"/usr/local/bin/dartfmt -w\"` (Linux/Mac)"); + LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); } if (!additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { @@ -216,10 +218,8 @@ private void configureSerializationLibrary(String srcFolder) { } private void configureSerializationLibraryBuiltValue(String srcFolder) { - supportingFiles.add( - new SupportingFile("serialization/built_value/serializers.mustache", srcFolder, "serializers.dart")); - supportingFiles - .add(new SupportingFile("serialization/built_value/api_util.mustache", srcFolder, "api_util.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/serializers.mustache", srcFolder, "serializers.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/api_util.mustache", srcFolder, "api_util.dart")); typeMapping.put("Array", "BuiltList"); typeMapping.put("array", "BuiltList"); @@ -240,8 +240,7 @@ private void configureSerializationLibraryBuiltValue(String srcFolder) { } private void configureSerializationLibraryJsonSerializable(String srcFolder) { - supportingFiles.add(new SupportingFile("serialization/json_serializable/build.yaml.mustache", - "" /* main project dir */, "build.yaml")); + supportingFiles.add(new SupportingFile("serialization/json_serializable/build.yaml.mustache", "" /* main project dir */, "build.yaml")); supportingFiles.add(new SupportingFile("serialization/json_serializable/deserialize.mustache", srcFolder, "deserialize.dart")); @@ -263,8 +262,7 @@ private void configureDateLibrary(String srcFolder) { imports.put("OffsetDate", "package:time_machine/time_machine.dart"); imports.put("OffsetDateTime", "package:time_machine/time_machine.dart"); if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { - supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", - srcFolder, "local_date_serializer.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", srcFolder, "local_date_serializer.dart")); } break; default: @@ -275,10 +273,8 @@ private void configureDateLibrary(String srcFolder) { typeMapping.put("Date", "Date"); importMapping.put("Date", "package:" + pubName + "/src/model/date.dart"); - supportingFiles.add(new SupportingFile("serialization/built_value/date.mustache", - srcFolder + File.separator + "model", "date.dart")); - supportingFiles.add(new SupportingFile("serialization/built_value/date_serializer.mustache", - srcFolder, "date_serializer.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/date.mustache", srcFolder + File.separator + "model", "date.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/date_serializer.mustache", srcFolder, "date_serializer.dart")); } break; } From 2c5ef7059ab3580feb93afb7d3dd57f70aed846f Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 26 Oct 2021 15:46:25 +1030 Subject: [PATCH 05/34] Treat non-required fields as nullable --- .../dio/serialization/json_serializable/class.mustache | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache index c9199d60c448..5cbbd191318a 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache @@ -33,7 +33,11 @@ class {{{classname}}} { {{#isBinary}} @JsonKey(ignore: true) {{/isBinary}} - {{{datatypeWithEnum}}}{{^isNullable}}?{{/isNullable}} {{{name}}}; + {{#required}} + {{{datatypeWithEnum}}}{{^isNullable}}?{{/isNullable}} {{{name}}}; + {{/required}}{{^required}} + {{{datatypeWithEnum}}}? {{{name}}}; + {{/required}} {{/vars}} @override From 693227c0315237dcbdd5b66092945d9edfd3e0bd Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 26 Oct 2021 15:49:06 +1030 Subject: [PATCH 06/34] Make class properties final --- .../dio/serialization/json_serializable/class.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache index 5cbbd191318a..40cd1facec0f 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache @@ -34,9 +34,9 @@ class {{{classname}}} { @JsonKey(ignore: true) {{/isBinary}} {{#required}} - {{{datatypeWithEnum}}}{{^isNullable}}?{{/isNullable}} {{{name}}}; + final {{{datatypeWithEnum}}}{{^isNullable}}?{{/isNullable}} {{{name}}}; {{/required}}{{^required}} - {{{datatypeWithEnum}}}? {{{name}}}; + final {{{datatypeWithEnum}}}? {{{name}}}; {{/required}} {{/vars}} From e1c95710d1fcbdd144ca71d2e1cd125fd7ea3c6d Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 26 Oct 2021 16:28:03 +1030 Subject: [PATCH 07/34] Fix error introduced by merging in master --- .../codegen/languages/DartDioNextClientCodegen.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 5f6227eba022..f499e7e65ffa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -248,7 +248,7 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { // just the binary / file handling languageSpecificPrimitives.add("Object"); imports.put("Uint8List", "dart:typed_data"); - imports.put("MultipartFile", DIO_IMPORT); + imports.put("MultipartFile", dioImport); } private void configureDateLibrary(String srcFolder) { @@ -406,6 +406,7 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List Date: Wed, 27 Oct 2021 13:46:04 +1030 Subject: [PATCH 08/34] Fix map creation when deserializing --- .../serialization/json_serializable/deserialize.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache index 5855820cc212..63cb844f82d0 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache @@ -41,20 +41,20 @@ final _regMap = RegExp(r'^Map$'); if (value is List && (match = _regList.firstMatch(targetType)) != null) { targetType = match![1]!; // ignore: parameter_assignments return value - .map((v) => deserialize(v, targetType, growable: growable)) + .map((dynamic v) => deserialize(v, targetType, growable: growable)) .toList(growable: growable) as ReturnType; } if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { targetType = match![1]!; // ignore: parameter_assignments return value - .map((v) => deserialize(v, targetType, growable: growable)) + .map((dynamic v) => deserialize(v, targetType, growable: growable)) .toSet() as ReturnType; } if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { targetType = match![1]!; // ignore: parameter_assignments - return Map.fromIterables( + return Map.fromIterables( value.keys, - value.values.map((v) => deserialize(v, targetType, growable: growable)), + value.values.map((dynamic v) => deserialize(v, targetType, growable: growable)), ) as ReturnType; } break; From 36f47e7b6dacd802b1766c75c2f5265647da1138 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Wed, 27 Oct 2021 13:46:14 +1030 Subject: [PATCH 09/34] Exclude built files from analysis --- .../main/resources/dart/libraries/dio/analysis_options.mustache | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache index a611887d3acf..28be8936a4bd 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache @@ -7,3 +7,4 @@ analyzer: implicit-casts: false exclude: - test/*.dart + - lib/src/model/*.g.dart From 0feda9b1d3f5b93a3227b41b8f85c0d0c8181fac Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Wed, 27 Oct 2021 13:46:55 +1030 Subject: [PATCH 10/34] Add new dio import props --- .../codegen/languages/DartDioNextClientCodegen.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index f499e7e65ffa..5414ab7df640 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -185,6 +185,9 @@ private void configureSerializationLibrary(String srcFolder) { switch (library) { case SERIALIZATION_LIBRARY_JSON_SERIALIZABLE: additionalProperties.put("useJsonSerializable", "true"); + additionalProperties.put("useDioHttp", dioLibrary.equals(DIO_HTTP)); + additionalProperties.put("dioImport", dioImport); + additionalProperties.put("dioLibrary", dioLibrary); configureSerializationLibraryJsonSerializable(srcFolder); break; default: From dc34a8a897eacf6708170b92e43a89bd4c54c2e1 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Wed, 27 Oct 2021 13:47:09 +1030 Subject: [PATCH 11/34] Fix broken merge --- .../codegen/languages/DartDioNextClientCodegen.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 5414ab7df640..d74c85377e38 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -405,10 +405,11 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List Date: Fri, 29 Oct 2021 14:47:36 +1030 Subject: [PATCH 12/34] Fix configuration of nullable properties --- .../dio/serialization/json_serializable/class.mustache | 6 +----- .../json_serializable/dart_constructor.mustache | 5 +++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache index 40cd1facec0f..e2e704346a38 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache @@ -33,11 +33,7 @@ class {{{classname}}} { {{#isBinary}} @JsonKey(ignore: true) {{/isBinary}} - {{#required}} - final {{{datatypeWithEnum}}}{{^isNullable}}?{{/isNullable}} {{{name}}}; - {{/required}}{{^required}} - final {{{datatypeWithEnum}}}? {{{name}}}; - {{/required}} + final {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{{name}}}; {{/vars}} @override diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache index 91e8548cd494..d2139dbd87d6 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache @@ -3,8 +3,9 @@ {{#vars}} {{! A field is @required in Dart when it is - required && !nullable && !defaultValue in OAS + !nullable && !defaultValue in OAS }} - {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}this.{{{name}}}{{^isNullable}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}{{/isNullable}}, + + {{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}this.{{{name}}}{{^isNullable}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}{{/isNullable}}, {{/vars}} }); \ No newline at end of file From 5d4fa0fce099341ac80ccd5181b0c34e076660c5 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Thu, 4 Nov 2021 14:40:02 +1030 Subject: [PATCH 13/34] Only add api_util import if using built value --- .../codegen/languages/DartDioNextClientCodegen.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index d74c85377e38..7c012aba5e6e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -408,7 +408,8 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List Date: Fri, 3 Dec 2021 09:54:27 +1030 Subject: [PATCH 14/34] Add config param to set properties as final --- .../languages/DartDioNextClientCodegen.java | 22 +++++++++++++++++++ .../json_serializable/class.mustache | 11 +++++++++- .../dart_constructor.mustache | 8 +++---- .../DartDioNextClientOptionsProvider.java | 2 ++ 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 7c012aba5e6e..0fc3970402e1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -60,6 +60,9 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE; private static final String DIO_IMPORT = "package:dio/dio.dart"; + public static final String FINAL_PROPERTIES = "finalProperties"; + public static final String FINAL_PROPERTIES_DEFAULT_VALUE = "true"; + private static final String CLIENT_NAME = "clientName"; private String dateLibrary; @@ -95,6 +98,11 @@ public DartDioNextClientCodegen() { serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); cliOptions.add(serializationLibrary); + final CliOption finalProperties = CliOption.newBoolean(FINAL_PROPERTIES, "Whether properties are marked as final when using Json Serializable for serialization"); + finalProperties.setDefault("true"); + cliOptions.add(finalProperties); + + // Date Library Option final CliOption dateOption = CliOption.newString(DATE_LIBRARY, "Specify Date library"); dateOption.setDefault(DATE_LIBRARY_DEFAULT); @@ -152,6 +160,20 @@ public void processOpts() { } setDateLibrary(additionalProperties.get(DATE_LIBRARY).toString()); + if (!additionalProperties.containsKey(FINAL_PROPERTIES)) { + additionalProperties.put(FINAL_PROPERTIES, Boolean.parseBoolean(FINAL_PROPERTIES_DEFAULT_VALUE)); + LOGGER.debug("finalProperties not set, using default {}", FINAL_PROPERTIES_DEFAULT_VALUE); + } + else { + additionalProperties.put(FINAL_PROPERTIES, Boolean.parseBoolean(additionalProperties.get(FINAL_PROPERTIES).toString())); + } + + if (!additionalProperties.containsKey(DIO_LIBRARY)) { + additionalProperties.put(DIO_LIBRARY, DIO_LIBRARY_DEFAULT); + LOGGER.debug("Dio library not set, using default {}", DIO_LIBRARY_DEFAULT); + } + setDioLibrary(additionalProperties.get(DIO_LIBRARY).toString()); + if (!additionalProperties.containsKey(CLIENT_NAME)) { final String name = org.openapitools.codegen.utils.StringUtils.camelize(pubName); additionalProperties.put(CLIENT_NAME, name); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache index e2e704346a38..fcc779faf758 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache @@ -33,7 +33,16 @@ class {{{classname}}} { {{#isBinary}} @JsonKey(ignore: true) {{/isBinary}} - final {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{{name}}}; + + + {{#required}} + {{#finalProperties}}final {{/finalProperties}}{{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{{name}}}; + {{/required}} + {{^required}} + {{#finalProperties}}final {{/finalProperties}}{{{datatypeWithEnum}}}? {{{name}}}; + {{/required}} + + {{/vars}} @override diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache index d2139dbd87d6..3b99f0c54016 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache @@ -1,11 +1,11 @@ /// Returns a new [{{{classname}}}] instance. {{{classname}}}({ {{#vars}} + {{! - A field is @required in Dart when it is - !nullable && !defaultValue in OAS + A field is required in Dart when it is + required && !defaultValue in OAS }} - - {{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}this.{{{name}}}{{^isNullable}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}{{/isNullable}}, + {{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}} this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}, {{/vars}} }); \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java index cda6e36cfc6c..5f4b58b21bde 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java @@ -59,6 +59,8 @@ public Map createOptions() { .put(DartDioNextClientCodegen.PUB_HOMEPAGE, PUB_HOMEPAGE_VALUE) .put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT) .put(DartDioNextClientCodegen.DATE_LIBRARY, DartDioNextClientCodegen.DATE_LIBRARY_DEFAULT) + .put(DartDioNextClientCodegen.DIO_LIBRARY, DartDioNextClientCodegen.DIO_LIBRARY_DEFAULT) + .put(DartDioNextClientCodegen.FINAL_PROPERTIES, DartDioNextClientCodegen.FINAL_PROPERTIES_DEFAULT_VALUE) .put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE) .put(DartDioNextClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) From a3ab5d27083d9beae09cf441b5507a5c473983d2 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 12 Apr 2022 12:18:02 +0930 Subject: [PATCH 15/34] Fix syntax error due to merge --- .../languages/DartDioNextClientCodegen.java | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 0fc3970402e1..6f73604e15ca 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -168,12 +168,6 @@ public void processOpts() { additionalProperties.put(FINAL_PROPERTIES, Boolean.parseBoolean(additionalProperties.get(FINAL_PROPERTIES).toString())); } - if (!additionalProperties.containsKey(DIO_LIBRARY)) { - additionalProperties.put(DIO_LIBRARY, DIO_LIBRARY_DEFAULT); - LOGGER.debug("Dio library not set, using default {}", DIO_LIBRARY_DEFAULT); - } - setDioLibrary(additionalProperties.get(DIO_LIBRARY).toString()); - if (!additionalProperties.containsKey(CLIENT_NAME)) { final String name = org.openapitools.codegen.utils.StringUtils.camelize(pubName); additionalProperties.put(CLIENT_NAME, name); @@ -435,18 +429,16 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List Date: Tue, 12 Apr 2022 12:31:01 +0930 Subject: [PATCH 16/34] Update to simplified dio configuration --- .../codegen/languages/DartDioNextClientCodegen.java | 4 ---- .../codegen/options/DartDioNextClientOptionsProvider.java | 1 - 2 files changed, 5 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 6f73604e15ca..83e1acb12686 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -201,9 +201,6 @@ private void configureSerializationLibrary(String srcFolder) { switch (library) { case SERIALIZATION_LIBRARY_JSON_SERIALIZABLE: additionalProperties.put("useJsonSerializable", "true"); - additionalProperties.put("useDioHttp", dioLibrary.equals(DIO_HTTP)); - additionalProperties.put("dioImport", dioImport); - additionalProperties.put("dioLibrary", dioLibrary); configureSerializationLibraryJsonSerializable(srcFolder); break; default: @@ -267,7 +264,6 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { // just the binary / file handling languageSpecificPrimitives.add("Object"); imports.put("Uint8List", "dart:typed_data"); - imports.put("MultipartFile", dioImport); } private void configureDateLibrary(String srcFolder) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java index 5f4b58b21bde..d1ee3c3cbffb 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java @@ -59,7 +59,6 @@ public Map createOptions() { .put(DartDioNextClientCodegen.PUB_HOMEPAGE, PUB_HOMEPAGE_VALUE) .put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT) .put(DartDioNextClientCodegen.DATE_LIBRARY, DartDioNextClientCodegen.DATE_LIBRARY_DEFAULT) - .put(DartDioNextClientCodegen.DIO_LIBRARY, DartDioNextClientCodegen.DIO_LIBRARY_DEFAULT) .put(DartDioNextClientCodegen.FINAL_PROPERTIES, DartDioNextClientCodegen.FINAL_PROPERTIES_DEFAULT_VALUE) .put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE) .put(DartDioNextClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION) From 019084aa4ac35f1bb87f03f6310ce81285a2f089 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 12 Apr 2022 16:30:05 +0930 Subject: [PATCH 17/34] Add missing api constructor template --- .../dio/serialization/json_serializable/api/constructor.mustache | 1 + 1 file changed, 1 insertion(+) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache new file mode 100644 index 000000000000..a772c3148eaa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache @@ -0,0 +1 @@ + const {{classname}}(this._dio); \ No newline at end of file From f9c7e21d63ae55a9ddad07b8501568613e6a36c9 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 12 Apr 2022 16:56:25 +0930 Subject: [PATCH 18/34] Fix import for multipart files --- .../openapitools/codegen/languages/DartDioNextClientCodegen.java | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 204c573fd90e..7d0f6a9a20b8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -264,6 +264,7 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { // just the binary / file handling languageSpecificPrimitives.add("Object"); imports.put("Uint8List", "dart:typed_data"); + imports.put("MultipartFile", DIO_IMPORT); } private void configureDateLibrary(String srcFolder) { From 826b465f24889327eb24bef995dec7fc6a22b7cc Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 12 Apr 2022 17:17:26 +0930 Subject: [PATCH 19/34] Fix inclusion of library deserialize template --- .../src/main/resources/dart/libraries/dio/api.mustache | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache index a3dbf28d227a..39cfe5362be7 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache @@ -118,9 +118,8 @@ class {{classname}} { {{{returnType}}} _responseData; try { -{{#useBuiltValue}}{{>serialization/built_value/deserialize}}{{/useBuiltValue}} -{{#useJsonSerializable}} -_responseData = deserialize<{{{returnType}}}, {{{returnBaseType}}}>(_response.data!, '{{{returnType}}}', growable: true);{{/useJsonSerializable}} +{{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} + } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, From 6d185a1249cdadf31aae2907c9ced3e80e3cc908 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 12 Apr 2022 17:49:04 +0930 Subject: [PATCH 20/34] Update docs --- docs/generators/dart-dio-next.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/generators/dart-dio-next.md b/docs/generators/dart-dio-next.md index d247192fd97c..785a61c3b2a5 100644 --- a/docs/generators/dart-dio-next.md +++ b/docs/generators/dart-dio-next.md @@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| +|finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |null| @@ -32,7 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |pubLibrary|Library name in generated code| |null| |pubName|Name in generated pubspec| |null| |pubVersion|Version in generated pubspec| |null| -|serializationLibrary|Specify serialization library|
**built_value**
[DEFAULT] built_value
|built_value| +|serializationLibrary|Specify serialization library|
**built_value**
[DEFAULT] built_value
**json_serializable**
json_serializable
|built_value| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|Source folder for generated code| |null| From a78f410fdac9181f14c8a0430c6997c5516434b9 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 12 Apr 2022 18:01:32 +0930 Subject: [PATCH 21/34] Remove trailing newline from class --- .../src/main/resources/dart/libraries/dio/class.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache index 634f16ce936b..228fcf5826d1 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache @@ -1 +1 @@ -{{#includeLibraryTemplate}}class{{/includeLibraryTemplate}} +{{#includeLibraryTemplate}}class{{/includeLibraryTemplate}} \ No newline at end of file From 8e8cb4f1ef09a093465a3a7132773115a8551fe2 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 12 Apr 2022 20:34:48 +0930 Subject: [PATCH 22/34] Fix whitespace in generated templates --- .../resources/dart/libraries/dio/analysis_options.mustache | 4 ++-- .../src/main/resources/dart/libraries/dio/api.mustache | 1 - .../src/main/resources/dart2/pubspec.mustache | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache index 28be8936a4bd..435ebda4c7e3 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache @@ -6,5 +6,5 @@ analyzer: implicit-dynamic: false implicit-casts: false exclude: - - test/*.dart - - lib/src/model/*.g.dart + - test/*.dart{{#useJsonSerializable}} + - lib/src/model/*.g.dart{{/useJsonSerializable}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache index 39cfe5362be7..892cbafd4694 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache @@ -119,7 +119,6 @@ class {{classname}} { try { {{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, diff --git a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache index e963eea9ea45..cf182945cdbd 100644 --- a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache @@ -16,4 +16,4 @@ dev_dependencies: test: '>=1.16.0 <1.18.0' {{#json_serializable}} build_runner: '^1.10.9' - json_serializable: '^3.5.1'{{/json_serializable}} + json_serializable: '^3.5.1'{{/json_serializable}} \ No newline at end of file From a820c449ae6a65166c08bda71bf330af0e22bc34 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Tue, 12 Apr 2022 20:53:03 +0930 Subject: [PATCH 23/34] FIx built value generation problem caused by merge conflicts --- .../codegen/languages/DartDioNextClientCodegen.java | 2 +- .../src/main/resources/dart/libraries/dio/enum.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 7d0f6a9a20b8..15da567031b2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -405,7 +405,7 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List Date: Wed, 13 Apr 2022 13:54:04 +0930 Subject: [PATCH 24/34] Escape dollar signs in strings --- .../org/openapitools/codegen/languages/AbstractDartCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8d121c79c732..c9bc63f361f1 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 @@ -768,7 +768,7 @@ public String escapeQuotationMark(String input) { @Override public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); + return input.replace("*/", "*_/").replace("/*", "/_*").replace("$", "\\$"); } @Override From de62845264a7e48c66d88058ee70112a10765028 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Wed, 13 Apr 2022 13:54:33 +0930 Subject: [PATCH 25/34] Handle enums --- .../main/resources/dart/libraries/dio/pubspec.mustache | 4 ++-- .../dio/serialization/json_serializable/class.mustache | 5 +++-- .../dio/serialization/json_serializable/enum.mustache | 8 +++++++- .../serialization/json_serializable/enum_inline.mustache | 7 +++++-- 4 files changed, 17 insertions(+), 7 deletions(-) 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 639be69a374c..139b6ef4ccde 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 @@ -13,7 +13,7 @@ dependencies: built_collection: '>=5.1.0 <6.0.0' {{/useBuiltValue}} {{#useJsonSerializable}} - json_annotation: '^4.0.0' + json_annotation: '^4.4.0' {{/useJsonSerializable}} {{#useDateLibTimeMachine}} time_machine: ^0.9.16 @@ -26,6 +26,6 @@ dev_dependencies: {{/useBuiltValue}} {{#useJsonSerializable}} build_runner: any - json_serializable: '^4.1.0' + json_serializable: '^6.1.5' {{/useJsonSerializable}} test: ^1.16.0 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache index fcc779faf758..e6b9445654f7 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache @@ -28,6 +28,7 @@ class {{{classname}}} { {{#defaultValue}}defaultValue: {{{defaultValue}}},{{/defaultValue}} name: r'{{{baseName}}}', required: {{#required}}true{{/required}}{{^required}}false{{/required}}, + includeIfNull: {{#required}}{{#isNullable}}true{{/isNullable}}false{{/required}}{{^required}}false{{/required}} ) {{/isBinary}} {{#isBinary}} @@ -71,12 +72,12 @@ class {{{classname}}} { {{#isEnum}} {{^isContainer}} -{{>serialization/json_serializable/json_serializable_enum_inline}} +{{>serialization/json_serializable/enum_inline}} {{/isContainer}} {{#isContainer}} {{#mostInnerItems}} -{{>serialization/json_serializable/json_serializable_enum_inline}} +{{>serialization/json_serializable/enum_inline}} {{/mostInnerItems}} {{/isContainer}} {{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache index 5249f86b398e..0d6a4ee0276c 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache @@ -1,7 +1,13 @@ +import 'package:json_annotation/json_annotation.dart'; + {{#description}}/// {{{description}}}{{/description}} -enum {{{enumName}}} { +enum {{{classname}}} { {{#allowableValues}} {{#enumVars}} + {{#description}} + /// {{{.}}} + {{/description}} + @JsonValue({{{value}}}) {{{name}}}, {{/enumVars}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache index 5249f86b398e..fd827eaad135 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache @@ -1,8 +1,11 @@ +{{#enumName}} {{#description}}/// {{{description}}}{{/description}} -enum {{{enumName}}} { +enum {{{ enumName }}} { {{#allowableValues}} {{#enumVars}} + @JsonValue({{{value}}}) {{{name}}}, {{/enumVars}} {{/allowableValues}} -} \ No newline at end of file +} +{{/enumName}} \ No newline at end of file From 3c56734f9ec0f722e34ee3c388ae2cc3b8faf311 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Wed, 13 Apr 2022 13:54:46 +0930 Subject: [PATCH 26/34] Config for json_serializable sample --- ...t-petstore-client-lib-fake-json_serializable.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 bin/configs/dart-dio-next-petstore-client-lib-fake-json_serializable.yaml diff --git a/bin/configs/dart-dio-next-petstore-client-lib-fake-json_serializable.yaml b/bin/configs/dart-dio-next-petstore-client-lib-fake-json_serializable.yaml new file mode 100644 index 000000000000..3e1a7b3c9c9a --- /dev/null +++ b/bin/configs/dart-dio-next-petstore-client-lib-fake-json_serializable.yaml @@ -0,0 +1,12 @@ +generatorName: dart-dio-next +outputDir: samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" + serializationLibrary: "json_serializable" From 4203144f22cb752c233485b7220d27805642f781 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Wed, 13 Apr 2022 13:59:26 +0930 Subject: [PATCH 27/34] Generate sample for json_serializable --- .../.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 176 +++ .../.openapi-generator/VERSION | 1 + .../README.md | 201 +++ .../analysis_options.yaml | 10 + .../build.yaml | 18 + .../doc/AdditionalPropertiesClass.md | 16 + .../doc/Animal.md | 16 + .../doc/AnotherFakeApi.md | 57 + .../doc/ApiResponse.md | 17 + .../doc/ArrayOfArrayOfNumberOnly.md | 15 + .../doc/ArrayOfNumberOnly.md | 15 + .../doc/ArrayTest.md | 17 + .../doc/Capitalization.md | 20 + .../doc/Cat.md | 17 + .../doc/CatAllOf.md | 15 + .../doc/Category.md | 16 + .../doc/ClassModel.md | 15 + .../doc/DefaultApi.md | 51 + .../doc/DeprecatedObject.md | 15 + .../doc/Dog.md | 17 + .../doc/DogAllOf.md | 15 + .../doc/EnumArrays.md | 16 + .../doc/EnumTest.md | 22 + .../doc/FakeApi.md | 822 ++++++++++ .../doc/FakeClassnameTags123Api.md | 61 + .../doc/FileSchemaTestClass.md | 16 + .../doc/Foo.md | 15 + .../doc/FormatTest.md | 30 + .../doc/HasOnlyReadOnly.md | 16 + .../doc/HealthCheckResult.md | 15 + .../doc/InlineResponseDefault.md | 15 + .../doc/MapTest.md | 18 + ...dPropertiesAndAdditionalPropertiesClass.md | 17 + .../doc/Model200Response.md | 16 + .../doc/ModelClient.md | 15 + .../doc/ModelEnumClass.md | 14 + .../doc/ModelFile.md | 15 + .../doc/ModelList.md | 15 + .../doc/ModelReturn.md | 15 + .../doc/Name.md | 18 + .../doc/NullableClass.md | 26 + .../doc/NumberOnly.md | 15 + .../doc/ObjectWithDeprecatedFields.md | 18 + .../doc/Order.md | 20 + .../doc/OuterComposite.md | 17 + .../doc/OuterEnum.md | 14 + .../doc/OuterEnumDefaultValue.md | 14 + .../doc/OuterEnumInteger.md | 14 + .../doc/OuterEnumIntegerDefaultValue.md | 14 + .../doc/OuterObjectWithEnumProperty.md | 15 + .../doc/Pet.md | 20 + .../doc/PetApi.md | 439 ++++++ .../doc/ReadOnlyFirst.md | 16 + .../doc/SpecialModelName.md | 15 + .../doc/StoreApi.md | 188 +++ .../doc/Tag.md | 16 + .../doc/User.md | 23 + .../doc/UserApi.md | 359 +++++ .../doc/UserType.md | 14 + .../lib/openapi.dart | 65 + .../lib/src/api.dart | 110 ++ .../lib/src/api/another_fake_api.dart | 105 ++ .../lib/src/api/default_api.dart | 86 ++ .../lib/src/api/fake_api.dart | 1351 +++++++++++++++++ .../src/api/fake_classname_tags123_api.dart | 112 ++ .../lib/src/api/pet_api.dart | 711 +++++++++ .../lib/src/api/store_api.dart | 295 ++++ .../lib/src/api/user_api.dart | 515 +++++++ .../lib/src/auth/api_key_auth.dart | 30 + .../lib/src/auth/auth.dart | 18 + .../lib/src/auth/basic_auth.dart | 37 + .../lib/src/auth/bearer_auth.dart | 26 + .../lib/src/auth/oauth.dart | 26 + .../lib/src/deserialize.dart | 193 +++ .../model/additional_properties_class.dart | 68 + .../lib/src/model/animal.dart | 68 + .../lib/src/model/api_response.dart | 84 + .../model/array_of_array_of_number_only.dart | 52 + .../lib/src/model/array_of_number_only.dart | 52 + .../lib/src/model/array_test.dart | 85 ++ .../lib/src/model/capitalization.dart | 133 ++ .../lib/src/model/cat.dart | 86 ++ .../lib/src/model/cat_all_of.dart | 52 + .../lib/src/model/category.dart | 68 + .../lib/src/model/class_model.dart | 52 + .../lib/src/model/deprecated_object.dart | 52 + .../lib/src/model/dog.dart | 86 ++ .../lib/src/model/dog_all_of.dart | 52 + .../lib/src/model/enum_arrays.dart | 90 ++ .../lib/src/model/enum_test.dart | 216 +++ .../lib/src/model/file_schema_test_class.dart | 69 + .../lib/src/model/foo.dart | 52 + .../lib/src/model/format_test.dart | 300 ++++ .../lib/src/model/has_only_read_only.dart | 68 + .../lib/src/model/health_check_result.dart | 52 + .../src/model/inline_response_default.dart | 53 + .../lib/src/model/map_test.dart | 111 ++ ...rties_and_additional_properties_class.dart | 85 ++ .../lib/src/model/model200_response.dart | 68 + .../lib/src/model/model_client.dart | 52 + .../lib/src/model/model_enum_class.dart | 17 + .../lib/src/model/model_file.dart | 53 + .../lib/src/model/model_list.dart | 52 + .../lib/src/model/model_return.dart | 52 + .../lib/src/model/name.dart | 100 ++ .../lib/src/model/nullable_class.dart | 228 +++ .../lib/src/model/number_only.dart | 52 + .../model/object_with_deprecated_fields.dart | 101 ++ .../lib/src/model/order.dart | 146 ++ .../lib/src/model/outer_composite.dart | 84 + .../lib/src/model/outer_enum.dart | 17 + .../src/model/outer_enum_default_value.dart | 17 + .../lib/src/model/outer_enum_integer.dart | 17 + .../outer_enum_integer_default_value.dart | 17 + .../outer_object_with_enum_property.dart | 53 + .../lib/src/model/pet.dart | 148 ++ .../lib/src/model/read_only_first.dart | 68 + .../lib/src/model/special_model_name.dart | 52 + .../lib/src/model/tag.dart | 68 + .../lib/src/model/user.dart | 184 +++ .../lib/src/model/user_type.dart | 15 + .../pubspec.yaml | 16 + .../additional_properties_class_test.dart | 21 + .../test/animal_test.dart | 21 + .../test/another_fake_api_test.dart | 20 + .../test/api_response_test.dart | 26 + .../array_of_array_of_number_only_test.dart | 16 + .../test/array_of_number_only_test.dart | 16 + .../test/array_test_test.dart | 26 + .../test/capitalization_test.dart | 42 + .../test/cat_all_of_test.dart | 16 + .../test/cat_test.dart | 26 + .../test/category_test.dart | 21 + .../test/class_model_test.dart | 16 + .../test/default_api_test.dart | 16 + .../test/deprecated_object_test.dart | 16 + .../test/dog_all_of_test.dart | 16 + .../test/dog_test.dart | 26 + .../test/enum_arrays_test.dart | 21 + .../test/enum_test_test.dart | 51 + .../test/fake_api_test.dart | 140 ++ .../test/fake_classname_tags123_api_test.dart | 20 + .../test/file_schema_test_class_test.dart | 21 + .../test/foo_test.dart | 16 + .../test/format_test_test.dart | 93 ++ .../test/has_only_read_only_test.dart | 21 + .../test/health_check_result_test.dart | 16 + .../test/inline_response_default_test.dart | 16 + .../test/map_test_test.dart | 31 + ..._and_additional_properties_class_test.dart | 26 + .../test/model200_response_test.dart | 21 + .../test/model_client_test.dart | 16 + .../test/model_enum_class_test.dart | 9 + .../test/model_file_test.dart | 17 + .../test/model_list_test.dart | 16 + .../test/model_return_test.dart | 16 + .../test/name_test.dart | 31 + .../test/nullable_class_test.dart | 71 + .../test/number_only_test.dart | 16 + .../object_with_deprecated_fields_test.dart | 31 + .../test/order_test.dart | 42 + .../test/outer_composite_test.dart | 26 + .../test/outer_enum_default_value_test.dart | 9 + ...outer_enum_integer_default_value_test.dart | 9 + .../test/outer_enum_integer_test.dart | 9 + .../test/outer_enum_test.dart | 9 + .../outer_object_with_enum_property_test.dart | 16 + .../test/pet_api_test.dart | 92 ++ .../test/pet_test.dart | 42 + .../test/read_only_first_test.dart | 21 + .../test/special_model_name_test.dart | 16 + .../test/store_api_test.dart | 47 + .../test/tag_test.dart | 21 + .../test/user_api_test.dart | 83 + .../test/user_test.dart | 57 + .../test/user_type_test.dart | 9 + 178 files changed, 12240 insertions(+) create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/build.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Animal.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Capitalization.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Cat.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Category.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ClassModel.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Dog.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/EnumTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Foo.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FormatTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/MapTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Model200Response.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelClient.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelFile.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelList.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Name.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/NullableClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Order.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Pet.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/PetApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/StoreApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Tag.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/User.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/UserApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/UserType.md create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user_type.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/animal_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/api_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/category_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/class_model_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/foo_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/format_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/inline_response_default_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/map_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_client_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_file_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_list_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_return_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/order_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/store_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/tag_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.gitignore b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.gitignore @@ -0,0 +1,41 @@ +# See https://dart.dev/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock + +# Don’t commit files and directories created by other development environments. +# For example, if your development environment creates any of the following files, +# consider putting them in a global ignore file: + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES new file mode 100644 index 000000000000..61c90ee2a919 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -0,0 +1,176 @@ +.gitignore +.openapi-generator-ignore +README.md +analysis_options.yaml +build.yaml +doc/AdditionalPropertiesClass.md +doc/Animal.md +doc/AnotherFakeApi.md +doc/ApiResponse.md +doc/ArrayOfArrayOfNumberOnly.md +doc/ArrayOfNumberOnly.md +doc/ArrayTest.md +doc/Capitalization.md +doc/Cat.md +doc/CatAllOf.md +doc/Category.md +doc/ClassModel.md +doc/DefaultApi.md +doc/DeprecatedObject.md +doc/Dog.md +doc/DogAllOf.md +doc/EnumArrays.md +doc/EnumTest.md +doc/FakeApi.md +doc/FakeClassnameTags123Api.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FormatTest.md +doc/HasOnlyReadOnly.md +doc/HealthCheckResult.md +doc/InlineResponseDefault.md +doc/MapTest.md +doc/MixedPropertiesAndAdditionalPropertiesClass.md +doc/Model200Response.md +doc/ModelClient.md +doc/ModelEnumClass.md +doc/ModelFile.md +doc/ModelList.md +doc/ModelReturn.md +doc/Name.md +doc/NullableClass.md +doc/NumberOnly.md +doc/ObjectWithDeprecatedFields.md +doc/Order.md +doc/OuterComposite.md +doc/OuterEnum.md +doc/OuterEnumDefaultValue.md +doc/OuterEnumInteger.md +doc/OuterEnumIntegerDefaultValue.md +doc/OuterObjectWithEnumProperty.md +doc/Pet.md +doc/PetApi.md +doc/ReadOnlyFirst.md +doc/SpecialModelName.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +doc/UserType.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/another_fake_api.dart +lib/src/api/default_api.dart +lib/src/api/fake_api.dart +lib/src/api/fake_classname_tags123_api.dart +lib/src/api/pet_api.dart +lib/src/api/store_api.dart +lib/src/api/user_api.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/deserialize.dart +lib/src/model/additional_properties_class.dart +lib/src/model/animal.dart +lib/src/model/api_response.dart +lib/src/model/array_of_array_of_number_only.dart +lib/src/model/array_of_number_only.dart +lib/src/model/array_test.dart +lib/src/model/capitalization.dart +lib/src/model/cat.dart +lib/src/model/cat_all_of.dart +lib/src/model/category.dart +lib/src/model/class_model.dart +lib/src/model/deprecated_object.dart +lib/src/model/dog.dart +lib/src/model/dog_all_of.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/format_test.dart +lib/src/model/has_only_read_only.dart +lib/src/model/health_check_result.dart +lib/src/model/inline_response_default.dart +lib/src/model/map_test.dart +lib/src/model/mixed_properties_and_additional_properties_class.dart +lib/src/model/model200_response.dart +lib/src/model/model_client.dart +lib/src/model/model_enum_class.dart +lib/src/model/model_file.dart +lib/src/model/model_list.dart +lib/src/model/model_return.dart +lib/src/model/name.dart +lib/src/model/nullable_class.dart +lib/src/model/number_only.dart +lib/src/model/object_with_deprecated_fields.dart +lib/src/model/order.dart +lib/src/model/outer_composite.dart +lib/src/model/outer_enum.dart +lib/src/model/outer_enum_default_value.dart +lib/src/model/outer_enum_integer.dart +lib/src/model/outer_enum_integer_default_value.dart +lib/src/model/outer_object_with_enum_property.dart +lib/src/model/pet.dart +lib/src/model/read_only_first.dart +lib/src/model/special_model_name.dart +lib/src/model/tag.dart +lib/src/model/user.dart +lib/src/model/user_type.dart +pubspec.yaml +test/additional_properties_class_test.dart +test/animal_test.dart +test/another_fake_api_test.dart +test/api_response_test.dart +test/array_of_array_of_number_only_test.dart +test/array_of_number_only_test.dart +test/array_test_test.dart +test/capitalization_test.dart +test/cat_all_of_test.dart +test/cat_test.dart +test/category_test.dart +test/class_model_test.dart +test/default_api_test.dart +test/deprecated_object_test.dart +test/dog_all_of_test.dart +test/dog_test.dart +test/enum_arrays_test.dart +test/enum_test_test.dart +test/fake_api_test.dart +test/fake_classname_tags123_api_test.dart +test/file_schema_test_class_test.dart +test/foo_test.dart +test/format_test_test.dart +test/has_only_read_only_test.dart +test/health_check_result_test.dart +test/inline_response_default_test.dart +test/map_test_test.dart +test/mixed_properties_and_additional_properties_class_test.dart +test/model200_response_test.dart +test/model_client_test.dart +test/model_enum_class_test.dart +test/model_file_test.dart +test/model_list_test.dart +test/model_return_test.dart +test/name_test.dart +test/nullable_class_test.dart +test/number_only_test.dart +test/object_with_deprecated_fields_test.dart +test/order_test.dart +test/outer_composite_test.dart +test/outer_enum_default_value_test.dart +test/outer_enum_integer_default_value_test.dart +test/outer_enum_integer_test.dart +test/outer_enum_test.dart +test/outer_object_with_enum_property_test.dart +test/pet_api_test.dart +test/pet_test.dart +test/read_only_first_test.dart +test/special_model_name_test.dart +test/store_api_test.dart +test/tag_test.dart +test/user_api_test.dart +test/user_test.dart +test/user_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION new file mode 100644 index 000000000000..5f68295fc196 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/README.md new file mode 100644 index 000000000000..eacb4337d450 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/README.md @@ -0,0 +1,201 @@ +# openapi (EXPERIMENTAL) +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Build package: org.openapitools.codegen.languages.DartDioNextClientCodegen + +## Requirements + +* Dart 2.12.0 or later OR Flutter 1.26.0 or later +* Dio 4.0.0+ + +## Installation & Usage + +### pub.dev +To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml +```yaml +dependencies: + openapi: 1.0.0 +``` + +### Github +If this Dart package is published to Github, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + git: + url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git + #ref: main +``` + +### Local development +To use the package from your local drive, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + path: /path/to/openapi +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:openapi/openapi.dart'; + + +final api = Openapi().getAnotherFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = await api.call123testSpecialTags(modelClient); + print(response); +} catch on DioError (e) { + print("Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | +[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user +[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) + - [Animal](doc/Animal.md) + - [ApiResponse](doc/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) + - [ArrayTest](doc/ArrayTest.md) + - [Capitalization](doc/Capitalization.md) + - [Cat](doc/Cat.md) + - [CatAllOf](doc/CatAllOf.md) + - [Category](doc/Category.md) + - [ClassModel](doc/ClassModel.md) + - [DeprecatedObject](doc/DeprecatedObject.md) + - [Dog](doc/Dog.md) + - [DogAllOf](doc/DogAllOf.md) + - [EnumArrays](doc/EnumArrays.md) + - [EnumTest](doc/EnumTest.md) + - [FileSchemaTestClass](doc/FileSchemaTestClass.md) + - [Foo](doc/Foo.md) + - [FormatTest](doc/FormatTest.md) + - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) + - [HealthCheckResult](doc/HealthCheckResult.md) + - [InlineResponseDefault](doc/InlineResponseDefault.md) + - [MapTest](doc/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](doc/Model200Response.md) + - [ModelClient](doc/ModelClient.md) + - [ModelEnumClass](doc/ModelEnumClass.md) + - [ModelFile](doc/ModelFile.md) + - [ModelList](doc/ModelList.md) + - [ModelReturn](doc/ModelReturn.md) + - [Name](doc/Name.md) + - [NullableClass](doc/NullableClass.md) + - [NumberOnly](doc/NumberOnly.md) + - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md) + - [Order](doc/Order.md) + - [OuterComposite](doc/OuterComposite.md) + - [OuterEnum](doc/OuterEnum.md) + - [OuterEnumDefaultValue](doc/OuterEnumDefaultValue.md) + - [OuterEnumInteger](doc/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md) + - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) + - [Pet](doc/Pet.md) + - [ReadOnlyFirst](doc/ReadOnlyFirst.md) + - [SpecialModelName](doc/SpecialModelName.md) + - [Tag](doc/Tag.md) + - [User](doc/User.md) + - [UserType](doc/UserType.md) + + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +## bearer_test + +- **Type**: HTTP basic authentication + +## http_basic_test + +- **Type**: HTTP basic authentication + +## http_signature_test + +- **Type**: HTTP basic authentication + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/analysis_options.yaml new file mode 100644 index 000000000000..28be8936a4bd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/analysis_options.yaml @@ -0,0 +1,10 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/build.yaml b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/build.yaml new file mode 100644 index 000000000000..89a4dd6e1c2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/build.yaml @@ -0,0 +1,18 @@ +targets: + $default: + builders: + json_serializable: + options: + # Options configure how source code is generated for every + # `@JsonSerializable`-annotated class in the package. + # + # The default value for each is listed. + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: true + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..863b8503db83 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md @@ -0,0 +1,16 @@ +# openapi.model.AdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **Map<String, String>** | | [optional] +**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Animal.md new file mode 100644 index 000000000000..415b56e9bc2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Animal.md @@ -0,0 +1,16 @@ +# openapi.model.Animal + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md new file mode 100644 index 000000000000..df89b0eb12a8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md @@ -0,0 +1,57 @@ +# openapi.api.AnotherFakeApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags + + +# **call123testSpecialTags** +> ModelClient call123testSpecialTags(modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getAnotherFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.call123testSpecialTags(modelClient); + print(response); +} catch on DioError (e) { + print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md new file mode 100644 index 000000000000..7ad5da0f89e4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..e5b9d669a436 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [**List<List<num>>**](List.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..fe8e071eb45c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | **List<num>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md new file mode 100644 index 000000000000..8ae11de10022 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md @@ -0,0 +1,17 @@ +# openapi.model.ArrayTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **List<String>** | | [optional] +**arrayArrayOfInteger** | [**List<List<int>>**](List.md) | | [optional] +**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Capitalization.md new file mode 100644 index 000000000000..4a07b4eb820d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Capitalization.md @@ -0,0 +1,20 @@ +# openapi.model.Capitalization + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **String** | | [optional] +**capitalCamel** | **String** | | [optional] +**smallSnake** | **String** | | [optional] +**capitalSnake** | **String** | | [optional] +**sCAETHFlowPoints** | **String** | | [optional] +**ATT_NAME** | **String** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Cat.md new file mode 100644 index 000000000000..6552eea4b435 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Cat.md @@ -0,0 +1,17 @@ +# openapi.model.Cat + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md new file mode 100644 index 000000000000..36b2ae0e8ab3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.CatAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Category.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Category.md new file mode 100644 index 000000000000..ae6bc52e89d8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [default to 'default-name'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ClassModel.md new file mode 100644 index 000000000000..13ae5d3a4708 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ClassModel.md @@ -0,0 +1,15 @@ +# openapi.model.ClassModel + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md new file mode 100644 index 000000000000..f1753b62ee84 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md @@ -0,0 +1,51 @@ +# openapi.api.DefaultApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooget) | **GET** /foo | + + +# **fooGet** +> InlineResponseDefault fooGet() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.fooGet(); + print(response); +} catch on DioError (e) { + print('Exception when calling DefaultApi->fooGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md new file mode 100644 index 000000000000..bf2ef67a26fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md @@ -0,0 +1,15 @@ +# openapi.model.DeprecatedObject + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Dog.md new file mode 100644 index 000000000000..d36439b767bb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Dog.md @@ -0,0 +1,17 @@ +# openapi.model.Dog + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md new file mode 100644 index 000000000000..97a7c8fba492 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.DogAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md new file mode 100644 index 000000000000..1d4fd1363b59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md @@ -0,0 +1,16 @@ +# openapi.model.EnumArrays + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | **String** | | [optional] +**arrayEnum** | **List<String>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/EnumTest.md new file mode 100644 index 000000000000..7c24fe2347b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/EnumTest.md @@ -0,0 +1,22 @@ +# openapi.model.EnumTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | **String** | | [optional] +**enumStringRequired** | **String** | | +**enumInteger** | **int** | | [optional] +**enumNumber** | **double** | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FakeApi.md new file mode 100644 index 000000000000..3d408769d11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FakeApi.md @@ -0,0 +1,822 @@ +# openapi.api.FakeApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | +[**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | + + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); + +try { + final response = api.fakeHealthGet(); + print(response); +} catch on DioError (e) { + print('Exception when calling FakeApi->fakeHealthGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure HTTP basic authorization: http_signature_test +//defaultApiClient.getAuthentication('http_signature_test').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('http_signature_test').password = 'YOUR_PASSWORD'; + +final api = Openapi().getFakeApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store +final String query1 = query1_example; // String | query parameter +final String header1 = header1_example; // String | header parameter + +try { + api.fakeHttpSignatureTest(pet, query1, header1); +} catch on DioError (e) { + print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **String**| query parameter | [optional] + **header1** | **String**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterBooleanSerialize** +> bool fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final bool body = true; // bool | Input boolean as post body + +try { + final response = api.fakeOuterBooleanSerialize(body); + print(response); +} catch on DioError (e) { + print('Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **bool**| Input boolean as post body | [optional] + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final OuterComposite outerComposite = ; // OuterComposite | Input composite as post body + +try { + final response = api.fakeOuterCompositeSerialize(outerComposite); + print(response); +} catch on DioError (e) { + print('Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterNumberSerialize** +> num fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final num body = 8.14; // num | Input number as post body + +try { + final response = api.fakeOuterNumberSerialize(body); + print(response); +} catch on DioError (e) { + print('Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **num**| Input number as post body | [optional] + +### Return type + +**num** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String body = body_example; // String | Input string as post body + +try { + final response = api.fakeOuterStringSerialize(body); + print(response); +} catch on DioError (e) { + print('Exception when calling FakeApi->fakeOuterStringSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakePropertyEnumIntegerSerialize** +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final OuterObjectWithEnumProperty outerObjectWithEnumProperty = ; // OuterObjectWithEnumProperty | Input enum (int) as post body + +try { + final response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + print(response); +} catch on DioError (e) { + print('Exception when calling FakeApi->fakePropertyEnumIntegerSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithBinary** +> testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final MultipartFile body = BINARY_DATA_HERE; // MultipartFile | image to upload + +try { + api.testBodyWithBinary(body); +} catch on DioError (e) { + print('Exception when calling FakeApi->testBodyWithBinary: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **MultipartFile**| image to upload | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: image/png + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final FileSchemaTestClass fileSchemaTestClass = ; // FileSchemaTestClass | + +try { + api.testBodyWithFileSchema(fileSchemaTestClass); +} catch on DioError (e) { + print('Exception when calling FakeApi->testBodyWithFileSchema: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String query = query_example; // String | +final User user = ; // User | + +try { + api.testBodyWithQueryParams(query, user); +} catch on DioError (e) { + print('Exception when calling FakeApi->testBodyWithQueryParams: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testClientModel** +> ModelClient testClientModel(modelClient) + +To test \"client\" model + +To test \"client\" model + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.testClientModel(modelClient); + print(response); +} catch on DioError (e) { + print('Exception when calling FakeApi->testClientModel: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testEndpointParameters** +> testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure HTTP basic authorization: http_basic_test +//defaultApiClient.getAuthentication('http_basic_test').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('http_basic_test').password = 'YOUR_PASSWORD'; + +final api = Openapi().getFakeApi(); +final num number = 8.14; // num | None +final double double_ = 1.2; // double | None +final String patternWithoutDelimiter = patternWithoutDelimiter_example; // String | None +final String byte = BYTE_ARRAY_DATA_HERE; // String | None +final int integer = 56; // int | None +final int int32 = 56; // int | None +final int int64 = 789; // int | None +final double float = 3.4; // double | None +final String string = string_example; // String | None +final MultipartFile binary = BINARY_DATA_HERE; // MultipartFile | None +final DateTime date = 2013-10-20; // DateTime | None +final DateTime dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None +final String password = password_example; // String | None +final String callback = callback_example; // String | None + +try { + api.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback); +} catch on DioError (e) { + print('Exception when calling FakeApi->testEndpointParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **num**| None | + **double_** | **double**| None | + **patternWithoutDelimiter** | **String**| None | + **byte** | **String**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **double**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **MultipartFile**| None | [optional] + **date** | **DateTime**| None | [optional] + **dateTime** | **DateTime**| None | [optional] + **password** | **String**| None | [optional] + **callback** | **String**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final List enumHeaderStringArray = ; // List | Header parameter enum test (string array) +final String enumHeaderString = enumHeaderString_example; // String | Header parameter enum test (string) +final List enumQueryStringArray = ; // List | Query parameter enum test (string array) +final String enumQueryString = enumQueryString_example; // String | Query parameter enum test (string) +final int enumQueryInteger = 56; // int | Query parameter enum test (double) +final double enumQueryDouble = 1.2; // double | Query parameter enum test (double) +final List enumQueryModelArray = ; // List | +final List enumFormStringArray = ; // List | Form parameter enum test (string array) +final String enumFormString = enumFormString_example; // String | Form parameter enum test (string) + +try { + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); +} catch on DioError (e) { + print('Exception when calling FakeApi->testEnumParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] + **enumQueryModelArray** | [**List<ModelEnumClass>**](ModelEnumClass.md)| | [optional] + **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure HTTP basic authorization: bearer_test +//defaultApiClient.getAuthentication('bearer_test').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('bearer_test').password = 'YOUR_PASSWORD'; + +final api = Openapi().getFakeApi(); +final int requiredStringGroup = 56; // int | Required String in group parameters +final bool requiredBooleanGroup = true; // bool | Required Boolean in group parameters +final int requiredInt64Group = 789; // int | Required Integer in group parameters +final int stringGroup = 56; // int | String in group parameters +final bool booleanGroup = true; // bool | Boolean in group parameters +final int int64Group = 789; // int | Integer in group parameters + +try { + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); +} catch on DioError (e) { + print('Exception when calling FakeApi->testGroupParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **int**| Required Integer in group parameters | + **stringGroup** | **int**| String in group parameters | [optional] + **booleanGroup** | **bool**| Boolean in group parameters | [optional] + **int64Group** | **int**| Integer in group parameters | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final Map requestBody = ; // Map | request body + +try { + api.testInlineAdditionalProperties(requestBody); +} catch on DioError (e) { + print('Exception when calling FakeApi->testInlineAdditionalProperties: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Map<String, String>**](String.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String param = param_example; // String | field1 +final String param2 = param2_example; // String | field2 + +try { + api.testJsonFormData(param, param2); +} catch on DioError (e) { + print('Exception when calling FakeApi->testJsonFormData: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final List pipe = ; // List | +final List ioutil = ; // List | +final List http = ; // List | +final List url = ; // List | +final List context = ; // List | +final String allowEmpty = allowEmpty_example; // String | +final Map language = ; // Map | + +try { + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); +} catch on DioError (e) { + print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + **allowEmpty** | **String**| | + **language** | [**Map<String, String>**](String.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..35e244fbf21e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md @@ -0,0 +1,61 @@ +# openapi.api.FakeClassnameTags123Api + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **testClassname** +> ModelClient testClassname(modelClient) + +To test class name in snake case + +To test class name in snake case + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key_query +//defaultApiClient.getAuthentication('api_key_query').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key_query').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getFakeClassnameTags123Api(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.testClassname(modelClient); + print(response); +} catch on DioError (e) { + print('Exception when calling FakeClassnameTags123Api->testClassname: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md new file mode 100644 index 000000000000..d14ac319d294 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md @@ -0,0 +1,16 @@ +# openapi.model.FileSchemaTestClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**ModelFile**](ModelFile.md) | | [optional] +**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Foo.md new file mode 100644 index 000000000000..185b76e3f5b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Foo.md @@ -0,0 +1,15 @@ +# openapi.model.Foo + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [default to 'bar'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FormatTest.md new file mode 100644 index 000000000000..83b60545eb61 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/FormatTest.md @@ -0,0 +1,30 @@ +# openapi.model.FormatTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**number** | **num** | | +**float** | **double** | | [optional] +**double_** | **double** | | [optional] +**decimal** | **double** | | [optional] +**string** | **String** | | [optional] +**byte** | **String** | | +**binary** | [**MultipartFile**](MultipartFile.md) | | [optional] +**date** | [**DateTime**](DateTime.md) | | +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**uuid** | **String** | | [optional] +**password** | **String** | | +**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md new file mode 100644 index 000000000000..32cae937155d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md @@ -0,0 +1,16 @@ +# openapi.model.HasOnlyReadOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**foo** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md new file mode 100644 index 000000000000..4d6aeb75d965 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md @@ -0,0 +1,15 @@ +# openapi.model.HealthCheckResult + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md new file mode 100644 index 000000000000..c5e61e1162bf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md @@ -0,0 +1,15 @@ +# openapi.model.InlineResponseDefault + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/MapTest.md new file mode 100644 index 000000000000..197fe780a25a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/MapTest.md @@ -0,0 +1,18 @@ +# openapi.model.MapTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapOfEnumString** | **Map<String, String>** | | [optional] +**directMap** | **Map<String, bool>** | | [optional] +**indirectMap** | **Map<String, bool>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..66d0d39c42be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# openapi.model.MixedPropertiesAndAdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**map** | [**Map<String, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Model200Response.md new file mode 100644 index 000000000000..5aa3fb97c32e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Model200Response.md @@ -0,0 +1,16 @@ +# openapi.model.Model200Response + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**class_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelClient.md new file mode 100644 index 000000000000..f7b922f4a398 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelClient.md @@ -0,0 +1,15 @@ +# openapi.model.ModelClient + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md new file mode 100644 index 000000000000..ebaafb44c7f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md @@ -0,0 +1,14 @@ +# openapi.model.ModelEnumClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelFile.md new file mode 100644 index 000000000000..4be260e93f6e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelFile.md @@ -0,0 +1,15 @@ +# openapi.model.ModelFile + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelList.md new file mode 100644 index 000000000000..283aa1f6b711 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelList.md @@ -0,0 +1,15 @@ +# openapi.model.ModelList + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**n123list** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md new file mode 100644 index 000000000000..bc02df7a3692 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md @@ -0,0 +1,15 @@ +# openapi.model.ModelReturn + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**return_** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Name.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Name.md new file mode 100644 index 000000000000..25f49ea946b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Name.md @@ -0,0 +1,18 @@ +# openapi.model.Name + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snakeCase** | **int** | | [optional] +**property** | **String** | | [optional] +**n123number** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/NullableClass.md new file mode 100644 index 000000000000..70ac1091d417 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/NullableClass.md @@ -0,0 +1,26 @@ +# openapi.model.NullableClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **int** | | [optional] +**numberProp** | **num** | | [optional] +**booleanProp** | **bool** | | [optional] +**stringProp** | **String** | | [optional] +**dateProp** | [**DateTime**](DateTime.md) | | [optional] +**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] +**arrayNullableProp** | **List<Object>** | | [optional] +**arrayAndItemsNullableProp** | **List<Object>** | | [optional] +**arrayItemsNullable** | **List<Object>** | | [optional] +**objectNullableProp** | **Map<String, Object>** | | [optional] +**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] +**objectItemsNullable** | **Map<String, Object>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md new file mode 100644 index 000000000000..d8096a3db37a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.NumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..dda2836d8d54 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md @@ -0,0 +1,18 @@ +# openapi.model.ObjectWithDeprecatedFields + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**id** | **num** | | [optional] +**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**bars** | **List<String>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Order.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Order.md new file mode 100644 index 000000000000..bde5ffe51a2c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**petId** | **int** | | [optional] +**quantity** | **int** | | [optional] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] +**status** | **String** | Order Status | [optional] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md new file mode 100644 index 000000000000..04bab7eff5d1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md @@ -0,0 +1,17 @@ +# openapi.model.OuterComposite + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | **num** | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md new file mode 100644 index 000000000000..af62ad87ab2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnum + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..c1bf8b0dec44 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md new file mode 100644 index 000000000000..8c80a9e5c85f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumInteger + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..eb8b55d70249 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumIntegerDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..eab2ae8f66b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md @@ -0,0 +1,15 @@ +# openapi.model.OuterObjectWithEnumProperty + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Pet.md new file mode 100644 index 000000000000..3cd230bfb213 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **Set<String>** | | +**tags** | [**List<Tag>**](Tag.md) | | [optional] +**status** | **String** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/PetApi.md new file mode 100644 index 000000000000..dbf7f15b3cd3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/PetApi.md @@ -0,0 +1,439 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + +# **addPet** +> addPet(pet) + +Add a new pet to the store + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + api.addPet(pet); +} catch on DioError (e) { + print('Exception when calling PetApi->addPet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | Pet id to delete +final String apiKey = apiKey_example; // String | + +try { + api.deletePet(petId, apiKey); +} catch on DioError (e) { + print('Exception when calling PetApi->deletePet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final List status = ; // List | Status values that need to be considered for filter + +try { + final response = api.findPetsByStatus(status); + print(response); +} catch on DioError (e) { + print('Exception when calling PetApi->findPetsByStatus: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> Set findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final Set tags = ; // Set | Tags to filter by + +try { + final response = api.findPetsByTags(tags); + print(response); +} catch on DioError (e) { + print('Exception when calling PetApi->findPetsByTags: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**Set<String>**](String.md)| Tags to filter by | + +### Return type + +[**Set<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to return + +try { + final response = api.getPetById(petId); + print(response); +} catch on DioError (e) { + print('Exception when calling PetApi->getPetById: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(pet) + +Update an existing pet + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + api.updatePet(pet); +} catch on DioError (e) { + print('Exception when calling PetApi->updatePet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet that needs to be updated +final String name = name_example; // String | Updated name of the pet +final String status = status_example; // String | Updated status of the pet + +try { + api.updatePetWithForm(petId, name, status); +} catch on DioError (e) { + print('Exception when calling PetApi->updatePetWithForm: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to update +final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + final response = api.uploadFile(petId, additionalMetadata, file); + print(response); +} catch on DioError (e) { + print('Exception when calling PetApi->uploadFile: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **MultipartFile**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to update +final MultipartFile requiredFile = BINARY_DATA_HERE; // MultipartFile | file to upload +final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server + +try { + final response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + print(response); +} catch on DioError (e) { + print('Exception when calling PetApi->uploadFileWithRequiredFile: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | + **requiredFile** | **MultipartFile**| file to upload | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md new file mode 100644 index 000000000000..8f612e8ba19f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md @@ -0,0 +1,16 @@ +# openapi.model.ReadOnlyFirst + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**baz** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md new file mode 100644 index 000000000000..5fcfa98e0b36 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md @@ -0,0 +1,15 @@ +# openapi.model.SpecialModelName + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/StoreApi.md new file mode 100644 index 000000000000..a25dc85408db --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/StoreApi.md @@ -0,0 +1,188 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final String orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api.deleteOrder(orderId); +} catch on DioError (e) { + print('Exception when calling StoreApi->deleteOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getStoreApi(); + +try { + final response = api.getInventory(); + print(response); +} catch on DioError (e) { + print('Exception when calling StoreApi->getInventory: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map<String, int>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final int orderId = 789; // int | ID of pet that needs to be fetched + +try { + final response = api.getOrderById(orderId); + print(response); +} catch on DioError (e) { + print('Exception when calling StoreApi->getOrderById: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final Order order = ; // Order | order placed for purchasing the pet + +try { + final response = api.placeOrder(order); + print(response); +} catch on DioError (e) { + print('Exception when calling StoreApi->placeOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Tag.md new file mode 100644 index 000000000000..c219f987c19c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/User.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/User.md new file mode 100644 index 000000000000..0f0490bac193 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/User.md @@ -0,0 +1,23 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **int** | User Status | [optional] +**userType** | [**UserType**](UserType.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/UserApi.md new file mode 100644 index 000000000000..c7fd450beb04 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/UserApi.md @@ -0,0 +1,359 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createuser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final User user = ; // User | Created user object + +try { + api.createUser(user); +} catch on DioError (e) { + print('Exception when calling UserApi->createUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final List user = ; // List | List of user object + +try { + api.createUsersWithArrayInput(user); +} catch on DioError (e) { + print('Exception when calling UserApi->createUsersWithArrayInput: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final List user = ; // List | List of user object + +try { + api.createUsersWithListInput(user); +} catch on DioError (e) { + print('Exception when calling UserApi->createUsersWithListInput: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The name that needs to be deleted + +try { + api.deleteUser(username); +} catch on DioError (e) { + print('Exception when calling UserApi->deleteUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + final response = api.getUserByName(username); + print(response); +} catch on DioError (e) { + print('Exception when calling UserApi->getUserByName: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The user name for login +final String password = password_example; // String | The password for login in clear text + +try { + final response = api.loginUser(username, password); + print(response); +} catch on DioError (e) { + print('Exception when calling UserApi->loginUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); + +try { + api.logoutUser(); +} catch on DioError (e) { + print('Exception when calling UserApi->logoutUser: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | name that need to be deleted +final User user = ; // User | Updated user object + +try { + api.updateUser(username, user); +} catch on DioError (e) { + print('Exception when calling UserApi->updateUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/UserType.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/UserType.md new file mode 100644 index 000000000000..b56ddc66eb79 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/doc/UserType.md @@ -0,0 +1,14 @@ +# openapi.model.UserType + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/openapi.dart new file mode 100644 index 000000000000..3e7431276043 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/openapi.dart @@ -0,0 +1,65 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:openapi/src/api.dart'; +export 'package:openapi/src/auth/api_key_auth.dart'; +export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; + + +export 'package:openapi/src/api/another_fake_api.dart'; +export 'package:openapi/src/api/default_api.dart'; +export 'package:openapi/src/api/fake_api.dart'; +export 'package:openapi/src/api/fake_classname_tags123_api.dart'; +export 'package:openapi/src/api/pet_api.dart'; +export 'package:openapi/src/api/store_api.dart'; +export 'package:openapi/src/api/user_api.dart'; + +export 'package:openapi/src/model/additional_properties_class.dart'; +export 'package:openapi/src/model/animal.dart'; +export 'package:openapi/src/model/api_response.dart'; +export 'package:openapi/src/model/array_of_array_of_number_only.dart'; +export 'package:openapi/src/model/array_of_number_only.dart'; +export 'package:openapi/src/model/array_test.dart'; +export 'package:openapi/src/model/capitalization.dart'; +export 'package:openapi/src/model/cat.dart'; +export 'package:openapi/src/model/cat_all_of.dart'; +export 'package:openapi/src/model/category.dart'; +export 'package:openapi/src/model/class_model.dart'; +export 'package:openapi/src/model/deprecated_object.dart'; +export 'package:openapi/src/model/dog.dart'; +export 'package:openapi/src/model/dog_all_of.dart'; +export 'package:openapi/src/model/enum_arrays.dart'; +export 'package:openapi/src/model/enum_test.dart'; +export 'package:openapi/src/model/file_schema_test_class.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/format_test.dart'; +export 'package:openapi/src/model/has_only_read_only.dart'; +export 'package:openapi/src/model/health_check_result.dart'; +export 'package:openapi/src/model/inline_response_default.dart'; +export 'package:openapi/src/model/map_test.dart'; +export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +export 'package:openapi/src/model/model200_response.dart'; +export 'package:openapi/src/model/model_client.dart'; +export 'package:openapi/src/model/model_enum_class.dart'; +export 'package:openapi/src/model/model_file.dart'; +export 'package:openapi/src/model/model_list.dart'; +export 'package:openapi/src/model/model_return.dart'; +export 'package:openapi/src/model/name.dart'; +export 'package:openapi/src/model/nullable_class.dart'; +export 'package:openapi/src/model/number_only.dart'; +export 'package:openapi/src/model/object_with_deprecated_fields.dart'; +export 'package:openapi/src/model/order.dart'; +export 'package:openapi/src/model/outer_composite.dart'; +export 'package:openapi/src/model/outer_enum.dart'; +export 'package:openapi/src/model/outer_enum_default_value.dart'; +export 'package:openapi/src/model/outer_enum_integer.dart'; +export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +export 'package:openapi/src/model/outer_object_with_enum_property.dart'; +export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/read_only_first.dart'; +export 'package:openapi/src/model/special_model_name.dart'; +export 'package:openapi/src/model/tag.dart'; +export 'package:openapi/src/model/user.dart'; +export 'package:openapi/src/model/user_type.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api.dart new file mode 100644 index 000000000000..55cd646d296e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api.dart @@ -0,0 +1,110 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/api_key_auth.dart'; +import 'package:openapi/src/auth/basic_auth.dart'; +import 'package:openapi/src/auth/bearer_auth.dart'; +import 'package:openapi/src/auth/oauth.dart'; +import 'package:openapi/src/api/another_fake_api.dart'; +import 'package:openapi/src/api/default_api.dart'; +import 'package:openapi/src/api/fake_api.dart'; +import 'package:openapi/src/api/fake_classname_tags123_api.dart'; +import 'package:openapi/src/api/pet_api.dart'; +import 'package:openapi/src/api/store_api.dart'; +import 'package:openapi/src/api/user_api.dart'; + +class Openapi { + static const String basePath = r'http://petstore.swagger.io:80/v2'; + + final Dio dio; + Openapi({ + Dio? dio, + String? basePathOverride, + List? interceptors, + }) : + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: 5000, + receiveTimeout: 3000, + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + } + } + + /// Get AnotherFakeApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + AnotherFakeApi getAnotherFakeApi() { + return AnotherFakeApi(dio); + } + + /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + DefaultApi getDefaultApi() { + return DefaultApi(dio); + } + + /// Get FakeApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FakeApi getFakeApi() { + return FakeApi(dio); + } + + /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FakeClassnameTags123Api getFakeClassnameTags123Api() { + return FakeClassnameTags123Api(dio); + } + + /// Get PetApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + PetApi getPetApi() { + return PetApi(dio); + } + + /// Get StoreApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + StoreApi getStoreApi() { + return StoreApi(dio); + } + + /// Get UserApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + UserApi getUserApi() { + return UserApi(dio); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart new file mode 100644 index 000000000000..e4ac44b0c76d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart @@ -0,0 +1,105 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/model_client.dart'; + +class AnotherFakeApi { + + final Dio _dio; + + const AnotherFakeApi(this._dio); + + /// To test special tags + /// To test special tags and operation ID starting with number + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioError] if API call or serialization fails + Future> call123testSpecialTags({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/another-fake/dummy'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(modelClient); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient _responseData; + + try { +_responseData = deserialize(_response.data!, 'ModelClient', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart new file mode 100644 index 000000000000..7acdb047a1a7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/inline_response_default.dart'; + +class DefaultApi { + + final Dio _dio; + + const DefaultApi(this._dio); + + /// fooGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [InlineResponseDefault] as data + /// Throws [DioError] if API call or serialization fails + Future> fooGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + InlineResponseDefault _responseData; + + try { +_responseData = deserialize(_response.data!, 'InlineResponseDefault', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart new file mode 100644 index 000000000000..eb92299f3ae8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart @@ -0,0 +1,1351 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_enum_class.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/user.dart'; + +class FakeApi { + + final Dio _dio; + + const FakeApi(this._dio); + + /// Health check endpoint + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeHealthGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/health'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + HealthCheckResult _responseData; + + try { +_responseData = deserialize(_response.data!, 'HealthCheckResult', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// test http signature authentication + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [query1] - query parameter + /// * [header1] - header parameter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> fakeHttpSignatureTest({ + required Pet pet, + String? query1, + String? header1, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/http-signature-test'; + final _options = Options( + method: r'GET', + headers: { + if (header1 != null) r'header_1': header1, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'signature', + 'name': 'http_signature_test', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (query1 != null) r'query_1': query1, + }; + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(pet); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// fakeOuterBooleanSerialize + /// Test serialization of outer boolean types + /// + /// Parameters: + /// * [body] - Input boolean as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [bool] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterBooleanSerialize({ + bool? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/boolean'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + bool _responseData; + + try { +_responseData = deserialize(_response.data!, 'bool', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterCompositeSerialize + /// Test serialization of object with outer number type + /// + /// Parameters: + /// * [outerComposite] - Input composite as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterComposite] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterCompositeSerialize({ + OuterComposite? outerComposite, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/composite'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(outerComposite); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterComposite _responseData; + + try { +_responseData = deserialize(_response.data!, 'OuterComposite', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterNumberSerialize + /// Test serialization of outer number types + /// + /// Parameters: + /// * [body] - Input number as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [num] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterNumberSerialize({ + num? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/number'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + num _responseData; + + try { +_responseData = deserialize(_response.data!, 'num', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterStringSerialize + /// Test serialization of outer string types + /// + /// Parameters: + /// * [body] - Input string as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterStringSerialize({ + String? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/string'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String _responseData; + + try { +_responseData = deserialize(_response.data!, 'String', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakePropertyEnumIntegerSerialize + /// Test serialization of enum (int) properties with examples + /// + /// Parameters: + /// * [outerObjectWithEnumProperty] - Input enum (int) as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data + /// Throws [DioError] if API call or serialization fails + Future> fakePropertyEnumIntegerSerialize({ + required OuterObjectWithEnumProperty outerObjectWithEnumProperty, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/property/enum-int'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(outerObjectWithEnumProperty); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterObjectWithEnumProperty _responseData; + + try { +_responseData = deserialize(_response.data!, 'OuterObjectWithEnumProperty', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// testBodyWithBinary + /// For this test, the body has to be a binary file. + /// + /// Parameters: + /// * [body] - image to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testBodyWithBinary({ + MultipartFile? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-binary'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'image/png', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithFileSchema + /// For this test, the body for this request must reference a schema named `File`. + /// + /// Parameters: + /// * [fileSchemaTestClass] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testBodyWithFileSchema({ + required FileSchemaTestClass fileSchemaTestClass, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-file-schema'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(fileSchemaTestClass); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithQueryParams + /// + /// + /// Parameters: + /// * [query] + /// * [user] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testBodyWithQueryParams({ + required String query, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-query-params'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'query': query, + }; + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test \"client\" model + /// To test \"client\" model + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioError] if API call or serialization fails + Future> testClientModel({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(modelClient); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient _responseData; + + try { +_responseData = deserialize(_response.data!, 'ModelClient', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Parameters: + /// * [number] - None + /// * [double_] - None + /// * [patternWithoutDelimiter] - None + /// * [byte] - None + /// * [integer] - None + /// * [int32] - None + /// * [int64] - None + /// * [float] - None + /// * [string] - None + /// * [binary] - None + /// * [date] - None + /// * [dateTime] - None + /// * [password] - None + /// * [callback] - None + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testEndpointParameters({ + required num number, + required double double_, + required String patternWithoutDelimiter, + required String byte, + int? integer, + int? int32, + int? int64, + double? float, + String? string, + MultipartFile? binary, + DateTime? date, + DateTime? dateTime, + String? password, + String? callback, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'basic', + 'name': 'http_basic_test', + }, + ], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test enum parameters + /// To test enum parameters + /// + /// Parameters: + /// * [enumHeaderStringArray] - Header parameter enum test (string array) + /// * [enumHeaderString] - Header parameter enum test (string) + /// * [enumQueryStringArray] - Query parameter enum test (string array) + /// * [enumQueryString] - Query parameter enum test (string) + /// * [enumQueryInteger] - Query parameter enum test (double) + /// * [enumQueryDouble] - Query parameter enum test (double) + /// * [enumQueryModelArray] + /// * [enumFormStringArray] - Form parameter enum test (string array) + /// * [enumFormString] - Form parameter enum test (string) + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testEnumParameters({ + List? enumHeaderStringArray, + String? enumHeaderString = '-efg', + List? enumQueryStringArray, + String? enumQueryString = '-efg', + int? enumQueryInteger, + double? enumQueryDouble, + List? enumQueryModelArray, + List? enumFormStringArray, + String? enumFormString, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'GET', + headers: { + if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, + if (enumHeaderString != null) r'enum_header_string': enumHeaderString, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (enumQueryStringArray != null) r'enum_query_string_array': enumQueryStringArray, + if (enumQueryString != null) r'enum_query_string': enumQueryString, + if (enumQueryInteger != null) r'enum_query_integer': enumQueryInteger, + if (enumQueryDouble != null) r'enum_query_double': enumQueryDouble, + if (enumQueryModelArray != null) r'enum_query_model_array': enumQueryModelArray, + }; + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Fake endpoint to test group parameters (optional) + /// Fake endpoint to test group parameters (optional) + /// + /// Parameters: + /// * [requiredStringGroup] - Required String in group parameters + /// * [requiredBooleanGroup] - Required Boolean in group parameters + /// * [requiredInt64Group] - Required Integer in group parameters + /// * [stringGroup] - String in group parameters + /// * [booleanGroup] - Boolean in group parameters + /// * [int64Group] - Integer in group parameters + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testGroupParameters({ + required int requiredStringGroup, + required bool requiredBooleanGroup, + required int requiredInt64Group, + int? stringGroup, + bool? booleanGroup, + int? int64Group, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'DELETE', + headers: { + r'required_boolean_group': requiredBooleanGroup, + if (booleanGroup != null) r'boolean_group': booleanGroup, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'bearer_test', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'required_string_group': requiredStringGroup, + r'required_int64_group': requiredInt64Group, + if (stringGroup != null) r'string_group': stringGroup, + if (int64Group != null) r'int64_group': int64Group, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test inline additionalProperties + /// + /// + /// Parameters: + /// * [requestBody] - request body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testInlineAdditionalProperties({ + required Map requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/inline-additionalProperties'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(requestBody); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test json serialization of form data + /// + /// + /// Parameters: + /// * [param] - field1 + /// * [param2] - field2 + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testJsonFormData({ + required String param, + required String param2, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/jsonFormData'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testQueryParameterCollectionFormat + /// To test the collection format in query parameters + /// + /// Parameters: + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testQueryParameterCollectionFormat({ + required List pipe, + required List ioutil, + required List http, + required List url, + required List context, + required String allowEmpty, + Map? language, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/test-query-parameters'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'pipe': pipe, + r'ioutil': ioutil, + r'http': http, + r'url': url, + r'context': context, + if (language != null) r'language': language, + r'allowEmpty': allowEmpty, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart new file mode 100644 index 000000000000..df4f5ce8a6f1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart @@ -0,0 +1,112 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/model_client.dart'; + +class FakeClassnameTags123Api { + + final Dio _dio; + + const FakeClassnameTags123Api(this._dio); + + /// To test class name in snake case + /// To test class name in snake case + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioError] if API call or serialization fails + Future> testClassname({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake_classname_test'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key_query', + 'keyName': 'api_key_query', + 'where': 'query', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(modelClient); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient _responseData; + + try { +_responseData = deserialize(_response.data!, 'ModelClient', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart new file mode 100644 index 000000000000..7ee1cba5061c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart @@ -0,0 +1,711 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/pet.dart'; + +class PetApi { + + final Dio _dio; + + const PetApi(this._dio); + + /// Add a new pet to the store + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> addPet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(pet); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Deletes a pet + /// + /// + /// Parameters: + /// * [petId] - Pet id to delete + /// * [apiKey] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> deletePet({ + required int petId, + String? apiKey, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + if (apiKey != null) r'api_key': apiKey, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Finds Pets by status + /// Multiple status values can be provided with comma separated strings + /// + /// Parameters: + /// * [status] - Status values that need to be considered for filter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [List] as data + /// Throws [DioError] if API call or serialization fails + Future>> findPetsByStatus({ + required List status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/findByStatus'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'status': status, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List _responseData; + + try { +_responseData = deserialize, Pet>(_response.data!, 'List', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Finds Pets by tags + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Parameters: + /// * [tags] - Tags to filter by + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Set] as data + /// Throws [DioError] if API call or serialization fails + @Deprecated('This operation has been deprecated') + Future>> findPetsByTags({ + required Set tags, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/findByTags'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'tags': tags, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Set _responseData; + + try { +_responseData = deserialize, Pet>(_response.data!, 'Set', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Find pet by ID + /// Returns a single pet + /// + /// Parameters: + /// * [petId] - ID of pet to return + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Pet] as data + /// Throws [DioError] if API call or serialization fails + Future> getPetById({ + required int petId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Pet _responseData; + + try { +_responseData = deserialize(_response.data!, 'Pet', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Update an existing pet + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> updatePet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(pet); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updates a pet in the store with form data + /// + /// + /// Parameters: + /// * [petId] - ID of pet that needs to be updated + /// * [name] - Updated name of the pet + /// * [status] - Updated status of the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> updatePetWithForm({ + required int petId, + String? name, + String? status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// uploads an image + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [additionalMetadata] - Additional data to pass to server + /// * [file] - file to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioError] if API call or serialization fails + Future> uploadFile({ + required int petId, + String? additionalMetadata, + MultipartFile? file, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse _responseData; + + try { +_responseData = deserialize(_response.data!, 'ApiResponse', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// uploads an image (required) + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [requiredFile] - file to upload + /// * [additionalMetadata] - Additional data to pass to server + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioError] if API call or serialization fails + Future> uploadFileWithRequiredFile({ + required int petId, + required MultipartFile requiredFile, + String? additionalMetadata, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse _responseData; + + try { +_responseData = deserialize(_response.data!, 'ApiResponse', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart new file mode 100644 index 000000000000..98eca21e58aa --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart @@ -0,0 +1,295 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/order.dart'; + +class StoreApi { + + final Dio _dio; + + const StoreApi(this._dio); + + /// Delete purchase order by ID + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Parameters: + /// * [orderId] - ID of the order that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> deleteOrder({ + required String orderId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Returns pet inventories by status + /// Returns a map of status codes to quantities + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Map] as data + /// Throws [DioError] if API call or serialization fails + Future>> getInventory({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/inventory'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Map _responseData; + + try { +_responseData = deserialize, int>(_response.data!, 'Map', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Find purchase order by ID + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Parameters: + /// * [orderId] - ID of pet that needs to be fetched + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioError] if API call or serialization fails + Future> getOrderById({ + required int orderId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Order _responseData; + + try { +_responseData = deserialize(_response.data!, 'Order', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Place an order for a pet + /// + /// + /// Parameters: + /// * [order] - order placed for purchasing the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioError] if API call or serialization fails + Future> placeOrder({ + required Order order, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(order); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Order _responseData; + + try { +_responseData = deserialize(_response.data!, 'Order', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart new file mode 100644 index 000000000000..d51d9a884e32 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart @@ -0,0 +1,515 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/user.dart'; + +class UserApi { + + final Dio _dio; + + const UserApi(this._dio); + + /// Create user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [user] - Created user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> createUser({ + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> createUsersWithArrayInput({ + required List user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/createWithArray'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> createUsersWithListInput({ + required List user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/createWithList'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Delete user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - The name that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> deleteUser({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Get user by user name + /// + /// + /// Parameters: + /// * [username] - The name that needs to be fetched. Use user1 for testing. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [User] as data + /// Throws [DioError] if API call or serialization fails + Future> getUserByName({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + User _responseData; + + try { +_responseData = deserialize(_response.data!, 'User', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs user into the system + /// + /// + /// Parameters: + /// * [username] - The user name for login + /// * [password] - The password for login in clear text + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> loginUser({ + required String username, + required String password, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/login'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'username': username, + r'password': password, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String _responseData; + + try { +_responseData = deserialize(_response.data!, 'String', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs out current logged in user session + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> logoutUser({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/logout'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updated user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - name that need to be deleted + /// * [user] - Updated user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> updateUser({ + required String username, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class ApiKeyAuthInterceptor extends AuthInterceptor { + final Map apiKeys = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + for (final info in authInfo) { + final authName = info['name'] as String; + final authKeyName = info['keyName'] as String; + final authWhere = info['where'] as String; + final apiKey = apiKeys[authName]; + if (apiKey != null) { + if (authWhere == 'query') { + options.queryParameters[authKeyName] = apiKey; + } else { + options.headers[authKeyName] = apiKey; + } + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; + +abstract class AuthInterceptor extends Interceptor { + /// Get auth information on given route for the given type. + /// Can return an empty list if type is not present on auth data or + /// if route doesn't need authentication. + List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + if (route.extra.containsKey('secure')) { + final auth = route.extra['secure'] as List>; + return auth.where((secure) => handles(secure)).toList(); + } + return []; + } +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b6e6dce04f9c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BasicAuthInfo { + final String username; + final String password; + + const BasicAuthInfo(this.username, this.password); +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + for (final info in metadataAuthInfo) { + final authName = info['name'] as String; + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..1d4402b376c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class OAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart new file mode 100644 index 000000000000..d433a20de0b2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart @@ -0,0 +1,193 @@ +import 'package:openapi/src/model/additional_properties_class.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/array_of_array_of_number_only.dart'; +import 'package:openapi/src/model/array_of_number_only.dart'; +import 'package:openapi/src/model/array_test.dart'; +import 'package:openapi/src/model/capitalization.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:openapi/src/model/cat_all_of.dart'; +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/class_model.dart'; +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/dog.dart'; +import 'package:openapi/src/model/dog_all_of.dart'; +import 'package:openapi/src/model/enum_arrays.dart'; +import 'package:openapi/src/model/enum_test.dart'; +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/format_test.dart'; +import 'package:openapi/src/model/has_only_read_only.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/inline_response_default.dart'; +import 'package:openapi/src/model/map_test.dart'; +import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +import 'package:openapi/src/model/model200_response.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_enum_class.dart'; +import 'package:openapi/src/model/model_file.dart'; +import 'package:openapi/src/model/model_list.dart'; +import 'package:openapi/src/model/model_return.dart'; +import 'package:openapi/src/model/name.dart'; +import 'package:openapi/src/model/nullable_class.dart'; +import 'package:openapi/src/model/number_only.dart'; +import 'package:openapi/src/model/object_with_deprecated_fields.dart'; +import 'package:openapi/src/model/order.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:openapi/src/model/special_model_name.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:openapi/src/model/user.dart'; +import 'package:openapi/src/model/user_type.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + + ReturnType deserialize(dynamic value, String targetType, {bool growable= true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + break; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'AdditionalPropertiesClass': + return AdditionalPropertiesClass.fromJson(value as Map) as ReturnType; + case 'Animal': + return Animal.fromJson(value as Map) as ReturnType; + case 'ApiResponse': + return ApiResponse.fromJson(value as Map) as ReturnType; + case 'ArrayOfArrayOfNumberOnly': + return ArrayOfArrayOfNumberOnly.fromJson(value as Map) as ReturnType; + case 'ArrayOfNumberOnly': + return ArrayOfNumberOnly.fromJson(value as Map) as ReturnType; + case 'ArrayTest': + return ArrayTest.fromJson(value as Map) as ReturnType; + case 'Capitalization': + return Capitalization.fromJson(value as Map) as ReturnType; + case 'Cat': + return Cat.fromJson(value as Map) as ReturnType; + case 'CatAllOf': + return CatAllOf.fromJson(value as Map) as ReturnType; + case 'Category': + return Category.fromJson(value as Map) as ReturnType; + case 'ClassModel': + return ClassModel.fromJson(value as Map) as ReturnType; + case 'DeprecatedObject': + return DeprecatedObject.fromJson(value as Map) as ReturnType; + case 'Dog': + return Dog.fromJson(value as Map) as ReturnType; + case 'DogAllOf': + return DogAllOf.fromJson(value as Map) as ReturnType; + case 'EnumArrays': + return EnumArrays.fromJson(value as Map) as ReturnType; + case 'EnumTest': + return EnumTest.fromJson(value as Map) as ReturnType; + case 'FileSchemaTestClass': + return FileSchemaTestClass.fromJson(value as Map) as ReturnType; + case 'Foo': + return Foo.fromJson(value as Map) as ReturnType; + case 'FormatTest': + return FormatTest.fromJson(value as Map) as ReturnType; + case 'HasOnlyReadOnly': + return HasOnlyReadOnly.fromJson(value as Map) as ReturnType; + case 'HealthCheckResult': + return HealthCheckResult.fromJson(value as Map) as ReturnType; + case 'InlineResponseDefault': + return InlineResponseDefault.fromJson(value as Map) as ReturnType; + case 'MapTest': + return MapTest.fromJson(value as Map) as ReturnType; + case 'MixedPropertiesAndAdditionalPropertiesClass': + return MixedPropertiesAndAdditionalPropertiesClass.fromJson(value as Map) as ReturnType; + case 'Model200Response': + return Model200Response.fromJson(value as Map) as ReturnType; + case 'ModelClient': + return ModelClient.fromJson(value as Map) as ReturnType; + case 'ModelEnumClass': + + + case 'ModelFile': + return ModelFile.fromJson(value as Map) as ReturnType; + case 'ModelList': + return ModelList.fromJson(value as Map) as ReturnType; + case 'ModelReturn': + return ModelReturn.fromJson(value as Map) as ReturnType; + case 'Name': + return Name.fromJson(value as Map) as ReturnType; + case 'NullableClass': + return NullableClass.fromJson(value as Map) as ReturnType; + case 'NumberOnly': + return NumberOnly.fromJson(value as Map) as ReturnType; + case 'ObjectWithDeprecatedFields': + return ObjectWithDeprecatedFields.fromJson(value as Map) as ReturnType; + case 'Order': + return Order.fromJson(value as Map) as ReturnType; + case 'OuterComposite': + return OuterComposite.fromJson(value as Map) as ReturnType; + case 'OuterEnum': + + + case 'OuterEnumDefaultValue': + + + case 'OuterEnumInteger': + + + case 'OuterEnumIntegerDefaultValue': + + + case 'OuterObjectWithEnumProperty': + return OuterObjectWithEnumProperty.fromJson(value as Map) as ReturnType; + case 'Pet': + return Pet.fromJson(value as Map) as ReturnType; + case 'ReadOnlyFirst': + return ReadOnlyFirst.fromJson(value as Map) as ReturnType; + case 'SpecialModelName': + return SpecialModelName.fromJson(value as Map) as ReturnType; + case 'Tag': + return Tag.fromJson(value as Map) as ReturnType; + case 'User': + return User.fromJson(value as Map) as ReturnType; + case 'UserType': + + + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetType, growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetType, growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize(v, targetType, growable: growable)), + ) as ReturnType; + } + break; + } + throw Exception('Cannot deserialize'); + } \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart new file mode 100644 index 000000000000..e0927d4c1e5b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart @@ -0,0 +1,68 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'additional_properties_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AdditionalPropertiesClass { + /// Returns a new [AdditionalPropertiesClass] instance. + AdditionalPropertiesClass({ + + this.mapProperty, + + this.mapOfMapProperty, + }); + + @JsonKey( + + name: r'map_property', + required: false, + includeIfNull: false + ) + + + final Map? mapProperty; + + + + @JsonKey( + + name: r'map_of_map_property', + required: false, + includeIfNull: false + ) + + + final Map>? mapOfMapProperty; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AdditionalPropertiesClass && + other.mapProperty == mapProperty && + other.mapOfMapProperty == mapOfMapProperty; + + @override + int get hashCode => + (mapProperty == null ? 0 : mapProperty.hashCode) + + (mapOfMapProperty == null ? 0 : mapOfMapProperty.hashCode); + + factory AdditionalPropertiesClass.fromJson(Map json) => _$AdditionalPropertiesClassFromJson(json); + + Map toJson() => _$AdditionalPropertiesClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart new file mode 100644 index 000000000000..5df63e81a0dc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart @@ -0,0 +1,68 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'animal.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Animal { + /// Returns a new [Animal] instance. + Animal({ + + required this.className, + + this.color = 'red', + }); + + @JsonKey( + + name: r'className', + required: true, + includeIfNull: false + ) + + + final String className; + + + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Animal && + other.className == className && + other.color == color; + + @override + int get hashCode => + (className == null ? 0 : className.hashCode) + + (color == null ? 0 : color.hashCode); + + factory Animal.fromJson(Map json) => _$AnimalFromJson(json); + + Map toJson() => _$AnimalToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart new file mode 100644 index 000000000000..ef2e44b2ef5d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart @@ -0,0 +1,84 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'api_response.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ApiResponse { + /// Returns a new [ApiResponse] instance. + ApiResponse({ + + this.code, + + this.type, + + this.message, + }); + + @JsonKey( + + name: r'code', + required: false, + includeIfNull: false + ) + + + final int? code; + + + + @JsonKey( + + name: r'type', + required: false, + includeIfNull: false + ) + + + final String? type; + + + + @JsonKey( + + name: r'message', + required: false, + includeIfNull: false + ) + + + final String? message; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ApiResponse && + other.code == code && + other.type == type && + other.message == message; + + @override + int get hashCode => + (code == null ? 0 : code.hashCode) + + (type == null ? 0 : type.hashCode) + + (message == null ? 0 : message.hashCode); + + factory ApiResponse.fromJson(Map json) => _$ApiResponseFromJson(json); + + Map toJson() => _$ApiResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart new file mode 100644 index 000000000000..aea6750c663e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'array_of_array_of_number_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayOfArrayOfNumberOnly { + /// Returns a new [ArrayOfArrayOfNumberOnly] instance. + ArrayOfArrayOfNumberOnly({ + + this.arrayArrayNumber, + }); + + @JsonKey( + + name: r'ArrayArrayNumber', + required: false, + includeIfNull: false + ) + + + final List>? arrayArrayNumber; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayOfArrayOfNumberOnly && + other.arrayArrayNumber == arrayArrayNumber; + + @override + int get hashCode => + (arrayArrayNumber == null ? 0 : arrayArrayNumber.hashCode); + + factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfArrayOfNumberOnlyFromJson(json); + + Map toJson() => _$ArrayOfArrayOfNumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart new file mode 100644 index 000000000000..ab21a96c7d55 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'array_of_number_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayOfNumberOnly { + /// Returns a new [ArrayOfNumberOnly] instance. + ArrayOfNumberOnly({ + + this.arrayNumber, + }); + + @JsonKey( + + name: r'ArrayNumber', + required: false, + includeIfNull: false + ) + + + final List? arrayNumber; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayOfNumberOnly && + other.arrayNumber == arrayNumber; + + @override + int get hashCode => + (arrayNumber == null ? 0 : arrayNumber.hashCode); + + factory ArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfNumberOnlyFromJson(json); + + Map toJson() => _$ArrayOfNumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart new file mode 100644 index 000000000000..db1d5c917389 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart @@ -0,0 +1,85 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'array_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayTest { + /// Returns a new [ArrayTest] instance. + ArrayTest({ + + this.arrayOfString, + + this.arrayArrayOfInteger, + + this.arrayArrayOfModel, + }); + + @JsonKey( + + name: r'array_of_string', + required: false, + includeIfNull: false + ) + + + final List? arrayOfString; + + + + @JsonKey( + + name: r'array_array_of_integer', + required: false, + includeIfNull: false + ) + + + final List>? arrayArrayOfInteger; + + + + @JsonKey( + + name: r'array_array_of_model', + required: false, + includeIfNull: false + ) + + + final List>? arrayArrayOfModel; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayTest && + other.arrayOfString == arrayOfString && + other.arrayArrayOfInteger == arrayArrayOfInteger && + other.arrayArrayOfModel == arrayArrayOfModel; + + @override + int get hashCode => + (arrayOfString == null ? 0 : arrayOfString.hashCode) + + (arrayArrayOfInteger == null ? 0 : arrayArrayOfInteger.hashCode) + + (arrayArrayOfModel == null ? 0 : arrayArrayOfModel.hashCode); + + factory ArrayTest.fromJson(Map json) => _$ArrayTestFromJson(json); + + Map toJson() => _$ArrayTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart new file mode 100644 index 000000000000..5334bbdfbfcf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart @@ -0,0 +1,133 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'capitalization.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Capitalization { + /// Returns a new [Capitalization] instance. + Capitalization({ + + this.smallCamel, + + this.capitalCamel, + + this.smallSnake, + + this.capitalSnake, + + this.sCAETHFlowPoints, + + this.ATT_NAME, + }); + + @JsonKey( + + name: r'smallCamel', + required: false, + includeIfNull: false + ) + + + final String? smallCamel; + + + + @JsonKey( + + name: r'CapitalCamel', + required: false, + includeIfNull: false + ) + + + final String? capitalCamel; + + + + @JsonKey( + + name: r'small_Snake', + required: false, + includeIfNull: false + ) + + + final String? smallSnake; + + + + @JsonKey( + + name: r'Capital_Snake', + required: false, + includeIfNull: false + ) + + + final String? capitalSnake; + + + + @JsonKey( + + name: r'SCA_ETH_Flow_Points', + required: false, + includeIfNull: false + ) + + + final String? sCAETHFlowPoints; + + + + /// Name of the pet + @JsonKey( + + name: r'ATT_NAME', + required: false, + includeIfNull: false + ) + + + final String? ATT_NAME; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Capitalization && + other.smallCamel == smallCamel && + other.capitalCamel == capitalCamel && + other.smallSnake == smallSnake && + other.capitalSnake == capitalSnake && + other.sCAETHFlowPoints == sCAETHFlowPoints && + other.ATT_NAME == ATT_NAME; + + @override + int get hashCode => + (smallCamel == null ? 0 : smallCamel.hashCode) + + (capitalCamel == null ? 0 : capitalCamel.hashCode) + + (smallSnake == null ? 0 : smallSnake.hashCode) + + (capitalSnake == null ? 0 : capitalSnake.hashCode) + + (sCAETHFlowPoints == null ? 0 : sCAETHFlowPoints.hashCode) + + (ATT_NAME == null ? 0 : ATT_NAME.hashCode); + + factory Capitalization.fromJson(Map json) => _$CapitalizationFromJson(json); + + Map toJson() => _$CapitalizationToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart new file mode 100644 index 000000000000..c626e2bc020c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/animal.dart'; +import 'package:openapi/src/model/cat_all_of.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'cat.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Cat { + /// Returns a new [Cat] instance. + Cat({ + + required this.className, + + this.color = 'red', + + this.declawed, + }); + + @JsonKey( + + name: r'className', + required: true, + includeIfNull: false + ) + + + final String className; + + + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @JsonKey( + + name: r'declawed', + required: false, + includeIfNull: false + ) + + + final bool? declawed; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Cat && + other.className == className && + other.color == color && + other.declawed == declawed; + + @override + int get hashCode => + (className == null ? 0 : className.hashCode) + + (color == null ? 0 : color.hashCode) + + (declawed == null ? 0 : declawed.hashCode); + + factory Cat.fromJson(Map json) => _$CatFromJson(json); + + Map toJson() => _$CatToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart new file mode 100644 index 000000000000..9789ca2444d2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'cat_all_of.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class CatAllOf { + /// Returns a new [CatAllOf] instance. + CatAllOf({ + + this.declawed, + }); + + @JsonKey( + + name: r'declawed', + required: false, + includeIfNull: false + ) + + + final bool? declawed; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is CatAllOf && + other.declawed == declawed; + + @override + int get hashCode => + (declawed == null ? 0 : declawed.hashCode); + + factory CatAllOf.fromJson(Map json) => _$CatAllOfFromJson(json); + + Map toJson() => _$CatAllOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart new file mode 100644 index 000000000000..6d8e010d43f1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart @@ -0,0 +1,68 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'category.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Category { + /// Returns a new [Category] instance. + Category({ + + this.id, + + this.name = 'default-name', + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + defaultValue: 'default-name', + name: r'name', + required: true, + includeIfNull: false + ) + + + final String name; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Category && + other.id == id && + other.name == name; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode); + + factory Category.fromJson(Map json) => _$CategoryFromJson(json); + + Map toJson() => _$CategoryToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart new file mode 100644 index 000000000000..ef70b04cca84 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'class_model.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ClassModel { + /// Returns a new [ClassModel] instance. + ClassModel({ + + this.class_, + }); + + @JsonKey( + + name: r'_class', + required: false, + includeIfNull: false + ) + + + final String? class_; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ClassModel && + other.class_ == class_; + + @override + int get hashCode => + (class_ == null ? 0 : class_.hashCode); + + factory ClassModel.fromJson(Map json) => _$ClassModelFromJson(json); + + Map toJson() => _$ClassModelToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart new file mode 100644 index 000000000000..4ea102840a3a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'deprecated_object.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DeprecatedObject { + /// Returns a new [DeprecatedObject] instance. + DeprecatedObject({ + + this.name, + }); + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final String? name; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is DeprecatedObject && + other.name == name; + + @override + int get hashCode => + (name == null ? 0 : name.hashCode); + + factory DeprecatedObject.fromJson(Map json) => _$DeprecatedObjectFromJson(json); + + Map toJson() => _$DeprecatedObjectToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart new file mode 100644 index 000000000000..e668362703a6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/dog_all_of.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'dog.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Dog { + /// Returns a new [Dog] instance. + Dog({ + + required this.className, + + this.color = 'red', + + this.breed, + }); + + @JsonKey( + + name: r'className', + required: true, + includeIfNull: false + ) + + + final String className; + + + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @JsonKey( + + name: r'breed', + required: false, + includeIfNull: false + ) + + + final String? breed; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Dog && + other.className == className && + other.color == color && + other.breed == breed; + + @override + int get hashCode => + (className == null ? 0 : className.hashCode) + + (color == null ? 0 : color.hashCode) + + (breed == null ? 0 : breed.hashCode); + + factory Dog.fromJson(Map json) => _$DogFromJson(json); + + Map toJson() => _$DogToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart new file mode 100644 index 000000000000..01dd0c9e75de --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'dog_all_of.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DogAllOf { + /// Returns a new [DogAllOf] instance. + DogAllOf({ + + this.breed, + }); + + @JsonKey( + + name: r'breed', + required: false, + includeIfNull: false + ) + + + final String? breed; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is DogAllOf && + other.breed == breed; + + @override + int get hashCode => + (breed == null ? 0 : breed.hashCode); + + factory DogAllOf.fromJson(Map json) => _$DogAllOfFromJson(json); + + Map toJson() => _$DogAllOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart new file mode 100644 index 000000000000..19127cf51445 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart @@ -0,0 +1,90 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'enum_arrays.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EnumArrays { + /// Returns a new [EnumArrays] instance. + EnumArrays({ + + this.justSymbol, + + this.arrayEnum, + }); + + @JsonKey( + + name: r'just_symbol', + required: false, + includeIfNull: false + ) + + + final EnumArraysJustSymbolEnum? justSymbol; + + + + @JsonKey( + + name: r'array_enum', + required: false, + includeIfNull: false + ) + + + final List? arrayEnum; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is EnumArrays && + other.justSymbol == justSymbol && + other.arrayEnum == arrayEnum; + + @override + int get hashCode => + (justSymbol == null ? 0 : justSymbol.hashCode) + + (arrayEnum == null ? 0 : arrayEnum.hashCode); + + factory EnumArrays.fromJson(Map json) => _$EnumArraysFromJson(json); + + Map toJson() => _$EnumArraysToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + +enum EnumArraysJustSymbolEnum { + @JsonValue('>=') + greaterThanEqual, + @JsonValue('\$') + dollar, + @JsonValue('unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +enum EnumArraysArrayEnumEnum { + @JsonValue('fish') + fish, + @JsonValue('crab') + crab, + @JsonValue('unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart new file mode 100644 index 000000000000..6cffe5cdd43c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart @@ -0,0 +1,216 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'enum_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EnumTest { + /// Returns a new [EnumTest] instance. + EnumTest({ + + this.enumString, + + required this.enumStringRequired, + + this.enumInteger, + + this.enumNumber, + + this.outerEnum, + + this.outerEnumInteger, + + this.outerEnumDefaultValue, + + this.outerEnumIntegerDefaultValue, + }); + + @JsonKey( + + name: r'enum_string', + required: false, + includeIfNull: false + ) + + + final EnumTestEnumStringEnum? enumString; + + + + @JsonKey( + + name: r'enum_string_required', + required: true, + includeIfNull: false + ) + + + final EnumTestEnumStringRequiredEnum enumStringRequired; + + + + @JsonKey( + + name: r'enum_integer', + required: false, + includeIfNull: false + ) + + + final EnumTestEnumIntegerEnum? enumInteger; + + + + @JsonKey( + + name: r'enum_number', + required: false, + includeIfNull: false + ) + + + final EnumTestEnumNumberEnum? enumNumber; + + + + @JsonKey( + + name: r'outerEnum', + required: false, + includeIfNull: false + ) + + + final OuterEnum? outerEnum; + + + + @JsonKey( + + name: r'outerEnumInteger', + required: false, + includeIfNull: false + ) + + + final OuterEnumInteger? outerEnumInteger; + + + + @JsonKey( + + name: r'outerEnumDefaultValue', + required: false, + includeIfNull: false + ) + + + final OuterEnumDefaultValue? outerEnumDefaultValue; + + + + @JsonKey( + + name: r'outerEnumIntegerDefaultValue', + required: false, + includeIfNull: false + ) + + + final OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is EnumTest && + other.enumString == enumString && + other.enumStringRequired == enumStringRequired && + other.enumInteger == enumInteger && + other.enumNumber == enumNumber && + other.outerEnum == outerEnum && + other.outerEnumInteger == outerEnumInteger && + other.outerEnumDefaultValue == outerEnumDefaultValue && + other.outerEnumIntegerDefaultValue == outerEnumIntegerDefaultValue; + + @override + int get hashCode => + (enumString == null ? 0 : enumString.hashCode) + + (enumStringRequired == null ? 0 : enumStringRequired.hashCode) + + (enumInteger == null ? 0 : enumInteger.hashCode) + + (enumNumber == null ? 0 : enumNumber.hashCode) + + (outerEnum == null ? 0 : outerEnum.hashCode) + + (outerEnumInteger == null ? 0 : outerEnumInteger.hashCode) + + (outerEnumDefaultValue == null ? 0 : outerEnumDefaultValue.hashCode) + + (outerEnumIntegerDefaultValue == null ? 0 : outerEnumIntegerDefaultValue.hashCode); + + factory EnumTest.fromJson(Map json) => _$EnumTestFromJson(json); + + Map toJson() => _$EnumTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + +enum EnumTestEnumStringEnum { + @JsonValue('UPPER') + UPPER, + @JsonValue('lower') + lower, + @JsonValue('') + empty, + @JsonValue('unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +enum EnumTestEnumStringRequiredEnum { + @JsonValue('UPPER') + UPPER, + @JsonValue('lower') + lower, + @JsonValue('') + empty, + @JsonValue('unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +enum EnumTestEnumIntegerEnum { + @JsonValue(1) + number1, + @JsonValue(-1) + numberNegative1, + @JsonValue(11184809) + unknownDefaultOpenApi, +} + + + +enum EnumTestEnumNumberEnum { + @JsonValue('1.1') + number1Period1, + @JsonValue('-1.2') + numberNegative1Period2, + @JsonValue('11184809') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart new file mode 100644 index 000000000000..2206480edb1e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/model_file.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'file_schema_test_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FileSchemaTestClass { + /// Returns a new [FileSchemaTestClass] instance. + FileSchemaTestClass({ + + this.file, + + this.files, + }); + + @JsonKey( + + name: r'file', + required: false, + includeIfNull: false + ) + + + final ModelFile? file; + + + + @JsonKey( + + name: r'files', + required: false, + includeIfNull: false + ) + + + final List? files; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FileSchemaTestClass && + other.file == file && + other.files == files; + + @override + int get hashCode => + (file == null ? 0 : file.hashCode) + + (files == null ? 0 : files.hashCode); + + factory FileSchemaTestClass.fromJson(Map json) => _$FileSchemaTestClassFromJson(json); + + Map toJson() => _$FileSchemaTestClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart new file mode 100644 index 000000000000..0e28f45c0313 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'foo.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Foo { + /// Returns a new [Foo] instance. + Foo({ + + this.bar = 'bar', + }); + + @JsonKey( + defaultValue: 'bar', + name: r'bar', + required: false, + includeIfNull: false + ) + + + final String? bar; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Foo && + other.bar == bar; + + @override + int get hashCode => + (bar == null ? 0 : bar.hashCode); + + factory Foo.fromJson(Map json) => _$FooFromJson(json); + + Map toJson() => _$FooToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart new file mode 100644 index 000000000000..ac40facc09da --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart @@ -0,0 +1,300 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'format_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FormatTest { + /// Returns a new [FormatTest] instance. + FormatTest({ + + this.integer, + + this.int32, + + this.int64, + + required this.number, + + this.float, + + this.double_, + + this.decimal, + + this.string, + + required this.byte, + + this.binary, + + required this.date, + + this.dateTime, + + this.uuid, + + required this.password, + + this.patternWithDigits, + + this.patternWithDigitsAndDelimiter, + }); + + // minimum: 10 + // maximum: 100 + @JsonKey( + + name: r'integer', + required: false, + includeIfNull: false + ) + + + final int? integer; + + + + // minimum: 20 + // maximum: 200 + @JsonKey( + + name: r'int32', + required: false, + includeIfNull: false + ) + + + final int? int32; + + + + @JsonKey( + + name: r'int64', + required: false, + includeIfNull: false + ) + + + final int? int64; + + + + // minimum: 32.1 + // maximum: 543.2 + @JsonKey( + + name: r'number', + required: true, + includeIfNull: false + ) + + + final num number; + + + + // minimum: 54.3 + // maximum: 987.6 + @JsonKey( + + name: r'float', + required: false, + includeIfNull: false + ) + + + final double? float; + + + + // minimum: 67.8 + // maximum: 123.4 + @JsonKey( + + name: r'double', + required: false, + includeIfNull: false + ) + + + final double? double_; + + + + @JsonKey( + + name: r'decimal', + required: false, + includeIfNull: false + ) + + + final double? decimal; + + + + @JsonKey( + + name: r'string', + required: false, + includeIfNull: false + ) + + + final String? string; + + + + @JsonKey( + + name: r'byte', + required: true, + includeIfNull: false + ) + + + final String byte; + + + + @JsonKey(ignore: true) + + + final MultipartFile? binary; + + + + @JsonKey( + + name: r'date', + required: true, + includeIfNull: false + ) + + + final DateTime date; + + + + @JsonKey( + + name: r'dateTime', + required: false, + includeIfNull: false + ) + + + final DateTime? dateTime; + + + + @JsonKey( + + name: r'uuid', + required: false, + includeIfNull: false + ) + + + final String? uuid; + + + + @JsonKey( + + name: r'password', + required: true, + includeIfNull: false + ) + + + final String password; + + + + /// A string that is a 10 digit number. Can have leading zeros. + @JsonKey( + + name: r'pattern_with_digits', + required: false, + includeIfNull: false + ) + + + final String? patternWithDigits; + + + + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + @JsonKey( + + name: r'pattern_with_digits_and_delimiter', + required: false, + includeIfNull: false + ) + + + final String? patternWithDigitsAndDelimiter; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FormatTest && + other.integer == integer && + other.int32 == int32 && + other.int64 == int64 && + other.number == number && + other.float == float && + other.double_ == double_ && + other.decimal == decimal && + other.string == string && + other.byte == byte && + other.binary == binary && + other.date == date && + other.dateTime == dateTime && + other.uuid == uuid && + other.password == password && + other.patternWithDigits == patternWithDigits && + other.patternWithDigitsAndDelimiter == patternWithDigitsAndDelimiter; + + @override + int get hashCode => + (integer == null ? 0 : integer.hashCode) + + (int32 == null ? 0 : int32.hashCode) + + (int64 == null ? 0 : int64.hashCode) + + (number == null ? 0 : number.hashCode) + + (float == null ? 0 : float.hashCode) + + (double_ == null ? 0 : double_.hashCode) + + (decimal == null ? 0 : decimal.hashCode) + + (string == null ? 0 : string.hashCode) + + (byte == null ? 0 : byte.hashCode) + + (binary == null ? 0 : binary.hashCode) + + (date == null ? 0 : date.hashCode) + + (dateTime == null ? 0 : dateTime.hashCode) + + (uuid == null ? 0 : uuid.hashCode) + + (password == null ? 0 : password.hashCode) + + (patternWithDigits == null ? 0 : patternWithDigits.hashCode) + + (patternWithDigitsAndDelimiter == null ? 0 : patternWithDigitsAndDelimiter.hashCode); + + factory FormatTest.fromJson(Map json) => _$FormatTestFromJson(json); + + Map toJson() => _$FormatTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart new file mode 100644 index 000000000000..030c78fc8011 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart @@ -0,0 +1,68 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'has_only_read_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HasOnlyReadOnly { + /// Returns a new [HasOnlyReadOnly] instance. + HasOnlyReadOnly({ + + this.bar, + + this.foo, + }); + + @JsonKey( + + name: r'bar', + required: false, + includeIfNull: false + ) + + + final String? bar; + + + + @JsonKey( + + name: r'foo', + required: false, + includeIfNull: false + ) + + + final String? foo; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is HasOnlyReadOnly && + other.bar == bar && + other.foo == foo; + + @override + int get hashCode => + (bar == null ? 0 : bar.hashCode) + + (foo == null ? 0 : foo.hashCode); + + factory HasOnlyReadOnly.fromJson(Map json) => _$HasOnlyReadOnlyFromJson(json); + + Map toJson() => _$HasOnlyReadOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart new file mode 100644 index 000000000000..62bbce180e70 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'health_check_result.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HealthCheckResult { + /// Returns a new [HealthCheckResult] instance. + HealthCheckResult({ + + this.nullableMessage, + }); + + @JsonKey( + + name: r'NullableMessage', + required: false, + includeIfNull: false + ) + + + final String? nullableMessage; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is HealthCheckResult && + other.nullableMessage == nullableMessage; + + @override + int get hashCode => + (nullableMessage == null ? 0 : nullableMessage.hashCode); + + factory HealthCheckResult.fromJson(Map json) => _$HealthCheckResultFromJson(json); + + Map toJson() => _$HealthCheckResultToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart new file mode 100644 index 000000000000..9ab6de8d139e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart @@ -0,0 +1,53 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/foo.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'inline_response_default.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class InlineResponseDefault { + /// Returns a new [InlineResponseDefault] instance. + InlineResponseDefault({ + + this.string, + }); + + @JsonKey( + + name: r'string', + required: false, + includeIfNull: false + ) + + + final Foo? string; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is InlineResponseDefault && + other.string == string; + + @override + int get hashCode => + (string == null ? 0 : string.hashCode); + + factory InlineResponseDefault.fromJson(Map json) => _$InlineResponseDefaultFromJson(json); + + Map toJson() => _$InlineResponseDefaultToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart new file mode 100644 index 000000000000..498fcec29840 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart @@ -0,0 +1,111 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'map_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MapTest { + /// Returns a new [MapTest] instance. + MapTest({ + + this.mapMapOfString, + + this.mapOfEnumString, + + this.directMap, + + this.indirectMap, + }); + + @JsonKey( + + name: r'map_map_of_string', + required: false, + includeIfNull: false + ) + + + final Map>? mapMapOfString; + + + + @JsonKey( + + name: r'map_of_enum_string', + required: false, + includeIfNull: false + ) + + + final Map? mapOfEnumString; + + + + @JsonKey( + + name: r'direct_map', + required: false, + includeIfNull: false + ) + + + final Map? directMap; + + + + @JsonKey( + + name: r'indirect_map', + required: false, + includeIfNull: false + ) + + + final Map? indirectMap; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is MapTest && + other.mapMapOfString == mapMapOfString && + other.mapOfEnumString == mapOfEnumString && + other.directMap == directMap && + other.indirectMap == indirectMap; + + @override + int get hashCode => + (mapMapOfString == null ? 0 : mapMapOfString.hashCode) + + (mapOfEnumString == null ? 0 : mapOfEnumString.hashCode) + + (directMap == null ? 0 : directMap.hashCode) + + (indirectMap == null ? 0 : indirectMap.hashCode); + + factory MapTest.fromJson(Map json) => _$MapTestFromJson(json); + + Map toJson() => _$MapTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + +enum MapTestMapOfEnumStringEnum { + @JsonValue('UPPER') + UPPER, + @JsonValue('lower') + lower, + @JsonValue('unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart new file mode 100644 index 000000000000..36c122aa88e0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -0,0 +1,85 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'mixed_properties_and_additional_properties_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MixedPropertiesAndAdditionalPropertiesClass { + /// Returns a new [MixedPropertiesAndAdditionalPropertiesClass] instance. + MixedPropertiesAndAdditionalPropertiesClass({ + + this.uuid, + + this.dateTime, + + this.map, + }); + + @JsonKey( + + name: r'uuid', + required: false, + includeIfNull: false + ) + + + final String? uuid; + + + + @JsonKey( + + name: r'dateTime', + required: false, + includeIfNull: false + ) + + + final DateTime? dateTime; + + + + @JsonKey( + + name: r'map', + required: false, + includeIfNull: false + ) + + + final Map? map; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is MixedPropertiesAndAdditionalPropertiesClass && + other.uuid == uuid && + other.dateTime == dateTime && + other.map == map; + + @override + int get hashCode => + (uuid == null ? 0 : uuid.hashCode) + + (dateTime == null ? 0 : dateTime.hashCode) + + (map == null ? 0 : map.hashCode); + + factory MixedPropertiesAndAdditionalPropertiesClass.fromJson(Map json) => _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); + + Map toJson() => _$MixedPropertiesAndAdditionalPropertiesClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart new file mode 100644 index 000000000000..0aa6cce9db10 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart @@ -0,0 +1,68 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'model200_response.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Model200Response { + /// Returns a new [Model200Response] instance. + Model200Response({ + + this.name, + + this.class_, + }); + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final int? name; + + + + @JsonKey( + + name: r'class', + required: false, + includeIfNull: false + ) + + + final String? class_; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Model200Response && + other.name == name && + other.class_ == class_; + + @override + int get hashCode => + (name == null ? 0 : name.hashCode) + + (class_ == null ? 0 : class_.hashCode); + + factory Model200Response.fromJson(Map json) => _$Model200ResponseFromJson(json); + + Map toJson() => _$Model200ResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart new file mode 100644 index 000000000000..6addfa7887a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'model_client.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelClient { + /// Returns a new [ModelClient] instance. + ModelClient({ + + this.client, + }); + + @JsonKey( + + name: r'client', + required: false, + includeIfNull: false + ) + + + final String? client; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelClient && + other.client == client; + + @override + int get hashCode => + (client == null ? 0 : client.hashCode); + + factory ModelClient.fromJson(Map json) => _$ModelClientFromJson(json); + + Map toJson() => _$ModelClientToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart new file mode 100644 index 000000000000..47dea34bcee7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + + +enum ModelEnumClass { + @JsonValue('_abc') + abc, + @JsonValue('-efg') + efg, + @JsonValue('(xyz)') + leftParenthesisXyzRightParenthesis, + @JsonValue('unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart new file mode 100644 index 000000000000..c7accdaf30ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart @@ -0,0 +1,53 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'model_file.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelFile { + /// Returns a new [ModelFile] instance. + ModelFile({ + + this.sourceURI, + }); + + /// Test capitalization + @JsonKey( + + name: r'sourceURI', + required: false, + includeIfNull: false + ) + + + final String? sourceURI; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelFile && + other.sourceURI == sourceURI; + + @override + int get hashCode => + (sourceURI == null ? 0 : sourceURI.hashCode); + + factory ModelFile.fromJson(Map json) => _$ModelFileFromJson(json); + + Map toJson() => _$ModelFileToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart new file mode 100644 index 000000000000..e31c1e9ac7a6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'model_list.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelList { + /// Returns a new [ModelList] instance. + ModelList({ + + this.n123list, + }); + + @JsonKey( + + name: r'123-list', + required: false, + includeIfNull: false + ) + + + final String? n123list; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelList && + other.n123list == n123list; + + @override + int get hashCode => + (n123list == null ? 0 : n123list.hashCode); + + factory ModelList.fromJson(Map json) => _$ModelListFromJson(json); + + Map toJson() => _$ModelListToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart new file mode 100644 index 000000000000..f5af2469123b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'model_return.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelReturn { + /// Returns a new [ModelReturn] instance. + ModelReturn({ + + this.return_, + }); + + @JsonKey( + + name: r'return', + required: false, + includeIfNull: false + ) + + + final int? return_; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelReturn && + other.return_ == return_; + + @override + int get hashCode => + (return_ == null ? 0 : return_.hashCode); + + factory ModelReturn.fromJson(Map json) => _$ModelReturnFromJson(json); + + Map toJson() => _$ModelReturnToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart new file mode 100644 index 000000000000..03f126d02771 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart @@ -0,0 +1,100 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'name.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Name { + /// Returns a new [Name] instance. + Name({ + + required this.name, + + this.snakeCase, + + this.property, + + this.n123number, + }); + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false + ) + + + final int name; + + + + @JsonKey( + + name: r'snake_case', + required: false, + includeIfNull: false + ) + + + final int? snakeCase; + + + + @JsonKey( + + name: r'property', + required: false, + includeIfNull: false + ) + + + final String? property; + + + + @JsonKey( + + name: r'123Number', + required: false, + includeIfNull: false + ) + + + final int? n123number; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Name && + other.name == name && + other.snakeCase == snakeCase && + other.property == property && + other.n123number == n123number; + + @override + int get hashCode => + (name == null ? 0 : name.hashCode) + + (snakeCase == null ? 0 : snakeCase.hashCode) + + (property == null ? 0 : property.hashCode) + + (n123number == null ? 0 : n123number.hashCode); + + factory Name.fromJson(Map json) => _$NameFromJson(json); + + Map toJson() => _$NameToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart new file mode 100644 index 000000000000..bdcf45be5793 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart @@ -0,0 +1,228 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'nullable_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NullableClass { + /// Returns a new [NullableClass] instance. + NullableClass({ + + this.integerProp, + + this.numberProp, + + this.booleanProp, + + this.stringProp, + + this.dateProp, + + this.datetimeProp, + + this.arrayNullableProp, + + this.arrayAndItemsNullableProp, + + this.arrayItemsNullable, + + this.objectNullableProp, + + this.objectAndItemsNullableProp, + + this.objectItemsNullable, + }); + + @JsonKey( + + name: r'integer_prop', + required: false, + includeIfNull: false + ) + + + final int? integerProp; + + + + @JsonKey( + + name: r'number_prop', + required: false, + includeIfNull: false + ) + + + final num? numberProp; + + + + @JsonKey( + + name: r'boolean_prop', + required: false, + includeIfNull: false + ) + + + final bool? booleanProp; + + + + @JsonKey( + + name: r'string_prop', + required: false, + includeIfNull: false + ) + + + final String? stringProp; + + + + @JsonKey( + + name: r'date_prop', + required: false, + includeIfNull: false + ) + + + final DateTime? dateProp; + + + + @JsonKey( + + name: r'datetime_prop', + required: false, + includeIfNull: false + ) + + + final DateTime? datetimeProp; + + + + @JsonKey( + + name: r'array_nullable_prop', + required: false, + includeIfNull: false + ) + + + final List? arrayNullableProp; + + + + @JsonKey( + + name: r'array_and_items_nullable_prop', + required: false, + includeIfNull: false + ) + + + final List? arrayAndItemsNullableProp; + + + + @JsonKey( + + name: r'array_items_nullable', + required: false, + includeIfNull: false + ) + + + final List? arrayItemsNullable; + + + + @JsonKey( + + name: r'object_nullable_prop', + required: false, + includeIfNull: false + ) + + + final Map? objectNullableProp; + + + + @JsonKey( + + name: r'object_and_items_nullable_prop', + required: false, + includeIfNull: false + ) + + + final Map? objectAndItemsNullableProp; + + + + @JsonKey( + + name: r'object_items_nullable', + required: false, + includeIfNull: false + ) + + + final Map? objectItemsNullable; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is NullableClass && + other.integerProp == integerProp && + other.numberProp == numberProp && + other.booleanProp == booleanProp && + other.stringProp == stringProp && + other.dateProp == dateProp && + other.datetimeProp == datetimeProp && + other.arrayNullableProp == arrayNullableProp && + other.arrayAndItemsNullableProp == arrayAndItemsNullableProp && + other.arrayItemsNullable == arrayItemsNullable && + other.objectNullableProp == objectNullableProp && + other.objectAndItemsNullableProp == objectAndItemsNullableProp && + other.objectItemsNullable == objectItemsNullable; + + @override + int get hashCode => + (integerProp == null ? 0 : integerProp.hashCode) + + (numberProp == null ? 0 : numberProp.hashCode) + + (booleanProp == null ? 0 : booleanProp.hashCode) + + (stringProp == null ? 0 : stringProp.hashCode) + + (dateProp == null ? 0 : dateProp.hashCode) + + (datetimeProp == null ? 0 : datetimeProp.hashCode) + + (arrayNullableProp == null ? 0 : arrayNullableProp.hashCode) + + (arrayAndItemsNullableProp == null ? 0 : arrayAndItemsNullableProp.hashCode) + + (arrayItemsNullable == null ? 0 : arrayItemsNullable.hashCode) + + (objectNullableProp == null ? 0 : objectNullableProp.hashCode) + + (objectAndItemsNullableProp == null ? 0 : objectAndItemsNullableProp.hashCode) + + (objectItemsNullable == null ? 0 : objectItemsNullable.hashCode); + + factory NullableClass.fromJson(Map json) => _$NullableClassFromJson(json); + + Map toJson() => _$NullableClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart new file mode 100644 index 000000000000..938355d9ce01 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'number_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NumberOnly { + /// Returns a new [NumberOnly] instance. + NumberOnly({ + + this.justNumber, + }); + + @JsonKey( + + name: r'JustNumber', + required: false, + includeIfNull: false + ) + + + final num? justNumber; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is NumberOnly && + other.justNumber == justNumber; + + @override + int get hashCode => + (justNumber == null ? 0 : justNumber.hashCode); + + factory NumberOnly.fromJson(Map json) => _$NumberOnlyFromJson(json); + + Map toJson() => _$NumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart new file mode 100644 index 000000000000..cddbf2c90755 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart @@ -0,0 +1,101 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'object_with_deprecated_fields.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ObjectWithDeprecatedFields { + /// Returns a new [ObjectWithDeprecatedFields] instance. + ObjectWithDeprecatedFields({ + + this.uuid, + + this.id, + + this.deprecatedRef, + + this.bars, + }); + + @JsonKey( + + name: r'uuid', + required: false, + includeIfNull: false + ) + + + final String? uuid; + + + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final num? id; + + + + @JsonKey( + + name: r'deprecatedRef', + required: false, + includeIfNull: false + ) + + + final DeprecatedObject? deprecatedRef; + + + + @JsonKey( + + name: r'bars', + required: false, + includeIfNull: false + ) + + + final List? bars; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ObjectWithDeprecatedFields && + other.uuid == uuid && + other.id == id && + other.deprecatedRef == deprecatedRef && + other.bars == bars; + + @override + int get hashCode => + (uuid == null ? 0 : uuid.hashCode) + + (id == null ? 0 : id.hashCode) + + (deprecatedRef == null ? 0 : deprecatedRef.hashCode) + + (bars == null ? 0 : bars.hashCode); + + factory ObjectWithDeprecatedFields.fromJson(Map json) => _$ObjectWithDeprecatedFieldsFromJson(json); + + Map toJson() => _$ObjectWithDeprecatedFieldsToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart new file mode 100644 index 000000000000..96b0bb03430b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart @@ -0,0 +1,146 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'order.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Order { + /// Returns a new [Order] instance. + Order({ + + this.id, + + this.petId, + + this.quantity, + + this.shipDate, + + this.status, + + this.complete = false, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'petId', + required: false, + includeIfNull: false + ) + + + final int? petId; + + + + @JsonKey( + + name: r'quantity', + required: false, + includeIfNull: false + ) + + + final int? quantity; + + + + @JsonKey( + + name: r'shipDate', + required: false, + includeIfNull: false + ) + + + final DateTime? shipDate; + + + + /// Order Status + @JsonKey( + + name: r'status', + required: false, + includeIfNull: false + ) + + + final OrderStatusEnum? status; + + + + @JsonKey( + defaultValue: false, + name: r'complete', + required: false, + includeIfNull: false + ) + + + final bool? complete; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Order && + other.id == id && + other.petId == petId && + other.quantity == quantity && + other.shipDate == shipDate && + other.status == status && + other.complete == complete; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (petId == null ? 0 : petId.hashCode) + + (quantity == null ? 0 : quantity.hashCode) + + (shipDate == null ? 0 : shipDate.hashCode) + + (status == null ? 0 : status.hashCode) + + (complete == null ? 0 : complete.hashCode); + + factory Order.fromJson(Map json) => _$OrderFromJson(json); + + Map toJson() => _$OrderToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + +/// Order Status +enum OrderStatusEnum { + @JsonValue('placed') + placed, + @JsonValue('approved') + approved, + @JsonValue('delivered') + delivered, + @JsonValue('unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart new file mode 100644 index 000000000000..6b21dedcac50 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart @@ -0,0 +1,84 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'outer_composite.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OuterComposite { + /// Returns a new [OuterComposite] instance. + OuterComposite({ + + this.myNumber, + + this.myString, + + this.myBoolean, + }); + + @JsonKey( + + name: r'my_number', + required: false, + includeIfNull: false + ) + + + final num? myNumber; + + + + @JsonKey( + + name: r'my_string', + required: false, + includeIfNull: false + ) + + + final String? myString; + + + + @JsonKey( + + name: r'my_boolean', + required: false, + includeIfNull: false + ) + + + final bool? myBoolean; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is OuterComposite && + other.myNumber == myNumber && + other.myString == myString && + other.myBoolean == myBoolean; + + @override + int get hashCode => + (myNumber == null ? 0 : myNumber.hashCode) + + (myString == null ? 0 : myString.hashCode) + + (myBoolean == null ? 0 : myBoolean.hashCode); + + factory OuterComposite.fromJson(Map json) => _$OuterCompositeFromJson(json); + + Map toJson() => _$OuterCompositeToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart new file mode 100644 index 000000000000..f7351fd3b573 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnum { + @JsonValue('placed') + placed, + @JsonValue('approved') + approved, + @JsonValue('delivered') + delivered, + @JsonValue('unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart new file mode 100644 index 000000000000..611c3ad8d889 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnumDefaultValue { + @JsonValue('placed') + placed, + @JsonValue('approved') + approved, + @JsonValue('delivered') + delivered, + @JsonValue('unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart new file mode 100644 index 000000000000..c3f134455dc9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnumInteger { + @JsonValue(0) + number0, + @JsonValue(1) + number1, + @JsonValue(2) + number2, + @JsonValue(11184809) + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart new file mode 100644 index 000000000000..d94f696f81b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnumIntegerDefaultValue { + @JsonValue(0) + number0, + @JsonValue(1) + number1, + @JsonValue(2) + number2, + @JsonValue(11184809) + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart new file mode 100644 index 000000000000..cc5c9c566119 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart @@ -0,0 +1,53 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'outer_object_with_enum_property.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OuterObjectWithEnumProperty { + /// Returns a new [OuterObjectWithEnumProperty] instance. + OuterObjectWithEnumProperty({ + + required this.value, + }); + + @JsonKey( + + name: r'value', + required: true, + includeIfNull: false + ) + + + final OuterEnumInteger value; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is OuterObjectWithEnumProperty && + other.value == value; + + @override + int get hashCode => + (value == null ? 0 : value.hashCode); + + factory OuterObjectWithEnumProperty.fromJson(Map json) => _$OuterObjectWithEnumPropertyFromJson(json); + + Map toJson() => _$OuterObjectWithEnumPropertyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart new file mode 100644 index 000000000000..638653545a97 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart @@ -0,0 +1,148 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pet.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pet { + /// Returns a new [Pet] instance. + Pet({ + + this.id, + + this.category, + + required this.name, + + required this.photoUrls, + + this.tags, + + this.status, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'category', + required: false, + includeIfNull: false + ) + + + final Category? category; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false + ) + + + final String name; + + + + @JsonKey( + + name: r'photoUrls', + required: true, + includeIfNull: false + ) + + + final Set photoUrls; + + + + @JsonKey( + + name: r'tags', + required: false, + includeIfNull: false + ) + + + final List? tags; + + + + /// pet status in the store + @JsonKey( + + name: r'status', + required: false, + includeIfNull: false + ) + + + final PetStatusEnum? status; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Pet && + other.id == id && + other.category == category && + other.name == name && + other.photoUrls == photoUrls && + other.tags == tags && + other.status == status; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (category == null ? 0 : category.hashCode) + + (name == null ? 0 : name.hashCode) + + (photoUrls == null ? 0 : photoUrls.hashCode) + + (tags == null ? 0 : tags.hashCode) + + (status == null ? 0 : status.hashCode); + + factory Pet.fromJson(Map json) => _$PetFromJson(json); + + Map toJson() => _$PetToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + +/// pet status in the store +enum PetStatusEnum { + @JsonValue('available') + available, + @JsonValue('pending') + pending, + @JsonValue('sold') + sold, + @JsonValue('unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart new file mode 100644 index 000000000000..2f5dae784c26 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart @@ -0,0 +1,68 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'read_only_first.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ReadOnlyFirst { + /// Returns a new [ReadOnlyFirst] instance. + ReadOnlyFirst({ + + this.bar, + + this.baz, + }); + + @JsonKey( + + name: r'bar', + required: false, + includeIfNull: false + ) + + + final String? bar; + + + + @JsonKey( + + name: r'baz', + required: false, + includeIfNull: false + ) + + + final String? baz; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ReadOnlyFirst && + other.bar == bar && + other.baz == baz; + + @override + int get hashCode => + (bar == null ? 0 : bar.hashCode) + + (baz == null ? 0 : baz.hashCode); + + factory ReadOnlyFirst.fromJson(Map json) => _$ReadOnlyFirstFromJson(json); + + Map toJson() => _$ReadOnlyFirstToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart new file mode 100644 index 000000000000..1c97a0ab6cfa --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'special_model_name.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class SpecialModelName { + /// Returns a new [SpecialModelName] instance. + SpecialModelName({ + + this.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, + }); + + @JsonKey( + + name: r'$special[property.name]', + required: false, + includeIfNull: false + ) + + + final int? dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is SpecialModelName && + other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + @override + int get hashCode => + (dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == null ? 0 : dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket.hashCode); + + factory SpecialModelName.fromJson(Map json) => _$SpecialModelNameFromJson(json); + + Map toJson() => _$SpecialModelNameToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart new file mode 100644 index 000000000000..94ab7be0dfe4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart @@ -0,0 +1,68 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + +part 'tag.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Tag { + /// Returns a new [Tag] instance. + Tag({ + + this.id, + + this.name, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final String? name; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Tag && + other.id == id && + other.name == name; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode); + + factory Tag.fromJson(Map json) => _$TagFromJson(json); + + Map toJson() => _$TagToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart new file mode 100644 index 000000000000..ce5ca533b7e3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart @@ -0,0 +1,184 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/user_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'user.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class User { + /// Returns a new [User] instance. + User({ + + this.id, + + this.username, + + this.firstName, + + this.lastName, + + this.email, + + this.password, + + this.phone, + + this.userStatus, + + this.userType, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'username', + required: false, + includeIfNull: false + ) + + + final String? username; + + + + @JsonKey( + + name: r'firstName', + required: false, + includeIfNull: false + ) + + + final String? firstName; + + + + @JsonKey( + + name: r'lastName', + required: false, + includeIfNull: false + ) + + + final String? lastName; + + + + @JsonKey( + + name: r'email', + required: false, + includeIfNull: false + ) + + + final String? email; + + + + @JsonKey( + + name: r'password', + required: false, + includeIfNull: false + ) + + + final String? password; + + + + @JsonKey( + + name: r'phone', + required: false, + includeIfNull: false + ) + + + final String? phone; + + + + /// User Status + @JsonKey( + + name: r'userStatus', + required: false, + includeIfNull: false + ) + + + final int? userStatus; + + + + @JsonKey( + + name: r'userType', + required: false, + includeIfNull: false + ) + + + final UserType? userType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is User && + other.id == id && + other.username == username && + other.firstName == firstName && + other.lastName == lastName && + other.email == email && + other.password == password && + other.phone == phone && + other.userStatus == userStatus && + other.userType == userType; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (username == null ? 0 : username.hashCode) + + (firstName == null ? 0 : firstName.hashCode) + + (lastName == null ? 0 : lastName.hashCode) + + (email == null ? 0 : email.hashCode) + + (password == null ? 0 : password.hashCode) + + (phone == null ? 0 : phone.hashCode) + + (userStatus == null ? 0 : userStatus.hashCode) + + (userType == null ? 0 : userType.hashCode); + + factory User.fromJson(Map json) => _$UserFromJson(json); + + Map toJson() => _$UserToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user_type.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user_type.dart new file mode 100644 index 000000000000..8266eb1e523e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user_type.dart @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:json_annotation/json_annotation.dart'; + + +enum UserType { + @JsonValue('admin') + admin, + @JsonValue('user') + user, + @JsonValue('unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pubspec.yaml new file mode 100644 index 000000000000..0345c2c64cd9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pubspec.yaml @@ -0,0 +1,16 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '>=2.12.0 <3.0.0' + +dependencies: + dio: '>=4.0.0 <5.0.0' + json_annotation: '^4.4.0' + +dev_dependencies: + build_runner: any + json_serializable: '^6.1.5' + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart new file mode 100644 index 000000000000..9f7cb36093aa --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AdditionalPropertiesClass +void main() { + final instance = AdditionalPropertiesClassBuilder(); + // TODO add properties to the builder and call build() + + group(AdditionalPropertiesClass, () { + // Map mapProperty + test('to test the property `mapProperty`', () async { + // TODO + }); + + // Map> mapOfMapProperty + test('to test the property `mapOfMapProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/animal_test.dart new file mode 100644 index 000000000000..875bb42a106a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/animal_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Animal +void main() { + final instance = AnimalBuilder(); + // TODO add properties to the builder and call build() + + group(Animal, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart new file mode 100644 index 000000000000..ddafef2a831b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for AnotherFakeApi +void main() { + final instance = Openapi().getAnotherFakeApi(); + + group(AnotherFakeApi, () { + // To test special tags + // + // To test special tags and operation ID starting with number + // + //Future call123testSpecialTags(ModelClient modelClient) async + test('test call123testSpecialTags', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/api_response_test.dart new file mode 100644 index 000000000000..cf1a744cd629 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/api_response_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ApiResponse +void main() { + final instance = ApiResponseBuilder(); + // TODO add properties to the builder and call build() + + group(ApiResponse, () { + // int code + test('to test the property `code`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String message + test('to test the property `message`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart new file mode 100644 index 000000000000..524a3680975e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfArrayOfNumberOnly +void main() { + final instance = ArrayOfArrayOfNumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayOfArrayOfNumberOnly, () { + // List> arrayArrayNumber + test('to test the property `arrayArrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart new file mode 100644 index 000000000000..d6854390f45f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfNumberOnly +void main() { + final instance = ArrayOfNumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayOfNumberOnly, () { + // List arrayNumber + test('to test the property `arrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_test_test.dart new file mode 100644 index 000000000000..b34062725122 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_test_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayTest +void main() { + final instance = ArrayTestBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayTest, () { + // List arrayOfString + test('to test the property `arrayOfString`', () async { + // TODO + }); + + // List> arrayArrayOfInteger + test('to test the property `arrayArrayOfInteger`', () async { + // TODO + }); + + // List> arrayArrayOfModel + test('to test the property `arrayArrayOfModel`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart new file mode 100644 index 000000000000..23e04b0001bb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Capitalization +void main() { + final instance = CapitalizationBuilder(); + // TODO add properties to the builder and call build() + + group(Capitalization, () { + // String smallCamel + test('to test the property `smallCamel`', () async { + // TODO + }); + + // String capitalCamel + test('to test the property `capitalCamel`', () async { + // TODO + }); + + // String smallSnake + test('to test the property `smallSnake`', () async { + // TODO + }); + + // String capitalSnake + test('to test the property `capitalSnake`', () async { + // TODO + }); + + // String sCAETHFlowPoints + test('to test the property `sCAETHFlowPoints`', () async { + // TODO + }); + + // Name of the pet + // String ATT_NAME + test('to test the property `ATT_NAME`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart new file mode 100644 index 000000000000..afdac82ad182 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for CatAllOf +void main() { + final instance = CatAllOfBuilder(); + // TODO add properties to the builder and call build() + + group(CatAllOf, () { + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_test.dart new file mode 100644 index 000000000000..b8fc252acc60 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Cat +void main() { + final instance = CatBuilder(); + // TODO add properties to the builder and call build() + + group(Cat, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/category_test.dart new file mode 100644 index 000000000000..70f5fb5e02ac --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/category_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Category +void main() { + final instance = CategoryBuilder(); + // TODO add properties to the builder and call build() + + group(Category, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: 'default-name') + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/class_model_test.dart new file mode 100644 index 000000000000..92f95f186c91 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/class_model_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ClassModel +void main() { + final instance = ClassModelBuilder(); + // TODO add properties to the builder and call build() + + group(ClassModel, () { + // String class_ + test('to test the property `class_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/default_api_test.dart new file mode 100644 index 000000000000..eef4c41652eb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/default_api_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for DefaultApi +void main() { + final instance = Openapi().getDefaultApi(); + + group(DefaultApi, () { + //Future fooGet() async + test('test fooGet', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart new file mode 100644 index 000000000000..98ab991b2b14 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DeprecatedObject +void main() { + final instance = DeprecatedObjectBuilder(); + // TODO add properties to the builder and call build() + + group(DeprecatedObject, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart new file mode 100644 index 000000000000..7b58b3a27552 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DogAllOf +void main() { + final instance = DogAllOfBuilder(); + // TODO add properties to the builder and call build() + + group(DogAllOf, () { + // String breed + test('to test the property `breed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_test.dart new file mode 100644 index 000000000000..f57fcdc413df --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Dog +void main() { + final instance = DogBuilder(); + // TODO add properties to the builder and call build() + + group(Dog, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // String breed + test('to test the property `breed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart new file mode 100644 index 000000000000..cf45fa8ba6e0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumArrays +void main() { + final instance = EnumArraysBuilder(); + // TODO add properties to the builder and call build() + + group(EnumArrays, () { + // String justSymbol + test('to test the property `justSymbol`', () async { + // TODO + }); + + // List arrayEnum + test('to test the property `arrayEnum`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart new file mode 100644 index 000000000000..b5f3aeb7fbdd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumTest +void main() { + final instance = EnumTestBuilder(); + // TODO add properties to the builder and call build() + + group(EnumTest, () { + // String enumString + test('to test the property `enumString`', () async { + // TODO + }); + + // String enumStringRequired + test('to test the property `enumStringRequired`', () async { + // TODO + }); + + // int enumInteger + test('to test the property `enumInteger`', () async { + // TODO + }); + + // double enumNumber + test('to test the property `enumNumber`', () async { + // TODO + }); + + // OuterEnum outerEnum + test('to test the property `outerEnum`', () async { + // TODO + }); + + // OuterEnumInteger outerEnumInteger + test('to test the property `outerEnumInteger`', () async { + // TODO + }); + + // OuterEnumDefaultValue outerEnumDefaultValue + test('to test the property `outerEnumDefaultValue`', () async { + // TODO + }); + + // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue + test('to test the property `outerEnumIntegerDefaultValue`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart new file mode 100644 index 000000000000..06418dfa53c4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart @@ -0,0 +1,140 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FakeApi +void main() { + final instance = Openapi().getFakeApi(); + + group(FakeApi, () { + // Health check endpoint + // + //Future fakeHealthGet() async + test('test fakeHealthGet', () async { + // TODO + }); + + // test http signature authentication + // + //Future fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async + test('test fakeHttpSignatureTest', () async { + // TODO + }); + + // Test serialization of outer boolean types + // + //Future fakeOuterBooleanSerialize({ bool body }) async + test('test fakeOuterBooleanSerialize', () async { + // TODO + }); + + // Test serialization of object with outer number type + // + //Future fakeOuterCompositeSerialize({ OuterComposite outerComposite }) async + test('test fakeOuterCompositeSerialize', () async { + // TODO + }); + + // Test serialization of outer number types + // + //Future fakeOuterNumberSerialize({ num body }) async + test('test fakeOuterNumberSerialize', () async { + // TODO + }); + + // Test serialization of outer string types + // + //Future fakeOuterStringSerialize({ String body }) async + test('test fakeOuterStringSerialize', () async { + // TODO + }); + + // Test serialization of enum (int) properties with examples + // + //Future fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) async + test('test fakePropertyEnumIntegerSerialize', () async { + // TODO + }); + + // For this test, the body has to be a binary file. + // + //Future testBodyWithBinary(MultipartFile body) async + test('test testBodyWithBinary', () async { + // TODO + }); + + // For this test, the body for this request must reference a schema named `File`. + // + //Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async + test('test testBodyWithFileSchema', () async { + // TODO + }); + + //Future testBodyWithQueryParams(String query, User user) async + test('test testBodyWithQueryParams', () async { + // TODO + }); + + // To test \"client\" model + // + // To test \"client\" model + // + //Future testClientModel(ModelClient modelClient) async + test('test testClientModel', () async { + // TODO + }); + + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // + //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, MultipartFile binary, DateTime date, DateTime dateTime, String password, String callback }) async + test('test testEndpointParameters', () async { + // TODO + }); + + // To test enum parameters + // + // To test enum parameters + // + //Future testEnumParameters({ List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString }) async + test('test testEnumParameters', () async { + // TODO + }); + + // Fake endpoint to test group parameters (optional) + // + // Fake endpoint to test group parameters (optional) + // + //Future testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async + test('test testGroupParameters', () async { + // TODO + }); + + // test inline additionalProperties + // + // + // + //Future testInlineAdditionalProperties(Map requestBody) async + test('test testInlineAdditionalProperties', () async { + // TODO + }); + + // test json serialization of form data + // + // + // + //Future testJsonFormData(String param, String param2) async + test('test testJsonFormData', () async { + // TODO + }); + + // To test the collection format in query parameters + // + //Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async + test('test testQueryParameterCollectionFormat', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart new file mode 100644 index 000000000000..3075147f52fd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FakeClassnameTags123Api +void main() { + final instance = Openapi().getFakeClassnameTags123Api(); + + group(FakeClassnameTags123Api, () { + // To test class name in snake case + // + // To test class name in snake case + // + //Future testClassname(ModelClient modelClient) async + test('test testClassname', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart new file mode 100644 index 000000000000..16a122871047 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FileSchemaTestClass +void main() { + final instance = FileSchemaTestClassBuilder(); + // TODO add properties to the builder and call build() + + group(FileSchemaTestClass, () { + // ModelFile file + test('to test the property `file`', () async { + // TODO + }); + + // List files + test('to test the property `files`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/foo_test.dart new file mode 100644 index 000000000000..205237788aeb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/foo_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final instance = FooBuilder(); + // TODO add properties to the builder and call build() + + group(Foo, () { + // String bar (default value: 'bar') + test('to test the property `bar`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/format_test_test.dart new file mode 100644 index 000000000000..ecc4ff46458f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/format_test_test.dart @@ -0,0 +1,93 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FormatTest +void main() { + final instance = FormatTestBuilder(); + // TODO add properties to the builder and call build() + + group(FormatTest, () { + // int integer + test('to test the property `integer`', () async { + // TODO + }); + + // int int32 + test('to test the property `int32`', () async { + // TODO + }); + + // int int64 + test('to test the property `int64`', () async { + // TODO + }); + + // num number + test('to test the property `number`', () async { + // TODO + }); + + // double float + test('to test the property `float`', () async { + // TODO + }); + + // double double_ + test('to test the property `double_`', () async { + // TODO + }); + + // double decimal + test('to test the property `decimal`', () async { + // TODO + }); + + // String string + test('to test the property `string`', () async { + // TODO + }); + + // String byte + test('to test the property `byte`', () async { + // TODO + }); + + // MultipartFile binary + test('to test the property `binary`', () async { + // TODO + }); + + // DateTime date + test('to test the property `date`', () async { + // TODO + }); + + // DateTime dateTime + test('to test the property `dateTime`', () async { + // TODO + }); + + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // A string that is a 10 digit number. Can have leading zeros. + // String patternWithDigits + test('to test the property `patternWithDigits`', () async { + // TODO + }); + + // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + // String patternWithDigitsAndDelimiter + test('to test the property `patternWithDigitsAndDelimiter`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart new file mode 100644 index 000000000000..c34522214751 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HasOnlyReadOnly +void main() { + final instance = HasOnlyReadOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(HasOnlyReadOnly, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String foo + test('to test the property `foo`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart new file mode 100644 index 000000000000..fda0c9218217 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HealthCheckResult +void main() { + final instance = HealthCheckResultBuilder(); + // TODO add properties to the builder and call build() + + group(HealthCheckResult, () { + // String nullableMessage + test('to test the property `nullableMessage`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/inline_response_default_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/inline_response_default_test.dart new file mode 100644 index 000000000000..56fbf1d0b1ac --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/inline_response_default_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for InlineResponseDefault +void main() { + final instance = InlineResponseDefaultBuilder(); + // TODO add properties to the builder and call build() + + group(InlineResponseDefault, () { + // Foo string + test('to test the property `string`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/map_test_test.dart new file mode 100644 index 000000000000..2a1b43c77a13 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/map_test_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MapTest +void main() { + final instance = MapTestBuilder(); + // TODO add properties to the builder and call build() + + group(MapTest, () { + // Map> mapMapOfString + test('to test the property `mapMapOfString`', () async { + // TODO + }); + + // Map mapOfEnumString + test('to test the property `mapOfEnumString`', () async { + // TODO + }); + + // Map directMap + test('to test the property `directMap`', () async { + // TODO + }); + + // Map indirectMap + test('to test the property `indirectMap`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart new file mode 100644 index 000000000000..62187efce076 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MixedPropertiesAndAdditionalPropertiesClass +void main() { + final instance = MixedPropertiesAndAdditionalPropertiesClassBuilder(); + // TODO add properties to the builder and call build() + + group(MixedPropertiesAndAdditionalPropertiesClass, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // DateTime dateTime + test('to test the property `dateTime`', () async { + // TODO + }); + + // Map map + test('to test the property `map`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart new file mode 100644 index 000000000000..39ff6ec59c0b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Model200Response +void main() { + final instance = Model200ResponseBuilder(); + // TODO add properties to the builder and call build() + + group(Model200Response, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // String class_ + test('to test the property `class_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_client_test.dart new file mode 100644 index 000000000000..f494dfd08499 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_client_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelClient +void main() { + final instance = ModelClientBuilder(); + // TODO add properties to the builder and call build() + + group(ModelClient, () { + // String client + test('to test the property `client`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart new file mode 100644 index 000000000000..03e5855bf004 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelEnumClass +void main() { + + group(ModelEnumClass, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_file_test.dart new file mode 100644 index 000000000000..4f1397726226 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_file_test.dart @@ -0,0 +1,17 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelFile +void main() { + final instance = ModelFileBuilder(); + // TODO add properties to the builder and call build() + + group(ModelFile, () { + // Test capitalization + // String sourceURI + test('to test the property `sourceURI`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_list_test.dart new file mode 100644 index 000000000000..d35e02fe0c9a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_list_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelList +void main() { + final instance = ModelListBuilder(); + // TODO add properties to the builder and call build() + + group(ModelList, () { + // String n123list + test('to test the property `n123list`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_return_test.dart new file mode 100644 index 000000000000..eedfe7eb281a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_return_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelReturn +void main() { + final instance = ModelReturnBuilder(); + // TODO add properties to the builder and call build() + + group(ModelReturn, () { + // int return_ + test('to test the property `return_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/name_test.dart new file mode 100644 index 000000000000..6b2329bb0819 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/name_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Name +void main() { + final instance = NameBuilder(); + // TODO add properties to the builder and call build() + + group(Name, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // int snakeCase + test('to test the property `snakeCase`', () async { + // TODO + }); + + // String property + test('to test the property `property`', () async { + // TODO + }); + + // int n123number + test('to test the property `n123number`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart new file mode 100644 index 000000000000..eda41604104c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart @@ -0,0 +1,71 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NullableClass +void main() { + final instance = NullableClassBuilder(); + // TODO add properties to the builder and call build() + + group(NullableClass, () { + // int integerProp + test('to test the property `integerProp`', () async { + // TODO + }); + + // num numberProp + test('to test the property `numberProp`', () async { + // TODO + }); + + // bool booleanProp + test('to test the property `booleanProp`', () async { + // TODO + }); + + // String stringProp + test('to test the property `stringProp`', () async { + // TODO + }); + + // DateTime dateProp + test('to test the property `dateProp`', () async { + // TODO + }); + + // DateTime datetimeProp + test('to test the property `datetimeProp`', () async { + // TODO + }); + + // List arrayNullableProp + test('to test the property `arrayNullableProp`', () async { + // TODO + }); + + // List arrayAndItemsNullableProp + test('to test the property `arrayAndItemsNullableProp`', () async { + // TODO + }); + + // List arrayItemsNullable + test('to test the property `arrayItemsNullable`', () async { + // TODO + }); + + // Map objectNullableProp + test('to test the property `objectNullableProp`', () async { + // TODO + }); + + // Map objectAndItemsNullableProp + test('to test the property `objectAndItemsNullableProp`', () async { + // TODO + }); + + // Map objectItemsNullable + test('to test the property `objectItemsNullable`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/number_only_test.dart new file mode 100644 index 000000000000..7167d78a4962 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NumberOnly +void main() { + final instance = NumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(NumberOnly, () { + // num justNumber + test('to test the property `justNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart new file mode 100644 index 000000000000..55694e02864d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ObjectWithDeprecatedFields +void main() { + final instance = ObjectWithDeprecatedFieldsBuilder(); + // TODO add properties to the builder and call build() + + group(ObjectWithDeprecatedFields, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // num id + test('to test the property `id`', () async { + // TODO + }); + + // DeprecatedObject deprecatedRef + test('to test the property `deprecatedRef`', () async { + // TODO + }); + + // List bars + test('to test the property `bars`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/order_test.dart new file mode 100644 index 000000000000..7ff992230bf6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/order_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Order +void main() { + final instance = OrderBuilder(); + // TODO add properties to the builder and call build() + + group(Order, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // int petId + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart new file mode 100644 index 000000000000..dac257d9a0d6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterComposite +void main() { + final instance = OuterCompositeBuilder(); + // TODO add properties to the builder and call build() + + group(OuterComposite, () { + // num myNumber + test('to test the property `myNumber`', () async { + // TODO + }); + + // String myString + test('to test the property `myString`', () async { + // TODO + }); + + // bool myBoolean + test('to test the property `myBoolean`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart new file mode 100644 index 000000000000..502c8326be58 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumDefaultValue +void main() { + + group(OuterEnumDefaultValue, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart new file mode 100644 index 000000000000..c535fe8ac354 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumIntegerDefaultValue +void main() { + + group(OuterEnumIntegerDefaultValue, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart new file mode 100644 index 000000000000..d945bc8c489d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumInteger +void main() { + + group(OuterEnumInteger, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart new file mode 100644 index 000000000000..8e11eb02fb8a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnum +void main() { + + group(OuterEnum, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart new file mode 100644 index 000000000000..d6d763c5d93a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterObjectWithEnumProperty +void main() { + final instance = OuterObjectWithEnumPropertyBuilder(); + // TODO add properties to the builder and call build() + + group(OuterObjectWithEnumProperty, () { + // OuterEnumInteger value + test('to test the property `value`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart new file mode 100644 index 000000000000..85a28bcfbe53 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart @@ -0,0 +1,92 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for PetApi +void main() { + final instance = Openapi().getPetApi(); + + group(PetApi, () { + // Add a new pet to the store + // + // + // + //Future addPet(Pet pet) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + // + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(Set tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + // + // + //Future updatePet(Pet pet) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + // + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + // + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + // uploads an image (required) + // + // + // + //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async + test('test uploadFileWithRequiredFile', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_test.dart new file mode 100644 index 000000000000..77a37d5a4c35 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pet +void main() { + final instance = PetBuilder(); + // TODO add properties to the builder and call build() + + group(Pet, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // Category category + test('to test the property `category`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Set photoUrls + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status + test('to test the property `status`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart new file mode 100644 index 000000000000..550d3d793ec6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ReadOnlyFirst +void main() { + final instance = ReadOnlyFirstBuilder(); + // TODO add properties to the builder and call build() + + group(ReadOnlyFirst, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String baz + test('to test the property `baz`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart new file mode 100644 index 000000000000..08a4592a1ed7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SpecialModelName +void main() { + final instance = SpecialModelNameBuilder(); + // TODO add properties to the builder and call build() + + group(SpecialModelName, () { + // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/store_api_test.dart new file mode 100644 index 000000000000..9c0bab17a787 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/store_api_test.dart @@ -0,0 +1,47 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for StoreApi +void main() { + final instance = Openapi().getStoreApi(); + + group(StoreApi, () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + // + // + //Future placeOrder(Order order) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/tag_test.dart new file mode 100644 index 000000000000..6f7c63b8f0c2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/tag_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Tag +void main() { + final instance = TagBuilder(); + // TODO add properties to the builder and call build() + + group(Tag, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_api_test.dart new file mode 100644 index 000000000000..4bf28b67623b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_api_test.dart @@ -0,0 +1,83 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for UserApi +void main() { + final instance = Openapi().getUserApi(); + + group(UserApi, () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User user) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + // + // + //Future createUsersWithArrayInput(List user) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + // + // + //Future createUsersWithListInput(List user) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + // + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + // + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + // + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User user) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_test.dart new file mode 100644 index 000000000000..d4555abccc59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_test.dart @@ -0,0 +1,57 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for User +void main() { + final instance = UserBuilder(); + // TODO add properties to the builder and call build() + + group(User, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String username + test('to test the property `username`', () async { + // TODO + }); + + // String firstName + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName + test('to test the property `lastName`', () async { + // TODO + }); + + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // String phone + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus + test('to test the property `userStatus`', () async { + // TODO + }); + + // UserType userType + test('to test the property `userType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_type_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_type_test.dart new file mode 100644 index 000000000000..0ceb0f208724 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_type_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for UserType +void main() { + + group(UserType, () { + }); +} From 87608f7dc15411d8a8760da90d42d20f9067664c Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Wed, 13 Apr 2022 14:09:43 +0930 Subject: [PATCH 28/34] Revert "Escape dollar signs in strings" This reverts commit 6e2a3aeea0450518433f2a07fe7cda92272b18a5. --- .../org/openapitools/codegen/languages/AbstractDartCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c9bc63f361f1..8d121c79c732 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 @@ -768,7 +768,7 @@ public String escapeQuotationMark(String input) { @Override public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*").replace("$", "\\$"); + return input.replace("*/", "*_/").replace("/*", "/_*"); } @Override From 4c41ddbe75a43d9128fa9aa008a13cd1be4248f4 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Wed, 13 Apr 2022 14:13:36 +0930 Subject: [PATCH 29/34] Use raw strings when dealing with enum values --- .../json_serializable/enum.mustache | 2 +- .../json_serializable/enum_inline.mustache | 2 +- .../.openapi-generator/FILES | 55 ------------------- .../lib/src/model/enum_arrays.dart | 12 ++-- .../lib/src/model/enum_test.dart | 28 +++++----- .../lib/src/model/map_test.dart | 6 +- .../lib/src/model/model_enum_class.dart | 8 +-- .../lib/src/model/order.dart | 8 +-- .../lib/src/model/outer_enum.dart | 8 +-- .../src/model/outer_enum_default_value.dart | 8 +-- .../lib/src/model/outer_enum_integer.dart | 8 +-- .../outer_enum_integer_default_value.dart | 8 +-- .../lib/src/model/pet.dart | 8 +-- .../lib/src/model/user_type.dart | 6 +- 14 files changed, 56 insertions(+), 111 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache index 0d6a4ee0276c..150003cc0be2 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache @@ -7,7 +7,7 @@ enum {{{classname}}} { {{#description}} /// {{{.}}} {{/description}} - @JsonValue({{{value}}}) + @JsonValue(r{{{value}}}) {{{name}}}, {{/enumVars}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache index fd827eaad135..2c557f062dfd 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache @@ -3,7 +3,7 @@ enum {{{ enumName }}} { {{#allowableValues}} {{#enumVars}} - @JsonValue({{{value}}}) + @JsonValue(r{{{value}}}) {{{name}}}, {{/enumVars}} {{/allowableValues}} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES index 61c90ee2a919..2838a7b1d06d 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md analysis_options.yaml build.yaml @@ -120,57 +119,3 @@ lib/src/model/tag.dart lib/src/model/user.dart lib/src/model/user_type.dart pubspec.yaml -test/additional_properties_class_test.dart -test/animal_test.dart -test/another_fake_api_test.dart -test/api_response_test.dart -test/array_of_array_of_number_only_test.dart -test/array_of_number_only_test.dart -test/array_test_test.dart -test/capitalization_test.dart -test/cat_all_of_test.dart -test/cat_test.dart -test/category_test.dart -test/class_model_test.dart -test/default_api_test.dart -test/deprecated_object_test.dart -test/dog_all_of_test.dart -test/dog_test.dart -test/enum_arrays_test.dart -test/enum_test_test.dart -test/fake_api_test.dart -test/fake_classname_tags123_api_test.dart -test/file_schema_test_class_test.dart -test/foo_test.dart -test/format_test_test.dart -test/has_only_read_only_test.dart -test/health_check_result_test.dart -test/inline_response_default_test.dart -test/map_test_test.dart -test/mixed_properties_and_additional_properties_class_test.dart -test/model200_response_test.dart -test/model_client_test.dart -test/model_enum_class_test.dart -test/model_file_test.dart -test/model_list_test.dart -test/model_return_test.dart -test/name_test.dart -test/nullable_class_test.dart -test/number_only_test.dart -test/object_with_deprecated_fields_test.dart -test/order_test.dart -test/outer_composite_test.dart -test/outer_enum_default_value_test.dart -test/outer_enum_integer_default_value_test.dart -test/outer_enum_integer_test.dart -test/outer_enum_test.dart -test/outer_object_with_enum_property_test.dart -test/pet_api_test.dart -test/pet_test.dart -test/read_only_first_test.dart -test/special_model_name_test.dart -test/store_api_test.dart -test/tag_test.dart -test/user_api_test.dart -test/user_test.dart -test/user_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart index 19127cf51445..45403806b778 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart @@ -68,22 +68,22 @@ class EnumArrays { enum EnumArraysJustSymbolEnum { - @JsonValue('>=') + @JsonValue(r'>=') greaterThanEqual, - @JsonValue('\$') + @JsonValue(r'$') dollar, - @JsonValue('unknown_default_open_api') + @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } enum EnumArraysArrayEnumEnum { - @JsonValue('fish') + @JsonValue(r'fish') fish, - @JsonValue('crab') + @JsonValue(r'crab') crab, - @JsonValue('unknown_default_open_api') + @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart index 6cffe5cdd43c..c53bf9045228 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart @@ -168,48 +168,48 @@ class EnumTest { enum EnumTestEnumStringEnum { - @JsonValue('UPPER') + @JsonValue(r'UPPER') UPPER, - @JsonValue('lower') + @JsonValue(r'lower') lower, - @JsonValue('') + @JsonValue(r'') empty, - @JsonValue('unknown_default_open_api') + @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } enum EnumTestEnumStringRequiredEnum { - @JsonValue('UPPER') + @JsonValue(r'UPPER') UPPER, - @JsonValue('lower') + @JsonValue(r'lower') lower, - @JsonValue('') + @JsonValue(r'') empty, - @JsonValue('unknown_default_open_api') + @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } enum EnumTestEnumIntegerEnum { - @JsonValue(1) + @JsonValue(r1) number1, - @JsonValue(-1) + @JsonValue(r-1) numberNegative1, - @JsonValue(11184809) + @JsonValue(r11184809) unknownDefaultOpenApi, } enum EnumTestEnumNumberEnum { - @JsonValue('1.1') + @JsonValue(r'1.1') number1Period1, - @JsonValue('-1.2') + @JsonValue(r'-1.2') numberNegative1Period2, - @JsonValue('11184809') + @JsonValue(r'11184809') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart index 498fcec29840..016644d1a721 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart @@ -100,11 +100,11 @@ class MapTest { enum MapTestMapOfEnumStringEnum { - @JsonValue('UPPER') + @JsonValue(r'UPPER') UPPER, - @JsonValue('lower') + @JsonValue(r'lower') lower, - @JsonValue('unknown_default_open_api') + @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart index 47dea34bcee7..e3323e17a181 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart @@ -6,12 +6,12 @@ import 'package:json_annotation/json_annotation.dart'; enum ModelEnumClass { - @JsonValue('_abc') + @JsonValue(r'_abc') abc, - @JsonValue('-efg') + @JsonValue(r'-efg') efg, - @JsonValue('(xyz)') + @JsonValue(r'(xyz)') leftParenthesisXyzRightParenthesis, - @JsonValue('unknown_default_open_api') + @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart index 96b0bb03430b..2b99a85ee497 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart @@ -133,13 +133,13 @@ class Order { /// Order Status enum OrderStatusEnum { - @JsonValue('placed') + @JsonValue(r'placed') placed, - @JsonValue('approved') + @JsonValue(r'approved') approved, - @JsonValue('delivered') + @JsonValue(r'delivered') delivered, - @JsonValue('unknown_default_open_api') + @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart index f7351fd3b573..5b863632d5d9 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart @@ -6,12 +6,12 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnum { - @JsonValue('placed') + @JsonValue(r'placed') placed, - @JsonValue('approved') + @JsonValue(r'approved') approved, - @JsonValue('delivered') + @JsonValue(r'delivered') delivered, - @JsonValue('unknown_default_open_api') + @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart index 611c3ad8d889..f4585362ec87 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart @@ -6,12 +6,12 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumDefaultValue { - @JsonValue('placed') + @JsonValue(r'placed') placed, - @JsonValue('approved') + @JsonValue(r'approved') approved, - @JsonValue('delivered') + @JsonValue(r'delivered') delivered, - @JsonValue('unknown_default_open_api') + @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart index c3f134455dc9..f8879ef34d94 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart @@ -6,12 +6,12 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumInteger { - @JsonValue(0) + @JsonValue(r0) number0, - @JsonValue(1) + @JsonValue(r1) number1, - @JsonValue(2) + @JsonValue(r2) number2, - @JsonValue(11184809) + @JsonValue(r11184809) unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart index d94f696f81b4..e1ed5b152df4 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart @@ -6,12 +6,12 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumIntegerDefaultValue { - @JsonValue(0) + @JsonValue(r0) number0, - @JsonValue(1) + @JsonValue(r1) number1, - @JsonValue(2) + @JsonValue(r2) number2, - @JsonValue(11184809) + @JsonValue(r11184809) unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart index 638653545a97..cbda1528033e 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart @@ -135,13 +135,13 @@ class Pet { /// pet status in the store enum PetStatusEnum { - @JsonValue('available') + @JsonValue(r'available') available, - @JsonValue('pending') + @JsonValue(r'pending') pending, - @JsonValue('sold') + @JsonValue(r'sold') sold, - @JsonValue('unknown_default_open_api') + @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user_type.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user_type.dart index 8266eb1e523e..83196b8b110f 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user_type.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user_type.dart @@ -6,10 +6,10 @@ import 'package:json_annotation/json_annotation.dart'; enum UserType { - @JsonValue('admin') + @JsonValue(r'admin') admin, - @JsonValue('user') + @JsonValue(r'user') user, - @JsonValue('unknown_default_open_api') + @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } From 78f075a4972e9719516c0592c22360cd6f18989a Mon Sep 17 00:00:00 2001 From: Peter Leibiger Date: Thu, 14 Apr 2022 01:07:27 +0200 Subject: [PATCH 30/34] Add json_serializable Maven module ind fix number based enums * regenerate all tests --- .../dart/libraries/dio/model_test.mustache | 3 +- .../built_value/test_instance.mustache | 2 + .../json_serializable/enum.mustache | 2 +- .../json_serializable/enum_inline.mustache | 2 +- .../json_serializable/test_instance.mustache | 2 + pom.xml | 1 + .../doc/UserType.md | 14 --- .../lib/src/model/user_type.dart | 33 ------- .../test/user_type_test.dart | 9 -- .../.openapi-generator/FILES | 54 ++++++++++++ .../lib/src/model/enum_test.dart | 12 +-- .../lib/src/model/outer_enum_integer.dart | 8 +- .../outer_enum_integer_default_value.dart | 8 +- .../pom.xml | 88 +++++++++++++++++++ .../additional_properties_class_test.dart | 4 +- .../test/animal_test.dart | 4 +- .../test/api_response_test.dart | 4 +- .../array_of_array_of_number_only_test.dart | 4 +- .../test/array_of_number_only_test.dart | 4 +- .../test/array_test_test.dart | 4 +- .../test/capitalization_test.dart | 4 +- .../test/cat_all_of_test.dart | 4 +- .../test/cat_test.dart | 4 +- .../test/category_test.dart | 4 +- .../test/class_model_test.dart | 4 +- .../test/deprecated_object_test.dart | 4 +- .../test/dog_all_of_test.dart | 4 +- .../test/dog_test.dart | 4 +- .../test/enum_arrays_test.dart | 4 +- .../test/enum_test_test.dart | 4 +- .../test/file_schema_test_class_test.dart | 4 +- .../test/foo_test.dart | 4 +- .../test/format_test_test.dart | 4 +- .../test/has_only_read_only_test.dart | 4 +- .../test/health_check_result_test.dart | 4 +- .../test/inline_response_default_test.dart | 4 +- .../test/map_test_test.dart | 4 +- ..._and_additional_properties_class_test.dart | 4 +- .../test/model200_response_test.dart | 4 +- .../test/model_client_test.dart | 4 +- .../test/model_file_test.dart | 4 +- .../test/model_list_test.dart | 4 +- .../test/model_return_test.dart | 4 +- .../test/name_test.dart | 4 +- .../test/nullable_class_test.dart | 4 +- .../test/number_only_test.dart | 4 +- .../object_with_deprecated_fields_test.dart | 4 +- .../test/order_test.dart | 4 +- .../test/outer_composite_test.dart | 4 +- .../outer_object_with_enum_property_test.dart | 4 +- .../test/pet_test.dart | 4 +- .../test/read_only_first_test.dart | 4 +- .../test/special_model_name_test.dart | 4 +- .../test/tag_test.dart | 4 +- .../test/user_test.dart | 4 +- .../.openapi-generator/FILES | 54 ++++++++++++ .../test/fake_api_test.dart | 17 +++- .../test/pet_api_test.dart | 16 +++- .../test/store_api_test.dart | 2 + .../test/user_api_test.dart | 10 +++ .../test/user_test.dart | 5 ++ 61 files changed, 345 insertions(+), 161 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/test_instance.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/test_instance.mustache delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserType.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user_type.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_type_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pom.xml diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache index 56686dc889aa..26f614c657f2 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache @@ -7,8 +7,7 @@ import 'package:{{pubName}}/{{pubName}}.dart'; void main() { {{^isEnum}} {{! Due to required vars without default value we can not create a full instance here }} - final instance = {{{classname}}}Builder(); - // TODO add properties to the builder and call build() +{{#includeLibraryTemplate}}test_instance{{/includeLibraryTemplate}} {{/isEnum}} group({{{classname}}}, () { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/test_instance.mustache new file mode 100644 index 000000000000..4ee29fff3cc0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/test_instance.mustache @@ -0,0 +1,2 @@ + final instance = {{{classname}}}Builder(); + // TODO add properties to the builder and call build() \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache index 150003cc0be2..53f1ec90b529 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache @@ -7,7 +7,7 @@ enum {{{classname}}} { {{#description}} /// {{{.}}} {{/description}} - @JsonValue(r{{{value}}}) + @JsonValue({{#isString}}r{{/isString}}{{{value}}}) {{{name}}}, {{/enumVars}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache index 2c557f062dfd..c9af017948f9 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache @@ -3,7 +3,7 @@ enum {{{ enumName }}} { {{#allowableValues}} {{#enumVars}} - @JsonValue(r{{{value}}}) + @JsonValue({{#isString}}r{{/isString}}{{{value}}}) {{{name}}}, {{/enumVars}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/test_instance.mustache new file mode 100644 index 000000000000..1b32f6768164 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/test_instance.mustache @@ -0,0 +1,2 @@ + final {{{classname}}}? instance = /* {{{classname}}}(...) */ null; + // TODO add properties to the entity \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1a7ecf89b373..0b5d55869762 100644 --- a/pom.xml +++ b/pom.xml @@ -1321,6 +1321,7 @@ samples/openapi3/client/petstore/dart2/petstore_client_lib samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake + samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib-json_serializable diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserType.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserType.md deleted file mode 100644 index b56ddc66eb79..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserType.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.UserType - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user_type.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user_type.dart deleted file mode 100644 index a90c44f6f4b3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user_type.dart +++ /dev/null @@ -1,33 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'user_type.g.dart'; - -class UserType extends EnumClass { - - @BuiltValueEnumConst(wireName: r'admin') - static const UserType admin = _$admin; - @BuiltValueEnumConst(wireName: r'user') - static const UserType user = _$user; - - static Serializer get serializer => _$userTypeSerializer; - - const UserType._(String name): super(name); - - static BuiltSet get values => _$values; - static UserType valueOf(String name) => _$valueOf(name); -} - -/// Optionally, enum_class can generate a mixin to go with your enum for use -/// with Angular. It exposes your enum constants as getters. So, if you mix it -/// in to your Dart component class, the values become available to the -/// corresponding Angular template. -/// -/// Trigger mixin generation by writing a line like this one next to your enum. -abstract class UserTypeMixin = Object with _$UserTypeMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_type_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_type_test.dart deleted file mode 100644 index 0ceb0f208724..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_type_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for UserType -void main() { - - group(UserType, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES index 2838a7b1d06d..62109be32e88 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -119,3 +119,57 @@ lib/src/model/tag.dart lib/src/model/user.dart lib/src/model/user_type.dart pubspec.yaml +test/additional_properties_class_test.dart +test/animal_test.dart +test/another_fake_api_test.dart +test/api_response_test.dart +test/array_of_array_of_number_only_test.dart +test/array_of_number_only_test.dart +test/array_test_test.dart +test/capitalization_test.dart +test/cat_all_of_test.dart +test/cat_test.dart +test/category_test.dart +test/class_model_test.dart +test/default_api_test.dart +test/deprecated_object_test.dart +test/dog_all_of_test.dart +test/dog_test.dart +test/enum_arrays_test.dart +test/enum_test_test.dart +test/fake_api_test.dart +test/fake_classname_tags123_api_test.dart +test/file_schema_test_class_test.dart +test/foo_test.dart +test/format_test_test.dart +test/has_only_read_only_test.dart +test/health_check_result_test.dart +test/inline_response_default_test.dart +test/map_test_test.dart +test/mixed_properties_and_additional_properties_class_test.dart +test/model200_response_test.dart +test/model_client_test.dart +test/model_enum_class_test.dart +test/model_file_test.dart +test/model_list_test.dart +test/model_return_test.dart +test/name_test.dart +test/nullable_class_test.dart +test/number_only_test.dart +test/object_with_deprecated_fields_test.dart +test/order_test.dart +test/outer_composite_test.dart +test/outer_enum_default_value_test.dart +test/outer_enum_integer_default_value_test.dart +test/outer_enum_integer_test.dart +test/outer_enum_test.dart +test/outer_object_with_enum_property_test.dart +test/pet_api_test.dart +test/pet_test.dart +test/read_only_first_test.dart +test/special_model_name_test.dart +test/store_api_test.dart +test/tag_test.dart +test/user_api_test.dart +test/user_test.dart +test/user_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart index c53bf9045228..9a6ed0601bd8 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart @@ -194,22 +194,22 @@ enum EnumTestEnumStringRequiredEnum { enum EnumTestEnumIntegerEnum { - @JsonValue(r1) + @JsonValue(1) number1, - @JsonValue(r-1) + @JsonValue(-1) numberNegative1, - @JsonValue(r11184809) + @JsonValue(11184809) unknownDefaultOpenApi, } enum EnumTestEnumNumberEnum { - @JsonValue(r'1.1') + @JsonValue('1.1') number1Period1, - @JsonValue(r'-1.2') + @JsonValue('-1.2') numberNegative1Period2, - @JsonValue(r'11184809') + @JsonValue('11184809') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart index f8879ef34d94..c3f134455dc9 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart @@ -6,12 +6,12 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumInteger { - @JsonValue(r0) + @JsonValue(0) number0, - @JsonValue(r1) + @JsonValue(1) number1, - @JsonValue(r2) + @JsonValue(2) number2, - @JsonValue(r11184809) + @JsonValue(11184809) unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart index e1ed5b152df4..d94f696f81b4 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart @@ -6,12 +6,12 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumIntegerDefaultValue { - @JsonValue(r0) + @JsonValue(0) number0, - @JsonValue(r1) + @JsonValue(1) number1, - @JsonValue(r2) + @JsonValue(2) number2, - @JsonValue(r11184809) + @JsonValue(11184809) unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pom.xml b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pom.xml new file mode 100644 index 000000000000..f344fe151823 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pom.xml @@ -0,0 +1,88 @@ + + 4.0.0 + org.openapitools + DartDioNextPetstoreClientLibFakeJsonSerializableTests + pom + 1.0.0-SNAPSHOT + DartDioNext Petstore Client Lib Fake Json Serializable + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + pub-get + pre-integration-test + + exec + + + pub + + get + + + + + pub-run-build-runner + pre-integration-test + + exec + + + pub + + run + build_runner + build + + + + + dart-analyze + integration-test + + exec + + + dart + + analyze + --fatal-infos + + + + + dart-test + integration-test + + exec + + + dart + + test + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart index 9f7cb36093aa..fd8299fb998f 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for AdditionalPropertiesClass void main() { - final instance = AdditionalPropertiesClassBuilder(); - // TODO add properties to the builder and call build() + final AdditionalPropertiesClass? instance = /* AdditionalPropertiesClass(...) */ null; + // TODO add properties to the entity group(AdditionalPropertiesClass, () { // Map mapProperty diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/animal_test.dart index 875bb42a106a..83c65b22bfc3 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/animal_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/animal_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for Animal void main() { - final instance = AnimalBuilder(); - // TODO add properties to the builder and call build() + final Animal? instance = /* Animal(...) */ null; + // TODO add properties to the entity group(Animal, () { // String className diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/api_response_test.dart index cf1a744cd629..9487afd7f58c 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/api_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/api_response_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ApiResponse void main() { - final instance = ApiResponseBuilder(); - // TODO add properties to the builder and call build() + final ApiResponse? instance = /* ApiResponse(...) */ null; + // TODO add properties to the entity group(ApiResponse, () { // int code diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart index 524a3680975e..79c0d3f3bba8 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ArrayOfArrayOfNumberOnly void main() { - final instance = ArrayOfArrayOfNumberOnlyBuilder(); - // TODO add properties to the builder and call build() + final ArrayOfArrayOfNumberOnly? instance = /* ArrayOfArrayOfNumberOnly(...) */ null; + // TODO add properties to the entity group(ArrayOfArrayOfNumberOnly, () { // List> arrayArrayNumber diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart index d6854390f45f..d80be97cf147 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ArrayOfNumberOnly void main() { - final instance = ArrayOfNumberOnlyBuilder(); - // TODO add properties to the builder and call build() + final ArrayOfNumberOnly? instance = /* ArrayOfNumberOnly(...) */ null; + // TODO add properties to the entity group(ArrayOfNumberOnly, () { // List arrayNumber diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_test_test.dart index b34062725122..bfe7c84fd122 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/array_test_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ArrayTest void main() { - final instance = ArrayTestBuilder(); - // TODO add properties to the builder and call build() + final ArrayTest? instance = /* ArrayTest(...) */ null; + // TODO add properties to the entity group(ArrayTest, () { // List arrayOfString diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart index 23e04b0001bb..156b0ee4993c 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for Capitalization void main() { - final instance = CapitalizationBuilder(); - // TODO add properties to the builder and call build() + final Capitalization? instance = /* Capitalization(...) */ null; + // TODO add properties to the entity group(Capitalization, () { // String smallCamel diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart index afdac82ad182..c22efb324bea 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for CatAllOf void main() { - final instance = CatAllOfBuilder(); - // TODO add properties to the builder and call build() + final CatAllOf? instance = /* CatAllOf(...) */ null; + // TODO add properties to the entity group(CatAllOf, () { // bool declawed diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_test.dart index b8fc252acc60..0a8811bd37f7 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/cat_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for Cat void main() { - final instance = CatBuilder(); - // TODO add properties to the builder and call build() + final Cat? instance = /* Cat(...) */ null; + // TODO add properties to the entity group(Cat, () { // String className diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/category_test.dart index 70f5fb5e02ac..0ed6921ae7fc 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/category_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/category_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for Category void main() { - final instance = CategoryBuilder(); - // TODO add properties to the builder and call build() + final Category? instance = /* Category(...) */ null; + // TODO add properties to the entity group(Category, () { // int id diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/class_model_test.dart index 92f95f186c91..e2dda7bab74e 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/class_model_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/class_model_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ClassModel void main() { - final instance = ClassModelBuilder(); - // TODO add properties to the builder and call build() + final ClassModel? instance = /* ClassModel(...) */ null; + // TODO add properties to the entity group(ClassModel, () { // String class_ diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart index 98ab991b2b14..1b2214668577 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for DeprecatedObject void main() { - final instance = DeprecatedObjectBuilder(); - // TODO add properties to the builder and call build() + final DeprecatedObject? instance = /* DeprecatedObject(...) */ null; + // TODO add properties to the entity group(DeprecatedObject, () { // String name diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart index 7b58b3a27552..f5e191fea696 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for DogAllOf void main() { - final instance = DogAllOfBuilder(); - // TODO add properties to the builder and call build() + final DogAllOf? instance = /* DogAllOf(...) */ null; + // TODO add properties to the entity group(DogAllOf, () { // String breed diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_test.dart index f57fcdc413df..98097bd4bf25 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/dog_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for Dog void main() { - final instance = DogBuilder(); - // TODO add properties to the builder and call build() + final Dog? instance = /* Dog(...) */ null; + // TODO add properties to the entity group(Dog, () { // String className diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart index cf45fa8ba6e0..30d12204ba17 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for EnumArrays void main() { - final instance = EnumArraysBuilder(); - // TODO add properties to the builder and call build() + final EnumArrays? instance = /* EnumArrays(...) */ null; + // TODO add properties to the entity group(EnumArrays, () { // String justSymbol diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart index b5f3aeb7fbdd..befb9901ce9d 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for EnumTest void main() { - final instance = EnumTestBuilder(); - // TODO add properties to the builder and call build() + final EnumTest? instance = /* EnumTest(...) */ null; + // TODO add properties to the entity group(EnumTest, () { // String enumString diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart index 16a122871047..2ccd0d450ce7 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for FileSchemaTestClass void main() { - final instance = FileSchemaTestClassBuilder(); - // TODO add properties to the builder and call build() + final FileSchemaTestClass? instance = /* FileSchemaTestClass(...) */ null; + // TODO add properties to the entity group(FileSchemaTestClass, () { // ModelFile file diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/foo_test.dart index 205237788aeb..28ae9a5b5e13 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/foo_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/foo_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for Foo void main() { - final instance = FooBuilder(); - // TODO add properties to the builder and call build() + final Foo? instance = /* Foo(...) */ null; + // TODO add properties to the entity group(Foo, () { // String bar (default value: 'bar') diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/format_test_test.dart index ecc4ff46458f..b08838d81a37 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/format_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/format_test_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for FormatTest void main() { - final instance = FormatTestBuilder(); - // TODO add properties to the builder and call build() + final FormatTest? instance = /* FormatTest(...) */ null; + // TODO add properties to the entity group(FormatTest, () { // int integer diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart index c34522214751..d72429a31bb5 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for HasOnlyReadOnly void main() { - final instance = HasOnlyReadOnlyBuilder(); - // TODO add properties to the builder and call build() + final HasOnlyReadOnly? instance = /* HasOnlyReadOnly(...) */ null; + // TODO add properties to the entity group(HasOnlyReadOnly, () { // String bar diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart index fda0c9218217..b2b48337b76c 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for HealthCheckResult void main() { - final instance = HealthCheckResultBuilder(); - // TODO add properties to the builder and call build() + final HealthCheckResult? instance = /* HealthCheckResult(...) */ null; + // TODO add properties to the entity group(HealthCheckResult, () { // String nullableMessage diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/inline_response_default_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/inline_response_default_test.dart index 56fbf1d0b1ac..d57cafb1928d 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/inline_response_default_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/inline_response_default_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for InlineResponseDefault void main() { - final instance = InlineResponseDefaultBuilder(); - // TODO add properties to the builder and call build() + final InlineResponseDefault? instance = /* InlineResponseDefault(...) */ null; + // TODO add properties to the entity group(InlineResponseDefault, () { // Foo string diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/map_test_test.dart index 2a1b43c77a13..909415df7540 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/map_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/map_test_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for MapTest void main() { - final instance = MapTestBuilder(); - // TODO add properties to the builder and call build() + final MapTest? instance = /* MapTest(...) */ null; + // TODO add properties to the entity group(MapTest, () { // Map> mapMapOfString diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart index 62187efce076..0115f01ed6be 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for MixedPropertiesAndAdditionalPropertiesClass void main() { - final instance = MixedPropertiesAndAdditionalPropertiesClassBuilder(); - // TODO add properties to the builder and call build() + final MixedPropertiesAndAdditionalPropertiesClass? instance = /* MixedPropertiesAndAdditionalPropertiesClass(...) */ null; + // TODO add properties to the entity group(MixedPropertiesAndAdditionalPropertiesClass, () { // String uuid diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart index 39ff6ec59c0b..de8cf3037b6b 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for Model200Response void main() { - final instance = Model200ResponseBuilder(); - // TODO add properties to the builder and call build() + final Model200Response? instance = /* Model200Response(...) */ null; + // TODO add properties to the entity group(Model200Response, () { // int name diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_client_test.dart index f494dfd08499..44faf62f15b4 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_client_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_client_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ModelClient void main() { - final instance = ModelClientBuilder(); - // TODO add properties to the builder and call build() + final ModelClient? instance = /* ModelClient(...) */ null; + // TODO add properties to the entity group(ModelClient, () { // String client diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_file_test.dart index 4f1397726226..8ea65f6ccb41 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_file_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_file_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ModelFile void main() { - final instance = ModelFileBuilder(); - // TODO add properties to the builder and call build() + final ModelFile? instance = /* ModelFile(...) */ null; + // TODO add properties to the entity group(ModelFile, () { // Test capitalization diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_list_test.dart index d35e02fe0c9a..f748eee993ac 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_list_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_list_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ModelList void main() { - final instance = ModelListBuilder(); - // TODO add properties to the builder and call build() + final ModelList? instance = /* ModelList(...) */ null; + // TODO add properties to the entity group(ModelList, () { // String n123list diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_return_test.dart index eedfe7eb281a..cfc17807c151 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_return_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/model_return_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ModelReturn void main() { - final instance = ModelReturnBuilder(); - // TODO add properties to the builder and call build() + final ModelReturn? instance = /* ModelReturn(...) */ null; + // TODO add properties to the entity group(ModelReturn, () { // int return_ diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/name_test.dart index 6b2329bb0819..4f3f7f633728 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/name_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/name_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for Name void main() { - final instance = NameBuilder(); - // TODO add properties to the builder and call build() + final Name? instance = /* Name(...) */ null; + // TODO add properties to the entity group(Name, () { // int name diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart index eda41604104c..0ab76167983b 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for NullableClass void main() { - final instance = NullableClassBuilder(); - // TODO add properties to the builder and call build() + final NullableClass? instance = /* NullableClass(...) */ null; + // TODO add properties to the entity group(NullableClass, () { // int integerProp diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/number_only_test.dart index 7167d78a4962..12b19c59dfb7 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/number_only_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for NumberOnly void main() { - final instance = NumberOnlyBuilder(); - // TODO add properties to the builder and call build() + final NumberOnly? instance = /* NumberOnly(...) */ null; + // TODO add properties to the entity group(NumberOnly, () { // num justNumber diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart index 55694e02864d..e197bd0ad807 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ObjectWithDeprecatedFields void main() { - final instance = ObjectWithDeprecatedFieldsBuilder(); - // TODO add properties to the builder and call build() + final ObjectWithDeprecatedFields? instance = /* ObjectWithDeprecatedFields(...) */ null; + // TODO add properties to the entity group(ObjectWithDeprecatedFields, () { // String uuid diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/order_test.dart index 7ff992230bf6..45b02097daed 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/order_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/order_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for Order void main() { - final instance = OrderBuilder(); - // TODO add properties to the builder and call build() + final Order? instance = /* Order(...) */ null; + // TODO add properties to the entity group(Order, () { // int id diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart index dac257d9a0d6..a5f0172ba21c 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for OuterComposite void main() { - final instance = OuterCompositeBuilder(); - // TODO add properties to the builder and call build() + final OuterComposite? instance = /* OuterComposite(...) */ null; + // TODO add properties to the entity group(OuterComposite, () { // num myNumber diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart index d6d763c5d93a..3d72c6188e17 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for OuterObjectWithEnumProperty void main() { - final instance = OuterObjectWithEnumPropertyBuilder(); - // TODO add properties to the builder and call build() + final OuterObjectWithEnumProperty? instance = /* OuterObjectWithEnumProperty(...) */ null; + // TODO add properties to the entity group(OuterObjectWithEnumProperty, () { // OuterEnumInteger value diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_test.dart index 77a37d5a4c35..20b5e3e06735 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/pet_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for Pet void main() { - final instance = PetBuilder(); - // TODO add properties to the builder and call build() + final Pet? instance = /* Pet(...) */ null; + // TODO add properties to the entity group(Pet, () { // int id diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart index 550d3d793ec6..bcefd75befb6 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ReadOnlyFirst void main() { - final instance = ReadOnlyFirstBuilder(); - // TODO add properties to the builder and call build() + final ReadOnlyFirst? instance = /* ReadOnlyFirst(...) */ null; + // TODO add properties to the entity group(ReadOnlyFirst, () { // String bar diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart index 08a4592a1ed7..23b58324ef99 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for SpecialModelName void main() { - final instance = SpecialModelNameBuilder(); - // TODO add properties to the builder and call build() + final SpecialModelName? instance = /* SpecialModelName(...) */ null; + // TODO add properties to the entity group(SpecialModelName, () { // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/tag_test.dart index 6f7c63b8f0c2..ffe49b3179c3 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/tag_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/tag_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for Tag void main() { - final instance = TagBuilder(); - // TODO add properties to the builder and call build() + final Tag? instance = /* Tag(...) */ null; + // TODO add properties to the entity group(Tag, () { // int id diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_test.dart index d4555abccc59..e1a35216a88c 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/test/user_test.dart @@ -3,8 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for User void main() { - final instance = UserBuilder(); - // TODO add properties to the builder and call build() + final User? instance = /* User(...) */ null; + // TODO add properties to the entity group(User, () { // int id diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/FILES index 6f14e15b683e..66428661d759 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/FILES @@ -121,3 +121,57 @@ lib/src/model/user.dart lib/src/model/user_type.dart lib/src/serializers.dart pubspec.yaml +test/additional_properties_class_test.dart +test/animal_test.dart +test/another_fake_api_test.dart +test/api_response_test.dart +test/array_of_array_of_number_only_test.dart +test/array_of_number_only_test.dart +test/array_test_test.dart +test/capitalization_test.dart +test/cat_all_of_test.dart +test/cat_test.dart +test/category_test.dart +test/class_model_test.dart +test/default_api_test.dart +test/deprecated_object_test.dart +test/dog_all_of_test.dart +test/dog_test.dart +test/enum_arrays_test.dart +test/enum_test_test.dart +test/fake_api_test.dart +test/fake_classname_tags123_api_test.dart +test/file_schema_test_class_test.dart +test/foo_test.dart +test/format_test_test.dart +test/has_only_read_only_test.dart +test/health_check_result_test.dart +test/inline_response_default_test.dart +test/map_test_test.dart +test/mixed_properties_and_additional_properties_class_test.dart +test/model200_response_test.dart +test/model_client_test.dart +test/model_enum_class_test.dart +test/model_file_test.dart +test/model_list_test.dart +test/model_return_test.dart +test/name_test.dart +test/nullable_class_test.dart +test/number_only_test.dart +test/object_with_deprecated_fields_test.dart +test/order_test.dart +test/outer_composite_test.dart +test/outer_enum_default_value_test.dart +test/outer_enum_integer_default_value_test.dart +test/outer_enum_integer_test.dart +test/outer_enum_test.dart +test/outer_object_with_enum_property_test.dart +test/pet_api_test.dart +test/pet_test.dart +test/read_only_first_test.dart +test/special_model_name_test.dart +test/store_api_test.dart +test/tag_test.dart +test/user_api_test.dart +test/user_test.dart +test/user_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/fake_api_test.dart index 7dca853fa9d6..c552474e280b 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/fake_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/fake_api_test.dart @@ -56,7 +56,14 @@ void main() { // TODO }); - // For this test, the body for this request much reference a schema named `File`. + // For this test, the body has to be a binary file. + // + //Future testBodyWithBinary(MultipartFile body) async + test('test testBodyWithBinary', () async { + // TODO + }); + + // For this test, the body for this request must reference a schema named `File`. // //Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async test('test testBodyWithFileSchema', () async { @@ -90,7 +97,7 @@ void main() { // // To test enum parameters // - //Future testEnumParameters({ BuiltList enumHeaderStringArray, String enumHeaderString, BuiltList enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, BuiltList enumFormStringArray, String enumFormString }) async + //Future testEnumParameters({ BuiltList enumHeaderStringArray, String enumHeaderString, BuiltList enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, BuiltList enumQueryModelArray, BuiltList enumFormStringArray, String enumFormString }) async test('test testEnumParameters', () async { // TODO }); @@ -106,6 +113,8 @@ void main() { // test inline additionalProperties // + // + // //Future testInlineAdditionalProperties(BuiltMap requestBody) async test('test testInlineAdditionalProperties', () async { // TODO @@ -113,6 +122,8 @@ void main() { // test json serialization of form data // + // + // //Future testJsonFormData(String param, String param2) async test('test testJsonFormData', () async { // TODO @@ -120,7 +131,7 @@ void main() { // To test the collection format in query parameters // - //Future testQueryParameterCollectionFormat(BuiltList pipe, BuiltList ioutil, BuiltList http, BuiltList url, BuiltList context) async + //Future testQueryParameterCollectionFormat(BuiltList pipe, BuiltList ioutil, BuiltList http, BuiltList url, BuiltList context, String allowEmpty, { BuiltMap language }) async test('test testQueryParameterCollectionFormat', () async { // TODO }); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/pet_api_test.dart index 99e9a07b97c6..bd23e2e9e73d 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/pet_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/pet_api_test.dart @@ -9,6 +9,8 @@ void main() { group(PetApi, () { // Add a new pet to the store // + // + // //Future addPet(Pet pet) async test('test addPet', () async { // TODO @@ -16,6 +18,8 @@ void main() { // Deletes a pet // + // + // //Future deletePet(int petId, { String apiKey }) async test('test deletePet', () async { // TODO @@ -50,6 +54,8 @@ void main() { // Update an existing pet // + // + // //Future updatePet(Pet pet) async test('test updatePet', () async { // TODO @@ -57,6 +63,8 @@ void main() { // Updates a pet in the store with form data // + // + // //Future updatePetWithForm(int petId, { String name, String status }) async test('test updatePetWithForm', () async { // TODO @@ -64,14 +72,18 @@ void main() { // uploads an image // - //Future uploadFile(int petId, { String additionalMetadata, Uint8List file }) async + // + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async test('test uploadFile', () async { // TODO }); // uploads an image (required) // - //Future uploadFileWithRequiredFile(int petId, Uint8List requiredFile, { String additionalMetadata }) async + // + // + //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async test('test uploadFileWithRequiredFile', () async { // TODO }); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/store_api_test.dart index 9eac725762b7..b3afe7ca1e8f 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/store_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/store_api_test.dart @@ -36,6 +36,8 @@ void main() { // Place an order for a pet // + // + // //Future placeOrder(Order order) async test('test placeOrder', () async { // TODO diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/user_api_test.dart index 01eaad61fc2d..29f63ba073ba 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/user_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/user_api_test.dart @@ -18,6 +18,8 @@ void main() { // Creates list of users with given input array // + // + // //Future createUsersWithArrayInput(BuiltList user) async test('test createUsersWithArrayInput', () async { // TODO @@ -25,6 +27,8 @@ void main() { // Creates list of users with given input array // + // + // //Future createUsersWithListInput(BuiltList user) async test('test createUsersWithListInput', () async { // TODO @@ -41,6 +45,8 @@ void main() { // Get user by user name // + // + // //Future getUserByName(String username) async test('test getUserByName', () async { // TODO @@ -48,6 +54,8 @@ void main() { // Logs user into the system // + // + // //Future loginUser(String username, String password) async test('test loginUser', () async { // TODO @@ -55,6 +63,8 @@ void main() { // Logs out current logged in user session // + // + // //Future logoutUser() async test('test logoutUser', () async { // TODO diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/user_test.dart index 1e6a1bc23faa..d4555abccc59 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/user_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/test/user_test.dart @@ -48,5 +48,10 @@ void main() { // TODO }); + // UserType userType + test('to test the property `userType`', () async { + // TODO + }); + }); } From 5006f9e7e58ad0b905e93be0d1c2c75bd8bd892f Mon Sep 17 00:00:00 2001 From: Peter Leibiger Date: Thu, 14 Apr 2022 18:00:59 +0200 Subject: [PATCH 31/34] Update docs and fix wrong maven module * add a beta hint to json_serializable option --- docs/generators/dart-dio-next.md | 2 +- .../languages/DartDioNextClientCodegen.java | 2 +- pom.xml | 2 +- .../.openapi-generator/FILES | 54 ------------------- .../.openapi-generator/FILES | 54 ------------------- 5 files changed, 3 insertions(+), 111 deletions(-) diff --git a/docs/generators/dart-dio-next.md b/docs/generators/dart-dio-next.md index 785a61c3b2a5..9619d7b8b3d0 100644 --- a/docs/generators/dart-dio-next.md +++ b/docs/generators/dart-dio-next.md @@ -33,7 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |pubLibrary|Library name in generated code| |null| |pubName|Name in generated pubspec| |null| |pubVersion|Version in generated pubspec| |null| -|serializationLibrary|Specify serialization library|
**built_value**
[DEFAULT] built_value
**json_serializable**
json_serializable
|built_value| +|serializationLibrary|Specify serialization library|
**built_value**
[DEFAULT] built_value
**json_serializable**
[BETA] json_serializable
|built_value| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|Source folder for generated code| |null| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 15da567031b2..510a930736b0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -92,7 +92,7 @@ public DartDioNextClientCodegen() { modelPackage = "lib.src.model"; supportedLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); - supportedLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "json_serializable"); + supportedLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable"); final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); serializationLibrary.setEnum(supportedLibraries); serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); diff --git a/pom.xml b/pom.xml index 0b5d55869762..3cb89068ddf9 100644 --- a/pom.xml +++ b/pom.xml @@ -1321,7 +1321,7 @@ samples/openapi3/client/petstore/dart2/petstore_client_lib samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake - samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib-json_serializable + samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable
diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES index 62109be32e88..2838a7b1d06d 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -119,57 +119,3 @@ lib/src/model/tag.dart lib/src/model/user.dart lib/src/model/user_type.dart pubspec.yaml -test/additional_properties_class_test.dart -test/animal_test.dart -test/another_fake_api_test.dart -test/api_response_test.dart -test/array_of_array_of_number_only_test.dart -test/array_of_number_only_test.dart -test/array_test_test.dart -test/capitalization_test.dart -test/cat_all_of_test.dart -test/cat_test.dart -test/category_test.dart -test/class_model_test.dart -test/default_api_test.dart -test/deprecated_object_test.dart -test/dog_all_of_test.dart -test/dog_test.dart -test/enum_arrays_test.dart -test/enum_test_test.dart -test/fake_api_test.dart -test/fake_classname_tags123_api_test.dart -test/file_schema_test_class_test.dart -test/foo_test.dart -test/format_test_test.dart -test/has_only_read_only_test.dart -test/health_check_result_test.dart -test/inline_response_default_test.dart -test/map_test_test.dart -test/mixed_properties_and_additional_properties_class_test.dart -test/model200_response_test.dart -test/model_client_test.dart -test/model_enum_class_test.dart -test/model_file_test.dart -test/model_list_test.dart -test/model_return_test.dart -test/name_test.dart -test/nullable_class_test.dart -test/number_only_test.dart -test/object_with_deprecated_fields_test.dart -test/order_test.dart -test/outer_composite_test.dart -test/outer_enum_default_value_test.dart -test/outer_enum_integer_default_value_test.dart -test/outer_enum_integer_test.dart -test/outer_enum_test.dart -test/outer_object_with_enum_property_test.dart -test/pet_api_test.dart -test/pet_test.dart -test/read_only_first_test.dart -test/special_model_name_test.dart -test/store_api_test.dart -test/tag_test.dart -test/user_api_test.dart -test/user_test.dart -test/user_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/FILES index 66428661d759..6f14e15b683e 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/FILES @@ -121,57 +121,3 @@ lib/src/model/user.dart lib/src/model/user_type.dart lib/src/serializers.dart pubspec.yaml -test/additional_properties_class_test.dart -test/animal_test.dart -test/another_fake_api_test.dart -test/api_response_test.dart -test/array_of_array_of_number_only_test.dart -test/array_of_number_only_test.dart -test/array_test_test.dart -test/capitalization_test.dart -test/cat_all_of_test.dart -test/cat_test.dart -test/category_test.dart -test/class_model_test.dart -test/default_api_test.dart -test/deprecated_object_test.dart -test/dog_all_of_test.dart -test/dog_test.dart -test/enum_arrays_test.dart -test/enum_test_test.dart -test/fake_api_test.dart -test/fake_classname_tags123_api_test.dart -test/file_schema_test_class_test.dart -test/foo_test.dart -test/format_test_test.dart -test/has_only_read_only_test.dart -test/health_check_result_test.dart -test/inline_response_default_test.dart -test/map_test_test.dart -test/mixed_properties_and_additional_properties_class_test.dart -test/model200_response_test.dart -test/model_client_test.dart -test/model_enum_class_test.dart -test/model_file_test.dart -test/model_list_test.dart -test/model_return_test.dart -test/name_test.dart -test/nullable_class_test.dart -test/number_only_test.dart -test/object_with_deprecated_fields_test.dart -test/order_test.dart -test/outer_composite_test.dart -test/outer_enum_default_value_test.dart -test/outer_enum_integer_default_value_test.dart -test/outer_enum_integer_test.dart -test/outer_enum_test.dart -test/outer_object_with_enum_property_test.dart -test/pet_api_test.dart -test/pet_test.dart -test/read_only_first_test.dart -test/special_model_name_test.dart -test/store_api_test.dart -test/tag_test.dart -test/user_api_test.dart -test/user_test.dart -test/user_type_test.dart From a016b8858591e78db16905e732e22b69f7e6dbd2 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Wed, 27 Apr 2022 12:48:41 +0930 Subject: [PATCH 32/34] Update minimum dart sdk with json serializable --- .../src/main/resources/dart/libraries/dio/pubspec.mustache | 5 +++++ .../petstore_client_lib_fake-json_serializable/pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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 139b6ef4ccde..2498c80c74ea 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 @@ -4,7 +4,12 @@ description: {{pubDescription}} homepage: {{pubHomepage}} environment: +{{#useBuiltValue}} sdk: '>=2.12.0 <3.0.0' +{{/useBuiltValue}} +{{#useJsonSerializable}} + sdk: '>=2.14.0 <3.0.0' +{{/useJsonSerializable}} dependencies: dio: '>=4.0.0 <5.0.0' diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pubspec.yaml index 0345c2c64cd9..ec055d740665 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/pubspec.yaml @@ -4,7 +4,7 @@ description: OpenAPI API client homepage: homepage environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.14.0 <3.0.0' dependencies: dio: '>=4.0.0 <5.0.0' From b894e148f5aee2fcb5c51b6297863b1e3cd8f6b6 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Wed, 27 Apr 2022 13:47:51 +0930 Subject: [PATCH 33/34] Use dart 2.14 when testing Dart samples --- .github/workflows/samples-dart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/samples-dart.yaml b/.github/workflows/samples-dart.yaml index fd78f8a6d912..229b0c488132 100644 --- a/.github/workflows/samples-dart.yaml +++ b/.github/workflows/samples-dart.yaml @@ -40,7 +40,7 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('samples/**/pubspec.yaml') }} - uses: dart-lang/setup-dart@v1 with: - sdk: 2.13.0 + sdk: 2.14.0 - name: Run tests uses: ./.github/actions/run-samples with: From cf5ceefa4fb58f060a0a57638cb29b6879e495f4 Mon Sep 17 00:00:00 2001 From: Michael Marner Date: Wed, 27 Apr 2022 14:38:39 +0930 Subject: [PATCH 34/34] Update codegen to remove analysis errors in output --- .../json_serializable/api/imports.mustache | 1 + .../json_serializable/class.mustache | 11 ++++++- .../json_serializable/deserialize.mustache | 3 +- .../lib/src/api/another_fake_api.dart | 1 + .../lib/src/api/default_api.dart | 1 + .../lib/src/api/fake_api.dart | 1 + .../src/api/fake_classname_tags123_api.dart | 1 + .../lib/src/api/pet_api.dart | 1 + .../lib/src/api/store_api.dart | 1 + .../lib/src/api/user_api.dart | 1 + .../lib/src/deserialize.dart | 7 ---- .../model/additional_properties_class.dart | 5 +-- .../lib/src/model/all_of_with_single_ref.dart | 3 +- .../lib/src/model/animal.dart | 5 +-- .../lib/src/model/api_response.dart | 7 ++-- .../model/array_of_array_of_number_only.dart | 3 +- .../lib/src/model/array_of_number_only.dart | 3 +- .../lib/src/model/array_test.dart | 7 ++-- .../lib/src/model/capitalization.dart | 13 ++++---- .../lib/src/model/cat.dart | 9 +++-- .../lib/src/model/cat_all_of.dart | 3 +- .../lib/src/model/category.dart | 5 +-- .../lib/src/model/class_model.dart | 3 +- .../lib/src/model/deprecated_object.dart | 3 +- .../lib/src/model/dog.dart | 9 +++-- .../lib/src/model/dog_all_of.dart | 3 +- .../lib/src/model/enum_arrays.dart | 5 +-- .../lib/src/model/enum_test.dart | 15 +++++---- .../lib/src/model/file_schema_test_class.dart | 5 +-- .../lib/src/model/foo.dart | 3 +- .../lib/src/model/format_test.dart | 33 ++++++++++--------- .../lib/src/model/has_only_read_only.dart | 5 +-- .../lib/src/model/health_check_result.dart | 1 + .../src/model/inline_response_default.dart | 3 +- .../lib/src/model/map_test.dart | 9 ++--- ...rties_and_additional_properties_class.dart | 7 ++-- .../lib/src/model/model200_response.dart | 5 +-- .../lib/src/model/model_client.dart | 3 +- .../lib/src/model/model_file.dart | 3 +- .../lib/src/model/model_list.dart | 3 +- .../lib/src/model/model_return.dart | 3 +- .../lib/src/model/name.dart | 9 ++--- .../lib/src/model/nullable_class.dart | 5 +-- .../lib/src/model/number_only.dart | 3 +- .../model/object_with_deprecated_fields.dart | 9 ++--- .../lib/src/model/order.dart | 13 ++++---- .../lib/src/model/outer_composite.dart | 7 ++-- .../outer_object_with_enum_property.dart | 3 +- .../lib/src/model/pet.dart | 13 ++++---- .../lib/src/model/read_only_first.dart | 5 +-- .../lib/src/model/special_model_name.dart | 3 +- .../lib/src/model/tag.dart | 5 +-- .../lib/src/model/user.dart | 17 +++++----- 53 files changed, 181 insertions(+), 124 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache index c9df06d0bfaa..f2b20f7171b5 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache @@ -1,2 +1,3 @@ +// ignore: unused_import import 'dart:convert'; import 'package:{{pubName}}/src/deserialize.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache index e6b9445654f7..6fe97cc9e4af 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache @@ -2,6 +2,15 @@ import 'package:json_annotation/json_annotation.dart'; part '{{classFilename}}.g.dart'; +{{! + Classes with polymorphism or composition may generate unused imports, + these need to be ignored for said classes so that there are no lint errors. +}} +{{#parentModel}} +// ignore_for_file: unused_import + +{{/parentModel}} + @JsonSerializable( checked: true, createToJson: true, @@ -55,7 +64,7 @@ class {{{classname}}} { @override int get hashCode => {{#vars}} - ({{{name}}} == null ? 0 : {{{name}}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}} + {{#isNullable}}({{{name}}} == null ? 0 : {{{name}}}.hashCode){{/isNullable}}{{^isNullable}}{{{name}}}.hashCode{{/isNullable}}{{^-last}} +{{/-last}}{{#-last}};{{/-last}} {{/vars}} factory {{{classname}}}.fromJson(Map json) => _${{{classname}}}FromJson(json); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache index 63cb844f82d0..d2cfeea2a014 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache @@ -1,6 +1,8 @@ {{#models}} {{#model}} + {{^isEnum}} import 'package:{{pubName}}/src/model/{{classFilename}}.dart'; +{{/isEnum}} {{/model}} {{/models}} @@ -20,7 +22,6 @@ final _regMap = RegExp(r'^Map$'); } final valueString = '$value'.toLowerCase(); return (valueString == 'true' || valueString == '1') as ReturnType; - break; case 'double': return (value is double ? value : double.parse('$value')) as ReturnType; {{#models}} diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart index e4ac44b0c76d..14aea6d2db40 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +// ignore: unused_import import 'dart:convert'; import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart index 7acdb047a1a7..50ad37daada5 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +// ignore: unused_import import 'dart:convert'; import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart index eb92299f3ae8..f9294bb4f19c 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +// ignore: unused_import import 'dart:convert'; import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart index df4f5ce8a6f1..bc92a874576e 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +// ignore: unused_import import 'dart:convert'; import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart index 7ee1cba5061c..fba6d184eb53 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +// ignore: unused_import import 'dart:convert'; import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart index 98eca21e58aa..5712d8c03cf9 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +// ignore: unused_import import 'dart:convert'; import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart index d51d9a884e32..ccd5e7a95116 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +// ignore: unused_import import 'dart:convert'; import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart index f40ff3fc0785..a93a48b22aa5 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart @@ -25,7 +25,6 @@ import 'package:openapi/src/model/map_test.dart'; import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; import 'package:openapi/src/model/model200_response.dart'; import 'package:openapi/src/model/model_client.dart'; -import 'package:openapi/src/model/model_enum_class.dart'; import 'package:openapi/src/model/model_file.dart'; import 'package:openapi/src/model/model_list.dart'; import 'package:openapi/src/model/model_return.dart'; @@ -35,14 +34,9 @@ import 'package:openapi/src/model/number_only.dart'; import 'package:openapi/src/model/object_with_deprecated_fields.dart'; import 'package:openapi/src/model/order.dart'; import 'package:openapi/src/model/outer_composite.dart'; -import 'package:openapi/src/model/outer_enum.dart'; -import 'package:openapi/src/model/outer_enum_default_value.dart'; -import 'package:openapi/src/model/outer_enum_integer.dart'; -import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; import 'package:openapi/src/model/outer_object_with_enum_property.dart'; import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/read_only_first.dart'; -import 'package:openapi/src/model/single_ref_type.dart'; import 'package:openapi/src/model/special_model_name.dart'; import 'package:openapi/src/model/tag.dart'; import 'package:openapi/src/model/user.dart'; @@ -63,7 +57,6 @@ final _regMap = RegExp(r'^Map$'); } final valueString = '$value'.toLowerCase(); return (valueString == 'true' || valueString == '1') as ReturnType; - break; case 'double': return (value is double ? value : double.parse('$value')) as ReturnType; case 'AdditionalPropertiesClass': diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart index e0927d4c1e5b..d45eeef83d99 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'additional_properties_class.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -52,8 +53,8 @@ class AdditionalPropertiesClass { @override int get hashCode => - (mapProperty == null ? 0 : mapProperty.hashCode) + - (mapOfMapProperty == null ? 0 : mapOfMapProperty.hashCode); + mapProperty.hashCode + + mapOfMapProperty.hashCode; factory AdditionalPropertiesClass.fromJson(Map json) => _$AdditionalPropertiesClassFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart index 3fbb53d7eb40..460aec9a9c80 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart @@ -7,6 +7,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'all_of_with_single_ref.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -53,7 +54,7 @@ class AllOfWithSingleRef { @override int get hashCode => - (username == null ? 0 : username.hashCode) + + username.hashCode + (singleRefType == null ? 0 : singleRefType.hashCode); factory AllOfWithSingleRef.fromJson(Map json) => _$AllOfWithSingleRefFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart index 5df63e81a0dc..26090b109208 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'animal.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -52,8 +53,8 @@ class Animal { @override int get hashCode => - (className == null ? 0 : className.hashCode) + - (color == null ? 0 : color.hashCode); + className.hashCode + + color.hashCode; factory Animal.fromJson(Map json) => _$AnimalFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart index ef2e44b2ef5d..ac22fd59d69a 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'api_response.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -67,9 +68,9 @@ class ApiResponse { @override int get hashCode => - (code == null ? 0 : code.hashCode) + - (type == null ? 0 : type.hashCode) + - (message == null ? 0 : message.hashCode); + code.hashCode + + type.hashCode + + message.hashCode; factory ApiResponse.fromJson(Map json) => _$ApiResponseFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart index aea6750c663e..dbae180528bd 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'array_of_array_of_number_only.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class ArrayOfArrayOfNumberOnly { @override int get hashCode => - (arrayArrayNumber == null ? 0 : arrayArrayNumber.hashCode); + arrayArrayNumber.hashCode; factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfArrayOfNumberOnlyFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart index ab21a96c7d55..a203361bcc3d 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'array_of_number_only.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class ArrayOfNumberOnly { @override int get hashCode => - (arrayNumber == null ? 0 : arrayNumber.hashCode); + arrayNumber.hashCode; factory ArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfNumberOnlyFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart index db1d5c917389..1f1720b2b667 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart @@ -7,6 +7,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'array_test.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -68,9 +69,9 @@ class ArrayTest { @override int get hashCode => - (arrayOfString == null ? 0 : arrayOfString.hashCode) + - (arrayArrayOfInteger == null ? 0 : arrayArrayOfInteger.hashCode) + - (arrayArrayOfModel == null ? 0 : arrayArrayOfModel.hashCode); + arrayOfString.hashCode + + arrayArrayOfInteger.hashCode + + arrayArrayOfModel.hashCode; factory ArrayTest.fromJson(Map json) => _$ArrayTestFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart index 5334bbdfbfcf..d40127b68a98 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'capitalization.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -113,12 +114,12 @@ class Capitalization { @override int get hashCode => - (smallCamel == null ? 0 : smallCamel.hashCode) + - (capitalCamel == null ? 0 : capitalCamel.hashCode) + - (smallSnake == null ? 0 : smallSnake.hashCode) + - (capitalSnake == null ? 0 : capitalSnake.hashCode) + - (sCAETHFlowPoints == null ? 0 : sCAETHFlowPoints.hashCode) + - (ATT_NAME == null ? 0 : ATT_NAME.hashCode); + smallCamel.hashCode + + capitalCamel.hashCode + + smallSnake.hashCode + + capitalSnake.hashCode + + sCAETHFlowPoints.hashCode + + ATT_NAME.hashCode; factory Capitalization.fromJson(Map json) => _$CapitalizationFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart index c626e2bc020c..7a19e1e19c95 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart @@ -8,6 +8,9 @@ import 'package:json_annotation/json_annotation.dart'; part 'cat.g.dart'; +// ignore_for_file: unused_import + + @JsonSerializable( checked: true, createToJson: true, @@ -69,9 +72,9 @@ class Cat { @override int get hashCode => - (className == null ? 0 : className.hashCode) + - (color == null ? 0 : color.hashCode) + - (declawed == null ? 0 : declawed.hashCode); + className.hashCode + + color.hashCode + + declawed.hashCode; factory Cat.fromJson(Map json) => _$CatFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart index 9789ca2444d2..55e2a10832f8 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'cat_all_of.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class CatAllOf { @override int get hashCode => - (declawed == null ? 0 : declawed.hashCode); + declawed.hashCode; factory CatAllOf.fromJson(Map json) => _$CatAllOfFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart index 6d8e010d43f1..6bc66f34418b 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'category.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -52,8 +53,8 @@ class Category { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (name == null ? 0 : name.hashCode); + id.hashCode + + name.hashCode; factory Category.fromJson(Map json) => _$CategoryFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart index ef70b04cca84..015d2d0297a0 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'class_model.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class ClassModel { @override int get hashCode => - (class_ == null ? 0 : class_.hashCode); + class_.hashCode; factory ClassModel.fromJson(Map json) => _$ClassModelFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart index 4ea102840a3a..9240f1160d03 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'deprecated_object.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class DeprecatedObject { @override int get hashCode => - (name == null ? 0 : name.hashCode); + name.hashCode; factory DeprecatedObject.fromJson(Map json) => _$DeprecatedObjectFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart index e668362703a6..163e9dfc1679 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart @@ -8,6 +8,9 @@ import 'package:json_annotation/json_annotation.dart'; part 'dog.g.dart'; +// ignore_for_file: unused_import + + @JsonSerializable( checked: true, createToJson: true, @@ -69,9 +72,9 @@ class Dog { @override int get hashCode => - (className == null ? 0 : className.hashCode) + - (color == null ? 0 : color.hashCode) + - (breed == null ? 0 : breed.hashCode); + className.hashCode + + color.hashCode + + breed.hashCode; factory Dog.fromJson(Map json) => _$DogFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart index 01dd0c9e75de..d5ceabdc3a1a 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'dog_all_of.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class DogAllOf { @override int get hashCode => - (breed == null ? 0 : breed.hashCode); + breed.hashCode; factory DogAllOf.fromJson(Map json) => _$DogAllOfFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart index 45403806b778..54c9839b9fe1 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'enum_arrays.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -52,8 +53,8 @@ class EnumArrays { @override int get hashCode => - (justSymbol == null ? 0 : justSymbol.hashCode) + - (arrayEnum == null ? 0 : arrayEnum.hashCode); + justSymbol.hashCode + + arrayEnum.hashCode; factory EnumArrays.fromJson(Map json) => _$EnumArraysFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart index 9a6ed0601bd8..17a67de347eb 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart @@ -10,6 +10,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'enum_test.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -146,14 +147,14 @@ class EnumTest { @override int get hashCode => - (enumString == null ? 0 : enumString.hashCode) + - (enumStringRequired == null ? 0 : enumStringRequired.hashCode) + - (enumInteger == null ? 0 : enumInteger.hashCode) + - (enumNumber == null ? 0 : enumNumber.hashCode) + + enumString.hashCode + + enumStringRequired.hashCode + + enumInteger.hashCode + + enumNumber.hashCode + (outerEnum == null ? 0 : outerEnum.hashCode) + - (outerEnumInteger == null ? 0 : outerEnumInteger.hashCode) + - (outerEnumDefaultValue == null ? 0 : outerEnumDefaultValue.hashCode) + - (outerEnumIntegerDefaultValue == null ? 0 : outerEnumIntegerDefaultValue.hashCode); + outerEnumInteger.hashCode + + outerEnumDefaultValue.hashCode + + outerEnumIntegerDefaultValue.hashCode; factory EnumTest.fromJson(Map json) => _$EnumTestFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart index 2206480edb1e..99d4dd3551c3 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart @@ -7,6 +7,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'file_schema_test_class.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -53,8 +54,8 @@ class FileSchemaTestClass { @override int get hashCode => - (file == null ? 0 : file.hashCode) + - (files == null ? 0 : files.hashCode); + file.hashCode + + files.hashCode; factory FileSchemaTestClass.fromJson(Map json) => _$FileSchemaTestClassFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart index 0e28f45c0313..b21bae484ea5 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'foo.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class Foo { @override int get hashCode => - (bar == null ? 0 : bar.hashCode); + bar.hashCode; factory Foo.fromJson(Map json) => _$FooFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart index ac40facc09da..a83f4721d820 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart @@ -7,6 +7,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'format_test.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -270,22 +271,22 @@ class FormatTest { @override int get hashCode => - (integer == null ? 0 : integer.hashCode) + - (int32 == null ? 0 : int32.hashCode) + - (int64 == null ? 0 : int64.hashCode) + - (number == null ? 0 : number.hashCode) + - (float == null ? 0 : float.hashCode) + - (double_ == null ? 0 : double_.hashCode) + - (decimal == null ? 0 : decimal.hashCode) + - (string == null ? 0 : string.hashCode) + - (byte == null ? 0 : byte.hashCode) + - (binary == null ? 0 : binary.hashCode) + - (date == null ? 0 : date.hashCode) + - (dateTime == null ? 0 : dateTime.hashCode) + - (uuid == null ? 0 : uuid.hashCode) + - (password == null ? 0 : password.hashCode) + - (patternWithDigits == null ? 0 : patternWithDigits.hashCode) + - (patternWithDigitsAndDelimiter == null ? 0 : patternWithDigitsAndDelimiter.hashCode); + integer.hashCode + + int32.hashCode + + int64.hashCode + + number.hashCode + + float.hashCode + + double_.hashCode + + decimal.hashCode + + string.hashCode + + byte.hashCode + + binary.hashCode + + date.hashCode + + dateTime.hashCode + + uuid.hashCode + + password.hashCode + + patternWithDigits.hashCode + + patternWithDigitsAndDelimiter.hashCode; factory FormatTest.fromJson(Map json) => _$FormatTestFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart index 030c78fc8011..25d25ddd06e9 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'has_only_read_only.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -52,8 +53,8 @@ class HasOnlyReadOnly { @override int get hashCode => - (bar == null ? 0 : bar.hashCode) + - (foo == null ? 0 : foo.hashCode); + bar.hashCode + + foo.hashCode; factory HasOnlyReadOnly.fromJson(Map json) => _$HasOnlyReadOnlyFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart index 62bbce180e70..43a07ec7d50c 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'health_check_result.g.dart'; + @JsonSerializable( checked: true, createToJson: true, diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart index 9ab6de8d139e..9f1eefd4c1a3 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart @@ -7,6 +7,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'inline_response_default.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -38,7 +39,7 @@ class InlineResponseDefault { @override int get hashCode => - (string == null ? 0 : string.hashCode); + string.hashCode; factory InlineResponseDefault.fromJson(Map json) => _$InlineResponseDefaultFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart index 016644d1a721..5c4c3edb70f9 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'map_test.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -82,10 +83,10 @@ class MapTest { @override int get hashCode => - (mapMapOfString == null ? 0 : mapMapOfString.hashCode) + - (mapOfEnumString == null ? 0 : mapOfEnumString.hashCode) + - (directMap == null ? 0 : directMap.hashCode) + - (indirectMap == null ? 0 : indirectMap.hashCode); + mapMapOfString.hashCode + + mapOfEnumString.hashCode + + directMap.hashCode + + indirectMap.hashCode; factory MapTest.fromJson(Map json) => _$MapTestFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart index 36c122aa88e0..649f7955806b 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -7,6 +7,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'mixed_properties_and_additional_properties_class.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -68,9 +69,9 @@ class MixedPropertiesAndAdditionalPropertiesClass { @override int get hashCode => - (uuid == null ? 0 : uuid.hashCode) + - (dateTime == null ? 0 : dateTime.hashCode) + - (map == null ? 0 : map.hashCode); + uuid.hashCode + + dateTime.hashCode + + map.hashCode; factory MixedPropertiesAndAdditionalPropertiesClass.fromJson(Map json) => _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart index 0aa6cce9db10..f4be2b420f64 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'model200_response.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -52,8 +53,8 @@ class Model200Response { @override int get hashCode => - (name == null ? 0 : name.hashCode) + - (class_ == null ? 0 : class_.hashCode); + name.hashCode + + class_.hashCode; factory Model200Response.fromJson(Map json) => _$Model200ResponseFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart index 6addfa7887a2..811e27768540 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'model_client.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class ModelClient { @override int get hashCode => - (client == null ? 0 : client.hashCode); + client.hashCode; factory ModelClient.fromJson(Map json) => _$ModelClientFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart index c7accdaf30ce..fa38556a5455 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'model_file.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -38,7 +39,7 @@ class ModelFile { @override int get hashCode => - (sourceURI == null ? 0 : sourceURI.hashCode); + sourceURI.hashCode; factory ModelFile.fromJson(Map json) => _$ModelFileFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart index e31c1e9ac7a6..f5ae9fdbd76c 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'model_list.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class ModelList { @override int get hashCode => - (n123list == null ? 0 : n123list.hashCode); + n123list.hashCode; factory ModelList.fromJson(Map json) => _$ModelListFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart index f5af2469123b..a2b022414fb8 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'model_return.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class ModelReturn { @override int get hashCode => - (return_ == null ? 0 : return_.hashCode); + return_.hashCode; factory ModelReturn.fromJson(Map json) => _$ModelReturnFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart index 03f126d02771..c361e4397eaf 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'name.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -82,10 +83,10 @@ class Name { @override int get hashCode => - (name == null ? 0 : name.hashCode) + - (snakeCase == null ? 0 : snakeCase.hashCode) + - (property == null ? 0 : property.hashCode) + - (n123number == null ? 0 : n123number.hashCode); + name.hashCode + + snakeCase.hashCode + + property.hashCode + + n123number.hashCode; factory Name.fromJson(Map json) => _$NameFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart index bdcf45be5793..3816bb33839e 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'nullable_class.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -210,10 +211,10 @@ class NullableClass { (datetimeProp == null ? 0 : datetimeProp.hashCode) + (arrayNullableProp == null ? 0 : arrayNullableProp.hashCode) + (arrayAndItemsNullableProp == null ? 0 : arrayAndItemsNullableProp.hashCode) + - (arrayItemsNullable == null ? 0 : arrayItemsNullable.hashCode) + + arrayItemsNullable.hashCode + (objectNullableProp == null ? 0 : objectNullableProp.hashCode) + (objectAndItemsNullableProp == null ? 0 : objectAndItemsNullableProp.hashCode) + - (objectItemsNullable == null ? 0 : objectItemsNullable.hashCode); + objectItemsNullable.hashCode; factory NullableClass.fromJson(Map json) => _$NullableClassFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart index 938355d9ce01..8efb55ea167b 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'number_only.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class NumberOnly { @override int get hashCode => - (justNumber == null ? 0 : justNumber.hashCode); + justNumber.hashCode; factory NumberOnly.fromJson(Map json) => _$NumberOnlyFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart index cddbf2c90755..522ee40e2e02 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart @@ -7,6 +7,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'object_with_deprecated_fields.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -83,10 +84,10 @@ class ObjectWithDeprecatedFields { @override int get hashCode => - (uuid == null ? 0 : uuid.hashCode) + - (id == null ? 0 : id.hashCode) + - (deprecatedRef == null ? 0 : deprecatedRef.hashCode) + - (bars == null ? 0 : bars.hashCode); + uuid.hashCode + + id.hashCode + + deprecatedRef.hashCode + + bars.hashCode; factory ObjectWithDeprecatedFields.fromJson(Map json) => _$ObjectWithDeprecatedFieldsFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart index 2b99a85ee497..087980a08e88 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'order.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -113,12 +114,12 @@ class Order { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (petId == null ? 0 : petId.hashCode) + - (quantity == null ? 0 : quantity.hashCode) + - (shipDate == null ? 0 : shipDate.hashCode) + - (status == null ? 0 : status.hashCode) + - (complete == null ? 0 : complete.hashCode); + id.hashCode + + petId.hashCode + + quantity.hashCode + + shipDate.hashCode + + status.hashCode + + complete.hashCode; factory Order.fromJson(Map json) => _$OrderFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart index 6b21dedcac50..f452e4b233d5 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'outer_composite.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -67,9 +68,9 @@ class OuterComposite { @override int get hashCode => - (myNumber == null ? 0 : myNumber.hashCode) + - (myString == null ? 0 : myString.hashCode) + - (myBoolean == null ? 0 : myBoolean.hashCode); + myNumber.hashCode + + myString.hashCode + + myBoolean.hashCode; factory OuterComposite.fromJson(Map json) => _$OuterCompositeFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart index cc5c9c566119..80331fe4df41 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart @@ -7,6 +7,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'outer_object_with_enum_property.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -38,7 +39,7 @@ class OuterObjectWithEnumProperty { @override int get hashCode => - (value == null ? 0 : value.hashCode); + value.hashCode; factory OuterObjectWithEnumProperty.fromJson(Map json) => _$OuterObjectWithEnumPropertyFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart index cbda1528033e..f9cf64883848 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart @@ -8,6 +8,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'pet.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -115,12 +116,12 @@ class Pet { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (category == null ? 0 : category.hashCode) + - (name == null ? 0 : name.hashCode) + - (photoUrls == null ? 0 : photoUrls.hashCode) + - (tags == null ? 0 : tags.hashCode) + - (status == null ? 0 : status.hashCode); + id.hashCode + + category.hashCode + + name.hashCode + + photoUrls.hashCode + + tags.hashCode + + status.hashCode; factory Pet.fromJson(Map json) => _$PetFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart index 2f5dae784c26..c79e7df9aeaf 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'read_only_first.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -52,8 +53,8 @@ class ReadOnlyFirst { @override int get hashCode => - (bar == null ? 0 : bar.hashCode) + - (baz == null ? 0 : baz.hashCode); + bar.hashCode + + baz.hashCode; factory ReadOnlyFirst.fromJson(Map json) => _$ReadOnlyFirstFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart index 1c97a0ab6cfa..84332bb1a13e 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'special_model_name.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -37,7 +38,7 @@ class SpecialModelName { @override int get hashCode => - (dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == null ? 0 : dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket.hashCode); + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket.hashCode; factory SpecialModelName.fromJson(Map json) => _$SpecialModelNameFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart index 94ab7be0dfe4..d0372c174224 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'tag.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -52,8 +53,8 @@ class Tag { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (name == null ? 0 : name.hashCode); + id.hashCode + + name.hashCode; factory Tag.fromJson(Map json) => _$TagFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart index 34970db20b0e..8bb2ae70ce5e 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart @@ -6,6 +6,7 @@ import 'package:json_annotation/json_annotation.dart'; part 'user.g.dart'; + @JsonSerializable( checked: true, createToJson: true, @@ -143,14 +144,14 @@ class User { @override int get hashCode => - (id == null ? 0 : id.hashCode) + - (username == null ? 0 : username.hashCode) + - (firstName == null ? 0 : firstName.hashCode) + - (lastName == null ? 0 : lastName.hashCode) + - (email == null ? 0 : email.hashCode) + - (password == null ? 0 : password.hashCode) + - (phone == null ? 0 : phone.hashCode) + - (userStatus == null ? 0 : userStatus.hashCode); + id.hashCode + + username.hashCode + + firstName.hashCode + + lastName.hashCode + + email.hashCode + + password.hashCode + + phone.hashCode + + userStatus.hashCode; factory User.fromJson(Map json) => _$UserFromJson(json);