From ddf6b5f96cc0f05e176540cced622b751b410546 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 16 Jul 2022 18:58:35 +0200 Subject: [PATCH 01/48] Feat: Initial working changes. --- .../languages/DartDioClientCodegen.java | 18 +++++++ .../dart/libraries/dio/pubspec.mustache | 9 ++++ .../freezed/api/constructor.mustache | 1 + .../freezed/api/deserialize.mustache | 28 ++++++++++ .../freezed/api/imports.mustache | 2 + .../freezed/api/query_param.mustache | 1 + .../freezed/api/serialize.mustache | 1 + .../serialization/freezed/build.yaml.mustache | 11 ++++ .../dio/serialization/freezed/class.mustache | 51 +++++++++++++++++++ .../dio/serialization/freezed/enum.mustache | 12 +++++ .../freezed/enum_inline.mustache | 8 +++ .../freezed/test_instance.mustache | 2 + .../freezed/variable_type.mustache | 14 +++++ 13 files changed, 158 insertions(+) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/constructor.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/query_param.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/serialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/build.yaml.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/test_instance.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index b8ec826fd946..92bf085b6c55 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -57,6 +57,8 @@ public class DartDioClientCodegen extends AbstractDartCodegen { 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_FREEZED = "freezed"; public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE; private static final String DIO_IMPORT = "package:dio/dio.dart"; @@ -90,6 +92,8 @@ public DartDioClientCodegen() { supportedLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); supportedLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable"); + supportedLibraries.put(SERIALIZATION_LIBRARY_FREEZED, "[BETA] freezed"); + final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); serializationLibrary.setEnum(supportedLibraries); serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); @@ -199,6 +203,10 @@ private void configureSerializationLibrary(String srcFolder) { additionalProperties.put("useJsonSerializable", "true"); configureSerializationLibraryJsonSerializable(srcFolder); break; + case SERIALIZATION_LIBRARY_FREEZED: + additionalProperties.put("useFreezed", "true"); + configureSerializationLibraryFreezed(srcFolder); + break; default: case SERIALIZATION_LIBRARY_BUILT_VALUE: additionalProperties.put("useBuiltValue", "true"); @@ -263,6 +271,16 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { imports.put("MultipartFile", DIO_IMPORT); } + private void configureSerializationLibraryFreezed(String srcFolder) { + supportingFiles.add(new SupportingFile("serialization/freezed/build.yaml.mustache", "" /* main project dir */, "build.yaml")); + + // 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: 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 4a919c21c04f..308fd6f1b579 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 @@ -20,6 +20,10 @@ dependencies: {{#useJsonSerializable}} json_annotation: '^4.4.0' {{/useJsonSerializable}} +{{#useFreezed}} + freezed_annotation: '^2.0.3' + json_annotation: '^4.4.0' +{{/useFreezed}} {{#useDateLibTimeMachine}} time_machine: ^0.9.16 {{/useDateLibTimeMachine}} @@ -33,4 +37,9 @@ dev_dependencies: build_runner: any json_serializable: '^6.1.5' {{/useJsonSerializable}} +{{#useFreezed}} + freezed: '^2.0.3' + json_serializable: '^6.1.4' + build_runner: any +{{/useFreezed}} test: ^1.16.0 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/constructor.mustache new file mode 100644 index 000000000000..a772c3148eaa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/constructor.mustache @@ -0,0 +1 @@ + const {{classname}}(this._dio); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache new file mode 100644 index 000000000000..1598d221dde2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache @@ -0,0 +1,28 @@ +{{#isResponseFile}} + _responseData = _response.data as {{{returnType}}}; +{{/isResponseFile}} +{{^isResponseFile}} + {{#returnSimpleType}} + {{#returnTypeIsPrimitive}} + _responseData = _response.data as {{{returnType}}}; + {{/returnTypeIsPrimitive}} + {{^returnTypeIsPrimitive}} + _responseData = {{{returnType}}}.fromJson(_response.data as Map); + {{/returnTypeIsPrimitive}} + {{/returnSimpleType}} + {{^returnSimpleType}} + {{#isArray}} + {{#uniqueItems}} + final _responseDataAsSet = _response.data as List; + _responseData = _responseDataAsSet.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toSet(); + {{/uniqueItems}} + {{^uniqueItems}} + final _responseDataAsList = _response.data as List; + _responseData = _responseDataAsList.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toList(); + {{/uniqueItems}} + {{/isArray}} + {{#isMap}} + _responseData = _response.data as Map; + {{/isMap}} + {{/returnSimpleType}} +{{/isResponseFile}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache new file mode 100644 index 000000000000..5283cabf6f92 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache @@ -0,0 +1,2 @@ +// ignore: unused_import +import 'dart:convert'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/query_param.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/query_param.mustache new file mode 100644 index 000000000000..a83489f9e91c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/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/freezed/api/serialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/serialize.mustache new file mode 100644 index 000000000000..93aed695e980 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/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/freezed/build.yaml.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/build.yaml.mustache new file mode 100644 index 000000000000..dee5edd67f90 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/build.yaml.mustache @@ -0,0 +1,11 @@ +targets: + $default: + builders: + freezed|freezed: + # This restricts freezed build runner to look + # files only inside models folder. + # If you prefer the build runner to scan the whole + # project for files then simply remove this build.yaml file + generate_for: + include: + - "lib/src/model/**.dart" \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache new file mode 100644 index 000000000000..a5625f9f0914 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache @@ -0,0 +1,51 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; + +part '{{classFilename}}.g.dart'; +part '{{classFilename}}.freezed.dart'; + +/// {{{description}}}{{^description}}{{classname}}{{/description}} +{{#hasVars}} + /// + /// Properties: + {{#allVars}} + /// * [{{{name}}}] {{#description}}- {{{.}}}{{/description}} + {{/allVars}} +{{/hasVars}} + +@freezed +class {{classname}} with _${{classname}} { +const {{classname}}._(); + +const factory {{classname}}({ +{{#vars}} + {{#description}} + /// {{{.}}} + {{/description}} + @JsonKey(name: r'{{baseName}}') {{>serialization/freezed/variable_type}} {{name}}, +{{/vars}} +}) = _{{classname}}; + +factory {{classname}}.fromJson(Map json) => _${{classname}}FromJson(json); +} + +{{! + Generate an enum for any variables that are declared as inline enums + isEnum is only true for inline variables that are enums. + If an enum is declared as a definition, isEnum is false and the enum is generated from the + enum.mustache template. +}} +{{#vars}} + {{#isEnum}} + {{^isContainer}} + + {{>serialization/freezed/enum_inline}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} + + {{>serialization/freezed/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/freezed/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache new file mode 100644 index 000000000000..bb1a4b8b47d4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache @@ -0,0 +1,12 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; + +{{#description}}/// {{{description}}}{{/description}} +enum {{classname}} { +{{#allowableValues}} + {{#enumVars}} + @JsonValue({{#isString}}r{{/isString}}{{{value}}}) + {{{name}}}, + {{/enumVars}} +{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache new file mode 100644 index 000000000000..369d6691d730 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache @@ -0,0 +1,8 @@ +{{#description}}/// {{{description}}}{{/description}} +enum {{{enumName}}} { +{{#allowableValues}} + {{#enumVars}} + @JsonValue(r{{{value}}}) {{{name}}}, + {{/enumVars}} +{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/test_instance.mustache new file mode 100644 index 000000000000..1b32f6768164 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/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/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache new file mode 100644 index 000000000000..b2a49c0ea6f6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache @@ -0,0 +1,14 @@ +{{! +Required Nullable Result +true true required Type? +true false required Type +false true Type? +false false Type? +}} + +{{#required}} + {{#required}}required {{/required}}{{#isContainer}}{{baseType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>serialization/built_value/variable_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}{{#isNullable}}?{{/isNullable}} +{{/required}} +{{^required}} + {{#isContainer}}{{baseType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>serialization/built_value/variable_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}? +{{/required}} From ab692789937a202c325b5fada7022ca99c64aa7d Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 16 Jul 2022 18:58:35 +0200 Subject: [PATCH 02/48] Feat: Initial working changes. --- .../languages/DartDioClientCodegen.java | 18 +++++++ .../dart/libraries/dio/pubspec.mustache | 9 ++++ .../freezed/api/constructor.mustache | 1 + .../freezed/api/deserialize.mustache | 28 ++++++++++ .../freezed/api/imports.mustache | 2 + .../freezed/api/query_param.mustache | 1 + .../freezed/api/serialize.mustache | 1 + .../serialization/freezed/build.yaml.mustache | 11 ++++ .../dio/serialization/freezed/class.mustache | 51 +++++++++++++++++++ .../dio/serialization/freezed/enum.mustache | 12 +++++ .../freezed/enum_inline.mustache | 8 +++ .../freezed/test_instance.mustache | 2 + .../freezed/variable_type.mustache | 14 +++++ 13 files changed, 158 insertions(+) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/constructor.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/query_param.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/serialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/build.yaml.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/test_instance.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 711a111be6a8..75c4b1101e51 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -60,6 +60,8 @@ public class DartDioClientCodegen extends AbstractDartCodegen { 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_FREEZED = "freezed"; public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE; private static final String DIO_IMPORT = "package:dio/dio.dart"; @@ -100,6 +102,8 @@ public DartDioClientCodegen() { supportedLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); supportedLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable"); + supportedLibraries.put(SERIALIZATION_LIBRARY_FREEZED, "[BETA] freezed"); + final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); serializationLibrary.setEnum(supportedLibraries); serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); @@ -212,6 +216,10 @@ private void configureSerializationLibrary(String srcFolder) { additionalProperties.put("useJsonSerializable", "true"); configureSerializationLibraryJsonSerializable(srcFolder); break; + case SERIALIZATION_LIBRARY_FREEZED: + additionalProperties.put("useFreezed", "true"); + configureSerializationLibraryFreezed(srcFolder); + break; default: case SERIALIZATION_LIBRARY_BUILT_VALUE: additionalProperties.put("useBuiltValue", "true"); @@ -276,6 +284,16 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { imports.put("MultipartFile", DIO_IMPORT); } + private void configureSerializationLibraryFreezed(String srcFolder) { + supportingFiles.add(new SupportingFile("serialization/freezed/build.yaml.mustache", "" /* main project dir */, "build.yaml")); + + // 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: 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 4faed4e3dc45..20c238fcc748 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 @@ -22,6 +22,10 @@ dependencies: {{#useJsonSerializable}} json_annotation: '^4.4.0' {{/useJsonSerializable}} +{{#useFreezed}} + freezed_annotation: '^2.0.3' + json_annotation: '^4.4.0' +{{/useFreezed}} {{#useDateLibTimeMachine}} time_machine: ^0.9.16 {{/useDateLibTimeMachine}} @@ -35,4 +39,9 @@ dev_dependencies: build_runner: any json_serializable: '^6.1.5' {{/useJsonSerializable}} +{{#useFreezed}} + freezed: '^2.0.3' + json_serializable: '^6.1.4' + build_runner: any +{{/useFreezed}} test: ^1.16.0 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/constructor.mustache new file mode 100644 index 000000000000..a772c3148eaa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/constructor.mustache @@ -0,0 +1 @@ + const {{classname}}(this._dio); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache new file mode 100644 index 000000000000..1598d221dde2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache @@ -0,0 +1,28 @@ +{{#isResponseFile}} + _responseData = _response.data as {{{returnType}}}; +{{/isResponseFile}} +{{^isResponseFile}} + {{#returnSimpleType}} + {{#returnTypeIsPrimitive}} + _responseData = _response.data as {{{returnType}}}; + {{/returnTypeIsPrimitive}} + {{^returnTypeIsPrimitive}} + _responseData = {{{returnType}}}.fromJson(_response.data as Map); + {{/returnTypeIsPrimitive}} + {{/returnSimpleType}} + {{^returnSimpleType}} + {{#isArray}} + {{#uniqueItems}} + final _responseDataAsSet = _response.data as List; + _responseData = _responseDataAsSet.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toSet(); + {{/uniqueItems}} + {{^uniqueItems}} + final _responseDataAsList = _response.data as List; + _responseData = _responseDataAsList.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toList(); + {{/uniqueItems}} + {{/isArray}} + {{#isMap}} + _responseData = _response.data as Map; + {{/isMap}} + {{/returnSimpleType}} +{{/isResponseFile}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache new file mode 100644 index 000000000000..5283cabf6f92 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache @@ -0,0 +1,2 @@ +// ignore: unused_import +import 'dart:convert'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/query_param.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/query_param.mustache new file mode 100644 index 000000000000..a83489f9e91c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/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/freezed/api/serialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/serialize.mustache new file mode 100644 index 000000000000..93aed695e980 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/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/freezed/build.yaml.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/build.yaml.mustache new file mode 100644 index 000000000000..dee5edd67f90 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/build.yaml.mustache @@ -0,0 +1,11 @@ +targets: + $default: + builders: + freezed|freezed: + # This restricts freezed build runner to look + # files only inside models folder. + # If you prefer the build runner to scan the whole + # project for files then simply remove this build.yaml file + generate_for: + include: + - "lib/src/model/**.dart" \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache new file mode 100644 index 000000000000..a5625f9f0914 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache @@ -0,0 +1,51 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; + +part '{{classFilename}}.g.dart'; +part '{{classFilename}}.freezed.dart'; + +/// {{{description}}}{{^description}}{{classname}}{{/description}} +{{#hasVars}} + /// + /// Properties: + {{#allVars}} + /// * [{{{name}}}] {{#description}}- {{{.}}}{{/description}} + {{/allVars}} +{{/hasVars}} + +@freezed +class {{classname}} with _${{classname}} { +const {{classname}}._(); + +const factory {{classname}}({ +{{#vars}} + {{#description}} + /// {{{.}}} + {{/description}} + @JsonKey(name: r'{{baseName}}') {{>serialization/freezed/variable_type}} {{name}}, +{{/vars}} +}) = _{{classname}}; + +factory {{classname}}.fromJson(Map json) => _${{classname}}FromJson(json); +} + +{{! + Generate an enum for any variables that are declared as inline enums + isEnum is only true for inline variables that are enums. + If an enum is declared as a definition, isEnum is false and the enum is generated from the + enum.mustache template. +}} +{{#vars}} + {{#isEnum}} + {{^isContainer}} + + {{>serialization/freezed/enum_inline}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} + + {{>serialization/freezed/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/freezed/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache new file mode 100644 index 000000000000..bb1a4b8b47d4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache @@ -0,0 +1,12 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; + +{{#description}}/// {{{description}}}{{/description}} +enum {{classname}} { +{{#allowableValues}} + {{#enumVars}} + @JsonValue({{#isString}}r{{/isString}}{{{value}}}) + {{{name}}}, + {{/enumVars}} +{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache new file mode 100644 index 000000000000..369d6691d730 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache @@ -0,0 +1,8 @@ +{{#description}}/// {{{description}}}{{/description}} +enum {{{enumName}}} { +{{#allowableValues}} + {{#enumVars}} + @JsonValue(r{{{value}}}) {{{name}}}, + {{/enumVars}} +{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/test_instance.mustache new file mode 100644 index 000000000000..1b32f6768164 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/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/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache new file mode 100644 index 000000000000..b2a49c0ea6f6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache @@ -0,0 +1,14 @@ +{{! +Required Nullable Result +true true required Type? +true false required Type +false true Type? +false false Type? +}} + +{{#required}} + {{#required}}required {{/required}}{{#isContainer}}{{baseType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>serialization/built_value/variable_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}{{#isNullable}}?{{/isNullable}} +{{/required}} +{{^required}} + {{#isContainer}}{{baseType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>serialization/built_value/variable_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}? +{{/required}} From 63c39d6bac67940d0482d8bf6ab0ff8ea32b4c6e Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Thu, 22 Sep 2022 17:06:16 +0200 Subject: [PATCH 03/48] fix: small typo. --- .../openapitools/codegen/languages/DartDioClientCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 75c4b1101e51..692e0983a3d7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -518,7 +518,7 @@ private void adaptToDartInheritance(Map objs) { // ancestorOnlyProperties are properties defined by all ancestors // NOTE: oneOf,anyOf are NOT considered ancestors - // since a child in dart must implment ALL OF the parent (using implements) + // since a child in dart must implEment ALL OF the parent (using implements) Map ancestorOnlyProperties = new HashMap<>(); // combines both selfOnlyProperties and ancestorOnlyProperties From 85f3db5ad28adc59acc8acb377e1d2a63e123770 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Thu, 22 Sep 2022 21:36:29 +0200 Subject: [PATCH 04/48] feat: initial setup for oneOf. --- .../languages/DartDioClientCodegen.java | 3 ++- .../dio/serialization/freezed/class.mustache | 26 ++++++++----------- .../freezed/class_factory.mustache | 21 +++++++++++++++ .../freezed/class_from_json.mustache | 19 ++++++++++++++ .../freezed/class_to_json.mustache | 11 ++++++++ .../freezed/models.dart.mustache | 9 +++++++ 6 files changed, 73 insertions(+), 16 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 692e0983a3d7..e8f6fb1c5aa7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -286,6 +286,7 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { private void configureSerializationLibraryFreezed(String srcFolder) { supportingFiles.add(new SupportingFile("serialization/freezed/build.yaml.mustache", "" /* main project dir */, "build.yaml")); + supportingFiles.add(new SupportingFile("serialization/freezed/models.dart.mustache", modelPackage, "models.dart")); // most of these are defined in AbstractDartCodegen, we are overriding // just the binary / file handling @@ -518,7 +519,7 @@ private void adaptToDartInheritance(Map objs) { // ancestorOnlyProperties are properties defined by all ancestors // NOTE: oneOf,anyOf are NOT considered ancestors - // since a child in dart must implEment ALL OF the parent (using implements) + // since a child in dart must implement ALL OF the parent (using implements) Map ancestorOnlyProperties = new HashMap<>(); // combines both selfOnlyProperties and ancestorOnlyProperties diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache index a5625f9f0914..f34a58ed2366 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache @@ -1,8 +1,4 @@ -//ignore_for_file: invalid_annotation_target -import 'package:freezed_annotation/freezed_annotation.dart'; - -part '{{classFilename}}.g.dart'; -part '{{classFilename}}.freezed.dart'; +part of 'models.dart'; /// {{{description}}}{{^description}}{{classname}}{{/description}} {{#hasVars}} @@ -17,16 +13,16 @@ part '{{classFilename}}.freezed.dart'; class {{classname}} with _${{classname}} { const {{classname}}._(); -const factory {{classname}}({ -{{#vars}} - {{#description}} - /// {{{.}}} - {{/description}} - @JsonKey(name: r'{{baseName}}') {{>serialization/freezed/variable_type}} {{name}}, -{{/vars}} -}) = _{{classname}}; - -factory {{classname}}.fromJson(Map json) => _${{classname}}FromJson(json); + +{{>serialization/freezed/class_factory}} + +{{>serialization/freezed/class_from_json}} + +{{! toJson is only required for oneOf types}} +{{#hasDiscriminatorWithNonEmptyMapping}} +{{>serialization/freezed/class_to_json}} +{{/hasDiscriminatorWithNonEmptyMapping}} + } {{! diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache new file mode 100644 index 000000000000..362d8661f44a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache @@ -0,0 +1,21 @@ +{{^hasDiscriminatorWithNonEmptyMapping}} +const factory {{classname}}({ +{{#vars}} + {{#description}} + /// {{{.}}} + {{/description}} + @JsonKey(name: r'{{baseName}}') {{>serialization/freezed/variable_type}} {{name}}, +{{/vars}} +}) = _{{classname}}; +{{/hasDiscriminatorWithNonEmptyMapping}} + +{{#hasDiscriminatorWithNonEmptyMapping}} + {{#discriminator}} + {{#mappedModels}} + const factory {{classname}}.{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}({ + required {{modelName}} {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} + }) = {{classname}}{{mappingName}}; + {{/mappedModels}} + const factory {{classname}}.unknown() = {{classname}}Unknown; + {{/discriminator}} +{{/hasDiscriminatorWithNonEmptyMapping}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache new file mode 100644 index 000000000000..7f55f3dbbf06 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache @@ -0,0 +1,19 @@ +{{^hasDiscriminatorWithNonEmptyMapping}} +factory {{classname}}.fromJson(Map json) => _${{classname}}FromJson(json); +{{/hasDiscriminatorWithNonEmptyMapping}} + +{{#hasDiscriminatorWithNonEmptyMapping}} + factory {{classname}}.fromJson(Map json) { + {{#discriminator}} + switch(json['{{propertyBaseName}}']){ + {{#mappedModels}} + case '{{mappingName}}': + return {{classname}}.{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}( + {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} : {{modelName}}.fromJson(json), + ); + {{/mappedModels}} + } + {{/discriminator}} + return {{classname}}.unknown(); + } +{{/hasDiscriminatorWithNonEmptyMapping}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache new file mode 100644 index 000000000000..8014a1ec68cd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache @@ -0,0 +1,11 @@ +{{#discriminator}} + Map toJson() { + return when( + {{#mappedModels}} + {{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}: ({{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}) => {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}.toJson(), + {{/mappedModels}} + {{! adds an unknown case to handle one Of}} + unknown: () => {}, + ); + } +{{/discriminator}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache new file mode 100644 index 000000000000..cee1c5fe645d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache @@ -0,0 +1,9 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'models.freezed.dart'; +part 'models.g.dart'; + +{{! Add part deifinition for all models}} +{{#models}}{{#model}}part '{{classFilename}}.dart';{{/model}}{{/models}} + From e965c65a7499c7431795e031664fb60ecbd6a5a3 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Fri, 23 Sep 2022 10:16:41 +0200 Subject: [PATCH 05/48] feat: seemingly working oneOf model generation. --- .../codegen/languages/DartDioClientCodegen.java | 2 +- .../src/main/resources/dart/libraries/dio/api.mustache | 5 +++++ .../src/main/resources/dart/libraries/dio/lib.mustache | 9 ++++++++- .../src/main/resources/dart/libraries/dio/model.mustache | 7 +++++-- .../main/resources/dart/libraries/dio/pubspec.mustache | 3 +++ .../dio/serialization/freezed/api/imports.mustache | 4 ++-- .../libraries/dio/serialization/freezed/enum.mustache | 3 +-- 7 files changed, 25 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index e8f6fb1c5aa7..dccfc27ac35b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -286,7 +286,7 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { private void configureSerializationLibraryFreezed(String srcFolder) { supportingFiles.add(new SupportingFile("serialization/freezed/build.yaml.mustache", "" /* main project dir */, "build.yaml")); - supportingFiles.add(new SupportingFile("serialization/freezed/models.dart.mustache", modelPackage, "models.dart")); + supportingFiles.add(new SupportingFile("serialization/freezed/models.dart.mustache", srcFolder + File.separator + modelPackage, "models.dart")); // most of these are defined in AbstractDartCodegen, we are overriding // just the binary / file handling 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 892cbafd4694..5c49afdf8338 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 @@ -5,8 +5,13 @@ import 'dart:async'; import 'package:dio/dio.dart'; {{#operations}} + +{{! No need to Import all the required model files as freezed uses the part of directive for it models}} +{{^useFreezed}} {{#imports}}import '{{.}}'; {{/imports}} +{{/useFreezed}} + class {{classname}} { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache index 1ac711810617..fd578d4c0b33 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache @@ -8,5 +8,12 @@ export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; {{#apiInfo}}{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; {{/apis}}{{/apiInfo}} + +{{! For freezed all the models are simply part of models.dart file utilizing the part directive}} +{{#useFreezed}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/models.dart';{{/useFreezed}} + +{{! No need to export all the models files as freezed uses the part of directive for it models}} +{{^useFreezed}} {{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; -{{/model}}{{/models}} \ No newline at end of file +{{/model}}{{/models}} +{{/useFreezed}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache index 1917decaf6c6..c622968a80d5 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache @@ -1,10 +1,13 @@ {{>header}} -// ignore_for_file: unused_element +// ignore_for_file: unused_element, invalid_annotation_target + {{#models}} {{#model}} + {{^useFreezed}} {{#imports}} import '{{.}}'; {{/imports}} + {{/useFreezed}} {{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}} {{/model}} -{{/models}} \ No newline at end of file +{{/models}} 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 20c238fcc748..396250c4b733 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache @@ -10,6 +10,9 @@ environment: {{#useJsonSerializable}} sdk: '>=2.14.0 <3.0.0' {{/useJsonSerializable}} +{{#useFreezed}} + sdk: '>=2.14.0 <3.0.0' +{{/useFreezed}} dependencies: dio: '>=4.0.1 <5.0.0' diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache index 5283cabf6f92..ac933ec55504 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache @@ -1,2 +1,2 @@ -// ignore: unused_import -import 'dart:convert'; \ No newline at end of file +import 'dart:convert'; +import '../model/models.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache index bb1a4b8b47d4..4baa498ba4ee 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache @@ -1,5 +1,4 @@ -//ignore_for_file: invalid_annotation_target -import 'package:freezed_annotation/freezed_annotation.dart'; +part of 'models.dart'; {{#description}}/// {{{description}}}{{/description}} enum {{classname}} { From 35f0b973826b317005661269ccff98d0580d4716 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Fri, 23 Sep 2022 10:37:17 +0200 Subject: [PATCH 06/48] feat: seemingly working oneOf model generation. --- .../codegen/languages/DartDioClientCodegen.java | 2 +- .../src/main/resources/dart/libraries/dio/api.mustache | 5 ----- .../src/main/resources/dart/libraries/dio/lib.mustache | 9 +-------- .../src/main/resources/dart/libraries/dio/model.mustache | 7 ++----- .../main/resources/dart/libraries/dio/pubspec.mustache | 3 --- .../dio/serialization/freezed/api/imports.mustache | 4 ++-- .../libraries/dio/serialization/freezed/enum.mustache | 3 ++- 7 files changed, 8 insertions(+), 25 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index dccfc27ac35b..e8f6fb1c5aa7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -286,7 +286,7 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { private void configureSerializationLibraryFreezed(String srcFolder) { supportingFiles.add(new SupportingFile("serialization/freezed/build.yaml.mustache", "" /* main project dir */, "build.yaml")); - supportingFiles.add(new SupportingFile("serialization/freezed/models.dart.mustache", srcFolder + File.separator + modelPackage, "models.dart")); + supportingFiles.add(new SupportingFile("serialization/freezed/models.dart.mustache", modelPackage, "models.dart")); // most of these are defined in AbstractDartCodegen, we are overriding // just the binary / file handling 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 5c49afdf8338..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 @@ -5,13 +5,8 @@ import 'dart:async'; import 'package:dio/dio.dart'; {{#operations}} - -{{! No need to Import all the required model files as freezed uses the part of directive for it models}} -{{^useFreezed}} {{#imports}}import '{{.}}'; {{/imports}} -{{/useFreezed}} - class {{classname}} { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache index fd578d4c0b33..1ac711810617 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache @@ -8,12 +8,5 @@ export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; {{#apiInfo}}{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; {{/apis}}{{/apiInfo}} - -{{! For freezed all the models are simply part of models.dart file utilizing the part directive}} -{{#useFreezed}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/models.dart';{{/useFreezed}} - -{{! No need to export all the models files as freezed uses the part of directive for it models}} -{{^useFreezed}} {{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; -{{/model}}{{/models}} -{{/useFreezed}} \ No newline at end of file +{{/model}}{{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache index c622968a80d5..1917decaf6c6 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache @@ -1,13 +1,10 @@ {{>header}} -// ignore_for_file: unused_element, invalid_annotation_target - +// ignore_for_file: unused_element {{#models}} {{#model}} - {{^useFreezed}} {{#imports}} import '{{.}}'; {{/imports}} - {{/useFreezed}} {{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}} {{/model}} -{{/models}} +{{/models}} \ No newline at end of file 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 396250c4b733..20c238fcc748 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache @@ -10,9 +10,6 @@ environment: {{#useJsonSerializable}} sdk: '>=2.14.0 <3.0.0' {{/useJsonSerializable}} -{{#useFreezed}} - sdk: '>=2.14.0 <3.0.0' -{{/useFreezed}} dependencies: dio: '>=4.0.1 <5.0.0' diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache index ac933ec55504..5283cabf6f92 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache @@ -1,2 +1,2 @@ -import 'dart:convert'; -import '../model/models.dart'; \ No newline at end of file +// ignore: unused_import +import 'dart:convert'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache index 4baa498ba4ee..bb1a4b8b47d4 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache @@ -1,4 +1,5 @@ -part of 'models.dart'; +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; {{#description}}/// {{{description}}}{{/description}} enum {{classname}} { From 899af8245e6fb62cb7be11934933c682b84fb708 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Fri, 23 Sep 2022 12:12:05 +0200 Subject: [PATCH 07/48] fix: case factory case and add missing sdk dependencies. --- .../src/main/resources/dart/libraries/dio/pubspec.mustache | 3 +++ .../libraries/dio/serialization/freezed/class_factory.mustache | 2 +- 2 files changed, 4 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 20c238fcc748..396250c4b733 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache @@ -10,6 +10,9 @@ environment: {{#useJsonSerializable}} sdk: '>=2.14.0 <3.0.0' {{/useJsonSerializable}} +{{#useFreezed}} + sdk: '>=2.14.0 <3.0.0' +{{/useFreezed}} dependencies: dio: '>=4.0.1 <5.0.0' diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache index 362d8661f44a..951bde2003cb 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache @@ -12,7 +12,7 @@ const factory {{classname}}({ {{#hasDiscriminatorWithNonEmptyMapping}} {{#discriminator}} {{#mappedModels}} - const factory {{classname}}.{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}({ + const factory {{classname}}.{{#lambda.camelcase}}{{mappingName}}{{/lambda.camelcase}}({ required {{modelName}} {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} }) = {{classname}}{{mappingName}}; {{/mappedModels}} From 15c756cde72664c081d2d29ba5de97168f07a3cd Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Fri, 23 Sep 2022 16:24:38 +0200 Subject: [PATCH 08/48] fix: merge issues + use camelCase for unions. --- .../codegen/languages/DartDioClientCodegen.java | 2 +- .../main/resources/dart/libraries/dio/api.mustache | 7 +++++-- .../main/resources/dart/libraries/dio/lib.mustache | 11 +++++++++-- .../main/resources/dart/libraries/dio/model.mustache | 6 ++++-- .../dio/serialization/freezed/api/imports.mustache | 4 ++-- .../serialization/freezed/class_from_json.mustache | 2 +- .../dio/serialization/freezed/class_to_json.mustache | 2 +- .../libraries/dio/serialization/freezed/enum.mustache | 3 +-- 8 files changed, 24 insertions(+), 13 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index e8f6fb1c5aa7..dccfc27ac35b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -286,7 +286,7 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { private void configureSerializationLibraryFreezed(String srcFolder) { supportingFiles.add(new SupportingFile("serialization/freezed/build.yaml.mustache", "" /* main project dir */, "build.yaml")); - supportingFiles.add(new SupportingFile("serialization/freezed/models.dart.mustache", modelPackage, "models.dart")); + supportingFiles.add(new SupportingFile("serialization/freezed/models.dart.mustache", srcFolder + File.separator + modelPackage, "models.dart")); // most of these are defined in AbstractDartCodegen, we are overriding // just the binary / file handling 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 892cbafd4694..ae8c4274dcbb 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 @@ -5,8 +5,11 @@ import 'dart:async'; import 'package:dio/dio.dart'; {{#operations}} -{{#imports}}import '{{.}}'; -{{/imports}} +{{! No need to Import all the required model files as freezed uses the part of directive for it models}} +{{^useFreezed}} + {{#imports}}import '{{.}}'; + {{/imports}} +{{/useFreezed}} class {{classname}} { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache index 1ac711810617..2b00f1536735 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache @@ -8,5 +8,12 @@ export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; {{#apiInfo}}{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; {{/apis}}{{/apiInfo}} -{{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; -{{/model}}{{/models}} \ No newline at end of file + +{{! For freezed all the models are simply part of models.dart file utilizing the part directive}} +{{#useFreezed}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/models.dart';{{/useFreezed}} + +{{! No need to export all the models files as freezed uses the part of directive for it models}} +{{^useFreezed}} + {{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; + {{/model}}{{/models}} +{{/useFreezed}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache index 1917decaf6c6..6473d74708c2 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache @@ -1,10 +1,12 @@ {{>header}} -// ignore_for_file: unused_element +// ignore_for_file: unused_element, invalid_annotation_target {{#models}} {{#model}} + {{^useFreezed}} {{#imports}} -import '{{.}}'; + import '{{.}}'; {{/imports}} + {{/useFreezed}} {{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}} {{/model}} {{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache index 5283cabf6f92..ac933ec55504 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/imports.mustache @@ -1,2 +1,2 @@ -// ignore: unused_import -import 'dart:convert'; \ No newline at end of file +import 'dart:convert'; +import '../model/models.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache index 7f55f3dbbf06..7ad8c2d742bb 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache @@ -8,7 +8,7 @@ factory {{classname}}.fromJson(Map json) => _${{classname}}From switch(json['{{propertyBaseName}}']){ {{#mappedModels}} case '{{mappingName}}': - return {{classname}}.{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}( + return {{classname}}.{{#lambda.camelcase}}{{mappingName}}{{/lambda.camelcase}}( {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} : {{modelName}}.fromJson(json), ); {{/mappedModels}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache index 8014a1ec68cd..d79258e7d712 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache @@ -2,7 +2,7 @@ Map toJson() { return when( {{#mappedModels}} - {{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}: ({{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}) => {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}.toJson(), + {{#lambda.camelcase}}{{mappingName}}{{/lambda.camelcase}}: ({{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}) => {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}.toJson(), {{/mappedModels}} {{! adds an unknown case to handle one Of}} unknown: () => {}, diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache index bb1a4b8b47d4..4baa498ba4ee 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache @@ -1,5 +1,4 @@ -//ignore_for_file: invalid_annotation_target -import 'package:freezed_annotation/freezed_annotation.dart'; +part of 'models.dart'; {{#description}}/// {{{description}}}{{/description}} enum {{classname}} { From 3cfbf98f6de600d42684b38debf55b47c3435aec Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 24 Sep 2022 17:02:06 +0200 Subject: [PATCH 09/48] fix: correct use of lambda for cases of classNames --- .../dio/serialization/freezed/class_factory.mustache | 4 ++-- .../dio/serialization/freezed/class_from_json.mustache | 2 +- .../dio/serialization/freezed/class_to_json.mustache | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache index 951bde2003cb..5b2eb14258dc 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache @@ -12,9 +12,9 @@ const factory {{classname}}({ {{#hasDiscriminatorWithNonEmptyMapping}} {{#discriminator}} {{#mappedModels}} - const factory {{classname}}.{{#lambda.camelcase}}{{mappingName}}{{/lambda.camelcase}}({ + const factory {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}({ required {{modelName}} {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} - }) = {{classname}}{{mappingName}}; + }) = {{classname}}{{#lambda.titlecase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.titlecase}}; {{/mappedModels}} const factory {{classname}}.unknown() = {{classname}}Unknown; {{/discriminator}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache index 7ad8c2d742bb..18d99cf6a267 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache @@ -8,7 +8,7 @@ factory {{classname}}.fromJson(Map json) => _${{classname}}From switch(json['{{propertyBaseName}}']){ {{#mappedModels}} case '{{mappingName}}': - return {{classname}}.{{#lambda.camelcase}}{{mappingName}}{{/lambda.camelcase}}( + return {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}( {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} : {{modelName}}.fromJson(json), ); {{/mappedModels}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache index d79258e7d712..b5638c84edd6 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache @@ -2,7 +2,7 @@ Map toJson() { return when( {{#mappedModels}} - {{#lambda.camelcase}}{{mappingName}}{{/lambda.camelcase}}: ({{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}) => {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}.toJson(), + {{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}: ({{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}) => {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}.toJson(), {{/mappedModels}} {{! adds an unknown case to handle one Of}} unknown: () => {}, From 478ac255d744fd060735cd8792d9cdf5a5a991f9 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 24 Sep 2022 19:48:23 +0200 Subject: [PATCH 10/48] fix: correct reference to variable_type.mustache --- .../dio/serialization/freezed/variable_type.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache index b2a49c0ea6f6..2ba560a129a6 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache @@ -7,8 +7,8 @@ false false Type? }} {{#required}} - {{#required}}required {{/required}}{{#isContainer}}{{baseType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>serialization/built_value/variable_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}{{#isNullable}}?{{/isNullable}} + {{#required}}required {{/required}}{{#isContainer}}{{baseType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>serialization/freezed/variable_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}{{#isNullable}}?{{/isNullable}} {{/required}} {{^required}} - {{#isContainer}}{{baseType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>serialization/built_value/variable_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}? + {{#isContainer}}{{baseType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>serialization/freezed/variable_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}? {{/required}} From d943167daf29046b4eccc0e8bcf485aaaedf4974 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Mon, 17 Oct 2022 21:39:06 +0200 Subject: [PATCH 11/48] fix: non simpleType but primitive response types. --- .../freezed/api/deserialize.mustache | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache index 1598d221dde2..5595c71cf42f 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache @@ -11,18 +11,23 @@ {{/returnTypeIsPrimitive}} {{/returnSimpleType}} {{^returnSimpleType}} - {{#isArray}} - {{#uniqueItems}} - final _responseDataAsSet = _response.data as List; - _responseData = _responseDataAsSet.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toSet(); - {{/uniqueItems}} - {{^uniqueItems}} - final _responseDataAsList = _response.data as List; - _responseData = _responseDataAsList.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toList(); - {{/uniqueItems}} - {{/isArray}} - {{#isMap}} - _responseData = _response.data as Map; - {{/isMap}} + {{#returnTypeIsPrimitive}} + _responseData = _response.data as {{{returnType}}}; + {{/returnTypeIsPrimitive}} + {{^returnTypeIsPrimitive}} + {{#isArray}} + {{#uniqueItems}} + final _responseDataAsSet = _response.data as List; + _responseData = _responseDataAsSet.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toSet(); + {{/uniqueItems}} + {{^uniqueItems}} + final _responseDataAsList = _response.data as List; + _responseData = _responseDataAsList.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toList(); + {{/uniqueItems}} + {{/isArray}} + {{#isMap}} + _responseData = _response.data as Map; + {{/isMap}} + {{/returnTypeIsPrimitive}} {{/returnSimpleType}} {{/isResponseFile}} \ No newline at end of file From c1bfa0d42397edaa96f41c188f79971ba03fe9d1 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Mon, 17 Oct 2022 21:39:41 +0200 Subject: [PATCH 12/48] fix: add correct files for analysis ignore --- .../resources/dart/libraries/dio/analysis_options.mustache | 4 ++++ 1 file changed, 4 insertions(+) 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 435ebda4c7e3..94385588f0c0 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 @@ -8,3 +8,7 @@ analyzer: exclude: - test/*.dart{{#useJsonSerializable}} - lib/src/model/*.g.dart{{/useJsonSerializable}} + {{#useFreezed}} + - lib/src/model/*.g.dart + - lib/src/model/*.freezed.dart + {{/useFreezed}} \ No newline at end of file From ca327df95d9d2bcc264709d88e724f7c5397a29d Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 25 Feb 2023 12:19:56 +0100 Subject: [PATCH 13/48] Working OneOf, AnyOf, set up including primitives, arrays, maps, polymorphism. --- .../languages/DartDioClientCodegen.java | 93 ++++++++++++++++++- .../dio/serialization/freezed/class.mustache | 10 +- .../freezed/class_factory.mustache | 74 +++++++++++---- .../freezed/class_factory_general.mustache | 8 ++ .../freezed/class_from_json.mustache | 86 ++++++++++++++--- .../class_primitive_union_extensions.mustache | 12 +++ .../freezed/class_to_json.mustache | 43 ++++++--- .../freezed/models.dart.mustache | 11 +++ .../freezed/primitive_union_types.mustache | 60 ++++++++++++ 9 files changed, 349 insertions(+), 48 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory_general.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_primitive_union_extensions.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/primitive_union_types.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 2f4653317643..4a29d7c73d8d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -22,8 +22,10 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Discriminator; import io.swagger.v3.oas.models.media.Schema; +import org.apache.commons.lang3.CharSetUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.graalvm.util.CollectionsUtil; import org.openapitools.codegen.*; import org.openapitools.codegen.CodegenDiscriminator.MappedModel; import org.openapitools.codegen.api.TemplatePathLocator; @@ -104,6 +106,7 @@ public DartDioClientCodegen() { supportedLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); supportedLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable"); + supportedLibraries.put(SERIALIZATION_LIBRARY_FREEZED, "[BETA] freezed"); final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); serializationLibrary.setEnum(supportedLibraries); serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); @@ -216,6 +219,10 @@ private void configureSerializationLibrary(String srcFolder) { additionalProperties.put("useJsonSerializable", "true"); configureSerializationLibraryJsonSerializable(srcFolder); break; + case SERIALIZATION_LIBRARY_FREEZED: + additionalProperties.put("useFreezed", "true"); + configureSerializationLibraryFreezed(srcFolder); + break; default: case SERIALIZATION_LIBRARY_BUILT_VALUE: additionalProperties.put("useBuiltValue", "true"); @@ -283,12 +290,96 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { private void configureSerializationLibraryFreezed(String srcFolder) { supportingFiles.add(new SupportingFile("serialization/freezed/build.yaml.mustache", "" /* main project dir */, "build.yaml")); supportingFiles.add(new SupportingFile("serialization/freezed/models.dart.mustache", srcFolder + File.separator + modelPackage, "models.dart")); + supportingFiles.add(new SupportingFile("serialization/freezed/primitive_union_types.mustache", srcFolder + File.separator + modelPackage, "primitive_union_types.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); + + // A lambda which transforms Types for naming factory constructors inFreezed unions. + additionalProperties.put("PrimitiveInUnion", (Mustache.Lambda) (fragment, writer) -> { + String content = fragment.execute(); + content = content.trim().replaceAll("\n", ""); + Set collectionTypes = Sets.newHashSet("List","Map","Set"); + Set nonCollectionTypes = defaultIncludes.stream().filter(e -> !collectionTypes.contains(e)).collect(Collectors.toSet()); + if(nonCollectionTypes.contains(content)){ + writer.write(content + "InUnion"); + return; + } + writer.write(content); + }); + // A lambda to generate correct form of FromJson methods. + additionalProperties.put("PrimitiveFromJson", (Mustache.Lambda) (fragment, writer) -> { + String content = fragment.execute(); + content = content.trim().replaceAll("\n", ""); + // Remove Generics Declarations as this is not required for factoryNames in freezed + String tmp_1 = StringUtils.substringBefore(content, "<"); + if(defaultIncludes.contains(tmp_1)) { + if (tmp_1.equals("Set") || tmp_1.equals("Map")) { + content = "<"+StringUtils.substringAfter(content, "<")+"{}"; + }else if(tmp_1.equals("List")){ + content = "<"+StringUtils.substringAfter(content, "<")+"[]"; + }else{ + content = tmp_1+"InUnion"; + } + } + writer.write(content); + }); + // A lambda which transforms Types for naming factory constructors inFreezed unions. + additionalProperties.put("PrimitiveCollections", (Mustache.Lambda) (fragment, writer) -> { + String content = fragment.execute(); + content = content.trim().replaceAll("\n", ""); + Set collectionTypes = Sets.newHashSet("List","Map","Set"); + Set nonCollectionTypes = defaultIncludes.stream().filter(e -> !collectionTypes.contains(e)).collect(Collectors.toSet()); + if(nonCollectionTypes.contains(content)){ + writer.write(""); + return; + } + writer.write(content); + }); + // A lambda to generate correct FromJson methods for collection types. + additionalProperties.put("PrimitiveExtension", (Mustache.Lambda) (fragment, writer) -> { + String content = fragment.execute(); + content = content.trim().replaceAll("\n", ""); + // Remove Generics Declarations as this is not required for factoryNames in freezed + String tmp_1 = StringUtils.substringBefore(content, "<"); + if (tmp_1.equals("Set")) { + content = String.join("\n", + "extension on " + content + " {", + content + "fromJson(Map json) {", + "return {};", + "}", + "Map toJson() {", + "return {};", + "}", + "}"); + }else if(tmp_1.equals("List")){ + content = String.join("\n", + "extension on " + content + " {", + content + "fromJson(Map json) {", + "return [];", + "}", + "Map toJson() {", + "return {};", + "}", + "}"); + }else if(tmp_1.equals("Map")){ + content = String.join("\n", + "extension on " + content + " {", + content + "fromJson(Map json) {", + "return {};", + "}", + "Map toJson() {", + "return {};", + "}", + "}"); + }else{ + content = ""; + } + writer.write(content); + }); } private void configureDateLibrary(String srcFolder) { @@ -592,7 +683,7 @@ protected CodegenDiscriminator createDiscriminator(String schemaName, Schema sch @Override public Map postProcessAllModels(Map objs) { objs = super.postProcessAllModels(objs); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library) || SERIALIZATION_LIBRARY_FREEZED.equals(library)) { adaptToDartInheritance(objs); syncRootTypesWithInnerVars(objs); } diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache index f34a58ed2366..307dfb026abd 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache @@ -18,13 +18,16 @@ const {{classname}}._(); {{>serialization/freezed/class_from_json}} -{{! toJson is only required for oneOf types}} -{{#hasDiscriminatorWithNonEmptyMapping}} {{>serialization/freezed/class_to_json}} -{{/hasDiscriminatorWithNonEmptyMapping}} + } +{{! +extension for collection primitives in union +}} +{{>serialization/freezed/class_primitive_union_extensions}} + {{! Generate an enum for any variables that are declared as inline enums isEnum is only true for inline variables that are enums. @@ -34,7 +37,6 @@ const {{classname}}._(); {{#vars}} {{#isEnum}} {{^isContainer}} - {{>serialization/freezed/enum_inline}} {{/isContainer}} {{#isContainer}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache index 5b2eb14258dc..7404be081ad4 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache @@ -1,21 +1,55 @@ -{{^hasDiscriminatorWithNonEmptyMapping}} -const factory {{classname}}({ -{{#vars}} - {{#description}} - /// {{{.}}} - {{/description}} - @JsonKey(name: r'{{baseName}}') {{>serialization/freezed/variable_type}} {{name}}, -{{/vars}} -}) = _{{classname}}; -{{/hasDiscriminatorWithNonEmptyMapping}} +{{#vendorExtensions.x-is-pure}} + {{>serialization/freezed/class_factory_general}} +{{/vendorExtensions.x-is-pure}} -{{#hasDiscriminatorWithNonEmptyMapping}} - {{#discriminator}} - {{#mappedModels}} - const factory {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}({ - required {{modelName}} {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} - }) = {{classname}}{{#lambda.titlecase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.titlecase}}; - {{/mappedModels}} - const factory {{classname}}.unknown() = {{classname}}Unknown; - {{/discriminator}} -{{/hasDiscriminatorWithNonEmptyMapping}} \ No newline at end of file +{{^vendorExtensions.x-is-pure}} + {{#vendorExtensions.x-is-child}} + {{^hasDiscriminatorWithNonEmptyMapping}} + {{>serialization/freezed/class_factory_general}} + {{/hasDiscriminatorWithNonEmptyMapping}} + {{/vendorExtensions.x-is-child}} +{{/vendorExtensions.x-is-pure}} + +{{^vendorExtensions.x-is-pure}} + {{#hasDiscriminatorWithNonEmptyMapping}} + {{#discriminator}} + {{#mappedModels}} + const factory {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}({ + required {{modelName}} {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}, + }) = {{classname}}{{#lambda.titlecase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.titlecase}}; + {{/mappedModels}} + const factory {{classname}}.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([{{#anyOf}}{{{.}}},{{/anyOf}}{{#oneOf}}{{{.}}},{{/oneOf}}]) List possibleTypes, + @Default(<{{classname}}>[]) List<{{classname}}> deserializedModels, + }) = {{classname}}Unknown; + {{/discriminator}} + {{/hasDiscriminatorWithNonEmptyMapping}} +{{/vendorExtensions.x-is-pure}} +{{^vendorExtensions.x-is-pure}} + {{^vendorExtensions.x-is-child}} + {{^hasDiscriminatorWithNonEmptyMapping}} + {{#anyOf}} + const factory {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}({ + required {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}} {{#lambda.camelcase}}{{{.}}}Value{{/lambda.camelcase}} + }) = {{classname}}As{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}; + {{/anyOf}} + {{#oneOf}} + const factory {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}({ + required {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}} {{#lambda.camelcase}}{{{.}}}Value{{/lambda.camelcase}} + }) = {{classname}}As{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}; + {{/oneOf}} + const factory {{classname}}.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([{{#anyOf}}{{{.}}},{{/anyOf}}{{#oneOf}}{{{.}}},{{/oneOf}}]) List possibleTypes, + @Default(<{{classname}}>[]) List<{{classname}}> deserializedModels, + }) = {{classname}}Unknown; + {{/hasDiscriminatorWithNonEmptyMapping}} + {{/vendorExtensions.x-is-child}} +{{/vendorExtensions.x-is-pure}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory_general.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory_general.mustache new file mode 100644 index 000000000000..bdfb074a1f89 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory_general.mustache @@ -0,0 +1,8 @@ +const factory {{classname}}({ +{{#vars}} + {{#description}} + /// {{{.}}} + {{/description}} + @JsonKey(name: r'{{baseName}}') {{>serialization/freezed/variable_type}} {{name}}, +{{/vars}} +}) = _{{classname}}; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache index 18d99cf6a267..4f85c1dabf53 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache @@ -1,19 +1,81 @@ -{{^hasDiscriminatorWithNonEmptyMapping}} +{{#vendorExtensions.x-is-pure}} factory {{classname}}.fromJson(Map json) => _${{classname}}FromJson(json); -{{/hasDiscriminatorWithNonEmptyMapping}} +{{/vendorExtensions.x-is-pure}} +{{^vendorExtensions.x-is-pure}} + {{#vendorExtensions.x-is-child}} + {{^hasDiscriminatorWithNonEmptyMapping}} + factory {{classname}}.fromJson(Map json) => _${{classname}}FromJson(json); + {{/hasDiscriminatorWithNonEmptyMapping}} + {{/vendorExtensions.x-is-child}} +{{/vendorExtensions.x-is-pure}} +{{^vendorExtensions.x-is-pure}} {{#hasDiscriminatorWithNonEmptyMapping}} factory {{classname}}.fromJson(Map json) { {{#discriminator}} - switch(json['{{propertyBaseName}}']){ - {{#mappedModels}} - case '{{mappingName}}': - return {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}( - {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} : {{modelName}}.fromJson(json), - ); - {{/mappedModels}} - } + switch(json['{{propertyBaseName}}']){ + {{#mappedModels}} + case '{{mappingName}}': + return {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}( + {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} : {{modelName}}.fromJson(json), + ); + {{/mappedModels}} + } {{/discriminator}} - return {{classname}}.unknown(); + return {{classname}}.unknown(json: json); } -{{/hasDiscriminatorWithNonEmptyMapping}} \ No newline at end of file +{{/hasDiscriminatorWithNonEmptyMapping}} +{{/vendorExtensions.x-is-pure}} + +{{^vendorExtensions.x-is-pure}} + {{^vendorExtensions.x-is-child}} + {{^hasDiscriminatorWithNonEmptyMapping}} + factory {{classname}}.fromJson(Map json) { + final fromJsonMethods = >[{{#anyOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/anyOf}}{{#oneOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/oneOf}}]; + final deserializedModels = <{{classname}}>[]; + {{classname}}? deserializedModel; + for (final fromJsonMethod in fromJsonMethods) { + try { + final parsedModel= fromJsonMethod.call(json); + // Note following line won't be executed if already the above parsing fails. + switch (deserializedModel.runtimeType) { + {{#anyOf}} + case {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel as {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}, + ); + break; + {{/anyOf}} + {{#oneOf}} + case {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel as {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}, + ); + break; + {{/oneOf}} + default: + deserializedModel = {{classname}}.unknown(json: json,); + } + deserializedModels.add(deserializedModel); + } catch (e) { + // We are suppressing the deserialization error when the json could not + // be parsed into one of the model. Because we return [{{classname}}.unknown] + // if the deserialization fails. + } + } + // Return an unknown type when the incoming json parses into more than one models. + // Since we pass deserializedModels, clients can still use the deserialized model. + // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. + // So we still return this as an unknown type. + if(deserializedModels.length > 1){ + deserializedModel = {{classname}}.unknown( + json: json, + deserializedModels: deserializedModels, + errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, + ); + } + return deserializedModel ?? {{classname}}.unknown(json: json); + } + {{/hasDiscriminatorWithNonEmptyMapping}} + {{/vendorExtensions.x-is-child}} +{{/vendorExtensions.x-is-pure}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_primitive_union_extensions.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_primitive_union_extensions.mustache new file mode 100644 index 000000000000..66ad0d1d44d7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_primitive_union_extensions.mustache @@ -0,0 +1,12 @@ +{{^vendorExtensions.x-is-pure}} + {{^vendorExtensions.x-is-child}} + {{^hasDiscriminatorWithNonEmptyMapping}} + {{#anyOf}} + {{#PrimitiveExtension}}{{{.}}}{{/PrimitiveExtension}} + {{/anyOf}} + {{#oneOf}} + {{#PrimitiveExtension}}{{{.}}}{{/PrimitiveExtension}} + {{/oneOf}} + {{/hasDiscriminatorWithNonEmptyMapping}} + {{/vendorExtensions.x-is-child}} +{{/vendorExtensions.x-is-pure}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache index b5638c84edd6..e42fb1f52540 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache @@ -1,11 +1,32 @@ -{{#discriminator}} - Map toJson() { - return when( - {{#mappedModels}} - {{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}: ({{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}) => {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}.toJson(), - {{/mappedModels}} - {{! adds an unknown case to handle one Of}} - unknown: () => {}, - ); - } -{{/discriminator}} \ No newline at end of file +{{#hasDiscriminatorWithNonEmptyMapping}} + {{#discriminator}} + Map toJson() { + return when( + {{#mappedModels}} + {{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}: ({{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}) => {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}.toJson(), + {{/mappedModels}} + {{! adds an unknown case to handle one Of}} + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + {{/discriminator}} +{{/hasDiscriminatorWithNonEmptyMapping}} + +{{^vendorExtensions.x-is-pure}} + {{^vendorExtensions.x-is-child}} + {{^hasDiscriminatorWithNonEmptyMapping}} + Map toJson() { + return when( + {{#anyOf}} + as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: (as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) => as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.toJson(), + {{/anyOf}} + {{#oneOf}} + as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: (as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) => as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.toJson(), + {{/oneOf}} + {{! adds an unknown case to handle one Of}} + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + {{/hasDiscriminatorWithNonEmptyMapping}} + {{/vendorExtensions.x-is-child}} +{{/vendorExtensions.x-is-pure}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache index cee1c5fe645d..631160406615 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache @@ -1,9 +1,20 @@ //ignore_for_file: invalid_annotation_target import 'package:freezed_annotation/freezed_annotation.dart'; +import 'dart:convert'; part 'models.freezed.dart'; part 'models.g.dart'; +part 'primitive_union_types.dart'; {{! Add part deifinition for all models}} {{#models}}{{#model}}part '{{classFilename}}.dart';{{/model}}{{/models}} +/// A typedef used in the deserialization of OneOf and AnyOf +/// models when no discriminator mapping is provided. +typedef FromJsonMethodType = T Function(Map); + +/// Deserialization error types for OneOf and AnyOf types. +enum DeserializationErrorType { + MoreThanOneTypeSatisfied, + UnKnownType, +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/primitive_union_types.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/primitive_union_types.mustache new file mode 100644 index 000000000000..fafa083471b8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/primitive_union_types.mustache @@ -0,0 +1,60 @@ +part of 'models.dart'; + +@freezed +class IntInUnion with _$IntInUnion{ + const factory IntInUnion({ + required int intValue + }) = _IntInUnion; + + factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); +} + +@freezed +class StringInUnion with _$StringInUnion{ + const factory StringInUnion({ + required String stringValue + }) = _StringInUnion; + + factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); +} +@freezed +class BoolInUnion with _$BoolInUnion{ + const factory BoolInUnion({ + required bool boolValue + }) = _BoolInUnion; + + factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); +} + +@freezed +class DoubleInUnion with _$DoubleInUnion{ + const factory DoubleInUnion({ + required double doubleValue + }) = _DoubleInUnion; + + factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); +} + +@freezed +class ObjectInUnion with _$ObjectInUnion { + const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; + + factory ObjectInUnion.fromJson(Map json) => + _$ObjectInUnionFromJson(json); +} + +@freezed +class NumInUnion with _$NumInUnion{ + const factory NumInUnion({required num numValue}) = _NumInUnion; + + factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); +} + +@freezed +class DateTimeInUnion with _$DateTimeInUnion { +const factory DateTimeInUnion({required DateTime dateTimeValue}) = +_DateTimeInUnion; + +factory DateTimeInUnion.fromJson(Map json) => +_$DateTimeInUnionFromJson(json); +} \ No newline at end of file From a878b6f819e00dd4fabaaa727d14b51560182743 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 25 Feb 2023 16:36:20 +0100 Subject: [PATCH 14/48] fixes for collection primitives in union. --- .../languages/DartDioClientCodegen.java | 71 +++++++------------ .../freezed/class_from_json.mustache | 4 +- .../class_primitive_union_extensions.mustache | 8 ++- 3 files changed, 34 insertions(+), 49 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 4a29d7c73d8d..ae36235ca6cb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -51,6 +51,8 @@ import java.util.*; import java.util.stream.Collectors; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; +import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; public class DartDioClientCodegen extends AbstractDartCodegen { @@ -327,59 +329,38 @@ private void configureSerializationLibraryFreezed(String srcFolder) { } writer.write(content); }); - // A lambda which transforms Types for naming factory constructors inFreezed unions. - additionalProperties.put("PrimitiveCollections", (Mustache.Lambda) (fragment, writer) -> { + // A lambda to filter out collection types from anyOf and oneOf sets in codegenmodel. + additionalProperties.put("PrimitiveCollectionsExtension", (Mustache.Lambda) (fragment, writer) -> { String content = fragment.execute(); content = content.trim().replaceAll("\n", ""); Set collectionTypes = Sets.newHashSet("List","Map","Set"); - Set nonCollectionTypes = defaultIncludes.stream().filter(e -> !collectionTypes.contains(e)).collect(Collectors.toSet()); - if(nonCollectionTypes.contains(content)){ - writer.write(""); - return; - } - writer.write(content); - }); - // A lambda to generate correct FromJson methods for collection types. - additionalProperties.put("PrimitiveExtension", (Mustache.Lambda) (fragment, writer) -> { - String content = fragment.execute(); - content = content.trim().replaceAll("\n", ""); // Remove Generics Declarations as this is not required for factoryNames in freezed String tmp_1 = StringUtils.substringBefore(content, "<"); - if (tmp_1.equals("Set")) { - content = String.join("\n", - "extension on " + content + " {", - content + "fromJson(Map json) {", - "return {};", - "}", - "Map toJson() {", - "return {};", - "}", - "}"); - }else if(tmp_1.equals("List")){ - content = String.join("\n", - "extension on " + content + " {", - content + "fromJson(Map json) {", - "return [];", - "}", - "Map toJson() {", - "return {};", - "}", - "}"); - }else if(tmp_1.equals("Map")){ - content = String.join("\n", - "extension on " + content + " {", - content + "fromJson(Map json) {", - "return {};", - "}", - "Map toJson() {", - "return {};", - "}", - "}"); + if(collectionTypes.contains(tmp_1)){ + String variableName = camelize(fragment.execute().replace(" ", "_"), LOWERCASE_FIRST_LETTER); + variableName = this.sanitizeName(variableName); + if (this.reservedWords().contains(variableName)) { + // Escaping must be done *after* camelize, because generators may escape using characters removed by camelize function. + variableName = this.escapeReservedWord(variableName); + } + tmp_1 = String.join("\n", "extension on "+ content + "{", + "dynamic fromJson(Map json) {", + "return json[\""+variableName+"Value\"];", + "}", + + "Map toJson() {", + "return {", + "\""+variableName+"Value\": this,", + "};", + "}", + "}"); + writer.write(tmp_1); }else{ - content = ""; + writer.write(""); + } - writer.write(content); }); + } private void configureDateLibrary(String srcFolder) { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache index 4f85c1dabf53..d280fc57855a 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache @@ -31,12 +31,12 @@ factory {{classname}}.fromJson(Map json) => _${{classname}}From {{^vendorExtensions.x-is-child}} {{^hasDiscriminatorWithNonEmptyMapping}} factory {{classname}}.fromJson(Map json) { - final fromJsonMethods = >[{{#anyOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/anyOf}}{{#oneOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/oneOf}}]; + final fromJsonMethods = >[{{#anyOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/anyOf}}{{#oneOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/oneOf}}]; final deserializedModels = <{{classname}}>[]; {{classname}}? deserializedModel; for (final fromJsonMethod in fromJsonMethods) { try { - final parsedModel= fromJsonMethod.call(json); + final dynamic parsedModel= fromJsonMethod.call(json); // Note following line won't be executed if already the above parsing fails. switch (deserializedModel.runtimeType) { {{#anyOf}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_primitive_union_extensions.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_primitive_union_extensions.mustache index 66ad0d1d44d7..a05e6c0727c6 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_primitive_union_extensions.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_primitive_union_extensions.mustache @@ -2,10 +2,14 @@ {{^vendorExtensions.x-is-child}} {{^hasDiscriminatorWithNonEmptyMapping}} {{#anyOf}} - {{#PrimitiveExtension}}{{{.}}}{{/PrimitiveExtension}} + {{#PrimitiveCollectionsExtension}} + {{{.}}} + {{/PrimitiveCollectionsExtension}} {{/anyOf}} {{#oneOf}} - {{#PrimitiveExtension}}{{{.}}}{{/PrimitiveExtension}} + {{#PrimitiveCollectionsExtension}} + {{{.}}} + {{/PrimitiveCollectionsExtension}} {{/oneOf}} {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-child}} From aa056eee94f8ad40f7c8f3072a8a3708831e964e Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 25 Feb 2023 18:07:02 +0100 Subject: [PATCH 15/48] Update freezed version --- .../src/main/resources/dart/libraries/dio/pubspec.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 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 c18220f3946d..4fb441c79dcb 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 @@ -19,7 +19,7 @@ dependencies: {{/useJsonSerializable}} {{#useFreezed}} freezed_annotation: '^2.0.3' - json_annotation: '^4.4.0' + json_annotation: '^4.8.0' {{/useFreezed}} {{#useDateLibTimeMachine}} time_machine: ^0.9.16 @@ -36,7 +36,7 @@ dev_dependencies: {{/useJsonSerializable}} {{#useFreezed}} freezed: '^2.0.3' - json_serializable: '^6.1.4' + json_serializable: '^6.6.1' build_runner: any {{/useFreezed}} test: ^1.16.0 From ee572996469accc0fc64e888b9c6fd87e85d06b6 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 25 Feb 2023 18:08:08 +0100 Subject: [PATCH 16/48] Update json_serialized version --- .../src/main/resources/dart/libraries/dio/pubspec.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 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 4fb441c79dcb..3cc69d5633f2 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 @@ -18,7 +18,7 @@ dependencies: json_annotation: '^4.4.0' {{/useJsonSerializable}} {{#useFreezed}} - freezed_annotation: '^2.0.3' + freezed_annotation: '^2.2.0' json_annotation: '^4.8.0' {{/useFreezed}} {{#useDateLibTimeMachine}} @@ -35,7 +35,7 @@ dev_dependencies: json_serializable: '^6.1.5' {{/useJsonSerializable}} {{#useFreezed}} - freezed: '^2.0.3' + freezed: '^2.3.2' json_serializable: '^6.6.1' build_runner: any {{/useFreezed}} From ab4c5dc0cf6a3dc7c73f8c54d8ec2e71e19d6106 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 25 Feb 2023 18:42:42 +0100 Subject: [PATCH 17/48] Remove unused imports --- .../openapitools/codegen/languages/DartDioClientCodegen.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index ae36235ca6cb..e4eb4a75a1c0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -22,10 +22,8 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Discriminator; import io.swagger.v3.oas.models.media.Schema; -import org.apache.commons.lang3.CharSetUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.graalvm.util.CollectionsUtil; import org.openapitools.codegen.*; import org.openapitools.codegen.CodegenDiscriminator.MappedModel; import org.openapitools.codegen.api.TemplatePathLocator; From 6b86b4e50cb35abf6e6a1ad5e30010707948fd42 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 26 Feb 2023 17:25:19 +0100 Subject: [PATCH 18/48] update enum logic --- .../dio/serialization/freezed/enum.mustache | 14 ++++++++------ .../serialization/freezed/enum_inline.mustache | 15 +++++++++------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache index 4baa498ba4ee..9f8079686ade 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache @@ -1,11 +1,13 @@ part of 'models.dart'; {{#description}}/// {{{description}}}{{/description}} +@JsonEnum(valueField: 'value') enum {{classname}} { -{{#allowableValues}} - {{#enumVars}} - @JsonValue({{#isString}}r{{/isString}}{{{value}}}) - {{{name}}}, - {{/enumVars}} -{{/allowableValues}} + {{#allowableValues}} + {{#enumVars}} + {{{name}}}(value: {{#isString}}r{{/isString}}{{{value}}}), + {{/enumVars}} + const {{classname}}({this.value}); + final String value; + {{/allowableValues}} } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache index 369d6691d730..5aa3b4664623 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache @@ -1,8 +1,11 @@ {{#description}}/// {{{description}}}{{/description}} -enum {{{enumName}}} { -{{#allowableValues}} - {{#enumVars}} - @JsonValue(r{{{value}}}) {{{name}}}, - {{/enumVars}} -{{/allowableValues}} +@JsonEnum(valueField: 'value') +enum {{classname}} { + {{#allowableValues}} + {{#enumVars}} + {{{name}}}(value: {{#isString}}r{{/isString}}{{{value}}}), + {{/enumVars}} + const {{classname}}({this.value}); + final String value; + {{/allowableValues}} } \ No newline at end of file From a30f7e8dd177208cfe95758879228edfb9911a13 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 26 Feb 2023 17:47:16 +0100 Subject: [PATCH 19/48] Update sdk to support enhanced enum features. --- .../src/main/resources/dart/libraries/dio/pubspec.mustache | 5 +++++ .../libraries/dio/serialization/freezed/enum_inline.mustache | 4 ++-- 2 files changed, 7 insertions(+), 2 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 3cc69d5633f2..92aed6e3c7b9 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: + {{^useFreezed}} sdk: '>=2.15.0 <3.0.0' + {{/useFreezed}} + {{#useFreezed}} + sdk: '>=2.17.0 <3.0.0' + {{/useFreezed}} dependencies: dio: '^5.0.0' diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache index 5aa3b4664623..c9428e1900c3 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache @@ -1,11 +1,11 @@ {{#description}}/// {{{description}}}{{/description}} @JsonEnum(valueField: 'value') -enum {{classname}} { +enum {{enumName}} { {{#allowableValues}} {{#enumVars}} {{{name}}}(value: {{#isString}}r{{/isString}}{{{value}}}), {{/enumVars}} - const {{classname}}({this.value}); + const {{enumName}}({this.value}); final String value; {{/allowableValues}} } \ No newline at end of file From e8fa5f8dd58fd5301fae8c7bf432ac504849e694 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 26 Feb 2023 18:25:07 +0100 Subject: [PATCH 20/48] fix enhanced enum definition. --- .../dart/libraries/dio/serialization/freezed/enum.mustache | 4 ++-- .../libraries/dio/serialization/freezed/enum_inline.mustache | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache index 9f8079686ade..3ede1a335975 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache @@ -5,9 +5,9 @@ part of 'models.dart'; enum {{classname}} { {{#allowableValues}} {{#enumVars}} - {{{name}}}(value: {{#isString}}r{{/isString}}{{{value}}}), + {{{name}}}(value: {{#isString}}r{{/isString}}{{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/enumVars}} - const {{classname}}({this.value}); + const {{classname}}({required this.value}); final String value; {{/allowableValues}} } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache index c9428e1900c3..7495ac28e837 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache @@ -3,9 +3,9 @@ enum {{enumName}} { {{#allowableValues}} {{#enumVars}} - {{{name}}}(value: {{#isString}}r{{/isString}}{{{value}}}), + {{{name}}}(value: {{#isString}}r{{/isString}}{{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/enumVars}} - const {{enumName}}({this.value}); + const {{enumName}}({required this.value}); final String value; {{/allowableValues}} } \ No newline at end of file From 2fda70c382fdbb8071faf83d94d5ef9a90a6fd57 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 26 Feb 2023 20:22:14 +0100 Subject: [PATCH 21/48] fix missing form params. --- .../freezed/api/serialize.mustache | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/serialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/serialize.mustache index 93aed695e980..359a9a5697fc 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/serialize.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/serialize.mustache @@ -1 +1,28 @@ -{{#bodyParam}}_bodyData=jsonEncode({{{paramName}}});{{/bodyParam}} \ No newline at end of file +{{#hasFormParams}} + {{#isMultipart}} + _bodyData = FormData.fromMap({ + {{#formParams}} + {{^required}} + {{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}} + {{/required}}r'{{{baseName}}}': + {{#isFile}}{{{paramName}}}{{#isArray}}.toList(){{/isArray}}{{/isFile}} + {{^isFile}}jsonEncode({{{paramName}}}){{/isFile}}, + {{/formParams}} + }); + {{/isMultipart}} + {{^isMultipart}} + _bodyData = { + {{#formParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': {{>serialization/freezed/api/query_param}}, + {{/formParams}} + }; + {{/isMultipart}} +{{/hasFormParams}} +{{#bodyParam}} + {{#isPrimitiveType}} + _bodyData = {{paramName}}{{#isFile}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}.finalize(){{/isFile}}; + {{/isPrimitiveType}} + {{^isPrimitiveType}} + _bodyData=jsonEncode({{{paramName}}}); + {{/isPrimitiveType}} +{{/bodyParam}} \ No newline at end of file From a21885e132be7b99a4c7ac76a60a28a362f2b2d9 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 12 Mar 2023 20:52:17 +0100 Subject: [PATCH 22/48] initial setup union_response. --- .../languages/DartDioClientCodegen.java | 9 ++- .../resources/dart/libraries/dio/api.mustache | 72 +++++++++++++++++-- .../freezed/api/deserialize.mustache | 71 +++++++++--------- .../freezed/api/deserialize_union.mustache | 53 ++++++++++++++ .../freezed/models.dart.mustache | 4 ++ .../freezed/response_models.mustache | 40 +++++++++++ 6 files changed, 211 insertions(+), 38 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize_union.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/response_models.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index e4eb4a75a1c0..bacad67560a9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -73,6 +73,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen { public static final String FINAL_PROPERTIES_DEFAULT_VALUE = "true"; private static final String CLIENT_NAME = "clientName"; + private static final String FREEZED_UNION_RESPONSE = "freezedUnionResponse"; private String dateLibrary; @@ -288,10 +289,16 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { } private void configureSerializationLibraryFreezed(String srcFolder) { + if (!additionalProperties.containsKey(FREEZED_UNION_RESPONSE)) { + additionalProperties.put(FREEZED_UNION_RESPONSE, false); + LOGGER.debug("freezedUnionResponse not set, using default {}", false); + } supportingFiles.add(new SupportingFile("serialization/freezed/build.yaml.mustache", "" /* main project dir */, "build.yaml")); supportingFiles.add(new SupportingFile("serialization/freezed/models.dart.mustache", srcFolder + File.separator + modelPackage, "models.dart")); supportingFiles.add(new SupportingFile("serialization/freezed/primitive_union_types.mustache", srcFolder + File.separator + modelPackage, "primitive_union_types.dart")); - + if(((boolean) additionalProperties.getOrDefault(FREEZED_UNION_RESPONSE, false))){ + supportingFiles.add(new SupportingFile("serialization/freezed/response_models.mustache", srcFolder + File.separator + modelPackage, "response_models.dart")); + } // most of these are defined in AbstractDartCodegen, we are overriding // just the binary / file handling languageSpecificPrimitives.add("Object"); 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 e759a60ea9b1..546b74ea7dc2 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 @@ -41,7 +41,18 @@ class {{classname}} { {{#isDeprecated}} @Deprecated('This operation has been deprecated') {{/isDeprecated}} - Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} + {{#useFreezed}} + {{#freezedUnionResponse}} + Future> {{nickname}}({ + {{/freezedUnionResponse}} + {{^freezedUnionResponse}} + Future> {{nickname}}({ + {{/freezedUnionResponse}} + {{/useFreezed}} + {{^useFreezed}} + Future> {{nickname}}({ + {{/useFreezed}} + {{#allParams}}{{#isPathParam}} required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} @@ -119,7 +130,17 @@ class {{classname}} { ); {{#returnType}} - {{{returnType}}} _responseData; + {{#useFreezed}} + {{#freezedUnionResponse}} + {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data _responseData; + {{/freezedUnionResponse}} + {{^freezedUnionResponse}} + {{{returnType}}} _responseData; + {{/freezedUnionResponse}} + {{/useFreezed}} + {{^useFreezed}} + {{{returnType}}} _responseData; + {{/useFreezed}} try { {{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} @@ -133,7 +154,17 @@ class {{classname}} { ); } + {{#useFreezed}} + {{#freezedUnionResponse}} + return Response<{{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data>( + {{/freezedUnionResponse}} + {{^freezedUnionResponse}} return Response<{{{returnType}}}>( + {{/freezedUnionResponse}} + {{/useFreezed}} + {{^useFreezed}} + return Response<{{{returnType}}}>( + {{/useFreezed}} data: _responseData, headers: _response.headers, isRedirect: _response.isRedirect, @@ -142,8 +173,41 @@ class {{classname}} { statusCode: _response.statusCode, statusMessage: _response.statusMessage, extra: _response.extra, - );{{/returnType}}{{^returnType}} - return _response;{{/returnType}} + );{{/returnType}} + {{^returnType}} + {{^useFreezed}} + return _response; + {{/useFreezed}} + {{#useFreezed}} + {{#freezedUnionResponse}} + {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data _responseData; + try { + {{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + return Response<{{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + {{/freezedUnionResponse}} + {{^freezedUnionResponse}} + return _response; + {{/freezedUnionResponse}} + {{/useFreezed}} + {{/returnType}} } {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache index 5595c71cf42f..4dae0a6476f4 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize.mustache @@ -1,33 +1,38 @@ -{{#isResponseFile}} - _responseData = _response.data as {{{returnType}}}; -{{/isResponseFile}} -{{^isResponseFile}} - {{#returnSimpleType}} - {{#returnTypeIsPrimitive}} - _responseData = _response.data as {{{returnType}}}; - {{/returnTypeIsPrimitive}} - {{^returnTypeIsPrimitive}} - _responseData = {{{returnType}}}.fromJson(_response.data as Map); - {{/returnTypeIsPrimitive}} - {{/returnSimpleType}} - {{^returnSimpleType}} - {{#returnTypeIsPrimitive}} - _responseData = _response.data as {{{returnType}}}; - {{/returnTypeIsPrimitive}} - {{^returnTypeIsPrimitive}} - {{#isArray}} - {{#uniqueItems}} - final _responseDataAsSet = _response.data as List; - _responseData = _responseDataAsSet.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toSet(); - {{/uniqueItems}} - {{^uniqueItems}} - final _responseDataAsList = _response.data as List; - _responseData = _responseDataAsList.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toList(); - {{/uniqueItems}} - {{/isArray}} - {{#isMap}} - _responseData = _response.data as Map; - {{/isMap}} - {{/returnTypeIsPrimitive}} - {{/returnSimpleType}} -{{/isResponseFile}} \ No newline at end of file +{{#freezedUnionResponse}} + _responseData = {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data.toUnionData(_response.statusCode, _response.data,); +{{/freezedUnionResponse}} +{{^freezedUnionResponse}} + {{#isResponseFile}} + _responseData = _response.data as {{{returnType}}}; + {{/isResponseFile}} + {{^isResponseFile}} + {{#returnSimpleType}} + {{#returnTypeIsPrimitive}} + _responseData = _response.data as {{{returnType}}}; + {{/returnTypeIsPrimitive}} + {{^returnTypeIsPrimitive}} + _responseData = {{{returnType}}}.fromJson(_response.data as Map); + {{/returnTypeIsPrimitive}} + {{/returnSimpleType}} + {{^returnSimpleType}} + {{#returnTypeIsPrimitive}} + _responseData = _response.data as {{{returnType}}}; + {{/returnTypeIsPrimitive}} + {{^returnTypeIsPrimitive}} + {{#isArray}} + {{#uniqueItems}} + final _responseDataAsSet = _response.data as List; + _responseData = _responseDataAsSet.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toSet(); + {{/uniqueItems}} + {{^uniqueItems}} + final _responseDataAsList = _response.data as List; + _responseData = _responseDataAsList.map<{{{returnBaseType}}}>((dynamic e)=> {{{returnBaseType}}}.fromJson(e as Map)).toList(); + {{/uniqueItems}} + {{/isArray}} + {{#isMap}} + _responseData = _response.data as Map; + {{/isMap}} + {{/returnTypeIsPrimitive}} + {{/returnSimpleType}} + {{/isResponseFile}} +{{/freezedUnionResponse}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize_union.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize_union.mustache new file mode 100644 index 000000000000..b04cd2195339 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/deserialize_union.mustache @@ -0,0 +1,53 @@ +{{#isFile}} + _responseData = responseData as {{{dataType}}}; +{{/isFile}} +{{^isFile}} + {{#simpleType}} + {{#primitiveType}} + {{#dataType}} + _responseData = responseData as {{{dataType}}}; + {{/dataType}} + {{^dataType}} + _responseData = responseData; + {{/dataType}} + {{/primitiveType}} + {{^primitiveType}} + {{#dataType}} + _responseData = {{{dataType}}}.fromJson(responseData as Map); + {{/dataType}} + {{^dataType}} + _responseData = responseData; + {{/dataType}} + {{/primitiveType}} + {{/simpleType}} + {{^simpleType}} + {{#primitiveType}} + _responseData = responseData as {{{dataType}}}; + {{/primitiveType}} + {{^primitiveType}} + {{#isModel}} + {{#isMap}} + _responseData = responseData as {{{dataType}}}; + {{/isMap}} + {{^isMap}} + _responseData = {{{dataType}}}.fromJson(responseData as Map); + {{/isMap}} + {{/isModel}} + {{^isModel}} + {{#isArray}} + {{#uniqueItems}} + final _responseDataAsSet = responseData as List; + _responseData = _responseDataAsSet.map<{{{baseType}}}>((dynamic e)=> {{{baseType}}}.fromJson(e as Map)).toSet(); + {{/uniqueItems}} + {{^uniqueItems}} + final _responseDataAsList = responseData as List; + _responseData = _responseDataAsList.map<{{{baseType}}}>((dynamic e)=> {{{baseType}}}.fromJson(e as Map)).toList(); + {{/uniqueItems}} + {{/isArray}} + {{#isMap}} + _responseData = responseData as Map; + {{/isMap}} + {{/isModel}} + {{/primitiveType}} + {{/simpleType}} +{{/isFile}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache index 631160406615..ff65bbd9cec3 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/models.dart.mustache @@ -1,11 +1,15 @@ //ignore_for_file: invalid_annotation_target import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:dio/dio.dart'; import 'dart:convert'; part 'models.freezed.dart'; part 'models.g.dart'; part 'primitive_union_types.dart'; +{{#freezedUnionResponse}} +part 'response_models.dart'; +{{/freezedUnionResponse}} {{! Add part deifinition for all models}} {{#models}}{{#model}}part '{{classFilename}}.dart';{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/response_models.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/response_models.mustache new file mode 100644 index 000000000000..857b97c843f6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/response_models.mustache @@ -0,0 +1,40 @@ +part of 'models.dart'; + +{{#apiInfo}}{{#apis}} +{{#operations}} + {{#operation}} + @freezed + class {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data with _${{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data { + const {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data._(); + {{#responses}} + const factory {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data.as{{code}}{{^returnType}}Void{{/returnType}}({ + required {{{dataType}}}{{^dataType}}Object?{{/dataType}} responseData, + }) = {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}DataAs{{code}}{{^returnType}}Void{{/returnType}}; + {{/responses}} + const factory {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data.unknown({ + int? statusCode, + required Object? responseData, + }) = {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}ResponseUnknown; + + /// Converts the incoming response into the correct response code based freezed union case. + static {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data toUnionData(int? statusCode, Object? responseData) { + + switch (statusCode) { + {{#responses}} + case {{code}}: + {{{dataType}}}{{^dataType}}Object?{{/dataType}} _responseData; + {{>serialization/freezed/api/deserialize_union}} + return {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data.as{{code}}{{^returnType}}Void{{/returnType}}( + responseData: _responseData + ); + {{/responses}} + default: + return {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data.unknown( + responseData: responseData, + ); + } + } + } + {{/operation}} +{{/operations}} +{{/apis}}{{/apiInfo}} \ No newline at end of file From 8bf50ae547d8ac45298079730b899435f48b5d23 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 19 Mar 2023 17:38:18 +0100 Subject: [PATCH 23/48] remove empty spaces in import and export --- .../src/main/resources/dart/libraries/dio/api.mustache | 6 +++--- .../src/main/resources/dart/libraries/dio/lib.mustache | 5 ++--- 2 files changed, 5 insertions(+), 6 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 546b74ea7dc2..4a74d1dd874c 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 @@ -7,7 +7,8 @@ import 'package:dio/dio.dart'; {{#operations}} {{! No need to Import all the required model files as freezed uses the part of directive for it models}} {{^useFreezed}} - {{#imports}}import '{{.}}'; + {{#imports}} +import '{{.}}'; {{/imports}} {{/useFreezed}} @@ -51,8 +52,7 @@ class {{classname}} { {{/useFreezed}} {{^useFreezed}} Future> {{nickname}}({ - {{/useFreezed}} - {{#allParams}}{{#isPathParam}} + {{/useFreezed}}{{#allParams}}{{#isPathParam}} required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache index 2b00f1536735..2814a5b9b8df 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache @@ -8,12 +8,11 @@ export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; {{#apiInfo}}{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; {{/apis}}{{/apiInfo}} - {{! For freezed all the models are simply part of models.dart file utilizing the part directive}} {{#useFreezed}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/models.dart';{{/useFreezed}} - {{! No need to export all the models files as freezed uses the part of directive for it models}} {{^useFreezed}} - {{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; + {{#models}}{{#model}} +export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; {{/model}}{{/models}} {{/useFreezed}} \ No newline at end of file From 4ddba3c21594c6d660f950312b56596621672a1b Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 19 Mar 2023 17:38:45 +0100 Subject: [PATCH 24/48] remove empty spaces in import and export --- .../src/main/resources/dart/libraries/dio/model.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache index 6473d74708c2..ce11e5f723d3 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache @@ -4,7 +4,7 @@ {{#model}} {{^useFreezed}} {{#imports}} - import '{{.}}'; +import '{{.}}'; {{/imports}} {{/useFreezed}} {{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}} From f9dcbf5bbb5cb05fef6e6babbbf57c3fb29a8723 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 19 Mar 2023 18:08:02 +0100 Subject: [PATCH 25/48] remove empty spaces in import and export --- .../src/main/resources/dart/libraries/dio/model.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache index ce11e5f723d3..6a9561375b01 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache @@ -1,5 +1,5 @@ {{>header}} -// ignore_for_file: unused_element, invalid_annotation_target +// ignore_for_file: unused_element{{#useFreezed}}, invalid_annotation_target{{/useFreezed}} {{#models}} {{#model}} {{^useFreezed}} From d8704c9c05a20043d69b9df07ea0fbb228905f85 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 19 Mar 2023 18:24:25 +0100 Subject: [PATCH 26/48] remove empty spaces in import and export --- .../src/main/resources/dart/libraries/dio/api.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 4a74d1dd874c..a76914498ac5 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 @@ -52,8 +52,8 @@ class {{classname}} { {{/useFreezed}} {{^useFreezed}} Future> {{nickname}}({ - {{/useFreezed}}{{#allParams}}{{#isPathParam}} - required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} + {{/useFreezed}} + {{#allParams}}{{#isPathParam}}required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} {{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isBodyParam}}{{#isFormParam}} @@ -139,7 +139,7 @@ class {{classname}} { {{/freezedUnionResponse}} {{/useFreezed}} {{^useFreezed}} - {{{returnType}}} _responseData; + {{{returnType}}} _responseData; {{/useFreezed}} try { @@ -176,7 +176,7 @@ class {{classname}} { );{{/returnType}} {{^returnType}} {{^useFreezed}} - return _response; + return _response; {{/useFreezed}} {{#useFreezed}} {{#freezedUnionResponse}} From eef65f3eee2cc3927850dc00dae3c1624e7cdac3 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 19 Mar 2023 18:46:36 +0100 Subject: [PATCH 27/48] remove empty spaces in import and export --- .../src/main/resources/dart/libraries/dio/api.mustache | 3 +-- 1 file changed, 1 insertion(+), 2 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 a76914498ac5..34f40bd1517f 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 @@ -52,8 +52,7 @@ class {{classname}} { {{/useFreezed}} {{^useFreezed}} Future> {{nickname}}({ - {{/useFreezed}} - {{#allParams}}{{#isPathParam}}required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} + {{/useFreezed}}{{#allParams}}{{#isPathParam}}required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} {{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isBodyParam}}{{#isFormParam}} From f43b609884782e19ed5984b728bcf496df54f8ac Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 19 Mar 2023 19:04:54 +0100 Subject: [PATCH 28/48] remove empty spaces in import and export --- .../src/main/resources/dart/libraries/dio/api.mustache | 4 ++-- .../src/main/resources/dart/libraries/dio/lib.mustache | 7 ++----- 2 files changed, 4 insertions(+), 7 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 34f40bd1517f..6f6a0562ee39 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 @@ -51,8 +51,8 @@ class {{classname}} { {{/freezedUnionResponse}} {{/useFreezed}} {{^useFreezed}} - Future> {{nickname}}({ - {{/useFreezed}}{{#allParams}}{{#isPathParam}}required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} + Future> {{nickname}}({ {{/useFreezed}}{{#allParams}}{{#isPathParam}} + required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} {{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isBodyParam}}{{#isFormParam}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache index 2814a5b9b8df..228313c9e1d2 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache @@ -11,8 +11,5 @@ export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; {{! For freezed all the models are simply part of models.dart file utilizing the part directive}} {{#useFreezed}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/models.dart';{{/useFreezed}} {{! No need to export all the models files as freezed uses the part of directive for it models}} -{{^useFreezed}} - {{#models}}{{#model}} -export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; - {{/model}}{{/models}} -{{/useFreezed}} \ No newline at end of file +{{^useFreezed}}{{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; +{{/model}}{{/models}}{{/useFreezed}} \ No newline at end of file From fdd352430ffadabc32f6c830a5f871bf326b77a5 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 19 Mar 2023 19:17:57 +0100 Subject: [PATCH 29/48] remove empty spaces in import and export --- .../src/main/resources/dart/libraries/dio/lib.mustache | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache index 228313c9e1d2..c70a98dc7184 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache @@ -8,8 +8,9 @@ export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; {{#apiInfo}}{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; {{/apis}}{{/apiInfo}} + +{{^useFreezed}}{{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; +{{/model}}{{/models}}{{/useFreezed}} {{! For freezed all the models are simply part of models.dart file utilizing the part directive}} {{#useFreezed}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/models.dart';{{/useFreezed}} -{{! No need to export all the models files as freezed uses the part of directive for it models}} -{{^useFreezed}}{{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; -{{/model}}{{/models}}{{/useFreezed}} \ No newline at end of file +{{! No need to export all the models files as freezed uses the part of directive for it models}} \ No newline at end of file From c156a801ceeba1bc9c8710e98ae5ab0f55e915f9 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 19 Mar 2023 20:26:17 +0100 Subject: [PATCH 30/48] remove empty spaces export --- .../src/main/resources/dart/libraries/dio/lib.mustache | 5 +---- .../openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart | 1 + .../oneof_polymorphism_and_inheritance/lib/openapi.dart | 1 + .../petstore/dart-dio/oneof_primitive/lib/openapi.dart | 1 + .../lib/openapi.dart | 1 + .../dart-dio/petstore_client_lib_fake/lib/openapi.dart | 1 + 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache index c70a98dc7184..e874fd7297bc 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache @@ -8,9 +8,6 @@ export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; {{#apiInfo}}{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; {{/apis}}{{/apiInfo}} - {{^useFreezed}}{{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; {{/model}}{{/models}}{{/useFreezed}} -{{! For freezed all the models are simply part of models.dart file utilizing the part directive}} -{{#useFreezed}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/models.dart';{{/useFreezed}} -{{! No need to export all the models files as freezed uses the part of directive for it models}} \ No newline at end of file +{{#useFreezed}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/models.dart';{{/useFreezed}} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart index d85a16fc6ad9..f19b07313c62 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart @@ -14,3 +14,4 @@ export 'package:openapi/src/api/default_api.dart'; export 'package:openapi/src/model/apple.dart'; export 'package:openapi/src/model/banana.dart'; export 'package:openapi/src/model/fruit.dart'; + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart index ea87a7cb4761..b4a3eb7a5b85 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart @@ -26,3 +26,4 @@ export 'package:openapi/src/model/foo_ref_or_value.dart'; export 'package:openapi/src/model/pasta.dart'; export 'package:openapi/src/model/pizza.dart'; export 'package:openapi/src/model/pizza_speziale.dart'; + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart index 220621d6961b..1592a50a75ac 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart @@ -13,3 +13,4 @@ export 'package:openapi/src/api/default_api.dart'; export 'package:openapi/src/model/child.dart'; export 'package:openapi/src/model/example.dart'; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart index 3beabf11dfcd..4a6aeee5d2bf 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart @@ -64,3 +64,4 @@ export 'package:openapi/src/model/single_ref_type.dart'; export 'package:openapi/src/model/special_model_name.dart'; export 'package:openapi/src/model/tag.dart'; export 'package:openapi/src/model/user.dart'; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart index 17f56a53fae1..d50f1597927d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart @@ -65,3 +65,4 @@ export 'package:openapi/src/model/single_ref_type.dart'; export 'package:openapi/src/model/special_model_name.dart'; export 'package:openapi/src/model/tag.dart'; export 'package:openapi/src/model/user.dart'; + From 9260c64fd2ada1b2102e9bfab2af84ad792054bd Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 19 Mar 2023 20:29:48 +0100 Subject: [PATCH 31/48] doc changes --- docs/generators/dart-dio.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index 486f4d5b7823..364d478dbb03 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -33,7 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |pubLibrary|Library name in generated code| |openapi.api| |pubName|Name in generated pubspec| |openapi| |pubVersion|Version in generated pubspec| |1.0.0| -|serializationLibrary|Specify serialization library|
**built_value**
[DEFAULT] built_value
**json_serializable**
[BETA] json_serializable
|built_value| +|serializationLibrary|Specify serialization library|
**built_value**
[DEFAULT] built_value
**json_serializable**
[BETA] json_serializable
**freezed**
[BETA] freezed
|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| |src| From db41f990867515692ccc7df1d66ca5479d372558 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sun, 3 Sep 2023 22:40:02 +0200 Subject: [PATCH 32/48] fix: enums and remove strong mode analysis option --- .../resources/dart/libraries/dio/analysis_options.mustache | 2 ++ .../src/main/resources/dart/libraries/dio/api.mustache | 6 +++--- .../dart/libraries/dio/serialization/freezed/class.mustache | 6 ++++-- .../dio/serialization/freezed/enum_inline.mustache | 3 +++ 4 files changed, 12 insertions(+), 5 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 bab807a0f230..4b6b2fd845ba 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 @@ -2,9 +2,11 @@ analyzer: language: strict-inference: true strict-raw-types: true + {{^useFreezed}} strong-mode: implicit-dynamic: false implicit-casts: false + {{/useFreezed}} exclude: - test/*.dart{{#useJsonSerializable}} - lib/{{sourceFolder}}/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 f2e047a33d24..168f2ca0aae0 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 @@ -134,7 +134,7 @@ class {{classname}} { {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data _responseData; {{/freezedUnionResponse}} {{^freezedUnionResponse}} - {{{.}}}? _responseData; + {{{returnType}}} _responseData; {{/freezedUnionResponse}} {{/useFreezed}} {{^useFreezed}} @@ -183,10 +183,10 @@ class {{classname}} { try { {{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache index 307dfb026abd..3d2bcabe507e 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache @@ -35,7 +35,8 @@ extension for collection primitives in union enum.mustache template. }} {{#vars}} - {{#isEnum}} + {{^isModel}} + {{#enumName}} {{^isContainer}} {{>serialization/freezed/enum_inline}} {{/isContainer}} @@ -45,5 +46,6 @@ extension for collection primitives in union {{>serialization/freezed/enum_inline}} {{/mostInnerItems}} {{/isContainer}} - {{/isEnum}} + {{/enumName}} + {{/isModel}} {{/vars}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache index 7495ac28e837..26685406fd89 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache @@ -1,4 +1,7 @@ {{#description}}/// {{{description}}}{{/description}} +{{#isDeprecated}} + @Deprecated('{{{enumName}}} has been deprecated') +{{/isDeprecated}} @JsonEnum(valueField: 'value') enum {{enumName}} { {{#allowableValues}} From 1554f9094f54116e386a1bfebbf7ebafdbae8775 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Mon, 1 Jan 2024 18:54:38 +0100 Subject: [PATCH 33/48] fix: enums and factory fromjson --- .../dart/libraries/dio/pubspec.mustache | 10 ++++---- .../freezed/api/query_param.mustache | 2 +- .../freezed/class_factory.mustache | 23 +++++++++++++++++-- .../freezed/class_from_json.mustache | 19 ++++++++++++++- .../dio/serialization/freezed/enum.mustache | 2 +- .../freezed/enum_inline.mustache | 2 +- 6 files changed, 47 insertions(+), 11 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 f9823fec1779..06ccc1654ff0 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 @@ -14,7 +14,7 @@ environment: sdk: '>=2.15.0 <3.0.0' {{/useFreezed}} {{#useFreezed}} - sdk: '>=2.17.0 <3.0.0' + sdk: '^3.0.0' {{/useFreezed}} dependencies: @@ -29,8 +29,8 @@ dependencies: json_annotation: '^4.4.0' {{/useJsonSerializable}} {{#useFreezed}} - freezed_annotation: '^2.2.0' - json_annotation: '^4.8.0' + freezed_annotation: '^2.4.1' + json_annotation: '^4.8.1' {{/useFreezed}} {{#useDateLibTimeMachine}} time_machine: ^0.9.16 @@ -46,8 +46,8 @@ dev_dependencies: json_serializable: '^6.1.5' {{/useJsonSerializable}} {{#useFreezed}} - freezed: '^2.3.2' - json_serializable: '^6.6.1' + freezed: '^2.4.2' + json_serializable: '^6.7.1' build_runner: any {{/useFreezed}} test: ^1.16.0 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/query_param.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/query_param.mustache index a83489f9e91c..7e5f88400403 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/query_param.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/api/query_param.mustache @@ -1 +1 @@ -{{{paramName}}} \ No newline at end of file +{{{paramName}}}{{#isEnumRef}}.value{{/isEnumRef}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache index 7404be081ad4..6dba8b93d1e6 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache @@ -1,5 +1,24 @@ {{#vendorExtensions.x-is-pure}} - {{>serialization/freezed/class_factory_general}} + {{^hasDiscriminatorWithNonEmptyMapping}} + {{>serialization/freezed/class_factory_general}} + {{/hasDiscriminatorWithNonEmptyMapping}} + {{#hasDiscriminatorWithNonEmptyMapping}} + {{#discriminator}} + {{#mappedModels}} + const factory {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}({ + required {{modelName}} {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}, + }) = {{classname}}{{#lambda.titlecase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.titlecase}}; + {{/mappedModels}} + const factory {{classname}}.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([{{#anyOf}}{{{.}}},{{/anyOf}}{{#oneOf}}{{{.}}},{{/oneOf}}]) List possibleTypes, + @Default(<{{classname}}>[]) List<{{classname}}> deserializedModels, + }) = {{classname}}Unknown; + {{/discriminator}} + {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-pure}} {{^vendorExtensions.x-is-pure}} @@ -52,4 +71,4 @@ }) = {{classname}}Unknown; {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-child}} -{{/vendorExtensions.x-is-pure}} \ No newline at end of file +{{/vendorExtensions.x-is-pure}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache index d280fc57855a..9e397e7ac2bd 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache @@ -1,5 +1,22 @@ {{#vendorExtensions.x-is-pure}} -factory {{classname}}.fromJson(Map json) => _${{classname}}FromJson(json); + {{^hasDiscriminatorWithNonEmptyMapping}} + factory {{classname}}.fromJson(Map json) => _${{classname}}FromJson(json); + {{/hasDiscriminatorWithNonEmptyMapping}} + {{#hasDiscriminatorWithNonEmptyMapping}} + factory {{classname}}.fromJson(Map json) { + {{#discriminator}} + switch(json['{{propertyBaseName}}']){ + {{#mappedModels}} + case '{{mappingName}}': + return {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}( + {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} : {{modelName}}.fromJson(json), + ); + {{/mappedModels}} + } + {{/discriminator}} + return {{classname}}.unknown(json: json); + } + {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-pure}} {{^vendorExtensions.x-is-pure}} {{#vendorExtensions.x-is-child}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache index 3ede1a335975..e5711b6f25cf 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum.mustache @@ -8,6 +8,6 @@ enum {{classname}} { {{{name}}}(value: {{#isString}}r{{/isString}}{{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/enumVars}} const {{classname}}({required this.value}); - final String value; + final {{dataType}} value; {{/allowableValues}} } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache index 26685406fd89..3c94941bfd9c 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/enum_inline.mustache @@ -9,6 +9,6 @@ enum {{enumName}} { {{{name}}}(value: {{#isString}}r{{/isString}}{{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/enumVars}} const {{enumName}}({required this.value}); - final String value; + final {{baseType}} value; {{/allowableValues}} } \ No newline at end of file From 6bb3aa28d389290aabecf3dc4f3e4fbdcc663f3a Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Tue, 27 Aug 2024 07:49:28 +0200 Subject: [PATCH 34/48] fix: parsing of oneOF and AnyOf types with no discriminator, with discriminator and with discriminator mapping. --- .../languages/DartDioClientCodegen.java | 10 +- .../dart/libraries/dio/pubspec.mustache | 8 +- .../freezed/class_from_json.mustache | 114 ++++++++++++------ 3 files changed, 87 insertions(+), 45 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 829d898baa96..0f522996e998 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -325,7 +325,15 @@ private void configureSerializationLibraryFreezed(String srcFolder) { languageSpecificPrimitives.add("Object"); imports.put("Uint8List", "dart:typed_data"); imports.put("MultipartFile", DIO_IMPORT); - + // A lambda which removes the model name prefix and suffix. Used mainly for default descrimator class name + // mapping in fromJson methods for unions in freezed. + additionalProperties.put("DelModelNamePrefixSuffix", (Mustache.Lambda) (fragment, writer) -> { + String content = fragment.execute(); + content = content.trim().replaceAll("\n", ""); + content = content.replaceAll(this.modelNamePrefix, ""); + content = content.replaceAll(this.modelNameSuffix, ""); + writer.write(content); + }); // A lambda which transforms Types for naming factory constructors inFreezed unions. additionalProperties.put("PrimitiveInUnion", (Mustache.Lambda) (fragment, writer) -> { String content = fragment.execute(); 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 ca6d9053ecf5..eb4d63687e76 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 @@ -32,8 +32,8 @@ dependencies: json_annotation: '^4.4.0' {{/useJsonSerializable}} {{#useFreezed}} - freezed_annotation: '^2.4.1' - json_annotation: '^4.8.1' + freezed_annotation: '^2.4.4' + json_annotation: '^4.9.0' {{/useFreezed}} {{#useDateLibTimeMachine}} time_machine: ^0.9.16 @@ -49,8 +49,8 @@ dev_dependencies: json_serializable: '^6.1.5' {{/useJsonSerializable}} {{#useFreezed}} - freezed: '^2.4.2' - json_serializable: '^6.7.1' + freezed: '^2.5.2' + json_serializable: '^6.8.0' build_runner: any {{/useFreezed}} test: ^1.16.0 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache index 9e397e7ac2bd..ce586de71468 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache @@ -48,49 +48,83 @@ {{^vendorExtensions.x-is-child}} {{^hasDiscriminatorWithNonEmptyMapping}} factory {{classname}}.fromJson(Map json) { - final fromJsonMethods = >[{{#anyOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/anyOf}}{{#oneOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/oneOf}}]; - final deserializedModels = <{{classname}}>[]; {{classname}}? deserializedModel; - for (final fromJsonMethod in fromJsonMethods) { - try { - final dynamic parsedModel= fromJsonMethod.call(json); - // Note following line won't be executed if already the above parsing fails. - switch (deserializedModel.runtimeType) { - {{#anyOf}} - case {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: - deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( - {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel as {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}, - ); - break; - {{/anyOf}} - {{#oneOf}} - case {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: - deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( - {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel as {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}, - ); - break; - {{/oneOf}} - default: - deserializedModel = {{classname}}.unknown(json: json,); + {{#discriminator}} + // A discriminator property is specified but no mapping + // is provided in the spec, so we expect the property to + // have the value of the name of the model. Model prefix & + // suffix are ignored, as this is not known by the api provider + switch(json['{{propertyBaseName}}']){ + {{#anyOf}} + case '{{#DelModelNamePrefixSuffix}}{{{.}}}{{/DelModelNamePrefixSuffix}}': + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.fromJson(json), + ); + break; + {{/anyOf}} + {{#oneOf}} + case '{{#DelModelNamePrefixSuffix}}{{{.}}}{{/DelModelNamePrefixSuffix}}': + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.fromJson(json), + ); + break; + {{/oneOf}} + default: + break; + } + {{/discriminator}} + {{^discriminator}} + // A discriminator property is not defined in the spec so + // we try to parse the json against all the models and try to + // return one of the valid model. Note: this approach tries + // to return one valid model and if more than one model + // is valid it then returns unknown type along with the json so + // the consumer can decide which model it is. + final fromJsonMethods = >[{{#anyOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/anyOf}}{{#oneOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/oneOf}}]; + final deserializedModels = <{{classname}}>[]; + for (final fromJsonMethod in fromJsonMethods) { + try { + final dynamic parsedModel= fromJsonMethod.call(json); + // Note following line won't be executed if already the above parsing fails. + switch (parsedModel) { + {{#anyOf}} + case {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel as {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}, + ); + break; + {{/anyOf}} + {{#oneOf}} + case {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel as {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}, + ); + break; + {{/oneOf}} + default: + deserializedModel = {{classname}}.unknown(json: json,); + } + deserializedModels.add(deserializedModel); + } catch (e) { + // We are suppressing the deserialization error when the json could not + // be parsed into one of the model. Because we return [{{classname}}.unknown] + // if the deserialization fails. } - deserializedModels.add(deserializedModel); - } catch (e) { - // We are suppressing the deserialization error when the json could not - // be parsed into one of the model. Because we return [{{classname}}.unknown] - // if the deserialization fails. } - } - // Return an unknown type when the incoming json parses into more than one models. - // Since we pass deserializedModels, clients can still use the deserialized model. - // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. - // So we still return this as an unknown type. - if(deserializedModels.length > 1){ - deserializedModel = {{classname}}.unknown( - json: json, - deserializedModels: deserializedModels, - errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, - ); - } + // Return an unknown type when the incoming json parses into more than one models. + // Since we pass deserializedModels, clients can still use the deserialized model. + // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. + // So we still return this as an unknown type. + if(deserializedModels.length > 1){ + deserializedModel = {{classname}}.unknown( + json: json, + deserializedModels: deserializedModels, + errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, + ); + } + {{/discriminator}} + + return deserializedModel ?? {{classname}}.unknown(json: json); } {{/hasDiscriminatorWithNonEmptyMapping}} From 265dd6e36602d9a29c23dbdf5a931a9c0914b511 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Fri, 6 Sep 2024 21:55:05 +0200 Subject: [PATCH 35/48] fix: parsing of oneOF and AnyOf types with no discriminator simply using an if else block. --- .../freezed/class_from_json.mustache | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache index ce586de71468..e937bd72d231 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache @@ -86,23 +86,22 @@ try { final dynamic parsedModel= fromJsonMethod.call(json); // Note following line won't be executed if already the above parsing fails. - switch (parsedModel) { - {{#anyOf}} - case {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: - deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( - {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel as {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}, - ); - break; - {{/anyOf}} - {{#oneOf}} - case {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: - deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( - {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel as {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}, - ); - break; - {{/oneOf}} - default: - deserializedModel = {{classname}}.unknown(json: json,); + {{#anyOf}} + if (parsedModel is {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) { + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel, + ); + } else + {{/anyOf}} + {{#oneOf}} + if (parsedModel is {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) { + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel, + ); + } else + {{/oneOf}} + { + deserializedModel = {{classname}}.unknown(json: json); } deserializedModels.add(deserializedModel); } catch (e) { From a5c2f621e174b7753431bd9da8263c0b0560a94a Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 7 Sep 2024 07:46:22 +0200 Subject: [PATCH 36/48] chore: remove tabs in mustache files. --- .../dio/serialization/freezed/variable_type.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache index 2ba560a129a6..e70ac3cdb41a 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/variable_type.mustache @@ -1,9 +1,9 @@ {{! Required Nullable Result -true true required Type? -true false required Type -false true Type? -false false Type? +true true required Type? +true false required Type +false true Type? +false false Type? }} {{#required}} From 8ba8b78b2085c60651abb717457bc8e49addd691 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 7 Sep 2024 08:19:52 +0200 Subject: [PATCH 37/48] test: add samples config yaml for freezed --- bin/configs/dart-dio-oneof-freezed.yaml | 12 ++++++++++++ ...o-oneof-polymorphism-and-inheritance-freezed.yaml | 12 ++++++++++++ bin/configs/dart-dio-oneof-primitive-freezed.yaml | 12 ++++++++++++ .../dart-dio-petstore-client-lib-fake-freezed.yaml | 12 ++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 bin/configs/dart-dio-oneof-freezed.yaml create mode 100644 bin/configs/dart-dio-oneof-polymorphism-and-inheritance-freezed.yaml create mode 100644 bin/configs/dart-dio-oneof-primitive-freezed.yaml create mode 100644 bin/configs/dart-dio-petstore-client-lib-fake-freezed.yaml diff --git a/bin/configs/dart-dio-oneof-freezed.yaml b/bin/configs/dart-dio-oneof-freezed.yaml new file mode 100644 index 000000000000..9b9f7682a8d8 --- /dev/null +++ b/bin/configs/dart-dio-oneof-freezed.yaml @@ -0,0 +1,12 @@ +generatorName: dart-dio +outputDir: samples/openapi3/client/petstore/dart-dio/oneof-freezed +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + serializationLibrary: "freezed" + diff --git a/bin/configs/dart-dio-oneof-polymorphism-and-inheritance-freezed.yaml b/bin/configs/dart-dio-oneof-polymorphism-and-inheritance-freezed.yaml new file mode 100644 index 000000000000..ad469b3f81e2 --- /dev/null +++ b/bin/configs/dart-dio-oneof-polymorphism-and-inheritance-freezed.yaml @@ -0,0 +1,12 @@ +generatorName: dart-dio +outputDir: samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" + serializationLibrary: "freezed" diff --git a/bin/configs/dart-dio-oneof-primitive-freezed.yaml b/bin/configs/dart-dio-oneof-primitive-freezed.yaml new file mode 100644 index 000000000000..b0e8a3787e95 --- /dev/null +++ b/bin/configs/dart-dio-oneof-primitive-freezed.yaml @@ -0,0 +1,12 @@ +generatorName: dart-dio +outputDir: samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_primitive.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" + serializationLibrary: "freezed" diff --git a/bin/configs/dart-dio-petstore-client-lib-fake-freezed.yaml b/bin/configs/dart-dio-petstore-client-lib-fake-freezed.yaml new file mode 100644 index 000000000000..166317b96d48 --- /dev/null +++ b/bin/configs/dart-dio-petstore-client-lib-fake-freezed.yaml @@ -0,0 +1,12 @@ +generatorName: dart-dio +outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed +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: "freezed" From f9696412b47ba0aca15930829d9f9a4d09794b36 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 7 Sep 2024 08:21:26 +0200 Subject: [PATCH 38/48] test: generate samples for freezed --- .../dart-dio/oneof-freezed/.gitignore | 41 + .../oneof-freezed/.openapi-generator-ignore | 23 + .../oneof-freezed/.openapi-generator/FILES | 22 + .../oneof-freezed/.openapi-generator/VERSION | 1 + .../petstore/dart-dio/oneof-freezed/README.md | 85 + .../oneof-freezed/analysis_options.yaml | 11 + .../dart-dio/oneof-freezed/build.yaml | 11 + .../dart-dio/oneof-freezed/doc/Apple.md | 15 + .../dart-dio/oneof-freezed/doc/Banana.md | 15 + .../dart-dio/oneof-freezed/doc/DefaultApi.md | 51 + .../dart-dio/oneof-freezed/doc/Fruit.md | 17 + .../dart-dio/oneof-freezed/lib/openapi.dart | 15 + .../dart-dio/oneof-freezed/lib/src/api.dart | 68 + .../lib/src/api/default_api.dart | 88 + .../lib/src/auth/api_key_auth.dart | 30 + .../oneof-freezed/lib/src/auth/auth.dart | 18 + .../lib/src/auth/basic_auth.dart | 37 + .../lib/src/auth/bearer_auth.dart | 26 + .../oneof-freezed/lib/src/auth/oauth.dart | 26 + .../oneof-freezed/lib/src/model/apple.dart | 40 + .../oneof-freezed/lib/src/model/banana.dart | 40 + .../oneof-freezed/lib/src/model/fruit.dart | 106 + .../oneof-freezed/lib/src/model/models.dart | 20 + .../lib/src/model/primitive_union_types.dart | 60 + .../dart-dio/oneof-freezed/pubspec.yaml | 18 + .../oneof-freezed/test/apple_test.dart | 16 + .../oneof-freezed/test/banana_test.dart | 16 + .../oneof-freezed/test/default_api_test.dart | 16 + .../oneof-freezed/test/fruit_test.dart | 26 + .../.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 75 + .../.openapi-generator/VERSION | 1 + .../README.md | 104 + .../analysis_options.yaml | 11 + .../build.yaml | 11 + .../doc/Addressable.md | 16 + .../doc/Apple.md | 15 + .../doc/Banana.md | 15 + .../doc/Bar.md | 22 + .../doc/BarApi.md | 55 + .../doc/BarCreate.md | 22 + .../doc/BarRef.md | 21 + .../doc/BarRefOrValue.md | 24 + .../doc/Entity.md | 19 + .../doc/EntityRef.md | 21 + .../doc/Extensible.md | 17 + .../doc/Foo.md | 21 + .../doc/FooApi.md | 93 + .../doc/FooRef.md | 22 + .../doc/FooRefOrValue.md | 24 + .../doc/Fruit.md | 17 + .../doc/FruitType.md | 14 + .../doc/Pasta.md | 20 + .../doc/Pizza.md | 20 + .../doc/PizzaSpeziale.md | 21 + .../lib/openapi.dart | 16 + .../lib/src/api.dart | 75 + .../lib/src/api/bar_api.dart | 109 + .../lib/src/api/foo_api.dart | 180 ++ .../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/model/addressable.dart | 46 + .../lib/src/model/apple.dart | 40 + .../lib/src/model/banana.dart | 40 + .../lib/src/model/bar.dart | 72 + .../lib/src/model/bar_create.dart | 73 + .../lib/src/model/bar_ref.dart | 71 + .../lib/src/model/bar_ref_or_value.dart | 113 ++ .../lib/src/model/entity.dart | 104 + .../lib/src/model/entity_ref.dart | 74 + .../lib/src/model/extensible.dart | 51 + .../lib/src/model/foo.dart | 69 + .../lib/src/model/foo_ref.dart | 75 + .../lib/src/model/foo_ref_or_value.dart | 88 + .../lib/src/model/fruit.dart | 70 + .../lib/src/model/fruit_type.dart | 16 + .../lib/src/model/models.dart | 20 + .../lib/src/model/pasta.dart | 65 + .../lib/src/model/pizza.dart | 65 + .../lib/src/model/pizza_speziale.dart | 69 + .../lib/src/model/primitive_union_types.dart | 60 + .../pubspec.yaml | 18 + .../test/addressable_test.dart | 23 + .../test/apple_test.dart | 16 + .../test/banana_test.dart | 16 + .../test/bar_api_test.dart | 18 + .../test/bar_create_test.dart | 56 + .../test/bar_ref_or_value_test.dart | 68 + .../test/bar_ref_test.dart | 53 + .../test/bar_test.dart | 55 + .../test/entity_ref_test.dart | 53 + .../test/entity_test.dart | 41 + .../test/extensible_test.dart | 29 + .../test/foo_api_test.dart | 25 + .../test/foo_ref_or_value_test.dart | 68 + .../test/foo_ref_test.dart | 58 + .../test/foo_test.dart | 51 + .../test/fruit_test.dart | 26 + .../test/fruit_type_test.dart | 9 + .../test/pasta_test.dart | 46 + .../test/pizza_speziale_test.dart | 51 + .../test/pizza_test.dart | 46 + .../oneof_primitive_freezed/.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 24 + .../.openapi-generator/VERSION | 1 + .../oneof_primitive_freezed/README.md | 84 + .../analysis_options.yaml | 11 + .../oneof_primitive_freezed/build.yaml | 11 + .../oneof_primitive_freezed/doc/Child.md | 15 + .../oneof_primitive_freezed/doc/DefaultApi.md | 51 + .../oneof_primitive_freezed/doc/Example.md | 15 + .../oneof_primitive_freezed/lib/openapi.dart | 15 + .../oneof_primitive_freezed/lib/src/api.dart | 68 + .../lib/src/api/default_api.dart | 88 + .../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/model/child.dart | 40 + .../lib/src/model/example.dart | 104 + .../lib/src/model/models.dart | 20 + .../lib/src/model/primitive_union_types.dart | 60 + .../oneof_primitive_freezed/pubspec.yaml | 18 + .../test/child_test.dart | 16 + .../test/default_api_test.dart | 16 + .../test/example_test.dart | 16 + .../.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 186 ++ .../.openapi-generator/VERSION | 1 + .../README.md | 211 ++ .../analysis_options.yaml | 11 + .../build.yaml | 11 + .../doc/AdditionalPropertiesClass.md | 16 + .../doc/AllOfWithSingleRef.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/Category.md | 16 + .../doc/ChildWithNullable.md | 17 + .../doc/ClassModel.md | 15 + .../doc/DefaultApi.md | 51 + .../doc/DeprecatedObject.md | 15 + .../doc/Dog.md | 17 + .../doc/EnumArrays.md | 16 + .../doc/EnumTest.md | 22 + .../doc/FakeApi.md | 1028 ++++++++++ .../doc/FakeBigDecimalMap200Response.md | 16 + .../doc/FakeClassnameTags123Api.md | 61 + .../doc/FileSchemaTestClass.md | 16 + .../doc/Foo.md | 15 + .../doc/FooGetDefaultResponse.md | 15 + .../doc/FormatTest.md | 30 + .../doc/HasOnlyReadOnly.md | 16 + .../doc/HealthCheckResult.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/ParentWithNullable.md | 16 + .../doc/Pet.md | 20 + .../doc/PetApi.md | 439 ++++ .../doc/ReadOnlyFirst.md | 16 + .../doc/SingleRefType.md | 14 + .../doc/SpecialModelName.md | 15 + .../doc/StoreApi.md | 188 ++ .../doc/Tag.md | 16 + ...lineFreeformAdditionalPropertiesRequest.md | 15 + .../doc/User.md | 22 + .../doc/UserApi.md | 359 ++++ .../lib/openapi.dart | 21 + .../lib/src/api.dart | 110 + .../lib/src/api/another_fake_api.dart | 109 + .../lib/src/api/default_api.dart | 88 + .../lib/src/api/fake_api.dart | 1761 +++++++++++++++++ .../src/api/fake_classname_tags123_api.dart | 116 ++ .../lib/src/api/pet_api.dart | 760 +++++++ .../lib/src/api/store_api.dart | 306 +++ .../lib/src/api/user_api.dart | 534 +++++ .../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 + .../model/additional_properties_class.dart | 50 + .../lib/src/model/all_of_with_single_ref.dart | 44 + .../lib/src/model/animal.dart | 69 + .../lib/src/model/api_response.dart | 48 + .../model/array_of_array_of_number_only.dart | 44 + .../lib/src/model/array_of_number_only.dart | 42 + .../lib/src/model/array_test.dart | 58 + .../lib/src/model/capitalization.dart | 61 + .../lib/src/model/cat.dart | 48 + .../lib/src/model/category.dart | 44 + .../lib/src/model/child_with_nullable.dart | 56 + .../lib/src/model/class_model.dart | 40 + .../lib/src/model/deprecated_object.dart | 40 + .../lib/src/model/dog.dart | 48 + .../lib/src/model/enum_arrays.dart | 65 + .../lib/src/model/enum_test.dart | 106 + .../fake_big_decimal_map200_response.dart | 46 + .../lib/src/model/file_schema_test_class.dart | 46 + .../lib/src/model/foo.dart | 40 + .../src/model/foo_get_default_response.dart | 40 + .../lib/src/model/format_test.dart | 102 + .../lib/src/model/has_only_read_only.dart | 44 + .../lib/src/model/health_check_result.dart | 40 + .../lib/src/model/map_test.dart | 72 + ...rties_and_additional_properties_class.dart | 50 + .../lib/src/model/model200_response.dart | 44 + .../lib/src/model/model_client.dart | 40 + .../lib/src/model/model_enum_class.dart | 17 + .../lib/src/model/model_file.dart | 41 + .../lib/src/model/model_list.dart | 40 + .../lib/src/model/model_return.dart | 40 + .../lib/src/model/models.dart | 20 + .../lib/src/model/name.dart | 52 + .../lib/src/model/nullable_class.dart | 96 + .../lib/src/model/number_only.dart | 40 + .../model/object_with_deprecated_fields.dart | 54 + .../lib/src/model/order.dart | 71 + .../lib/src/model/outer_composite.dart | 48 + .../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 | 40 + .../lib/src/model/parent_with_nullable.dart | 69 + .../lib/src/model/pet.dart | 75 + .../lib/src/model/primitive_union_types.dart | 60 + .../lib/src/model/read_only_first.dart | 44 + .../lib/src/model/single_ref_type.dart | 16 + .../lib/src/model/special_model_name.dart | 40 + .../lib/src/model/tag.dart | 44 + ...reeform_additional_properties_request.dart | 40 + .../lib/src/model/user.dart | 69 + .../pubspec.yaml | 18 + .../additional_properties_class_test.dart | 21 + .../test/all_of_with_single_ref_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_test.dart | 26 + .../test/category_test.dart | 21 + .../test/child_with_nullable_test.dart | 26 + .../test/class_model_test.dart | 16 + .../test/default_api_test.dart | 16 + .../test/deprecated_object_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 | 183 ++ ...fake_big_decimal_map200_response_test.dart | 21 + .../test/fake_classname_tags123_api_test.dart | 20 + .../test/file_schema_test_class_test.dart | 21 + .../test/foo_get_default_response_test.dart | 16 + .../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/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/parent_with_nullable_test.dart | 21 + .../test/pet_api_test.dart | 92 + .../test/pet_test.dart | 42 + .../test/read_only_first_test.dart | 21 + .../test/single_ref_type_test.dart | 9 + .../test/special_model_name_test.dart | 16 + .../test/store_api_test.dart | 47 + .../test/tag_test.dart | 21 + ...rm_additional_properties_request_test.dart | 16 + .../test/user_api_test.dart | 83 + .../test/user_test.dart | 52 + 320 files changed, 16869 insertions(+) create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/build.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Apple.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Banana.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Fruit.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/apple.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/banana.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/fruit.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/models.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/primitive_union_types.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/apple_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/banana_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/fruit_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/build.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Addressable.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Apple.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Banana.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Bar.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarCreate.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRefOrValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Entity.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/EntityRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Extensible.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Foo.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRefOrValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Fruit.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FruitType.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pasta.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pizza.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/PizzaSpeziale.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/addressable.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/apple.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/banana.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_create.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref_or_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/extensible.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref_or_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit_type.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/models.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pasta.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza_speziale.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/primitive_union_types.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/addressable_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/apple_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/banana_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_create_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_or_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/extensible_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_or_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_type_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pasta_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_speziale_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/build.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Child.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Example.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/child.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/example.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/models.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/primitive_union_types.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/child_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/example_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/build.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AllOfWithSingleRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Animal.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Capitalization.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Cat.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Category.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ChildWithNullable.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ClassModel.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/DeprecatedObject.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Dog.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/EnumTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeBigDecimalMap200Response.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Foo.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FooGetDefaultResponse.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FormatTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/MapTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Model200Response.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelClient.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelEnumClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelFile.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelList.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Name.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/NullableClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ObjectWithDeprecatedFields.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Order.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterObjectWithEnumProperty.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ParentWithNullable.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Pet.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/PetApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/SingleRefType.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/StoreApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Tag.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/TestInlineFreeformAdditionalPropertiesRequest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/User.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/UserApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/all_of_with_single_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/animal.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/api_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/capitalization.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/cat.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/category.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/child_with_nullable.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/class_model.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/deprecated_object.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/dog.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_arrays.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/fake_big_decimal_map200_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/file_schema_test_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo_get_default_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/format_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/has_only_read_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/health_check_result.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/map_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/mixed_properties_and_additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model200_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_client.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_enum_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_file.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_list.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_return.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/models.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/nullable_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/object_with_deprecated_fields.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/order.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_composite.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_object_with_enum_property.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/parent_with_nullable.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/pet.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/primitive_union_types.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/read_only_first.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/single_ref_type.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/special_model_name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/tag.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/test_inline_freeform_additional_properties_request.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/user.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/all_of_with_single_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/animal_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/another_fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/api_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/capitalization_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/cat_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/category_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/child_with_nullable_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/class_model_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/deprecated_object_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/dog_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/enum_arrays_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/enum_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_big_decimal_map200_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_classname_tags123_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/file_schema_test_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_get_default_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/format_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/has_only_read_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/health_check_result_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/map_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/mixed_properties_and_additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model200_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_client_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_enum_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_file_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_list_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_return_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/nullable_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/object_with_deprecated_fields_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/order_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_composite_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_integer_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_integer_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_object_with_enum_property_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/parent_with_nullable_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/read_only_first_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/single_ref_type_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/special_model_name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/store_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/tag_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/test_inline_freeform_additional_properties_request_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.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/oneof-freezed/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.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/oneof-freezed/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/FILES new file mode 100644 index 000000000000..fa20c48ff1e4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +analysis_options.yaml +build.yaml +doc/Apple.md +doc/Banana.md +doc/DefaultApi.md +doc/Fruit.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/default_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/model/apple.dart +lib/src/model/banana.dart +lib/src/model/fruit.dart +lib/src/model/models.dart +lib/src/model/primitive_union_types.dart +pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/VERSION new file mode 100644 index 000000000000..17f2442ff3bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/README.md b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/README.md new file mode 100644 index 000000000000..e382c9ec6ea0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/README.md @@ -0,0 +1,85 @@ +# openapi (EXPERIMENTAL) +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.0.1 +- Generator version: 7.9.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## 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().getDefaultApi(); + +try { + final response = await api.rootGet(); + print(response); +} catch on DioException (e) { + print("Exception when calling DefaultApi->rootGet: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*DefaultApi*](doc/DefaultApi.md) | [**rootGet**](doc/DefaultApi.md#rootget) | **GET** / | + + +## Documentation For Models + + - [Apple](doc/Apple.md) + - [Banana](doc/Banana.md) + - [Fruit](doc/Fruit.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/analysis_options.yaml new file mode 100644 index 000000000000..8ff047ce7675 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strict-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart + - lib/src/model/*.freezed.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/build.yaml b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/build.yaml new file mode 100644 index 000000000000..dee5edd67f90 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/build.yaml @@ -0,0 +1,11 @@ +targets: + $default: + builders: + freezed|freezed: + # This restricts freezed build runner to look + # files only inside models folder. + # If you prefer the build runner to scan the whole + # project for files then simply remove this build.yaml file + generate_for: + include: + - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Apple.md new file mode 100644 index 000000000000..c7f711b87cef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Apple.md @@ -0,0 +1,15 @@ +# openapi.model.Apple + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **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/oneof-freezed/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Banana.md new file mode 100644 index 000000000000..bef8a58a4276 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Banana.md @@ -0,0 +1,15 @@ +# openapi.model.Banana + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **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/oneof-freezed/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/DefaultApi.md new file mode 100644 index 000000000000..b010661371f9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/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://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**rootGet**](DefaultApi.md#rootget) | **GET** / | + + +# **rootGet** +> Fruit rootGet() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.rootGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->rootGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Fruit**](Fruit.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/oneof-freezed/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Fruit.md new file mode 100644 index 000000000000..5d48cc6e6d38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Fruit.md @@ -0,0 +1,17 @@ +# openapi.model.Fruit + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**kind** | **String** | | [optional] +**count** | **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/oneof-freezed/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/openapi.dart new file mode 100644 index 000000000000..581830866afb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/openapi.dart @@ -0,0 +1,15 @@ +// +// 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/bearer_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; + + +export 'package:openapi/src/api/default_api.dart'; + + +export 'package:openapi/src/model/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api.dart new file mode 100644 index 000000000000..8943da413f65 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api.dart @@ -0,0 +1,68 @@ +// +// 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/default_api.dart'; + +class Openapi { + static const String basePath = r'http://localhost'; + + final Dio dio; + Openapi({ + Dio? dio, + String? basePathOverride, + List? interceptors, + }) : + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 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 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); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart new file mode 100644 index 000000000000..581c8cfdce0b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.dart'; + + +class DefaultApi { + + final Dio _dio; + + const DefaultApi(this._dio); + + /// rootGet + /// + /// + /// 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 [Fruit] as data + /// Throws [DioException] if API call or serialization fails + Future> rootGet({ + + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/'; + 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, + ); + + Fruit _responseData; + + try { + _responseData = Fruit.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/oneof-freezed/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/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/oneof-freezed/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/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/oneof-freezed/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b65ccb5b71f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/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']?.toLowerCase() == '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/oneof-freezed/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..8f46678761b2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/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']?.toLowerCase() == '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/oneof-freezed/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/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/oneof-freezed/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/apple.dart new file mode 100644 index 000000000000..24e1d263d4c6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/apple.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Apple + /// + /// Properties: + /// * [kind] + +@freezed +class Apple with _$Apple { +const Apple._(); + + + const factory Apple({ + @JsonKey(name: r'kind') + String? + kind, +}) = _Apple; + + + + + factory Apple.fromJson(Map json) => _$AppleFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/banana.dart new file mode 100644 index 000000000000..3d3bf3238989 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/banana.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Banana + /// + /// Properties: + /// * [count] + +@freezed +class Banana with _$Banana { +const Banana._(); + + + const factory Banana({ + @JsonKey(name: r'count') + num? + count, +}) = _Banana; + + + + + factory Banana.fromJson(Map json) => _$BananaFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/fruit.dart new file mode 100644 index 000000000000..5e4dfbf65182 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/fruit.dart @@ -0,0 +1,106 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Fruit + /// + /// Properties: + /// * [color] + /// * [kind] + /// * [count] + +@freezed +class Fruit with _$Fruit { +const Fruit._(); + + + + + const factory Fruit.asApple({ + required Apple appleValue + }) = FruitAsApple; + const factory Fruit.asBanana({ + required Banana bananaValue + }) = FruitAsBanana; + const factory Fruit.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([Apple,Banana,]) List possibleTypes, + @Default([]) List deserializedModels, + }) = FruitUnknown; + + + + + factory Fruit.fromJson(Map json) { + Fruit? deserializedModel; + // A discriminator property is not defined in the spec so + // we try to parse the json against all the models and try to + // return one of the valid model. Note: this approach tries + // to return one valid model and if more than one model + // is valid it then returns unknown type along with the json so + // the consumer can decide which model it is. + final fromJsonMethods = >[Apple.fromJson,Banana.fromJson,]; + final deserializedModels = []; + for (final fromJsonMethod in fromJsonMethods) { + try { + final dynamic parsedModel= fromJsonMethod.call(json); + // Note following line won't be executed if already the above parsing fails. + if (parsedModel is Apple) { + deserializedModel = Fruit.asApple( + appleValue : parsedModel, + ); + } else + if (parsedModel is Banana) { + deserializedModel = Fruit.asBanana( + bananaValue : parsedModel, + ); + } else + { + deserializedModel = Fruit.unknown(json: json); + } + deserializedModels.add(deserializedModel); + } catch (e) { + // We are suppressing the deserialization error when the json could not + // be parsed into one of the model. Because we return [Fruit.unknown] + // if the deserialization fails. + } + } + // Return an unknown type when the incoming json parses into more than one models. + // Since we pass deserializedModels, clients can still use the deserialized model. + // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. + // So we still return this as an unknown type. + if(deserializedModels.length > 1){ + deserializedModel = Fruit.unknown( + json: json, + deserializedModels: deserializedModels, + errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, + ); + } + + + return deserializedModel ?? Fruit.unknown(json: json); + } + + + + Map toJson() { + return when( + asApple: (asApple) => asApple.toJson(), + asBanana: (asBanana) => asBanana.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/models.dart new file mode 100644 index 000000000000..3669a6b40ac4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/models.dart @@ -0,0 +1,20 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:dio/dio.dart'; +import 'dart:convert'; + +part 'models.freezed.dart'; +part 'models.g.dart'; + +part 'primitive_union_types.dart'; +part 'apple.dart';part 'banana.dart';part 'fruit.dart'; + +/// A typedef used in the deserialization of OneOf and AnyOf +/// models when no discriminator mapping is provided. +typedef FromJsonMethodType = T Function(Map); + +/// Deserialization error types for OneOf and AnyOf types. +enum DeserializationErrorType { + MoreThanOneTypeSatisfied, + UnKnownType, +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/primitive_union_types.dart new file mode 100644 index 000000000000..fafa083471b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/primitive_union_types.dart @@ -0,0 +1,60 @@ +part of 'models.dart'; + +@freezed +class IntInUnion with _$IntInUnion{ + const factory IntInUnion({ + required int intValue + }) = _IntInUnion; + + factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); +} + +@freezed +class StringInUnion with _$StringInUnion{ + const factory StringInUnion({ + required String stringValue + }) = _StringInUnion; + + factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); +} +@freezed +class BoolInUnion with _$BoolInUnion{ + const factory BoolInUnion({ + required bool boolValue + }) = _BoolInUnion; + + factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); +} + +@freezed +class DoubleInUnion with _$DoubleInUnion{ + const factory DoubleInUnion({ + required double doubleValue + }) = _DoubleInUnion; + + factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); +} + +@freezed +class ObjectInUnion with _$ObjectInUnion { + const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; + + factory ObjectInUnion.fromJson(Map json) => + _$ObjectInUnionFromJson(json); +} + +@freezed +class NumInUnion with _$NumInUnion{ + const factory NumInUnion({required num numValue}) = _NumInUnion; + + factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); +} + +@freezed +class DateTimeInUnion with _$DateTimeInUnion { +const factory DateTimeInUnion({required DateTime dateTimeValue}) = +_DateTimeInUnion; + +factory DateTimeInUnion.fromJson(Map json) => +_$DateTimeInUnionFromJson(json); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/pubspec.yaml new file mode 100644 index 000000000000..12925113115d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/pubspec.yaml @@ -0,0 +1,18 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '^3.0.0' + +dependencies: + dio: '^5.2.0' + freezed_annotation: '^2.4.4' + json_annotation: '^4.9.0' + +dev_dependencies: + freezed: '^2.5.2' + json_serializable: '^6.8.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/apple_test.dart new file mode 100644 index 000000000000..200492f8b1f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/apple_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Apple +void main() { + final Apple? instance = /* Apple(...) */ null; + // TODO add properties to the entity + + group(Apple, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/banana_test.dart new file mode 100644 index 000000000000..ae681c740af5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/banana_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Banana +void main() { + final Banana? instance = /* Banana(...) */ null; + // TODO add properties to the entity + + group(Banana, () { + // num count + test('to test the property `count`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/default_api_test.dart new file mode 100644 index 000000000000..07d256d2e554 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/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 rootGet() async + test('test rootGet', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/fruit_test.dart new file mode 100644 index 000000000000..8dfac99108f2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/fruit_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Fruit +void main() { + final Fruit? instance = /* Fruit(...) */ null; + // TODO add properties to the entity + + group(Fruit, () { + // String color + test('to test the property `color`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // num count + test('to test the property `count`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.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/oneof_polymorphism_and_inheritance_freezed/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.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/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES new file mode 100644 index 000000000000..ba0ca88ef8b5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES @@ -0,0 +1,75 @@ +.gitignore +.openapi-generator-ignore +README.md +analysis_options.yaml +build.yaml +doc/Addressable.md +doc/Apple.md +doc/Banana.md +doc/Bar.md +doc/BarApi.md +doc/BarCreate.md +doc/BarRef.md +doc/BarRefOrValue.md +doc/Entity.md +doc/EntityRef.md +doc/Extensible.md +doc/Foo.md +doc/FooApi.md +doc/FooRef.md +doc/FooRefOrValue.md +doc/Fruit.md +doc/FruitType.md +doc/Pasta.md +doc/Pizza.md +doc/PizzaSpeziale.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/bar_api.dart +lib/src/api/foo_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/model/addressable.dart +lib/src/model/apple.dart +lib/src/model/banana.dart +lib/src/model/bar.dart +lib/src/model/bar_create.dart +lib/src/model/bar_ref.dart +lib/src/model/bar_ref_or_value.dart +lib/src/model/entity.dart +lib/src/model/entity_ref.dart +lib/src/model/extensible.dart +lib/src/model/foo.dart +lib/src/model/foo_ref.dart +lib/src/model/foo_ref_or_value.dart +lib/src/model/fruit.dart +lib/src/model/fruit_type.dart +lib/src/model/models.dart +lib/src/model/pasta.dart +lib/src/model/pizza.dart +lib/src/model/pizza_speziale.dart +lib/src/model/primitive_union_types.dart +pubspec.yaml +test/addressable_test.dart +test/apple_test.dart +test/banana_test.dart +test/bar_api_test.dart +test/bar_create_test.dart +test/bar_ref_or_value_test.dart +test/bar_ref_test.dart +test/bar_test.dart +test/entity_ref_test.dart +test/entity_test.dart +test/extensible_test.dart +test/foo_api_test.dart +test/foo_ref_or_value_test.dart +test/foo_ref_test.dart +test/foo_test.dart +test/fruit_test.dart +test/fruit_type_test.dart +test/pasta_test.dart +test/pizza_speziale_test.dart +test/pizza_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/VERSION new file mode 100644 index 000000000000..17f2442ff3bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/README.md new file mode 100644 index 000000000000..2b9a132c0aa7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/README.md @@ -0,0 +1,104 @@ +# openapi (EXPERIMENTAL) +This tests for a oneOf interface representation + + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.0.1 +- Generator version: 7.9.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## 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().getBarApi(); +final BarCreate barCreate = ; // BarCreate | + +try { + final response = await api.createBar(barCreate); + print(response); +} catch on DioException (e) { + print("Exception when calling BarApi->createBar: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:8080* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*BarApi*](doc/BarApi.md) | [**createBar**](doc/BarApi.md#createbar) | **POST** /bar | Create a Bar +[*FooApi*](doc/FooApi.md) | [**createFoo**](doc/FooApi.md#createfoo) | **POST** /foo | Create a Foo +[*FooApi*](doc/FooApi.md) | [**getAllFoos**](doc/FooApi.md#getallfoos) | **GET** /foo | GET all Foos + + +## Documentation For Models + + - [Addressable](doc/Addressable.md) + - [Apple](doc/Apple.md) + - [Banana](doc/Banana.md) + - [Bar](doc/Bar.md) + - [BarCreate](doc/BarCreate.md) + - [BarRef](doc/BarRef.md) + - [BarRefOrValue](doc/BarRefOrValue.md) + - [Entity](doc/Entity.md) + - [EntityRef](doc/EntityRef.md) + - [Extensible](doc/Extensible.md) + - [Foo](doc/Foo.md) + - [FooRef](doc/FooRef.md) + - [FooRefOrValue](doc/FooRefOrValue.md) + - [Fruit](doc/Fruit.md) + - [FruitType](doc/FruitType.md) + - [Pasta](doc/Pasta.md) + - [Pizza](doc/Pizza.md) + - [PizzaSpeziale](doc/PizzaSpeziale.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/analysis_options.yaml new file mode 100644 index 000000000000..8ff047ce7675 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strict-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart + - lib/src/model/*.freezed.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/build.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/build.yaml new file mode 100644 index 000000000000..dee5edd67f90 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/build.yaml @@ -0,0 +1,11 @@ +targets: + $default: + builders: + freezed|freezed: + # This restricts freezed build runner to look + # files only inside models folder. + # If you prefer the build runner to scan the whole + # project for files then simply remove this build.yaml file + generate_for: + include: + - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Addressable.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Addressable.md new file mode 100644 index 000000000000..0fcd81b80382 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Addressable.md @@ -0,0 +1,16 @@ +# openapi.model.Addressable + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [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/oneof_polymorphism_and_inheritance_freezed/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Apple.md new file mode 100644 index 000000000000..13b34241ef81 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Apple.md @@ -0,0 +1,15 @@ +# openapi.model.Apple + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | + +[[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/oneof_polymorphism_and_inheritance_freezed/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Banana.md new file mode 100644 index 000000000000..4c5737d0c2e2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Banana.md @@ -0,0 +1,15 @@ +# openapi.model.Banana + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | + +[[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/oneof_polymorphism_and_inheritance_freezed/doc/Bar.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Bar.md new file mode 100644 index 000000000000..4cccc863a489 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Bar.md @@ -0,0 +1,22 @@ +# openapi.model.Bar + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/BarApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarApi.md new file mode 100644 index 000000000000..a6f23c00210c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarApi.md @@ -0,0 +1,55 @@ +# openapi.api.BarApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:8080* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createBar**](BarApi.md#createbar) | **POST** /bar | Create a Bar + + +# **createBar** +> Bar createBar(barCreate) + +Create a Bar + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getBarApi(); +final BarCreate barCreate = ; // BarCreate | + +try { + final response = api.createBar(barCreate); + print(response); +} catch on DioException (e) { + print('Exception when calling BarApi->createBar: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **barCreate** | [**BarCreate**](BarCreate.md)| | + +### Return type + +[**Bar**](Bar.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/oneof_polymorphism_and_inheritance_freezed/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarCreate.md new file mode 100644 index 000000000000..c0b4ba6edc9a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarCreate.md @@ -0,0 +1,22 @@ +# openapi.model.BarCreate + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/BarRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRef.md new file mode 100644 index 000000000000..cab0e7e57386 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRef.md @@ -0,0 +1,21 @@ +# openapi.model.BarRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRefOrValue.md new file mode 100644 index 000000000000..f88727e11aa8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRefOrValue.md @@ -0,0 +1,24 @@ +# openapi.model.BarRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | unique identifier | +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [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/oneof_polymorphism_and_inheritance_freezed/doc/Entity.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Entity.md new file mode 100644 index 000000000000..5ba2144b44fe --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Entity.md @@ -0,0 +1,19 @@ +# openapi.model.Entity + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/EntityRef.md new file mode 100644 index 000000000000..80eae55f4145 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/EntityRef.md @@ -0,0 +1,21 @@ +# openapi.model.EntityRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/Extensible.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Extensible.md new file mode 100644 index 000000000000..7a781e578ea4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Extensible.md @@ -0,0 +1,17 @@ +# openapi.model.Extensible + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Foo.md new file mode 100644 index 000000000000..2627691fefe5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Foo.md @@ -0,0 +1,21 @@ +# openapi.model.Foo + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fooPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/FooApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooApi.md new file mode 100644 index 000000000000..f1fe53aa31f2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooApi.md @@ -0,0 +1,93 @@ +# openapi.api.FooApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:8080* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createFoo**](FooApi.md#createfoo) | **POST** /foo | Create a Foo +[**getAllFoos**](FooApi.md#getallfoos) | **GET** /foo | GET all Foos + + +# **createFoo** +> FooRefOrValue createFoo(foo) + +Create a Foo + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFooApi(); +final Foo foo = ; // Foo | The Foo to be created + +try { + final response = api.createFoo(foo); + print(response); +} catch on DioException (e) { + print('Exception when calling FooApi->createFoo: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **foo** | [**Foo**](Foo.md)| The Foo to be created | [optional] + +### Return type + +[**FooRefOrValue**](FooRefOrValue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json;charset=utf-8 + - **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) + +# **getAllFoos** +> List getAllFoos() + +GET all Foos + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFooApi(); + +try { + final response = api.getAllFoos(); + print(response); +} catch on DioException (e) { + print('Exception when calling FooApi->getAllFoos: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<FooRefOrValue>**](FooRefOrValue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json;charset=utf-8 + +[[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/oneof_polymorphism_and_inheritance_freezed/doc/FooRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRef.md new file mode 100644 index 000000000000..bfa62bd4f54b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRef.md @@ -0,0 +1,22 @@ +# openapi.model.FooRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foorefPropA** | **String** | | [optional] +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRefOrValue.md new file mode 100644 index 000000000000..9bc8dec10571 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRefOrValue.md @@ -0,0 +1,24 @@ +# openapi.model.FooRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fooPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**foorefPropA** | **String** | | [optional] +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [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/oneof_polymorphism_and_inheritance_freezed/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Fruit.md new file mode 100644 index 000000000000..91c1f1cf9b55 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Fruit.md @@ -0,0 +1,17 @@ +# openapi.model.Fruit + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | [**FruitType**](FruitType.md) | | +**seeds** | **int** | | +**length** | **int** | | + +[[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/oneof_polymorphism_and_inheritance_freezed/doc/FruitType.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FruitType.md new file mode 100644 index 000000000000..ce2329c986ad --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FruitType.md @@ -0,0 +1,14 @@ +# openapi.model.FruitType + +## 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/oneof_polymorphism_and_inheritance_freezed/doc/Pasta.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pasta.md new file mode 100644 index 000000000000..034ff420d323 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pasta.md @@ -0,0 +1,20 @@ +# openapi.model.Pasta + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vendor** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/Pizza.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pizza.md new file mode 100644 index 000000000000..e4b040a6a79c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pizza.md @@ -0,0 +1,20 @@ +# openapi.model.Pizza + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pizzaSize** | **num** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/PizzaSpeziale.md new file mode 100644 index 000000000000..4e3800773dca --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/PizzaSpeziale.md @@ -0,0 +1,21 @@ +# openapi.model.PizzaSpeziale + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toppings** | **String** | | [optional] +**pizzaSize** | **num** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/openapi.dart new file mode 100644 index 000000000000..2dd7aa8bee7d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/openapi.dart @@ -0,0 +1,16 @@ +// +// 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/bearer_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; + + +export 'package:openapi/src/api/bar_api.dart'; +export 'package:openapi/src/api/foo_api.dart'; + + +export 'package:openapi/src/model/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api.dart new file mode 100644 index 000000000000..791892de5ea4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api.dart @@ -0,0 +1,75 @@ +// +// 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/bar_api.dart'; +import 'package:openapi/src/api/foo_api.dart'; + +class Openapi { + static const String basePath = r'http://localhost:8080'; + + final Dio dio; + Openapi({ + Dio? dio, + String? basePathOverride, + List? interceptors, + }) : + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 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 BarApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + BarApi getBarApi() { + return BarApi(dio); + } + + /// Get FooApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FooApi getFooApi() { + return FooApi(dio); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart new file mode 100644 index 000000000000..440e15c613d7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.dart'; + + +class BarApi { + + final Dio _dio; + + const BarApi(this._dio); + + /// Create a Bar + /// + /// + /// Parameters: + /// * [barCreate] + /// * [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 [Bar] as data + /// Throws [DioException] if API call or serialization fails + Future> createBar({ + + required BarCreate barCreate, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/bar'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData=jsonEncode(barCreate); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Bar _responseData; + + try { + _responseData = Bar.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart new file mode 100644 index 000000000000..4a727ff79430 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart @@ -0,0 +1,180 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.dart'; + + +class FooApi { + + final Dio _dio; + + const FooApi(this._dio); + + /// Create a Foo + /// + /// + /// Parameters: + /// * [foo] - The Foo to be created + /// * [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 [FooRefOrValue] as data + /// Throws [DioException] if API call or serialization fails + Future> createFoo({ + + Foo? foo, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json;charset=utf-8', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData=jsonEncode(foo); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FooRefOrValue _responseData; + + try { + _responseData = FooRefOrValue.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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, + ); + } + + /// GET all Foos + /// + /// + /// 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 [List] as data + /// Throws [DioException] if API call or serialization fails + Future>> getAllFoos({ + + 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, + ); + + List _responseData; + + try { + final _responseDataAsList = _response.data as List; + _responseData = _responseDataAsList.map((dynamic e)=> FooRefOrValue.fromJson(e as Map)).toList(); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/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/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/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/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b65ccb5b71f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/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']?.toLowerCase() == '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/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..8f46678761b2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/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']?.toLowerCase() == '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/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/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/oneof_polymorphism_and_inheritance_freezed/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/addressable.dart new file mode 100644 index 000000000000..ff1c69a84384 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/addressable.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Base schema for addressable entities + /// + /// Properties: + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + +@freezed +class Addressable with _$Addressable { +const Addressable._(); + + + const factory Addressable({ + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, +}) = _Addressable; + + + + + factory Addressable.fromJson(Map json) => _$AddressableFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/apple.dart new file mode 100644 index 000000000000..143bec0d76f1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/apple.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Apple + /// + /// Properties: + /// * [seeds] + +@freezed +class Apple with _$Apple { +const Apple._(); + + + const factory Apple({ + @JsonKey(name: r'seeds') + required int + seeds, +}) = _Apple; + + + + + factory Apple.fromJson(Map json) => _$AppleFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/banana.dart new file mode 100644 index 000000000000..9acc3dee8af8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/banana.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Banana + /// + /// Properties: + /// * [length] + +@freezed +class Banana with _$Banana { +const Banana._(); + + + const factory Banana({ + @JsonKey(name: r'length') + required int + length, +}) = _Banana; + + + + + factory Banana.fromJson(Map json) => _$BananaFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar.dart new file mode 100644 index 000000000000..20380a5d0872 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Bar + /// + /// Properties: + /// * [id] + /// * [barPropA] + /// * [fooPropB] + /// * [foo] + /// * [href] - Hyperlink reference + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Bar with _$Bar { +const Bar._(); + + + + const factory Bar({ + @JsonKey(name: r'id') + required String + id, + @JsonKey(name: r'barPropA') + String? + barPropA, + @JsonKey(name: r'fooPropB') + String? + fooPropB, + @JsonKey(name: r'foo') + FooRefOrValue? + foo, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _Bar; + + + + factory Bar.fromJson(Map json) => _$BarFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_create.dart new file mode 100644 index 000000000000..e781be79aaf8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_create.dart @@ -0,0 +1,73 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// BarCreate + /// + /// Properties: + /// * [barPropA] + /// * [fooPropB] + /// * [foo] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class BarCreate with _$BarCreate { +const BarCreate._(); + + + + const factory BarCreate({ + @JsonKey(name: r'barPropA') + String? + barPropA, + @JsonKey(name: r'fooPropB') + String? + fooPropB, + @JsonKey(name: r'foo') + FooRefOrValue? + foo, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _BarCreate; + + + + factory BarCreate.fromJson(Map json) => _$BarCreateFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref.dart new file mode 100644 index 000000000000..dfb59ba8a333 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// BarRef + /// + /// Properties: + /// * [name] - Name of the related entity. + /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class BarRef with _$BarRef { +const BarRef._(); + + + + const factory BarRef({ + /// Name of the related entity. + @JsonKey(name: r'name') + String? + name, + /// The actual type of the target instance when needed for disambiguation. + @JsonKey(name: r'@referredType') + String? + atReferredType, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _BarRef; + + + + factory BarRef.fromJson(Map json) => _$BarRefFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref_or_value.dart new file mode 100644 index 000000000000..d0cb4074e229 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref_or_value.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// BarRefOrValue + /// + /// Properties: + /// * [id] - unique identifier + /// * [barPropA] + /// * [fooPropB] + /// * [foo] + /// * [href] - Hyperlink reference + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + /// * [name] - Name of the related entity. + /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. + +@freezed +class BarRefOrValue with _$BarRefOrValue { +const BarRefOrValue._(); + + + + + const factory BarRefOrValue.asBar({ + required Bar barValue + }) = BarRefOrValueAsBar; + const factory BarRefOrValue.asBarRef({ + required BarRef barRefValue + }) = BarRefOrValueAsBarRef; + const factory BarRefOrValue.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([Bar,BarRef,]) List possibleTypes, + @Default([]) List deserializedModels, + }) = BarRefOrValueUnknown; + + + + + factory BarRefOrValue.fromJson(Map json) { + BarRefOrValue? deserializedModel; + // A discriminator property is not defined in the spec so + // we try to parse the json against all the models and try to + // return one of the valid model. Note: this approach tries + // to return one valid model and if more than one model + // is valid it then returns unknown type along with the json so + // the consumer can decide which model it is. + final fromJsonMethods = >[Bar.fromJson,BarRef.fromJson,]; + final deserializedModels = []; + for (final fromJsonMethod in fromJsonMethods) { + try { + final dynamic parsedModel= fromJsonMethod.call(json); + // Note following line won't be executed if already the above parsing fails. + if (parsedModel is Bar) { + deserializedModel = BarRefOrValue.asBar( + barValue : parsedModel, + ); + } else + if (parsedModel is BarRef) { + deserializedModel = BarRefOrValue.asBarRef( + barRefValue : parsedModel, + ); + } else + { + deserializedModel = BarRefOrValue.unknown(json: json); + } + deserializedModels.add(deserializedModel); + } catch (e) { + // We are suppressing the deserialization error when the json could not + // be parsed into one of the model. Because we return [BarRefOrValue.unknown] + // if the deserialization fails. + } + } + // Return an unknown type when the incoming json parses into more than one models. + // Since we pass deserializedModels, clients can still use the deserialized model. + // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. + // So we still return this as an unknown type. + if(deserializedModels.length > 1){ + deserializedModel = BarRefOrValue.unknown( + json: json, + deserializedModels: deserializedModels, + errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, + ); + } + + + return deserializedModel ?? BarRefOrValue.unknown(json: json); + } + + + + Map toJson() { + return when( + asBar: (asBar) => asBar.toJson(), + asBarRef: (asBarRef) => asBarRef.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity.dart new file mode 100644 index 000000000000..e1a6d61dfe82 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity.dart @@ -0,0 +1,104 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Entity + /// + /// Properties: + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Entity with _$Entity { +const Entity._(); + + + + + const factory Entity.bar({ + required Bar bar, + }) = EntityBar; + const factory Entity.barCreate({ + required BarCreate barCreate, + }) = EntityBar_create; + const factory Entity.foo({ + required Foo foo, + }) = EntityFoo; + const factory Entity.pasta({ + required Pasta pasta, + }) = EntityPasta; + const factory Entity.pizza({ + required Pizza pizza, + }) = EntityPizza; + const factory Entity.pizzaspeziale({ + required PizzaSpeziale pizzaSpeziale, + }) = EntityPizzaspeziale; + const factory Entity.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([]) List possibleTypes, + @Default([]) List deserializedModels, + }) = EntityUnknown; + + + + factory Entity.fromJson(Map json) { + switch(json['@type']){ + case 'Bar': + return Entity.bar( + bar : Bar.fromJson(json), + ); + case 'Bar_Create': + return Entity.barCreate( + barCreate : BarCreate.fromJson(json), + ); + case 'Foo': + return Entity.foo( + foo : Foo.fromJson(json), + ); + case 'Pasta': + return Entity.pasta( + pasta : Pasta.fromJson(json), + ); + case 'Pizza': + return Entity.pizza( + pizza : Pizza.fromJson(json), + ); + case 'PizzaSpeziale': + return Entity.pizzaspeziale( + pizzaSpeziale : PizzaSpeziale.fromJson(json), + ); + } + return Entity.unknown(json: json); + } + + + + Map toJson() { + return when( + bar: (bar) => bar.toJson(), + barCreate: (barCreate) => barCreate.toJson(), + foo: (foo) => foo.toJson(), + pasta: (pasta) => pasta.toJson(), + pizza: (pizza) => pizza.toJson(), + pizzaspeziale: (pizzaSpeziale) => pizzaSpeziale.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity_ref.dart new file mode 100644 index 000000000000..9db823ea0619 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity_ref.dart @@ -0,0 +1,74 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Entity reference schema to be use for all entityRef class. + /// + /// Properties: + /// * [name] - Name of the related entity. + /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class EntityRef with _$EntityRef { +const EntityRef._(); + + + + + const factory EntityRef.barref({ + required BarRef barRef, + }) = EntityRefBarref; + const factory EntityRef.fooref({ + required FooRef fooRef, + }) = EntityRefFooref; + const factory EntityRef.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([]) List possibleTypes, + @Default([]) List deserializedModels, + }) = EntityRefUnknown; + + + + factory EntityRef.fromJson(Map json) { + switch(json['@type']){ + case 'BarRef': + return EntityRef.barref( + barRef : BarRef.fromJson(json), + ); + case 'FooRef': + return EntityRef.fooref( + fooRef : FooRef.fromJson(json), + ); + } + return EntityRef.unknown(json: json); + } + + + + Map toJson() { + return when( + barref: (barRef) => barRef.toJson(), + fooref: (fooRef) => fooRef.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/extensible.dart new file mode 100644 index 000000000000..258fa6502a3e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/extensible.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Extensible + /// + /// Properties: + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Extensible with _$Extensible { +const Extensible._(); + + + const factory Extensible({ + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _Extensible; + + + + + factory Extensible.fromJson(Map json) => _$ExtensibleFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo.dart new file mode 100644 index 000000000000..ac75d3ce0192 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Foo + /// + /// Properties: + /// * [fooPropA] + /// * [fooPropB] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Foo with _$Foo { +const Foo._(); + + + + const factory Foo({ + @JsonKey(name: r'fooPropA') + String? + fooPropA, + @JsonKey(name: r'fooPropB') + String? + fooPropB, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _Foo; + + + + factory Foo.fromJson(Map json) => _$FooFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref.dart new file mode 100644 index 000000000000..a2fbb1c3467a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FooRef + /// + /// Properties: + /// * [foorefPropA] + /// * [name] - Name of the related entity. + /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class FooRef with _$FooRef { +const FooRef._(); + + + + const factory FooRef({ + @JsonKey(name: r'foorefPropA') + String? + foorefPropA, + /// Name of the related entity. + @JsonKey(name: r'name') + String? + name, + /// The actual type of the target instance when needed for disambiguation. + @JsonKey(name: r'@referredType') + String? + atReferredType, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _FooRef; + + + + factory FooRef.fromJson(Map json) => _$FooRefFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref_or_value.dart new file mode 100644 index 000000000000..66ef0d5c90d9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref_or_value.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FooRefOrValue + /// + /// Properties: + /// * [fooPropA] + /// * [fooPropB] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + /// * [foorefPropA] + /// * [name] - Name of the related entity. + /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. + +@freezed +class FooRefOrValue with _$FooRefOrValue { +const FooRefOrValue._(); + + + + + const factory FooRefOrValue.asFoo({ + required Foo fooValue + }) = FooRefOrValueAsFoo; + const factory FooRefOrValue.asFooRef({ + required FooRef fooRefValue + }) = FooRefOrValueAsFooRef; + const factory FooRefOrValue.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([Foo,FooRef,]) List possibleTypes, + @Default([]) List deserializedModels, + }) = FooRefOrValueUnknown; + + + + + factory FooRefOrValue.fromJson(Map json) { + FooRefOrValue? deserializedModel; + // A discriminator property is specified but no mapping + // is provided in the spec, so we expect the property to + // have the value of the name of the model. Model prefix & + // suffix are ignored, as this is not known by the api provider + switch(json['@type']){ + case 'Foo': + deserializedModel = FooRefOrValue.asFoo( + fooValue : Foo.fromJson(json), + ); + break; + case 'FooRef': + deserializedModel = FooRefOrValue.asFooRef( + fooRefValue : FooRef.fromJson(json), + ); + break; + default: + break; + } + + + return deserializedModel ?? FooRefOrValue.unknown(json: json); + } + + + + Map toJson() { + return when( + asFoo: (asFoo) => asFoo.toJson(), + asFooRef: (asFooRef) => asFooRef.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit.dart new file mode 100644 index 000000000000..17e727017cd3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Fruit + /// + /// Properties: + /// * [fruitType] + /// * [seeds] + /// * [length] + +@freezed +class Fruit with _$Fruit { +const Fruit._(); + + + + + const factory Fruit.apple({ + required Apple apple, + }) = FruitApple; + const factory Fruit.banana({ + required Banana banana, + }) = FruitBanana; + const factory Fruit.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([Apple,Banana,]) List possibleTypes, + @Default([]) List deserializedModels, + }) = FruitUnknown; + + + + factory Fruit.fromJson(Map json) { + switch(json['fruitType']){ + case 'APPLE': + return Fruit.apple( + apple : Apple.fromJson(json), + ); + case 'BANANA': + return Fruit.banana( + banana : Banana.fromJson(json), + ); + } + return Fruit.unknown(json: json); + } + + + + Map toJson() { + return when( + apple: (apple) => apple.toJson(), + banana: (banana) => banana.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit_type.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit_type.dart new file mode 100644 index 000000000000..cd394cc4803e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit_type.dart @@ -0,0 +1,16 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum FruitType { + APPLE(value: r'APPLE'), + BANANA(value: r'BANANA'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const FruitType({required this.value}); + final String value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/models.dart new file mode 100644 index 000000000000..793098c8ff67 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/models.dart @@ -0,0 +1,20 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:dio/dio.dart'; +import 'dart:convert'; + +part 'models.freezed.dart'; +part 'models.g.dart'; + +part 'primitive_union_types.dart'; +part 'addressable.dart';part 'apple.dart';part 'banana.dart';part 'bar.dart';part 'bar_create.dart';part 'bar_ref.dart';part 'bar_ref_or_value.dart';part 'entity.dart';part 'entity_ref.dart';part 'extensible.dart';part 'foo.dart';part 'foo_ref.dart';part 'foo_ref_or_value.dart';part 'fruit.dart';part 'fruit_type.dart';part 'pasta.dart';part 'pizza.dart';part 'pizza_speziale.dart'; + +/// A typedef used in the deserialization of OneOf and AnyOf +/// models when no discriminator mapping is provided. +typedef FromJsonMethodType = T Function(Map); + +/// Deserialization error types for OneOf and AnyOf types. +enum DeserializationErrorType { + MoreThanOneTypeSatisfied, + UnKnownType, +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pasta.dart new file mode 100644 index 000000000000..1002c786fb26 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pasta.dart @@ -0,0 +1,65 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Pasta + /// + /// Properties: + /// * [vendor] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Pasta with _$Pasta { +const Pasta._(); + + + + const factory Pasta({ + @JsonKey(name: r'vendor') + String? + vendor, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _Pasta; + + + + factory Pasta.fromJson(Map json) => _$PastaFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza.dart new file mode 100644 index 000000000000..79fafb715a2c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza.dart @@ -0,0 +1,65 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Pizza + /// + /// Properties: + /// * [pizzaSize] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Pizza with _$Pizza { +const Pizza._(); + + + + const factory Pizza({ + @JsonKey(name: r'pizzaSize') + num? + pizzaSize, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _Pizza; + + + + factory Pizza.fromJson(Map json) => _$PizzaFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza_speziale.dart new file mode 100644 index 000000000000..ed00d02d4539 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza_speziale.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// PizzaSpeziale + /// + /// Properties: + /// * [toppings] + /// * [pizzaSize] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class PizzaSpeziale with _$PizzaSpeziale { +const PizzaSpeziale._(); + + + + const factory PizzaSpeziale({ + @JsonKey(name: r'toppings') + String? + toppings, + @JsonKey(name: r'pizzaSize') + num? + pizzaSize, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _PizzaSpeziale; + + + + factory PizzaSpeziale.fromJson(Map json) => _$PizzaSpezialeFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/primitive_union_types.dart new file mode 100644 index 000000000000..fafa083471b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/primitive_union_types.dart @@ -0,0 +1,60 @@ +part of 'models.dart'; + +@freezed +class IntInUnion with _$IntInUnion{ + const factory IntInUnion({ + required int intValue + }) = _IntInUnion; + + factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); +} + +@freezed +class StringInUnion with _$StringInUnion{ + const factory StringInUnion({ + required String stringValue + }) = _StringInUnion; + + factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); +} +@freezed +class BoolInUnion with _$BoolInUnion{ + const factory BoolInUnion({ + required bool boolValue + }) = _BoolInUnion; + + factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); +} + +@freezed +class DoubleInUnion with _$DoubleInUnion{ + const factory DoubleInUnion({ + required double doubleValue + }) = _DoubleInUnion; + + factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); +} + +@freezed +class ObjectInUnion with _$ObjectInUnion { + const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; + + factory ObjectInUnion.fromJson(Map json) => + _$ObjectInUnionFromJson(json); +} + +@freezed +class NumInUnion with _$NumInUnion{ + const factory NumInUnion({required num numValue}) = _NumInUnion; + + factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); +} + +@freezed +class DateTimeInUnion with _$DateTimeInUnion { +const factory DateTimeInUnion({required DateTime dateTimeValue}) = +_DateTimeInUnion; + +factory DateTimeInUnion.fromJson(Map json) => +_$DateTimeInUnionFromJson(json); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/pubspec.yaml new file mode 100644 index 000000000000..12925113115d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/pubspec.yaml @@ -0,0 +1,18 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '^3.0.0' + +dependencies: + dio: '^5.2.0' + freezed_annotation: '^2.4.4' + json_annotation: '^4.9.0' + +dev_dependencies: + freezed: '^2.5.2' + json_serializable: '^6.8.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/addressable_test.dart new file mode 100644 index 000000000000..2c4a84f1cb39 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/addressable_test.dart @@ -0,0 +1,23 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Addressable +void main() { + final Addressable? instance = /* Addressable(...) */ null; + // TODO add properties to the entity + + group(Addressable, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/apple_test.dart new file mode 100644 index 000000000000..ff5cc46e59aa --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/apple_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Apple +void main() { + final Apple? instance = /* Apple(...) */ null; + // TODO add properties to the entity + + group(Apple, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/banana_test.dart new file mode 100644 index 000000000000..6489e32ff77f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/banana_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Banana +void main() { + final Banana? instance = /* Banana(...) */ null; + // TODO add properties to the entity + + group(Banana, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_api_test.dart new file mode 100644 index 000000000000..73be91c446e0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_api_test.dart @@ -0,0 +1,18 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for BarApi +void main() { + final instance = Openapi().getBarApi(); + + group(BarApi, () { + // Create a Bar + // + //Future createBar(BarCreate barCreate) async + test('test createBar', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_create_test.dart new file mode 100644 index 000000000000..720b7afc6e94 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_create_test.dart @@ -0,0 +1,56 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarCreate +void main() { + final BarCreate? instance = /* BarCreate(...) */ null; + // TODO add properties to the entity + + group(BarCreate, () { + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_or_value_test.dart new file mode 100644 index 000000000000..4f79824c2388 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_or_value_test.dart @@ -0,0 +1,68 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRefOrValue +void main() { + final BarRefOrValue? instance = /* BarRefOrValue(...) */ null; + // TODO add properties to the entity + + group(BarRefOrValue, () { + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_test.dart new file mode 100644 index 000000000000..9d5acfcd10f6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_test.dart @@ -0,0 +1,53 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRef +void main() { + final BarRef? instance = /* BarRef(...) */ null; + // TODO add properties to the entity + + group(BarRef, () { + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_test.dart new file mode 100644 index 000000000000..bacdc3d3b62d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_test.dart @@ -0,0 +1,55 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Bar +void main() { + final Bar? instance = /* Bar(...) */ null; + // TODO add properties to the entity + + group(Bar, () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_ref_test.dart new file mode 100644 index 000000000000..65fed045507a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_ref_test.dart @@ -0,0 +1,53 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EntityRef +void main() { + final EntityRef? instance = /* EntityRef(...) */ null; + // TODO add properties to the entity + + group(EntityRef, () { + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_test.dart new file mode 100644 index 000000000000..b34dd0ec767d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Entity +void main() { + final Entity? instance = /* Entity(...) */ null; + // TODO add properties to the entity + + group(Entity, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/extensible_test.dart new file mode 100644 index 000000000000..df1f73c05b35 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/extensible_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Extensible +void main() { + final Extensible? instance = /* Extensible(...) */ null; + // TODO add properties to the entity + + group(Extensible, () { + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_api_test.dart new file mode 100644 index 000000000000..40bc24e691ea --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_api_test.dart @@ -0,0 +1,25 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FooApi +void main() { + final instance = Openapi().getFooApi(); + + group(FooApi, () { + // Create a Foo + // + //Future createFoo({ Foo foo }) async + test('test createFoo', () async { + // TODO + }); + + // GET all Foos + // + //Future> getAllFoos() async + test('test getAllFoos', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_or_value_test.dart new file mode 100644 index 000000000000..584565158cc0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_or_value_test.dart @@ -0,0 +1,68 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRefOrValue +void main() { + final FooRefOrValue? instance = /* FooRefOrValue(...) */ null; + // TODO add properties to the entity + + group(FooRefOrValue, () { + // String fooPropA + test('to test the property `fooPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + // String foorefPropA + test('to test the property `foorefPropA`', () async { + // TODO + }); + + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_test.dart new file mode 100644 index 000000000000..53529ee1c1b1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_test.dart @@ -0,0 +1,58 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRef +void main() { + final FooRef? instance = /* FooRef(...) */ null; + // TODO add properties to the entity + + group(FooRef, () { + // String foorefPropA + test('to test the property `foorefPropA`', () async { + // TODO + }); + + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_test.dart new file mode 100644 index 000000000000..e4ccad0f338a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final Foo? instance = /* Foo(...) */ null; + // TODO add properties to the entity + + group(Foo, () { + // String fooPropA + test('to test the property `fooPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_test.dart new file mode 100644 index 000000000000..41ab86333d84 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Fruit +void main() { + final Fruit? instance = /* Fruit(...) */ null; + // TODO add properties to the entity + + group(Fruit, () { + // FruitType fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // int length + test('to test the property `length`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_type_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_type_test.dart new file mode 100644 index 000000000000..9bf9b6c2dd45 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_type_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitType +void main() { + + group(FruitType, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pasta_test.dart new file mode 100644 index 000000000000..c944fa0db8e7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pasta_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pasta +void main() { + final Pasta? instance = /* Pasta(...) */ null; + // TODO add properties to the entity + + group(Pasta, () { + // String vendor + test('to test the property `vendor`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_speziale_test.dart new file mode 100644 index 000000000000..8f931321e11d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_speziale_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PizzaSpeziale +void main() { + final PizzaSpeziale? instance = /* PizzaSpeziale(...) */ null; + // TODO add properties to the entity + + group(PizzaSpeziale, () { + // String toppings + test('to test the property `toppings`', () async { + // TODO + }); + + // num pizzaSize + test('to test the property `pizzaSize`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_test.dart new file mode 100644 index 000000000000..f23c37b80e8b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pizza +void main() { + final Pizza? instance = /* Pizza(...) */ null; + // TODO add properties to the entity + + group(Pizza, () { + // num pizzaSize + test('to test the property `pizzaSize`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.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/oneof_primitive_freezed/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.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/oneof_primitive_freezed/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/FILES new file mode 100644 index 000000000000..ed2e12c2c53a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/FILES @@ -0,0 +1,24 @@ +.gitignore +.openapi-generator-ignore +README.md +analysis_options.yaml +build.yaml +doc/Child.md +doc/DefaultApi.md +doc/Example.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/default_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/model/child.dart +lib/src/model/example.dart +lib/src/model/models.dart +lib/src/model/primitive_union_types.dart +pubspec.yaml +test/child_test.dart +test/default_api_test.dart +test/example_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/VERSION new file mode 100644 index 000000000000..17f2442ff3bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/README.md new file mode 100644 index 000000000000..e81640d8ed49 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/README.md @@ -0,0 +1,84 @@ +# openapi (EXPERIMENTAL) +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Generator version: 7.9.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## 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().getDefaultApi(); + +try { + final response = await api.list(); + print(response); +} catch on DioException (e) { + print("Exception when calling DefaultApi->list: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://api.example.xyz/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*DefaultApi*](doc/DefaultApi.md) | [**list**](doc/DefaultApi.md#list) | **GET** /example | + + +## Documentation For Models + + - [Child](doc/Child.md) + - [Example](doc/Example.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/analysis_options.yaml new file mode 100644 index 000000000000..8ff047ce7675 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strict-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart + - lib/src/model/*.freezed.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/build.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/build.yaml new file mode 100644 index 000000000000..dee5edd67f90 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/build.yaml @@ -0,0 +1,11 @@ +targets: + $default: + builders: + freezed|freezed: + # This restricts freezed build runner to look + # files only inside models folder. + # If you prefer the build runner to scan the whole + # project for files then simply remove this build.yaml file + generate_for: + include: + - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Child.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Child.md new file mode 100644 index 000000000000..bed0f2feec12 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Child.md @@ -0,0 +1,15 @@ +# openapi.model.Child + +## 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/oneof_primitive_freezed/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/DefaultApi.md new file mode 100644 index 000000000000..c4077a67727b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/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://api.example.xyz/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list**](DefaultApi.md#list) | **GET** /example | + + +# **list** +> Example list() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.list(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->list: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Example**](Example.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/oneof_primitive_freezed/doc/Example.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Example.md new file mode 100644 index 000000000000..bf49bb137a60 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Example.md @@ -0,0 +1,15 @@ +# openapi.model.Example + +## 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/oneof_primitive_freezed/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/openapi.dart new file mode 100644 index 000000000000..581830866afb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/openapi.dart @@ -0,0 +1,15 @@ +// +// 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/bearer_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; + + +export 'package:openapi/src/api/default_api.dart'; + + +export 'package:openapi/src/model/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api.dart new file mode 100644 index 000000000000..295416c42814 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api.dart @@ -0,0 +1,68 @@ +// +// 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/default_api.dart'; + +class Openapi { + static const String basePath = r'http://api.example.xyz/v1'; + + final Dio dio; + Openapi({ + Dio? dio, + String? basePathOverride, + List? interceptors, + }) : + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 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 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); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart new file mode 100644 index 000000000000..aa8dce121498 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.dart'; + + +class DefaultApi { + + final Dio _dio; + + const DefaultApi(this._dio); + + /// list + /// + /// + /// 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 [Example] as data + /// Throws [DioException] if API call or serialization fails + Future> list({ + + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/example'; + 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, + ); + + Example _responseData; + + try { + _responseData = Example.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/oneof_primitive_freezed/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/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/oneof_primitive_freezed/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/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/oneof_primitive_freezed/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b65ccb5b71f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/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']?.toLowerCase() == '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/oneof_primitive_freezed/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..8f46678761b2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/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']?.toLowerCase() == '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/oneof_primitive_freezed/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/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/oneof_primitive_freezed/lib/src/model/child.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/child.dart new file mode 100644 index 000000000000..adffaceb0b5c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/child.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Child + /// + /// Properties: + /// * [name] + +@freezed +class Child with _$Child { +const Child._(); + + + const factory Child({ + @JsonKey(name: r'name') + String? + name, +}) = _Child; + + + + + factory Child.fromJson(Map json) => _$ChildFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/example.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/example.dart new file mode 100644 index 000000000000..dd775d489d62 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/example.dart @@ -0,0 +1,104 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Example + /// + /// Properties: + /// * [name] + +@freezed +class Example with _$Example { +const Example._(); + + + + + const factory Example.asChild({ + required Child childValue + }) = ExampleAsChild; + const factory Example.asIntInUnion({ + required IntInUnion intValue + }) = ExampleAsIntInUnion; + const factory Example.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([Child,int,]) List possibleTypes, + @Default([]) List deserializedModels, + }) = ExampleUnknown; + + + + + factory Example.fromJson(Map json) { + Example? deserializedModel; + // A discriminator property is not defined in the spec so + // we try to parse the json against all the models and try to + // return one of the valid model. Note: this approach tries + // to return one valid model and if more than one model + // is valid it then returns unknown type along with the json so + // the consumer can decide which model it is. + final fromJsonMethods = >[Child.fromJson,IntInUnion.fromJson,]; + final deserializedModels = []; + for (final fromJsonMethod in fromJsonMethods) { + try { + final dynamic parsedModel= fromJsonMethod.call(json); + // Note following line won't be executed if already the above parsing fails. + if (parsedModel is Child) { + deserializedModel = Example.asChild( + childValue : parsedModel, + ); + } else + if (parsedModel is IntInUnion) { + deserializedModel = Example.asIntInUnion( + intValue : parsedModel, + ); + } else + { + deserializedModel = Example.unknown(json: json); + } + deserializedModels.add(deserializedModel); + } catch (e) { + // We are suppressing the deserialization error when the json could not + // be parsed into one of the model. Because we return [Example.unknown] + // if the deserialization fails. + } + } + // Return an unknown type when the incoming json parses into more than one models. + // Since we pass deserializedModels, clients can still use the deserialized model. + // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. + // So we still return this as an unknown type. + if(deserializedModels.length > 1){ + deserializedModel = Example.unknown( + json: json, + deserializedModels: deserializedModels, + errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, + ); + } + + + return deserializedModel ?? Example.unknown(json: json); + } + + + + Map toJson() { + return when( + asChild: (asChild) => asChild.toJson(), + asIntInUnion: (asIntInUnion) => asIntInUnion.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/models.dart new file mode 100644 index 000000000000..3c4f94cac696 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/models.dart @@ -0,0 +1,20 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:dio/dio.dart'; +import 'dart:convert'; + +part 'models.freezed.dart'; +part 'models.g.dart'; + +part 'primitive_union_types.dart'; +part 'child.dart';part 'example.dart'; + +/// A typedef used in the deserialization of OneOf and AnyOf +/// models when no discriminator mapping is provided. +typedef FromJsonMethodType = T Function(Map); + +/// Deserialization error types for OneOf and AnyOf types. +enum DeserializationErrorType { + MoreThanOneTypeSatisfied, + UnKnownType, +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/primitive_union_types.dart new file mode 100644 index 000000000000..fafa083471b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/primitive_union_types.dart @@ -0,0 +1,60 @@ +part of 'models.dart'; + +@freezed +class IntInUnion with _$IntInUnion{ + const factory IntInUnion({ + required int intValue + }) = _IntInUnion; + + factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); +} + +@freezed +class StringInUnion with _$StringInUnion{ + const factory StringInUnion({ + required String stringValue + }) = _StringInUnion; + + factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); +} +@freezed +class BoolInUnion with _$BoolInUnion{ + const factory BoolInUnion({ + required bool boolValue + }) = _BoolInUnion; + + factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); +} + +@freezed +class DoubleInUnion with _$DoubleInUnion{ + const factory DoubleInUnion({ + required double doubleValue + }) = _DoubleInUnion; + + factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); +} + +@freezed +class ObjectInUnion with _$ObjectInUnion { + const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; + + factory ObjectInUnion.fromJson(Map json) => + _$ObjectInUnionFromJson(json); +} + +@freezed +class NumInUnion with _$NumInUnion{ + const factory NumInUnion({required num numValue}) = _NumInUnion; + + factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); +} + +@freezed +class DateTimeInUnion with _$DateTimeInUnion { +const factory DateTimeInUnion({required DateTime dateTimeValue}) = +_DateTimeInUnion; + +factory DateTimeInUnion.fromJson(Map json) => +_$DateTimeInUnionFromJson(json); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/pubspec.yaml new file mode 100644 index 000000000000..12925113115d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/pubspec.yaml @@ -0,0 +1,18 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '^3.0.0' + +dependencies: + dio: '^5.2.0' + freezed_annotation: '^2.4.4' + json_annotation: '^4.9.0' + +dev_dependencies: + freezed: '^2.5.2' + json_serializable: '^6.8.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/child_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/child_test.dart new file mode 100644 index 000000000000..5c2504f58eb3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/child_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Child +void main() { + final Child? instance = /* Child(...) */ null; + // TODO add properties to the entity + + group(Child, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/default_api_test.dart new file mode 100644 index 000000000000..e4ec57077946 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/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 list() async + test('test list', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/example_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/example_test.dart new file mode 100644 index 000000000000..4cabaa4f7fce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/example_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Example +void main() { + final Example? instance = /* Example(...) */ null; + // TODO add properties to the entity + + group(Example, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.gitignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.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/petstore_client_lib_fake-freezed/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.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/petstore_client_lib_fake-freezed/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/FILES new file mode 100644 index 000000000000..818c11cee664 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/FILES @@ -0,0 +1,186 @@ +.gitignore +.openapi-generator-ignore +README.md +analysis_options.yaml +build.yaml +doc/AdditionalPropertiesClass.md +doc/AllOfWithSingleRef.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/Category.md +doc/ChildWithNullable.md +doc/ClassModel.md +doc/DefaultApi.md +doc/DeprecatedObject.md +doc/Dog.md +doc/EnumArrays.md +doc/EnumTest.md +doc/FakeApi.md +doc/FakeBigDecimalMap200Response.md +doc/FakeClassnameTags123Api.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FooGetDefaultResponse.md +doc/FormatTest.md +doc/HasOnlyReadOnly.md +doc/HealthCheckResult.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/ParentWithNullable.md +doc/Pet.md +doc/PetApi.md +doc/ReadOnlyFirst.md +doc/SingleRefType.md +doc/SpecialModelName.md +doc/StoreApi.md +doc/Tag.md +doc/TestInlineFreeformAdditionalPropertiesRequest.md +doc/User.md +doc/UserApi.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/model/additional_properties_class.dart +lib/src/model/all_of_with_single_ref.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/category.dart +lib/src/model/child_with_nullable.dart +lib/src/model/class_model.dart +lib/src/model/deprecated_object.dart +lib/src/model/dog.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/fake_big_decimal_map200_response.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/foo_get_default_response.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/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/models.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/parent_with_nullable.dart +lib/src/model/pet.dart +lib/src/model/primitive_union_types.dart +lib/src/model/read_only_first.dart +lib/src/model/single_ref_type.dart +lib/src/model/special_model_name.dart +lib/src/model/tag.dart +lib/src/model/test_inline_freeform_additional_properties_request.dart +lib/src/model/user.dart +pubspec.yaml +test/additional_properties_class_test.dart +test/all_of_with_single_ref_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_test.dart +test/category_test.dart +test/child_with_nullable_test.dart +test/class_model_test.dart +test/default_api_test.dart +test/deprecated_object_test.dart +test/dog_test.dart +test/enum_arrays_test.dart +test/enum_test_test.dart +test/fake_api_test.dart +test/fake_big_decimal_map200_response_test.dart +test/fake_classname_tags123_api_test.dart +test/file_schema_test_class_test.dart +test/foo_get_default_response_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/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/parent_with_nullable_test.dart +test/pet_api_test.dart +test/pet_test.dart +test/read_only_first_test.dart +test/single_ref_type_test.dart +test/special_model_name_test.dart +test/store_api_test.dart +test/tag_test.dart +test/test_inline_freeform_additional_properties_request_test.dart +test/user_api_test.dart +test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/VERSION new file mode 100644 index 000000000000..17f2442ff3bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/README.md new file mode 100644 index 000000000000..516bf125066e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/README.md @@ -0,0 +1,211 @@ +# 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 +- Generator version: 7.9.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## 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 DioException (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) | [**fakeBigDecimalMap**](doc/FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | +[*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) | [**testAdditionalPropertiesReference**](doc/FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +[*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) | [**testInlineFreeformAdditionalProperties**](doc/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[*FakeApi*](doc/FakeApi.md) | [**testNullable**](doc/FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property +[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +[*FakeApi*](doc/FakeApi.md) | [**testStringMapReference**](doc/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map +[*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) + - [AllOfWithSingleRef](doc/AllOfWithSingleRef.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) + - [Category](doc/Category.md) + - [ChildWithNullable](doc/ChildWithNullable.md) + - [ClassModel](doc/ClassModel.md) + - [DeprecatedObject](doc/DeprecatedObject.md) + - [Dog](doc/Dog.md) + - [EnumArrays](doc/EnumArrays.md) + - [EnumTest](doc/EnumTest.md) + - [FakeBigDecimalMap200Response](doc/FakeBigDecimalMap200Response.md) + - [FileSchemaTestClass](doc/FileSchemaTestClass.md) + - [Foo](doc/Foo.md) + - [FooGetDefaultResponse](doc/FooGetDefaultResponse.md) + - [FormatTest](doc/FormatTest.md) + - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) + - [HealthCheckResult](doc/HealthCheckResult.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) + - [ParentWithNullable](doc/ParentWithNullable.md) + - [Pet](doc/Pet.md) + - [ReadOnlyFirst](doc/ReadOnlyFirst.md) + - [SingleRefType](doc/SingleRefType.md) + - [SpecialModelName](doc/SpecialModelName.md) + - [Tag](doc/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](doc/TestInlineFreeformAdditionalPropertiesRequest.md) + - [User](doc/User.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### 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 + +### 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 + +### http_basic_test + +- **Type**: HTTP basic authentication + +### bearer_test + +- **Type**: HTTP Bearer Token authentication (JWT) + +### http_signature_test + +- **Type**: HTTP signature authentication + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/analysis_options.yaml new file mode 100644 index 000000000000..8ff047ce7675 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strict-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart + - lib/src/model/*.freezed.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/build.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/build.yaml new file mode 100644 index 000000000000..dee5edd67f90 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/build.yaml @@ -0,0 +1,11 @@ +targets: + $default: + builders: + freezed|freezed: + # This restricts freezed build runner to look + # files only inside models folder. + # If you prefer the build runner to scan the whole + # project for files then simply remove this build.yaml file + generate_for: + include: + - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..863b8503db83 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4c6f3ab2fe11 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AllOfWithSingleRef.md @@ -0,0 +1,16 @@ +# openapi.model.AllOfWithSingleRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **String** | | [optional] +**singleRefType** | [**SingleRefType**](SingleRefType.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/petstore_client_lib_fake-freezed/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Animal.md new file mode 100644 index 000000000000..415b56e9bc2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AnotherFakeApi.md new file mode 100644 index 000000000000..36a94e6bb703 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 DioException (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/petstore_client_lib_fake-freezed/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ApiResponse.md new file mode 100644 index 000000000000..7ad5da0f89e4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..e5b9d669a436 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..fe8e071eb45c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayTest.md new file mode 100644 index 000000000000..8ae11de10022 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Capitalization.md new file mode 100644 index 000000000000..4a07b4eb820d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Cat.md new file mode 100644 index 000000000000..6552eea4b435 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/Category.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Category.md new file mode 100644 index 000000000000..ae6bc52e89d8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/ChildWithNullable.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ChildWithNullable.md new file mode 100644 index 000000000000..770494fcf4cc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ChildWithNullable.md @@ -0,0 +1,17 @@ +# openapi.model.ChildWithNullable + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | | [optional] +**nullableProperty** | **String** | | [optional] +**otherProperty** | **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/petstore_client_lib_fake-freezed/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ClassModel.md new file mode 100644 index 000000000000..13ae5d3a4708 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/DefaultApi.md new file mode 100644 index 000000000000..6abd2b44f9c4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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** +> FooGetDefaultResponse fooGet() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.fooGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->fooGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.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/petstore_client_lib_fake-freezed/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/DeprecatedObject.md new file mode 100644 index 000000000000..bf2ef67a26fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Dog.md new file mode 100644 index 000000000000..d36439b767bb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/EnumArrays.md new file mode 100644 index 000000000000..1d4fd1363b59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/EnumTest.md new file mode 100644 index 000000000000..7c24fe2347b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeApi.md new file mode 100644 index 000000000000..1b5e1ca297c8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeApi.md @@ -0,0 +1,1028 @@ +# 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 +------------- | ------------- | ------------- +[**fakeBigDecimalMap**](FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | +[**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 | +[**testAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +[**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 +[**testInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**testNullable**](FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property +[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +[**testStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map + + +# **fakeBigDecimalMap** +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); + +try { + final response = api.fakeBigDecimalMap(); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeBigDecimalMap: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **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 DioException (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'; + +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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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) + +# **testAdditionalPropertiesReference** +> testAdditionalPropertiesReference(requestBody) + +test referenced additionalProperties + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final Map requestBody = Object; // Map | request body + +try { + api.testAdditionalPropertiesReference(requestBody); +} catch on DioException (e) { + print('Exception when calling FakeApi->testAdditionalPropertiesReference: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Map<String, Object>**](Object.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) + +# **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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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'; + +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 DioException (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 DioException (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) + +# **testInlineFreeformAdditionalProperties** +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = ; // TestInlineFreeformAdditionalPropertiesRequest | request body + +try { + api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); +} catch on DioException (e) { + print('Exception when calling FakeApi->testInlineFreeformAdditionalProperties: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.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 DioException (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) + +# **testNullable** +> testNullable(childWithNullable) + +test nullable parent property + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final ChildWithNullable childWithNullable = ; // ChildWithNullable | request body + +try { + api.testNullable(childWithNullable); +} catch on DioException (e) { + print('Exception when calling FakeApi->testNullable: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **childWithNullable** | [**ChildWithNullable**](ChildWithNullable.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) + +# **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 DioException (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) + +# **testStringMapReference** +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final Map requestBody = ; // Map | request body + +try { + api.testStringMapReference(requestBody); +} catch on DioException (e) { + print('Exception when calling FakeApi->testStringMapReference: $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) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeBigDecimalMap200Response.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..281dfc44fd8c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeBigDecimalMap200Response.md @@ -0,0 +1,16 @@ +# openapi.model.FakeBigDecimalMap200Response + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someId** | **num** | | [optional] +**someMap** | **Map<String, 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/petstore_client_lib_fake-freezed/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..645aebf399f0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 DioException (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/petstore_client_lib_fake-freezed/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FileSchemaTestClass.md new file mode 100644 index 000000000000..d14ac319d294 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Foo.md new file mode 100644 index 000000000000..185b76e3f5b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FooGetDefaultResponse.md new file mode 100644 index 000000000000..10d0133abd95 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FooGetDefaultResponse.md @@ -0,0 +1,15 @@ +# openapi.model.FooGetDefaultResponse + +## 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/petstore_client_lib_fake-freezed/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FormatTest.md new file mode 100644 index 000000000000..83b60545eb61 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/HasOnlyReadOnly.md new file mode 100644 index 000000000000..32cae937155d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/HealthCheckResult.md new file mode 100644 index 000000000000..4d6aeb75d965 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/MapTest.md new file mode 100644 index 000000000000..197fe780a25a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..66d0d39c42be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Model200Response.md new file mode 100644 index 000000000000..5aa3fb97c32e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelClient.md new file mode 100644 index 000000000000..f7b922f4a398 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelEnumClass.md new file mode 100644 index 000000000000..ebaafb44c7f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelFile.md new file mode 100644 index 000000000000..4be260e93f6e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelList.md new file mode 100644 index 000000000000..283aa1f6b711 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelReturn.md new file mode 100644 index 000000000000..bc02df7a3692 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/Name.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Name.md new file mode 100644 index 000000000000..25f49ea946b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/NullableClass.md new file mode 100644 index 000000000000..70ac1091d417 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/NumberOnly.md new file mode 100644 index 000000000000..d8096a3db37a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..dda2836d8d54 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/Order.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Order.md new file mode 100644 index 000000000000..bde5ffe51a2c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterComposite.md new file mode 100644 index 000000000000..04bab7eff5d1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnum.md new file mode 100644 index 000000000000..af62ad87ab2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..c1bf8b0dec44 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumInteger.md new file mode 100644 index 000000000000..8c80a9e5c85f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..eb8b55d70249 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..eab2ae8f66b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/ParentWithNullable.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ParentWithNullable.md new file mode 100644 index 000000000000..17aa5ca02941 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ParentWithNullable.md @@ -0,0 +1,16 @@ +# openapi.model.ParentWithNullable + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | | [optional] +**nullableProperty** | **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/petstore_client_lib_fake-freezed/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Pet.md new file mode 100644 index 000000000000..3cd230bfb213 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/PetApi.md new file mode 100644 index 000000000000..5fc7fbd2657f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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/petstore_client_lib_fake-freezed/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ReadOnlyFirst.md new file mode 100644 index 000000000000..8f612e8ba19f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/SingleRefType.md new file mode 100644 index 000000000000..0dc93840cd7f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/SingleRefType.md @@ -0,0 +1,14 @@ +# openapi.model.SingleRefType + +## 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/petstore_client_lib_fake-freezed/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/SpecialModelName.md new file mode 100644 index 000000000000..5fcfa98e0b36 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/StoreApi.md new file mode 100644 index 000000000000..42028947229f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 DioException (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 DioException (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 generate 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 DioException (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 DioException (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/petstore_client_lib_fake-freezed/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Tag.md new file mode 100644 index 000000000000..c219f987c19c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/doc/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 000000000000..e2b2f1fd4468 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,15 @@ +# openapi.model.TestInlineFreeformAdditionalPropertiesRequest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProperty** | **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/petstore_client_lib_fake-freezed/doc/User.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/User.md new file mode 100644 index 000000000000..fa87e64d8595 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/User.md @@ -0,0 +1,22 @@ +# 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] + +[[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/petstore_client_lib_fake-freezed/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/UserApi.md new file mode 100644 index 000000000000..49b79d76b8a1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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/petstore_client_lib_fake-freezed/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/openapi.dart new file mode 100644 index 000000000000..53e0ea635366 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/openapi.dart @@ -0,0 +1,21 @@ +// +// 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/bearer_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/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api.dart new file mode 100644 index 000000000000..835b76584b2d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 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/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart new file mode 100644 index 000000000000..ef34a5b6f04b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient _responseData; + + try { + _responseData = ModelClient.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart new file mode 100644 index 000000000000..13a24cdbf574 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [FooGetDefaultResponse] as data + /// Throws [DioException] 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, + ); + + FooGetDefaultResponse _responseData; + + try { + _responseData = FooGetDefaultResponse.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart new file mode 100644 index 000000000000..1946a0bb6308 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart @@ -0,0 +1,1761 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.dart'; + + +class FakeApi { + + final Dio _dio; + + const FakeApi(this._dio); + + /// fakeBigDecimalMap + /// for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + /// + /// 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 [FakeBigDecimalMap200Response] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeBigDecimalMap({ + + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/BigDecimalMap'; + 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, + ); + + FakeBigDecimalMap200Response _responseData; + + try { + _responseData = FakeBigDecimalMap200Response.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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, + ); + } + + /// 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 [DioException] 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 = HealthCheckResult.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 = body; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + bool _responseData; + + try { + _responseData = _response.data as bool; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterComposite _responseData; + + try { + _responseData = OuterComposite.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 = body; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + num _responseData; + + try { + _responseData = _response.data as num; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 = body; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String _responseData; + + try { + _responseData = _response.data as String; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterObjectWithEnumProperty _responseData; + + try { + _responseData = OuterObjectWithEnumProperty.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 referenced 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 [DioException] if API call or serialization fails + Future> testAdditionalPropertiesReference({ + + required Map requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/additionalProperties-reference'; + 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// 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 [DioException] 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 = body?.finalize(); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient _responseData; + + try { + _responseData = ModelClient.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = { + if (integer != null) r'integer': integer, + if (int32 != null) r'int32': int32, + if (int64 != null) r'int64': int64, + r'number': number, + if (float != null) r'float': float, + r'double': double_, + if (string != null) r'string': string, + r'pattern_without_delimiter': patternWithoutDelimiter, + r'byte': byte, + if (binary != null) r'binary': binary, + if (date != null) r'date': date, + if (dateTime != null) r'dateTime': dateTime, + if (password != null) r'password': password, + if (callback != null) r'callback': callback, + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = { + if (enumFormStringArray != null) r'enum_form_string_array': enumFormStringArray, + if (enumFormString != null) r'enum_form_string': enumFormString, + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test inline free-form additionalProperties + /// + /// + /// Parameters: + /// * [testInlineFreeformAdditionalPropertiesRequest] - 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 [DioException] if API call or serialization fails + Future> testInlineFreeformAdditionalProperties({ + + required TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/inline-freeform-additionalProperties'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData=jsonEncode(testInlineFreeformAdditionalPropertiesRequest); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = { + r'param': param, + r'param2': param2, + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test nullable parent property + /// + /// + /// Parameters: + /// * [childWithNullable] - 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 [DioException] if API call or serialization fails + Future> testNullable({ + + required ChildWithNullable childWithNullable, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/nullable'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData=jsonEncode(childWithNullable); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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; + } + + /// test referenced string map + /// + /// + /// 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 [DioException] if API call or serialization fails + Future> testStringMapReference({ + + required Map requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/stringMap-reference'; + 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart new file mode 100644 index 000000000000..dbcde22e5264 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart @@ -0,0 +1,116 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient _responseData; + + try { + _responseData = ModelClient.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart new file mode 100644 index 000000000000..a7c8c0262a2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart @@ -0,0 +1,760 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 [DioException] if API call or serialization fails + Future>> findPetsByStatus({ + + @Deprecated('status is deprecated') 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 { + final _responseDataAsList = _response.data as List; + _responseData = _responseDataAsList.map((dynamic e)=> Pet.fromJson(e as Map)).toList(); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 { + final _responseDataAsSet = _response.data as List; + _responseData = _responseDataAsSet.map((dynamic e)=> Pet.fromJson(e as Map)).toSet(); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 = Pet.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = { + if (name != null) r'name': name, + if (status != null) r'status': status, + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = FormData.fromMap({ + if (additionalMetadata != null) + r'additionalMetadata': + + jsonEncode(additionalMetadata), + if (file != null) + r'file': + file + , + }); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse _responseData; + + try { + _responseData = ApiResponse.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = FormData.fromMap({ + if (additionalMetadata != null) + r'additionalMetadata': + + jsonEncode(additionalMetadata), +r'requiredFile': + requiredFile + , + }); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse _responseData; + + try { + _responseData = ApiResponse.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart new file mode 100644 index 000000000000..a87ad786cdcf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart @@ -0,0 +1,306 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [DioException] 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 [DioException] 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 = _response.data as Map; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 generate 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 [DioException] 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 = Order.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Order _responseData; + + try { + _responseData = Order.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart new file mode 100644 index 000000000000..f24d00daabe4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart @@ -0,0 +1,534 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 [DioException] 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 = User.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 = _response.data as String; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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/petstore_client_lib_fake-freezed/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b65ccb5b71f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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']?.toLowerCase() == '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/petstore_client_lib_fake-freezed/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..8f46678761b2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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']?.toLowerCase() == '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/petstore_client_lib_fake-freezed/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/additional_properties_class.dart new file mode 100644 index 000000000000..12c438f0b974 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/additional_properties_class.dart @@ -0,0 +1,50 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// AdditionalPropertiesClass + /// + /// Properties: + /// * [mapProperty] + /// * [mapOfMapProperty] + +@freezed +class AdditionalPropertiesClass with _$AdditionalPropertiesClass { +const AdditionalPropertiesClass._(); + + + const factory AdditionalPropertiesClass({ + @JsonKey(name: r'map_property') + Map? + mapProperty, + @JsonKey(name: r'map_of_map_property') + Map? +>? + mapOfMapProperty, +}) = _AdditionalPropertiesClass; + + + + + factory AdditionalPropertiesClass.fromJson(Map json) => _$AdditionalPropertiesClassFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/all_of_with_single_ref.dart new file mode 100644 index 000000000000..04b3738b81b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/all_of_with_single_ref.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// AllOfWithSingleRef + /// + /// Properties: + /// * [username] + /// * [singleRefType] + +@freezed +class AllOfWithSingleRef with _$AllOfWithSingleRef { +const AllOfWithSingleRef._(); + + + const factory AllOfWithSingleRef({ + @JsonKey(name: r'username') + String? + username, + @JsonKey(name: r'SingleRefType') + SingleRefType? + singleRefType, +}) = _AllOfWithSingleRef; + + + + + factory AllOfWithSingleRef.fromJson(Map json) => _$AllOfWithSingleRefFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/animal.dart new file mode 100644 index 000000000000..ab4f4a5383c6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/animal.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Animal + /// + /// Properties: + /// * [className] + /// * [color] + +@freezed +class Animal with _$Animal { +const Animal._(); + + + const factory Animal.cat({ + required Cat cat, + }) = AnimalCat; + const factory Animal.dog({ + required Dog dog, + }) = AnimalDog; + const factory Animal.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([]) List possibleTypes, + @Default([]) List deserializedModels, + }) = AnimalUnknown; + + + + + factory Animal.fromJson(Map json) { + switch(json['className']){ + case 'CAT': + return Animal.cat( + cat : Cat.fromJson(json), + ); + case 'DOG': + return Animal.dog( + dog : Dog.fromJson(json), + ); + } + return Animal.unknown(json: json); + } + + + + + Map toJson() { + return when( + cat: (cat) => cat.toJson(), + dog: (dog) => dog.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/api_response.dart new file mode 100644 index 000000000000..e8608ad60603 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/api_response.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ApiResponse + /// + /// Properties: + /// * [code] + /// * [type] + /// * [message] + +@freezed +class ApiResponse with _$ApiResponse { +const ApiResponse._(); + + + const factory ApiResponse({ + @JsonKey(name: r'code') + int? + code, + @JsonKey(name: r'type') + String? + type, + @JsonKey(name: r'message') + String? + message, +}) = _ApiResponse; + + + + + factory ApiResponse.fromJson(Map json) => _$ApiResponseFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_array_of_number_only.dart new file mode 100644 index 000000000000..82381d375158 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_array_of_number_only.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ArrayOfArrayOfNumberOnly + /// + /// Properties: + /// * [arrayArrayNumber] + +@freezed +class ArrayOfArrayOfNumberOnly with _$ArrayOfArrayOfNumberOnly { +const ArrayOfArrayOfNumberOnly._(); + + + const factory ArrayOfArrayOfNumberOnly({ + @JsonKey(name: r'ArrayArrayNumber') + List< + List< + num? +>? +>? + arrayArrayNumber, +}) = _ArrayOfArrayOfNumberOnly; + + + + + factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfArrayOfNumberOnlyFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_number_only.dart new file mode 100644 index 000000000000..623dbe6d5d58 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_number_only.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ArrayOfNumberOnly + /// + /// Properties: + /// * [arrayNumber] + +@freezed +class ArrayOfNumberOnly with _$ArrayOfNumberOnly { +const ArrayOfNumberOnly._(); + + + const factory ArrayOfNumberOnly({ + @JsonKey(name: r'ArrayNumber') + List< + num? +>? + arrayNumber, +}) = _ArrayOfNumberOnly; + + + + + factory ArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfNumberOnlyFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_test.dart new file mode 100644 index 000000000000..1c793fc302a9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_test.dart @@ -0,0 +1,58 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ArrayTest + /// + /// Properties: + /// * [arrayOfString] + /// * [arrayArrayOfInteger] + /// * [arrayArrayOfModel] + +@freezed +class ArrayTest with _$ArrayTest { +const ArrayTest._(); + + + const factory ArrayTest({ + @JsonKey(name: r'array_of_string') + List< + String? +>? + arrayOfString, + @JsonKey(name: r'array_array_of_integer') + List< + List< + int? +>? +>? + arrayArrayOfInteger, + @JsonKey(name: r'array_array_of_model') + List< + List< + ReadOnlyFirst? +>? +>? + arrayArrayOfModel, +}) = _ArrayTest; + + + + + factory ArrayTest.fromJson(Map json) => _$ArrayTestFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/capitalization.dart new file mode 100644 index 000000000000..525d1f04e549 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/capitalization.dart @@ -0,0 +1,61 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Capitalization + /// + /// Properties: + /// * [smallCamel] + /// * [capitalCamel] + /// * [smallSnake] + /// * [capitalSnake] + /// * [sCAETHFlowPoints] + /// * [ATT_NAME] - Name of the pet + +@freezed +class Capitalization with _$Capitalization { +const Capitalization._(); + + + const factory Capitalization({ + @JsonKey(name: r'smallCamel') + String? + smallCamel, + @JsonKey(name: r'CapitalCamel') + String? + capitalCamel, + @JsonKey(name: r'small_Snake') + String? + smallSnake, + @JsonKey(name: r'Capital_Snake') + String? + capitalSnake, + @JsonKey(name: r'SCA_ETH_Flow_Points') + String? + sCAETHFlowPoints, + /// Name of the pet + @JsonKey(name: r'ATT_NAME') + String? + ATT_NAME, +}) = _Capitalization; + + + + + factory Capitalization.fromJson(Map json) => _$CapitalizationFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/cat.dart new file mode 100644 index 000000000000..a60babcaddc1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/cat.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Cat + /// + /// Properties: + /// * [className] + /// * [color] + /// * [declawed] + +@freezed +class Cat with _$Cat { +const Cat._(); + + + + const factory Cat({ + @JsonKey(name: r'className') + required String + className, + @JsonKey(name: r'color') + String? + color, + @JsonKey(name: r'declawed') + bool? + declawed, +}) = _Cat; + + + + factory Cat.fromJson(Map json) => _$CatFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/category.dart new file mode 100644 index 000000000000..5f4054076196 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/category.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Category + /// + /// Properties: + /// * [id] + /// * [name] + +@freezed +class Category with _$Category { +const Category._(); + + + const factory Category({ + @JsonKey(name: r'id') + int? + id, + @JsonKey(name: r'name') + required String + name, +}) = _Category; + + + + + factory Category.fromJson(Map json) => _$CategoryFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/child_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/child_with_nullable.dart new file mode 100644 index 000000000000..7b43ddac31c2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/child_with_nullable.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ChildWithNullable + /// + /// Properties: + /// * [type] + /// * [nullableProperty] + /// * [otherProperty] + +@freezed +class ChildWithNullable with _$ChildWithNullable { +const ChildWithNullable._(); + + + + const factory ChildWithNullable({ + @JsonKey(name: r'type') + ChildWithNullableTypeEnum? + type, + @JsonKey(name: r'nullableProperty') + String? + nullableProperty, + @JsonKey(name: r'otherProperty') + String? + otherProperty, +}) = _ChildWithNullable; + + + + factory ChildWithNullable.fromJson(Map json) => _$ChildWithNullableFromJson(json); + + + + + + + + +} + + + + +@JsonEnum(valueField: 'value') +enum ChildWithNullableTypeEnum { + childWithNullable(value: r'ChildWithNullable'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const ChildWithNullableTypeEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/class_model.dart new file mode 100644 index 000000000000..cb16c798fde3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/class_model.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Model for testing model with \"_class\" property + /// + /// Properties: + /// * [class_] + +@freezed +class ClassModel with _$ClassModel { +const ClassModel._(); + + + const factory ClassModel({ + @JsonKey(name: r'_class') + String? + class_, +}) = _ClassModel; + + + + + factory ClassModel.fromJson(Map json) => _$ClassModelFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/deprecated_object.dart new file mode 100644 index 000000000000..373d5863c1dd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/deprecated_object.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// DeprecatedObject + /// + /// Properties: + /// * [name] + +@freezed +class DeprecatedObject with _$DeprecatedObject { +const DeprecatedObject._(); + + + const factory DeprecatedObject({ + @JsonKey(name: r'name') + String? + name, +}) = _DeprecatedObject; + + + + + factory DeprecatedObject.fromJson(Map json) => _$DeprecatedObjectFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/dog.dart new file mode 100644 index 000000000000..9df086abe547 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/dog.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Dog + /// + /// Properties: + /// * [className] + /// * [color] + /// * [breed] + +@freezed +class Dog with _$Dog { +const Dog._(); + + + + const factory Dog({ + @JsonKey(name: r'className') + required String + className, + @JsonKey(name: r'color') + String? + color, + @JsonKey(name: r'breed') + String? + breed, +}) = _Dog; + + + + factory Dog.fromJson(Map json) => _$DogFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_arrays.dart new file mode 100644 index 000000000000..6fd9a450ca7b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_arrays.dart @@ -0,0 +1,65 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// EnumArrays + /// + /// Properties: + /// * [justSymbol] + /// * [arrayEnum] + +@freezed +class EnumArrays with _$EnumArrays { +const EnumArrays._(); + + + const factory EnumArrays({ + @JsonKey(name: r'just_symbol') + EnumArraysJustSymbolEnum? + justSymbol, + @JsonKey(name: r'array_enum') + List< + EnumArraysArrayEnumEnum? +>? + arrayEnum, +}) = _EnumArrays; + + + + + factory EnumArrays.fromJson(Map json) => _$EnumArraysFromJson(json); + + + + + + + + +} + + + + +@JsonEnum(valueField: 'value') +enum EnumArraysJustSymbolEnum { + greaterThanEqual(value: r'>='), + dollar(value: r'$'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumArraysJustSymbolEnum({required this.value}); + final String value; +} + + +@JsonEnum(valueField: 'value') +enum EnumArraysArrayEnumEnum { + fish(value: r'fish'), + crab(value: r'crab'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumArraysArrayEnumEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_test.dart new file mode 100644 index 000000000000..55b5cfe74ece --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_test.dart @@ -0,0 +1,106 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// EnumTest + /// + /// Properties: + /// * [enumString] + /// * [enumStringRequired] + /// * [enumInteger] + /// * [enumNumber] + /// * [outerEnum] + /// * [outerEnumInteger] + /// * [outerEnumDefaultValue] + /// * [outerEnumIntegerDefaultValue] + +@freezed +class EnumTest with _$EnumTest { +const EnumTest._(); + + + const factory EnumTest({ + @JsonKey(name: r'enum_string') + EnumTestEnumStringEnum? + enumString, + @JsonKey(name: r'enum_string_required') + required EnumTestEnumStringRequiredEnum + enumStringRequired, + @JsonKey(name: r'enum_integer') + EnumTestEnumIntegerEnum? + enumInteger, + @JsonKey(name: r'enum_number') + EnumTestEnumNumberEnum? + enumNumber, + @JsonKey(name: r'outerEnum') + OuterEnum? + outerEnum, + @JsonKey(name: r'outerEnumInteger') + OuterEnumInteger? + outerEnumInteger, + @JsonKey(name: r'outerEnumDefaultValue') + OuterEnumDefaultValue? + outerEnumDefaultValue, + @JsonKey(name: r'outerEnumIntegerDefaultValue') + OuterEnumIntegerDefaultValue? + outerEnumIntegerDefaultValue, +}) = _EnumTest; + + + + + factory EnumTest.fromJson(Map json) => _$EnumTestFromJson(json); + + + + + + + + +} + + + + +@JsonEnum(valueField: 'value') +enum EnumTestEnumStringEnum { + UPPER(value: r'UPPER'), + lower(value: r'lower'), + empty(value: r''), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumTestEnumStringEnum({required this.value}); + final String value; +} + +@JsonEnum(valueField: 'value') +enum EnumTestEnumStringRequiredEnum { + UPPER(value: r'UPPER'), + lower(value: r'lower'), + empty(value: r''), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumTestEnumStringRequiredEnum({required this.value}); + final String value; +} + +@JsonEnum(valueField: 'value') +enum EnumTestEnumIntegerEnum { + number1(value: 1), + numberNegative1(value: -1), + unknownDefaultOpenApi(value: 11184809); + const EnumTestEnumIntegerEnum({required this.value}); + final int value; +} + +@JsonEnum(valueField: 'value') +enum EnumTestEnumNumberEnum { + number1Period1(value: '1.1'), + numberNegative1Period2(value: '-1.2'), + unknownDefaultOpenApi(value: '11184809'); + const EnumTestEnumNumberEnum({required this.value}); + final double value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/fake_big_decimal_map200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/fake_big_decimal_map200_response.dart new file mode 100644 index 000000000000..58f1f2fb2971 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/fake_big_decimal_map200_response.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FakeBigDecimalMap200Response + /// + /// Properties: + /// * [someId] + /// * [someMap] + +@freezed +class FakeBigDecimalMap200Response with _$FakeBigDecimalMap200Response { +const FakeBigDecimalMap200Response._(); + + + const factory FakeBigDecimalMap200Response({ + @JsonKey(name: r'someId') + num? + someId, + @JsonKey(name: r'someMap') + Map? + someMap, +}) = _FakeBigDecimalMap200Response; + + + + + factory FakeBigDecimalMap200Response.fromJson(Map json) => _$FakeBigDecimalMap200ResponseFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/file_schema_test_class.dart new file mode 100644 index 000000000000..45eed25fb283 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/file_schema_test_class.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FileSchemaTestClass + /// + /// Properties: + /// * [file] + /// * [files] + +@freezed +class FileSchemaTestClass with _$FileSchemaTestClass { +const FileSchemaTestClass._(); + + + const factory FileSchemaTestClass({ + @JsonKey(name: r'file') + ModelFile? + file, + @JsonKey(name: r'files') + List< + ModelFile? +>? + files, +}) = _FileSchemaTestClass; + + + + + factory FileSchemaTestClass.fromJson(Map json) => _$FileSchemaTestClassFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo.dart new file mode 100644 index 000000000000..e1d42e6f0a5a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Foo + /// + /// Properties: + /// * [bar] + +@freezed +class Foo with _$Foo { +const Foo._(); + + + const factory Foo({ + @JsonKey(name: r'bar') + String? + bar, +}) = _Foo; + + + + + factory Foo.fromJson(Map json) => _$FooFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo_get_default_response.dart new file mode 100644 index 000000000000..06c214baa9e2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo_get_default_response.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FooGetDefaultResponse + /// + /// Properties: + /// * [string] + +@freezed +class FooGetDefaultResponse with _$FooGetDefaultResponse { +const FooGetDefaultResponse._(); + + + const factory FooGetDefaultResponse({ + @JsonKey(name: r'string') + Foo? + string, +}) = _FooGetDefaultResponse; + + + + + factory FooGetDefaultResponse.fromJson(Map json) => _$FooGetDefaultResponseFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/format_test.dart new file mode 100644 index 000000000000..c5a2780e3aae --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/format_test.dart @@ -0,0 +1,102 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FormatTest + /// + /// Properties: + /// * [integer] + /// * [int32] + /// * [int64] + /// * [number] + /// * [float] + /// * [double_] + /// * [decimal] + /// * [string] + /// * [byte] + /// * [binary] + /// * [date] + /// * [dateTime] + /// * [uuid] + /// * [password] + /// * [patternWithDigits] - A string that is a 10 digit number. Can have leading zeros. + /// * [patternWithDigitsAndDelimiter] - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + +@freezed +class FormatTest with _$FormatTest { +const FormatTest._(); + + + const factory FormatTest({ + @JsonKey(name: r'integer') + int? + integer, + @JsonKey(name: r'int32') + int? + int32, + @JsonKey(name: r'int64') + int? + int64, + @JsonKey(name: r'number') + required num + number, + @JsonKey(name: r'float') + double? + float, + @JsonKey(name: r'double') + double? + double_, + @JsonKey(name: r'decimal') + double? + decimal, + @JsonKey(name: r'string') + String? + string, + @JsonKey(name: r'byte') + required String + byte, + @JsonKey(name: r'binary') + MultipartFile? + binary, + @JsonKey(name: r'date') + required DateTime + date, + @JsonKey(name: r'dateTime') + DateTime? + dateTime, + @JsonKey(name: r'uuid') + String? + uuid, + @JsonKey(name: r'password') + required String + password, + /// A string that is a 10 digit number. Can have leading zeros. + @JsonKey(name: r'pattern_with_digits') + 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') + String? + patternWithDigitsAndDelimiter, +}) = _FormatTest; + + + + + factory FormatTest.fromJson(Map json) => _$FormatTestFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/has_only_read_only.dart new file mode 100644 index 000000000000..7761a7315928 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/has_only_read_only.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// HasOnlyReadOnly + /// + /// Properties: + /// * [bar] + /// * [foo] + +@freezed +class HasOnlyReadOnly with _$HasOnlyReadOnly { +const HasOnlyReadOnly._(); + + + const factory HasOnlyReadOnly({ + @JsonKey(name: r'bar') + String? + bar, + @JsonKey(name: r'foo') + String? + foo, +}) = _HasOnlyReadOnly; + + + + + factory HasOnlyReadOnly.fromJson(Map json) => _$HasOnlyReadOnlyFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/health_check_result.dart new file mode 100644 index 000000000000..9dfdbc5c1a82 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/health_check_result.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + /// Properties: + /// * [nullableMessage] + +@freezed +class HealthCheckResult with _$HealthCheckResult { +const HealthCheckResult._(); + + + const factory HealthCheckResult({ + @JsonKey(name: r'NullableMessage') + String? + nullableMessage, +}) = _HealthCheckResult; + + + + + factory HealthCheckResult.fromJson(Map json) => _$HealthCheckResultFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/map_test.dart new file mode 100644 index 000000000000..edeeb9fe5649 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/map_test.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// MapTest + /// + /// Properties: + /// * [mapMapOfString] + /// * [mapOfEnumString] + /// * [directMap] + /// * [indirectMap] + +@freezed +class MapTest with _$MapTest { +const MapTest._(); + + + const factory MapTest({ + @JsonKey(name: r'map_map_of_string') + Map? +>? + mapMapOfString, + @JsonKey(name: r'map_of_enum_string') + Map? + mapOfEnumString, + @JsonKey(name: r'direct_map') + Map? + directMap, + @JsonKey(name: r'indirect_map') + Map? + indirectMap, +}) = _MapTest; + + + + + factory MapTest.fromJson(Map json) => _$MapTestFromJson(json); + + + + + + + + +} + + + + + +@JsonEnum(valueField: 'value') +enum MapTestMapOfEnumStringEnum { + UPPER(value: r'UPPER'), + lower(value: r'lower'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const MapTestMapOfEnumStringEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/mixed_properties_and_additional_properties_class.dart new file mode 100644 index 000000000000..eb12475fc3b7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -0,0 +1,50 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// MixedPropertiesAndAdditionalPropertiesClass + /// + /// Properties: + /// * [uuid] + /// * [dateTime] + /// * [map] + +@freezed +class MixedPropertiesAndAdditionalPropertiesClass with _$MixedPropertiesAndAdditionalPropertiesClass { +const MixedPropertiesAndAdditionalPropertiesClass._(); + + + const factory MixedPropertiesAndAdditionalPropertiesClass({ + @JsonKey(name: r'uuid') + String? + uuid, + @JsonKey(name: r'dateTime') + DateTime? + dateTime, + @JsonKey(name: r'map') + Map? + map, +}) = _MixedPropertiesAndAdditionalPropertiesClass; + + + + + factory MixedPropertiesAndAdditionalPropertiesClass.fromJson(Map json) => _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model200_response.dart new file mode 100644 index 000000000000..cbc0c625c0e9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model200_response.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Model for testing model name starting with number + /// + /// Properties: + /// * [name] + /// * [class_] + +@freezed +class Model200Response with _$Model200Response { +const Model200Response._(); + + + const factory Model200Response({ + @JsonKey(name: r'name') + int? + name, + @JsonKey(name: r'class') + String? + class_, +}) = _Model200Response; + + + + + factory Model200Response.fromJson(Map json) => _$Model200ResponseFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_client.dart new file mode 100644 index 000000000000..5e7d477fc2c5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_client.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ModelClient + /// + /// Properties: + /// * [client] + +@freezed +class ModelClient with _$ModelClient { +const ModelClient._(); + + + const factory ModelClient({ + @JsonKey(name: r'client') + String? + client, +}) = _ModelClient; + + + + + factory ModelClient.fromJson(Map json) => _$ModelClientFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_enum_class.dart new file mode 100644 index 000000000000..46f700a2c015 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_enum_class.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum ModelEnumClass { + abc(value: r'_abc'), + efg(value: r'-efg'), + leftParenthesisXyzRightParenthesis(value: r'(xyz)'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const ModelEnumClass({required this.value}); + final String value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_file.dart new file mode 100644 index 000000000000..7585fead5f37 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_file.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Must be named `File` for test. + /// + /// Properties: + /// * [sourceURI] - Test capitalization + +@freezed +class ModelFile with _$ModelFile { +const ModelFile._(); + + + const factory ModelFile({ + /// Test capitalization + @JsonKey(name: r'sourceURI') + String? + sourceURI, +}) = _ModelFile; + + + + + factory ModelFile.fromJson(Map json) => _$ModelFileFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_list.dart new file mode 100644 index 000000000000..5f9e176b5ffd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_list.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ModelList + /// + /// Properties: + /// * [n123list] + +@freezed +class ModelList with _$ModelList { +const ModelList._(); + + + const factory ModelList({ + @JsonKey(name: r'123-list') + String? + n123list, +}) = _ModelList; + + + + + factory ModelList.fromJson(Map json) => _$ModelListFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_return.dart new file mode 100644 index 000000000000..29d509a235cf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_return.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Model for testing reserved words + /// + /// Properties: + /// * [return_] + +@freezed +class ModelReturn with _$ModelReturn { +const ModelReturn._(); + + + const factory ModelReturn({ + @JsonKey(name: r'return') + int? + return_, +}) = _ModelReturn; + + + + + factory ModelReturn.fromJson(Map json) => _$ModelReturnFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/models.dart new file mode 100644 index 000000000000..1591d5519c42 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/models.dart @@ -0,0 +1,20 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:dio/dio.dart'; +import 'dart:convert'; + +part 'models.freezed.dart'; +part 'models.g.dart'; + +part 'primitive_union_types.dart'; +part 'additional_properties_class.dart';part 'all_of_with_single_ref.dart';part 'animal.dart';part 'api_response.dart';part 'array_of_array_of_number_only.dart';part 'array_of_number_only.dart';part 'array_test.dart';part 'capitalization.dart';part 'cat.dart';part 'category.dart';part 'child_with_nullable.dart';part 'class_model.dart';part 'deprecated_object.dart';part 'dog.dart';part 'enum_arrays.dart';part 'enum_test.dart';part 'fake_big_decimal_map200_response.dart';part 'file_schema_test_class.dart';part 'foo.dart';part 'foo_get_default_response.dart';part 'format_test.dart';part 'has_only_read_only.dart';part 'health_check_result.dart';part 'map_test.dart';part 'mixed_properties_and_additional_properties_class.dart';part 'model200_response.dart';part 'model_client.dart';part 'model_enum_class.dart';part 'model_file.dart';part 'model_list.dart';part 'model_return.dart';part 'name.dart';part 'nullable_class.dart';part 'number_only.dart';part 'object_with_deprecated_fields.dart';part 'order.dart';part 'outer_composite.dart';part 'outer_enum.dart';part 'outer_enum_default_value.dart';part 'outer_enum_integer.dart';part 'outer_enum_integer_default_value.dart';part 'outer_object_with_enum_property.dart';part 'parent_with_nullable.dart';part 'pet.dart';part 'read_only_first.dart';part 'single_ref_type.dart';part 'special_model_name.dart';part 'tag.dart';part 'test_inline_freeform_additional_properties_request.dart';part 'user.dart'; + +/// A typedef used in the deserialization of OneOf and AnyOf +/// models when no discriminator mapping is provided. +typedef FromJsonMethodType = T Function(Map); + +/// Deserialization error types for OneOf and AnyOf types. +enum DeserializationErrorType { + MoreThanOneTypeSatisfied, + UnKnownType, +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/name.dart new file mode 100644 index 000000000000..2cf00d19f6e6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/name.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Model for testing model name same as property name + /// + /// Properties: + /// * [name] + /// * [snakeCase] + /// * [property] + /// * [n123number] + +@freezed +class Name with _$Name { +const Name._(); + + + const factory Name({ + @JsonKey(name: r'name') + required int + name, + @JsonKey(name: r'snake_case') + int? + snakeCase, + @JsonKey(name: r'property') + String? + property, + @JsonKey(name: r'123Number') + int? + n123number, +}) = _Name; + + + + + factory Name.fromJson(Map json) => _$NameFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/nullable_class.dart new file mode 100644 index 000000000000..d97933988453 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/nullable_class.dart @@ -0,0 +1,96 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// NullableClass + /// + /// Properties: + /// * [integerProp] + /// * [numberProp] + /// * [booleanProp] + /// * [stringProp] + /// * [dateProp] + /// * [datetimeProp] + /// * [arrayNullableProp] + /// * [arrayAndItemsNullableProp] + /// * [arrayItemsNullable] + /// * [objectNullableProp] + /// * [objectAndItemsNullableProp] + /// * [objectItemsNullable] + +@freezed +class NullableClass with _$NullableClass { +const NullableClass._(); + + + const factory NullableClass({ + @JsonKey(name: r'integer_prop') + int? + integerProp, + @JsonKey(name: r'number_prop') + num? + numberProp, + @JsonKey(name: r'boolean_prop') + bool? + booleanProp, + @JsonKey(name: r'string_prop') + String? + stringProp, + @JsonKey(name: r'date_prop') + DateTime? + dateProp, + @JsonKey(name: r'datetime_prop') + DateTime? + datetimeProp, + @JsonKey(name: r'array_nullable_prop') + List< + Object? +>? + arrayNullableProp, + @JsonKey(name: r'array_and_items_nullable_prop') + List< + Object? +>? + arrayAndItemsNullableProp, + @JsonKey(name: r'array_items_nullable') + List< + Object? +>? + arrayItemsNullable, + @JsonKey(name: r'object_nullable_prop') + Map? + objectNullableProp, + @JsonKey(name: r'object_and_items_nullable_prop') + Map? + objectAndItemsNullableProp, + @JsonKey(name: r'object_items_nullable') + Map? + objectItemsNullable, +}) = _NullableClass; + + + + + factory NullableClass.fromJson(Map json) => _$NullableClassFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/number_only.dart new file mode 100644 index 000000000000..6e59c27d03af --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/number_only.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// NumberOnly + /// + /// Properties: + /// * [justNumber] + +@freezed +class NumberOnly with _$NumberOnly { +const NumberOnly._(); + + + const factory NumberOnly({ + @JsonKey(name: r'JustNumber') + num? + justNumber, +}) = _NumberOnly; + + + + + factory NumberOnly.fromJson(Map json) => _$NumberOnlyFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/object_with_deprecated_fields.dart new file mode 100644 index 000000000000..8c78bdadaf8b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/object_with_deprecated_fields.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ObjectWithDeprecatedFields + /// + /// Properties: + /// * [uuid] + /// * [id] + /// * [deprecatedRef] + /// * [bars] + +@freezed +class ObjectWithDeprecatedFields with _$ObjectWithDeprecatedFields { +const ObjectWithDeprecatedFields._(); + + + const factory ObjectWithDeprecatedFields({ + @JsonKey(name: r'uuid') + String? + uuid, + @JsonKey(name: r'id') + num? + id, + @JsonKey(name: r'deprecatedRef') + DeprecatedObject? + deprecatedRef, + @JsonKey(name: r'bars') + List< + String? +>? + bars, +}) = _ObjectWithDeprecatedFields; + + + + + factory ObjectWithDeprecatedFields.fromJson(Map json) => _$ObjectWithDeprecatedFieldsFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/order.dart new file mode 100644 index 000000000000..543d035c9fa3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/order.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Order + /// + /// Properties: + /// * [id] + /// * [petId] + /// * [quantity] + /// * [shipDate] + /// * [status] - Order Status + /// * [complete] + +@freezed +class Order with _$Order { +const Order._(); + + + const factory Order({ + @JsonKey(name: r'id') + int? + id, + @JsonKey(name: r'petId') + int? + petId, + @JsonKey(name: r'quantity') + int? + quantity, + @JsonKey(name: r'shipDate') + DateTime? + shipDate, + /// Order Status + @JsonKey(name: r'status') + OrderStatusEnum? + status, + @JsonKey(name: r'complete') + bool? + complete, +}) = _Order; + + + + + factory Order.fromJson(Map json) => _$OrderFromJson(json); + + + + + + + + +} + + + + /// Order Status +@JsonEnum(valueField: 'value') +enum OrderStatusEnum { + placed(value: r'placed'), + approved(value: r'approved'), + delivered(value: r'delivered'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const OrderStatusEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_composite.dart new file mode 100644 index 000000000000..b683fc76db42 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_composite.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// OuterComposite + /// + /// Properties: + /// * [myNumber] + /// * [myString] + /// * [myBoolean] + +@freezed +class OuterComposite with _$OuterComposite { +const OuterComposite._(); + + + const factory OuterComposite({ + @JsonKey(name: r'my_number') + num? + myNumber, + @JsonKey(name: r'my_string') + String? + myString, + @JsonKey(name: r'my_boolean') + bool? + myBoolean, +}) = _OuterComposite; + + + + + factory OuterComposite.fromJson(Map json) => _$OuterCompositeFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum.dart new file mode 100644 index 000000000000..d1fbeffabb32 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum OuterEnum { + placed(value: r'placed'), + approved(value: r'approved'), + delivered(value: r'delivered'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const OuterEnum({required this.value}); + final String value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_default_value.dart new file mode 100644 index 000000000000..40b234a78af5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_default_value.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum OuterEnumDefaultValue { + placed(value: r'placed'), + approved(value: r'approved'), + delivered(value: r'delivered'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const OuterEnumDefaultValue({required this.value}); + final String value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer.dart new file mode 100644 index 000000000000..ed4e09fba4bf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum OuterEnumInteger { + number0(value: 0), + number1(value: 1), + number2(value: 2), + unknownDefaultOpenApi(value: 11184809); + const OuterEnumInteger({required this.value}); + final int value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer_default_value.dart new file mode 100644 index 000000000000..cc4104b1dd49 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer_default_value.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum OuterEnumIntegerDefaultValue { + number0(value: 0), + number1(value: 1), + number2(value: 2), + unknownDefaultOpenApi(value: 11184809); + const OuterEnumIntegerDefaultValue({required this.value}); + final int value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_object_with_enum_property.dart new file mode 100644 index 000000000000..9a7e946faecf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_object_with_enum_property.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// OuterObjectWithEnumProperty + /// + /// Properties: + /// * [value] + +@freezed +class OuterObjectWithEnumProperty with _$OuterObjectWithEnumProperty { +const OuterObjectWithEnumProperty._(); + + + const factory OuterObjectWithEnumProperty({ + @JsonKey(name: r'value') + required OuterEnumInteger + value, +}) = _OuterObjectWithEnumProperty; + + + + + factory OuterObjectWithEnumProperty.fromJson(Map json) => _$OuterObjectWithEnumPropertyFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/parent_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/parent_with_nullable.dart new file mode 100644 index 000000000000..f4ebcfe43f60 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/parent_with_nullable.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ParentWithNullable + /// + /// Properties: + /// * [type] + /// * [nullableProperty] + +@freezed +class ParentWithNullable with _$ParentWithNullable { +const ParentWithNullable._(); + + + const factory ParentWithNullable.childwithnullable({ + required ChildWithNullable childWithNullable, + }) = ParentWithNullableChildwithnullable; + const factory ParentWithNullable.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([]) List possibleTypes, + @Default([]) List deserializedModels, + }) = ParentWithNullableUnknown; + + + + + factory ParentWithNullable.fromJson(Map json) { + switch(json['type']){ + case 'ChildWithNullable': + return ParentWithNullable.childwithnullable( + childWithNullable : ChildWithNullable.fromJson(json), + ); + } + return ParentWithNullable.unknown(json: json); + } + + + + + Map toJson() { + return when( + childwithnullable: (childWithNullable) => childWithNullable.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + + +} + + + + +@JsonEnum(valueField: 'value') +enum ParentWithNullableTypeEnum { + childWithNullable(value: r'ChildWithNullable'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const ParentWithNullableTypeEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/pet.dart new file mode 100644 index 000000000000..bf4bbab02440 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/pet.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Pet + /// + /// Properties: + /// * [id] + /// * [category] + /// * [name] + /// * [photoUrls] + /// * [tags] + /// * [status] - pet status in the store + +@freezed +class Pet with _$Pet { +const Pet._(); + + + const factory Pet({ + @JsonKey(name: r'id') + int? + id, + @JsonKey(name: r'category') + Category? + category, + @JsonKey(name: r'name') + required String + name, + @JsonKey(name: r'photoUrls') + required Set< + String? +> + photoUrls, + @JsonKey(name: r'tags') + List< + Tag? +>? + tags, + /// pet status in the store + @JsonKey(name: r'status') + PetStatusEnum? + status, +}) = _Pet; + + + + + factory Pet.fromJson(Map json) => _$PetFromJson(json); + + + + + + + + +} + + + + /// pet status in the store +@JsonEnum(valueField: 'value') +enum PetStatusEnum { + available(value: r'available'), + pending(value: r'pending'), + sold(value: r'sold'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const PetStatusEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/primitive_union_types.dart new file mode 100644 index 000000000000..fafa083471b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/primitive_union_types.dart @@ -0,0 +1,60 @@ +part of 'models.dart'; + +@freezed +class IntInUnion with _$IntInUnion{ + const factory IntInUnion({ + required int intValue + }) = _IntInUnion; + + factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); +} + +@freezed +class StringInUnion with _$StringInUnion{ + const factory StringInUnion({ + required String stringValue + }) = _StringInUnion; + + factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); +} +@freezed +class BoolInUnion with _$BoolInUnion{ + const factory BoolInUnion({ + required bool boolValue + }) = _BoolInUnion; + + factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); +} + +@freezed +class DoubleInUnion with _$DoubleInUnion{ + const factory DoubleInUnion({ + required double doubleValue + }) = _DoubleInUnion; + + factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); +} + +@freezed +class ObjectInUnion with _$ObjectInUnion { + const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; + + factory ObjectInUnion.fromJson(Map json) => + _$ObjectInUnionFromJson(json); +} + +@freezed +class NumInUnion with _$NumInUnion{ + const factory NumInUnion({required num numValue}) = _NumInUnion; + + factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); +} + +@freezed +class DateTimeInUnion with _$DateTimeInUnion { +const factory DateTimeInUnion({required DateTime dateTimeValue}) = +_DateTimeInUnion; + +factory DateTimeInUnion.fromJson(Map json) => +_$DateTimeInUnionFromJson(json); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/read_only_first.dart new file mode 100644 index 000000000000..95486163ea5f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/read_only_first.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ReadOnlyFirst + /// + /// Properties: + /// * [bar] + /// * [baz] + +@freezed +class ReadOnlyFirst with _$ReadOnlyFirst { +const ReadOnlyFirst._(); + + + const factory ReadOnlyFirst({ + @JsonKey(name: r'bar') + String? + bar, + @JsonKey(name: r'baz') + String? + baz, +}) = _ReadOnlyFirst; + + + + + factory ReadOnlyFirst.fromJson(Map json) => _$ReadOnlyFirstFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/single_ref_type.dart new file mode 100644 index 000000000000..098b49b176e0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/single_ref_type.dart @@ -0,0 +1,16 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum SingleRefType { + admin(value: r'admin'), + user(value: r'user'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const SingleRefType({required this.value}); + final String value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/special_model_name.dart new file mode 100644 index 000000000000..6919aa67e9cb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/special_model_name.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// SpecialModelName + /// + /// Properties: + /// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] + +@freezed +class SpecialModelName with _$SpecialModelName { +const SpecialModelName._(); + + + const factory SpecialModelName({ + @JsonKey(name: r'$special[property.name]') + int? + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, +}) = _SpecialModelName; + + + + + factory SpecialModelName.fromJson(Map json) => _$SpecialModelNameFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/tag.dart new file mode 100644 index 000000000000..ecf57fea0818 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/tag.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Tag + /// + /// Properties: + /// * [id] + /// * [name] + +@freezed +class Tag with _$Tag { +const Tag._(); + + + const factory Tag({ + @JsonKey(name: r'id') + int? + id, + @JsonKey(name: r'name') + String? + name, +}) = _Tag; + + + + + factory Tag.fromJson(Map json) => _$TagFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/test_inline_freeform_additional_properties_request.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/test_inline_freeform_additional_properties_request.dart new file mode 100644 index 000000000000..931a021a8cd9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/test_inline_freeform_additional_properties_request.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// TestInlineFreeformAdditionalPropertiesRequest + /// + /// Properties: + /// * [someProperty] + +@freezed +class TestInlineFreeformAdditionalPropertiesRequest with _$TestInlineFreeformAdditionalPropertiesRequest { +const TestInlineFreeformAdditionalPropertiesRequest._(); + + + const factory TestInlineFreeformAdditionalPropertiesRequest({ + @JsonKey(name: r'someProperty') + String? + someProperty, +}) = _TestInlineFreeformAdditionalPropertiesRequest; + + + + + factory TestInlineFreeformAdditionalPropertiesRequest.fromJson(Map json) => _$TestInlineFreeformAdditionalPropertiesRequestFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/user.dart new file mode 100644 index 000000000000..06bc9e1c887d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/user.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// User + /// + /// Properties: + /// * [id] + /// * [username] + /// * [firstName] + /// * [lastName] + /// * [email] + /// * [password] + /// * [phone] + /// * [userStatus] - User Status + +@freezed +class User with _$User { +const User._(); + + + const factory User({ + @JsonKey(name: r'id') + int? + id, + @JsonKey(name: r'username') + String? + username, + @JsonKey(name: r'firstName') + String? + firstName, + @JsonKey(name: r'lastName') + String? + lastName, + @JsonKey(name: r'email') + String? + email, + @JsonKey(name: r'password') + String? + password, + @JsonKey(name: r'phone') + String? + phone, + /// User Status + @JsonKey(name: r'userStatus') + int? + userStatus, +}) = _User; + + + + + factory User.fromJson(Map json) => _$UserFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/pubspec.yaml new file mode 100644 index 000000000000..12925113115d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/pubspec.yaml @@ -0,0 +1,18 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '^3.0.0' + +dependencies: + dio: '^5.2.0' + freezed_annotation: '^2.4.4' + json_annotation: '^4.9.0' + +dev_dependencies: + freezed: '^2.5.2' + json_serializable: '^6.8.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/additional_properties_class_test.dart new file mode 100644 index 000000000000..fd8299fb998f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 AdditionalPropertiesClass? instance = /* AdditionalPropertiesClass(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/all_of_with_single_ref_test.dart new file mode 100644 index 000000000000..ad5da909f6e3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/all_of_with_single_ref_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AllOfWithSingleRef +void main() { + final AllOfWithSingleRef? instance = /* AllOfWithSingleRef(...) */ null; + // TODO add properties to the entity + + group(AllOfWithSingleRef, () { + // String username + test('to test the property `username`', () async { + // TODO + }); + + // SingleRefType singleRefType + test('to test the property `singleRefType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/animal_test.dart new file mode 100644 index 000000000000..83c65b22bfc3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/animal_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Animal +void main() { + final Animal? instance = /* Animal(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/another_fake_api_test.dart new file mode 100644 index 000000000000..ddafef2a831b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/api_response_test.dart new file mode 100644 index 000000000000..9487afd7f58c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 ApiResponse? instance = /* ApiResponse(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_array_of_number_only_test.dart new file mode 100644 index 000000000000..79c0d3f3bba8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 ArrayOfArrayOfNumberOnly? instance = /* ArrayOfArrayOfNumberOnly(...) */ null; + // TODO add properties to the entity + + group(ArrayOfArrayOfNumberOnly, () { + // List> arrayArrayNumber + test('to test the property `arrayArrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_number_only_test.dart new file mode 100644 index 000000000000..d80be97cf147 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 ArrayOfNumberOnly? instance = /* ArrayOfNumberOnly(...) */ null; + // TODO add properties to the entity + + group(ArrayOfNumberOnly, () { + // List arrayNumber + test('to test the property `arrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_test_test.dart new file mode 100644 index 000000000000..bfe7c84fd122 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 ArrayTest? instance = /* ArrayTest(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/capitalization_test.dart new file mode 100644 index 000000000000..156b0ee4993c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/capitalization_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Capitalization +void main() { + final Capitalization? instance = /* Capitalization(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/cat_test.dart new file mode 100644 index 000000000000..0a8811bd37f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/cat_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Cat +void main() { + final Cat? instance = /* Cat(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/category_test.dart new file mode 100644 index 000000000000..0ed6921ae7fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/category_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Category +void main() { + final Category? instance = /* Category(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/child_with_nullable_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/child_with_nullable_test.dart new file mode 100644 index 000000000000..ce2afd9a8a6e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/child_with_nullable_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ChildWithNullable +void main() { + final ChildWithNullable? instance = /* ChildWithNullable(...) */ null; + // TODO add properties to the entity + + group(ChildWithNullable, () { + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String nullableProperty + test('to test the property `nullableProperty`', () async { + // TODO + }); + + // String otherProperty + test('to test the property `otherProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/class_model_test.dart new file mode 100644 index 000000000000..e2dda7bab74e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 ClassModel? instance = /* ClassModel(...) */ null; + // TODO add properties to the entity + + group(ClassModel, () { + // String class_ + test('to test the property `class_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/default_api_test.dart new file mode 100644 index 000000000000..f079565f9785 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/deprecated_object_test.dart new file mode 100644 index 000000000000..1b2214668577 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 DeprecatedObject? instance = /* DeprecatedObject(...) */ null; + // TODO add properties to the entity + + group(DeprecatedObject, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/dog_test.dart new file mode 100644 index 000000000000..98097bd4bf25 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/dog_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Dog +void main() { + final Dog? instance = /* Dog(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/enum_arrays_test.dart new file mode 100644 index 000000000000..30d12204ba17 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 EnumArrays? instance = /* EnumArrays(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/enum_test_test.dart new file mode 100644 index 000000000000..befb9901ce9d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 EnumTest? instance = /* EnumTest(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_api_test.dart new file mode 100644 index 000000000000..67950bf50ce9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_api_test.dart @@ -0,0 +1,183 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FakeApi +void main() { + final instance = Openapi().getFakeApi(); + + group(FakeApi, () { + // for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + // + //Future fakeBigDecimalMap() async + test('test fakeBigDecimalMap', () async { + // TODO + }); + + // 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 + }); + + // test referenced additionalProperties + // + // + // + //Future testAdditionalPropertiesReference(Map requestBody) async + test('test testAdditionalPropertiesReference', () 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 inline free-form additionalProperties + // + // + // + //Future testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) async + test('test testInlineFreeformAdditionalProperties', () async { + // TODO + }); + + // test json serialization of form data + // + // + // + //Future testJsonFormData(String param, String param2) async + test('test testJsonFormData', () async { + // TODO + }); + + // test nullable parent property + // + // + // + //Future testNullable(ChildWithNullable childWithNullable) async + test('test testNullable', () 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 + }); + + // test referenced string map + // + // + // + //Future testStringMapReference(Map requestBody) async + test('test testStringMapReference', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_big_decimal_map200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_big_decimal_map200_response_test.dart new file mode 100644 index 000000000000..1279b8d0ff25 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_big_decimal_map200_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FakeBigDecimalMap200Response +void main() { + final FakeBigDecimalMap200Response? instance = /* FakeBigDecimalMap200Response(...) */ null; + // TODO add properties to the entity + + group(FakeBigDecimalMap200Response, () { + // num someId + test('to test the property `someId`', () async { + // TODO + }); + + // Map someMap + test('to test the property `someMap`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_classname_tags123_api_test.dart new file mode 100644 index 000000000000..3075147f52fd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/file_schema_test_class_test.dart new file mode 100644 index 000000000000..2ccd0d450ce7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 FileSchemaTestClass? instance = /* FileSchemaTestClass(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/foo_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_get_default_response_test.dart new file mode 100644 index 000000000000..4282326fe61f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_get_default_response_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooGetDefaultResponse +void main() { + final FooGetDefaultResponse? instance = /* FooGetDefaultResponse(...) */ null; + // TODO add properties to the entity + + group(FooGetDefaultResponse, () { + // Foo string + test('to test the property `string`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_test.dart new file mode 100644 index 000000000000..28ae9a5b5e13 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final Foo? instance = /* Foo(...) */ null; + // TODO add properties to the entity + + group(Foo, () { + // String bar (default value: 'bar') + test('to test the property `bar`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/format_test_test.dart new file mode 100644 index 000000000000..b08838d81a37 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 FormatTest? instance = /* FormatTest(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/has_only_read_only_test.dart new file mode 100644 index 000000000000..d72429a31bb5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 HasOnlyReadOnly? instance = /* HasOnlyReadOnly(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/health_check_result_test.dart new file mode 100644 index 000000000000..b2b48337b76c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 HealthCheckResult? instance = /* HealthCheckResult(...) */ null; + // TODO add properties to the entity + + group(HealthCheckResult, () { + // String nullableMessage + test('to test the property `nullableMessage`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/map_test_test.dart new file mode 100644 index 000000000000..909415df7540 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 MapTest? instance = /* MapTest(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/mixed_properties_and_additional_properties_class_test.dart new file mode 100644 index 000000000000..0115f01ed6be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 MixedPropertiesAndAdditionalPropertiesClass? instance = /* MixedPropertiesAndAdditionalPropertiesClass(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model200_response_test.dart new file mode 100644 index 000000000000..de8cf3037b6b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 Model200Response? instance = /* Model200Response(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_client_test.dart new file mode 100644 index 000000000000..44faf62f15b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 ModelClient? instance = /* ModelClient(...) */ null; + // TODO add properties to the entity + + group(ModelClient, () { + // String client + test('to test the property `client`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_enum_class_test.dart new file mode 100644 index 000000000000..03e5855bf004 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_file_test.dart new file mode 100644 index 000000000000..8ea65f6ccb41 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 ModelFile? instance = /* ModelFile(...) */ null; + // TODO add properties to the entity + + group(ModelFile, () { + // Test capitalization + // String sourceURI + test('to test the property `sourceURI`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_list_test.dart new file mode 100644 index 000000000000..f748eee993ac --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 ModelList? instance = /* ModelList(...) */ null; + // TODO add properties to the entity + + group(ModelList, () { + // String n123list + test('to test the property `n123list`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_return_test.dart new file mode 100644 index 000000000000..cfc17807c151 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 ModelReturn? instance = /* ModelReturn(...) */ null; + // TODO add properties to the entity + + group(ModelReturn, () { + // int return_ + test('to test the property `return_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/name_test.dart new file mode 100644 index 000000000000..4f3f7f633728 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/name_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Name +void main() { + final Name? instance = /* Name(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/nullable_class_test.dart new file mode 100644 index 000000000000..0ab76167983b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 NullableClass? instance = /* NullableClass(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/number_only_test.dart new file mode 100644 index 000000000000..12b19c59dfb7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 NumberOnly? instance = /* NumberOnly(...) */ null; + // TODO add properties to the entity + + group(NumberOnly, () { + // num justNumber + test('to test the property `justNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/object_with_deprecated_fields_test.dart new file mode 100644 index 000000000000..e197bd0ad807 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 ObjectWithDeprecatedFields? instance = /* ObjectWithDeprecatedFields(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/order_test.dart new file mode 100644 index 000000000000..45b02097daed --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/order_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Order +void main() { + final Order? instance = /* Order(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_composite_test.dart new file mode 100644 index 000000000000..a5f0172ba21c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 OuterComposite? instance = /* OuterComposite(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_default_value_test.dart new file mode 100644 index 000000000000..502c8326be58 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_integer_default_value_test.dart new file mode 100644 index 000000000000..c535fe8ac354 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_integer_test.dart new file mode 100644 index 000000000000..d945bc8c489d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_test.dart new file mode 100644 index 000000000000..8e11eb02fb8a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_object_with_enum_property_test.dart new file mode 100644 index 000000000000..3d72c6188e17 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 OuterObjectWithEnumProperty? instance = /* OuterObjectWithEnumProperty(...) */ null; + // TODO add properties to the entity + + group(OuterObjectWithEnumProperty, () { + // OuterEnumInteger value + test('to test the property `value`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/parent_with_nullable_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/parent_with_nullable_test.dart new file mode 100644 index 000000000000..b501d4220624 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/parent_with_nullable_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ParentWithNullable +void main() { + final ParentWithNullable? instance = /* ParentWithNullable(...) */ null; + // TODO add properties to the entity + + group(ParentWithNullable, () { + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String nullableProperty + test('to test the property `nullableProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_api_test.dart new file mode 100644 index 000000000000..85a28bcfbe53 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_test.dart new file mode 100644 index 000000000000..20b5e3e06735 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pet +void main() { + final Pet? instance = /* Pet(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/read_only_first_test.dart new file mode 100644 index 000000000000..bcefd75befb6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 ReadOnlyFirst? instance = /* ReadOnlyFirst(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/single_ref_type_test.dart new file mode 100644 index 000000000000..5cd85add393e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/single_ref_type_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SingleRefType +void main() { + + group(SingleRefType, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/special_model_name_test.dart new file mode 100644 index 000000000000..23b58324ef99 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 SpecialModelName? instance = /* SpecialModelName(...) */ null; + // TODO add properties to the entity + + group(SpecialModelName, () { + // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/store_api_test.dart new file mode 100644 index 000000000000..08f7f738043b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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 generate 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/petstore_client_lib_fake-freezed/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/tag_test.dart new file mode 100644 index 000000000000..ffe49b3179c3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/tag_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Tag +void main() { + final Tag? instance = /* Tag(...) */ null; + // TODO add properties to the entity + + 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/petstore_client_lib_fake-freezed/test/test_inline_freeform_additional_properties_request_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/test_inline_freeform_additional_properties_request_test.dart new file mode 100644 index 000000000000..8c60d3f11f36 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/test_inline_freeform_additional_properties_request_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for TestInlineFreeformAdditionalPropertiesRequest +void main() { + final TestInlineFreeformAdditionalPropertiesRequest? instance = /* TestInlineFreeformAdditionalPropertiesRequest(...) */ null; + // TODO add properties to the entity + + group(TestInlineFreeformAdditionalPropertiesRequest, () { + // String someProperty + test('to test the property `someProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_api_test.dart new file mode 100644 index 000000000000..4bf28b67623b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/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/petstore_client_lib_fake-freezed/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_test.dart new file mode 100644 index 000000000000..847b14196b93 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_test.dart @@ -0,0 +1,52 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for User +void main() { + final User? instance = /* User(...) */ null; + // TODO add properties to the entity + + 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 + }); + + }); +} From 502c9c624fb136fccff793d507914695bccff6f0 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 7 Sep 2024 08:26:51 +0200 Subject: [PATCH 39/48] fix: small spacing issue --- .../src/main/resources/dart/libraries/dio/api.mustache | 4 +--- 1 file changed, 1 insertion(+), 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 168f2ca0aae0..97ae46a17dec 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 @@ -137,9 +137,7 @@ class {{classname}} { {{{returnType}}} _responseData; {{/freezedUnionResponse}} {{/useFreezed}} - {{^useFreezed}} - {{{.}}}? _responseData; - {{/useFreezed}} + {{^useFreezed}}{{{.}}}? _responseData;{{/useFreezed}} try { {{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} From 5cd17d50edb5c827985c67437a2a88f6495cfafd Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 7 Sep 2024 08:27:10 +0200 Subject: [PATCH 40/48] chore: regenerate samples for freezed. --- .../lib/src/api/default_api.dart | 1 + .../.openapi-generator/FILES | 21 ------- .../lib/src/api/bar_api.dart | 1 + .../lib/src/api/foo_api.dart | 2 + .../.openapi-generator/FILES | 4 -- .../lib/src/api/default_api.dart | 1 + .../.openapi-generator/FILES | 58 ------------------- .../lib/src/api/another_fake_api.dart | 1 + .../lib/src/api/default_api.dart | 1 + .../lib/src/api/fake_api.dart | 8 +++ .../src/api/fake_classname_tags123_api.dart | 1 + .../lib/src/api/pet_api.dart | 5 ++ .../lib/src/api/store_api.dart | 3 + .../lib/src/api/user_api.dart | 2 + 14 files changed, 26 insertions(+), 83 deletions(-) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart index 581c8cfdce0b..f2a138a7077e 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart @@ -59,6 +59,7 @@ class DefaultApi { ); Fruit _responseData; + try { _responseData = Fruit.fromJson(_response.data as Map); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES index ba0ca88ef8b5..d31cbc479253 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md analysis_options.yaml build.yaml @@ -53,23 +52,3 @@ lib/src/model/pizza.dart lib/src/model/pizza_speziale.dart lib/src/model/primitive_union_types.dart pubspec.yaml -test/addressable_test.dart -test/apple_test.dart -test/banana_test.dart -test/bar_api_test.dart -test/bar_create_test.dart -test/bar_ref_or_value_test.dart -test/bar_ref_test.dart -test/bar_test.dart -test/entity_ref_test.dart -test/entity_test.dart -test/extensible_test.dart -test/foo_api_test.dart -test/foo_ref_or_value_test.dart -test/foo_ref_test.dart -test/foo_test.dart -test/fruit_test.dart -test/fruit_type_test.dart -test/pasta_test.dart -test/pizza_speziale_test.dart -test/pizza_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart index 440e15c613d7..625dff159bb3 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart @@ -80,6 +80,7 @@ class BarApi { ); Bar _responseData; + try { _responseData = Bar.fromJson(_response.data as Map); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart index 4a727ff79430..107218c14261 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart @@ -80,6 +80,7 @@ class FooApi { ); FooRefOrValue _responseData; + try { _responseData = FooRefOrValue.fromJson(_response.data as Map); @@ -150,6 +151,7 @@ class FooApi { ); List _responseData; + try { final _responseDataAsList = _response.data as List; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/FILES index ed2e12c2c53a..f99d1b97b0b5 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md analysis_options.yaml build.yaml @@ -19,6 +18,3 @@ lib/src/model/example.dart lib/src/model/models.dart lib/src/model/primitive_union_types.dart pubspec.yaml -test/child_test.dart -test/default_api_test.dart -test/example_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart index aa8dce121498..afce265c9b5b 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart @@ -59,6 +59,7 @@ class DefaultApi { ); Example _responseData; + try { _responseData = Example.fromJson(_response.data as Map); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/FILES index 818c11cee664..a3f13932bea8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md analysis_options.yaml build.yaml @@ -127,60 +126,3 @@ lib/src/model/tag.dart lib/src/model/test_inline_freeform_additional_properties_request.dart lib/src/model/user.dart pubspec.yaml -test/additional_properties_class_test.dart -test/all_of_with_single_ref_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_test.dart -test/category_test.dart -test/child_with_nullable_test.dart -test/class_model_test.dart -test/default_api_test.dart -test/deprecated_object_test.dart -test/dog_test.dart -test/enum_arrays_test.dart -test/enum_test_test.dart -test/fake_api_test.dart -test/fake_big_decimal_map200_response_test.dart -test/fake_classname_tags123_api_test.dart -test/file_schema_test_class_test.dart -test/foo_get_default_response_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/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/parent_with_nullable_test.dart -test/pet_api_test.dart -test/pet_test.dart -test/read_only_first_test.dart -test/single_ref_type_test.dart -test/special_model_name_test.dart -test/store_api_test.dart -test/tag_test.dart -test/test_inline_freeform_additional_properties_request_test.dart -test/user_api_test.dart -test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart index ef34a5b6f04b..0848266271ea 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart @@ -80,6 +80,7 @@ class AnotherFakeApi { ); ModelClient _responseData; + try { _responseData = ModelClient.fromJson(_response.data as Map); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart index 13a24cdbf574..1d8e607e18f3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart @@ -59,6 +59,7 @@ class DefaultApi { ); FooGetDefaultResponse _responseData; + try { _responseData = FooGetDefaultResponse.fromJson(_response.data as Map); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart index 1946a0bb6308..33ae292a61e7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart @@ -59,6 +59,7 @@ class FakeApi { ); FakeBigDecimalMap200Response _responseData; + try { _responseData = FakeBigDecimalMap200Response.fromJson(_response.data as Map); @@ -129,6 +130,7 @@ class FakeApi { ); HealthCheckResult _responseData; + try { _responseData = HealthCheckResult.fromJson(_response.data as Map); @@ -304,6 +306,7 @@ class FakeApi { ); bool _responseData; + try { _responseData = _response.data as bool; @@ -395,6 +398,7 @@ class FakeApi { ); OuterComposite _responseData; + try { _responseData = OuterComposite.fromJson(_response.data as Map); @@ -486,6 +490,7 @@ class FakeApi { ); num _responseData; + try { _responseData = _response.data as num; @@ -577,6 +582,7 @@ class FakeApi { ); String _responseData; + try { _responseData = _response.data as String; @@ -668,6 +674,7 @@ class FakeApi { ); OuterObjectWithEnumProperty _responseData; + try { _responseData = OuterObjectWithEnumProperty.fromJson(_response.data as Map); @@ -1035,6 +1042,7 @@ class FakeApi { ); ModelClient _responseData; + try { _responseData = ModelClient.fromJson(_response.data as Map); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart index dbcde22e5264..e4df96000116 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart @@ -87,6 +87,7 @@ class FakeClassnameTags123Api { ); ModelClient _responseData; + try { _responseData = ModelClient.fromJson(_response.data as Map); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart index a7c8c0262a2e..353d3b783c25 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart @@ -199,6 +199,7 @@ class PetApi { ); List _responseData; + try { final _responseDataAsList = _response.data as List; @@ -283,6 +284,7 @@ class PetApi { ); Set _responseData; + try { final _responseDataAsSet = _response.data as List; @@ -363,6 +365,7 @@ class PetApi { ); Pet _responseData; + try { _responseData = Pet.fromJson(_response.data as Map); @@ -623,6 +626,7 @@ class PetApi { ); ApiResponse _responseData; + try { _responseData = ApiResponse.fromJson(_response.data as Map); @@ -731,6 +735,7 @@ r'requiredFile': ); ApiResponse _responseData; + try { _responseData = ApiResponse.fromJson(_response.data as Map); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart index a87ad786cdcf..37987c684ef2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart @@ -114,6 +114,7 @@ class StoreApi { ); Map _responseData; + try { _responseData = _response.data as Map; @@ -186,6 +187,7 @@ class StoreApi { ); Order _responseData; + try { _responseData = Order.fromJson(_response.data as Map); @@ -277,6 +279,7 @@ class StoreApi { ); Order _responseData; + try { _responseData = Order.fromJson(_response.data as Map); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart index f24d00daabe4..a68b3f17dad1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart @@ -310,6 +310,7 @@ class UserApi { ); User _responseData; + try { _responseData = User.fromJson(_response.data as Map); @@ -390,6 +391,7 @@ class UserApi { ); String _responseData; + try { _responseData = _response.data as String; From 86bf1205491d8736485a0488b31566f588a2fa58 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 7 Sep 2024 08:39:29 +0200 Subject: [PATCH 41/48] chore: configure to generate samples in a freezed folder and remove old samples of freezed. --- bin/configs/dart-dio-oneof-freezed.yaml | 2 +- ...-polymorphism-and-inheritance-freezed.yaml | 2 +- .../dart-dio-oneof-primitive-freezed.yaml | 2 +- ...-dio-petstore-client-lib-fake-freezed.yaml | 2 +- .../dart-dio/oneof-freezed/.gitignore | 41 - .../oneof-freezed/.openapi-generator-ignore | 23 - .../oneof-freezed/.openapi-generator/FILES | 22 - .../oneof-freezed/.openapi-generator/VERSION | 1 - .../petstore/dart-dio/oneof-freezed/README.md | 85 - .../oneof-freezed/analysis_options.yaml | 11 - .../dart-dio/oneof-freezed/build.yaml | 11 - .../dart-dio/oneof-freezed/doc/Apple.md | 15 - .../dart-dio/oneof-freezed/doc/Banana.md | 15 - .../dart-dio/oneof-freezed/doc/DefaultApi.md | 51 - .../dart-dio/oneof-freezed/doc/Fruit.md | 17 - .../dart-dio/oneof-freezed/lib/openapi.dart | 15 - .../dart-dio/oneof-freezed/lib/src/api.dart | 68 - .../lib/src/api/default_api.dart | 89 - .../lib/src/auth/api_key_auth.dart | 30 - .../oneof-freezed/lib/src/auth/auth.dart | 18 - .../lib/src/auth/basic_auth.dart | 37 - .../lib/src/auth/bearer_auth.dart | 26 - .../oneof-freezed/lib/src/auth/oauth.dart | 26 - .../oneof-freezed/lib/src/model/apple.dart | 40 - .../oneof-freezed/lib/src/model/banana.dart | 40 - .../oneof-freezed/lib/src/model/fruit.dart | 106 - .../oneof-freezed/lib/src/model/models.dart | 20 - .../lib/src/model/primitive_union_types.dart | 60 - .../dart-dio/oneof-freezed/pubspec.yaml | 18 - .../oneof-freezed/test/apple_test.dart | 16 - .../oneof-freezed/test/banana_test.dart | 16 - .../oneof-freezed/test/default_api_test.dart | 16 - .../oneof-freezed/test/fruit_test.dart | 26 - .../.gitignore | 41 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 54 - .../.openapi-generator/VERSION | 1 - .../README.md | 104 - .../analysis_options.yaml | 11 - .../build.yaml | 11 - .../doc/Addressable.md | 16 - .../doc/Apple.md | 15 - .../doc/Banana.md | 15 - .../doc/Bar.md | 22 - .../doc/BarApi.md | 55 - .../doc/BarCreate.md | 22 - .../doc/BarRef.md | 21 - .../doc/BarRefOrValue.md | 24 - .../doc/Entity.md | 19 - .../doc/EntityRef.md | 21 - .../doc/Extensible.md | 17 - .../doc/Foo.md | 21 - .../doc/FooApi.md | 93 - .../doc/FooRef.md | 22 - .../doc/FooRefOrValue.md | 24 - .../doc/Fruit.md | 17 - .../doc/FruitType.md | 14 - .../doc/Pasta.md | 20 - .../doc/Pizza.md | 20 - .../doc/PizzaSpeziale.md | 21 - .../lib/openapi.dart | 16 - .../lib/src/api.dart | 75 - .../lib/src/api/bar_api.dart | 110 - .../lib/src/api/foo_api.dart | 182 -- .../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/model/addressable.dart | 46 - .../lib/src/model/apple.dart | 40 - .../lib/src/model/banana.dart | 40 - .../lib/src/model/bar.dart | 72 - .../lib/src/model/bar_create.dart | 73 - .../lib/src/model/bar_ref.dart | 71 - .../lib/src/model/bar_ref_or_value.dart | 113 -- .../lib/src/model/entity.dart | 104 - .../lib/src/model/entity_ref.dart | 74 - .../lib/src/model/extensible.dart | 51 - .../lib/src/model/foo.dart | 69 - .../lib/src/model/foo_ref.dart | 75 - .../lib/src/model/foo_ref_or_value.dart | 88 - .../lib/src/model/fruit.dart | 70 - .../lib/src/model/fruit_type.dart | 16 - .../lib/src/model/models.dart | 20 - .../lib/src/model/pasta.dart | 65 - .../lib/src/model/pizza.dart | 65 - .../lib/src/model/pizza_speziale.dart | 69 - .../lib/src/model/primitive_union_types.dart | 60 - .../pubspec.yaml | 18 - .../test/addressable_test.dart | 23 - .../test/apple_test.dart | 16 - .../test/banana_test.dart | 16 - .../test/bar_api_test.dart | 18 - .../test/bar_create_test.dart | 56 - .../test/bar_ref_or_value_test.dart | 68 - .../test/bar_ref_test.dart | 53 - .../test/bar_test.dart | 55 - .../test/entity_ref_test.dart | 53 - .../test/entity_test.dart | 41 - .../test/extensible_test.dart | 29 - .../test/foo_api_test.dart | 25 - .../test/foo_ref_or_value_test.dart | 68 - .../test/foo_ref_test.dart | 58 - .../test/foo_test.dart | 51 - .../test/fruit_test.dart | 26 - .../test/fruit_type_test.dart | 9 - .../test/pasta_test.dart | 46 - .../test/pizza_speziale_test.dart | 51 - .../test/pizza_test.dart | 46 - .../oneof_primitive_freezed/.gitignore | 41 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 20 - .../.openapi-generator/VERSION | 1 - .../oneof_primitive_freezed/README.md | 84 - .../analysis_options.yaml | 11 - .../oneof_primitive_freezed/build.yaml | 11 - .../oneof_primitive_freezed/doc/Child.md | 15 - .../oneof_primitive_freezed/doc/DefaultApi.md | 51 - .../oneof_primitive_freezed/doc/Example.md | 15 - .../oneof_primitive_freezed/lib/openapi.dart | 15 - .../oneof_primitive_freezed/lib/src/api.dart | 68 - .../lib/src/api/default_api.dart | 89 - .../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/model/child.dart | 40 - .../lib/src/model/example.dart | 104 - .../lib/src/model/models.dart | 20 - .../lib/src/model/primitive_union_types.dart | 60 - .../oneof_primitive_freezed/pubspec.yaml | 18 - .../test/child_test.dart | 16 - .../test/default_api_test.dart | 16 - .../test/example_test.dart | 16 - .../.gitignore | 41 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 128 -- .../.openapi-generator/VERSION | 1 - .../README.md | 211 -- .../analysis_options.yaml | 11 - .../build.yaml | 11 - .../doc/AdditionalPropertiesClass.md | 16 - .../doc/AllOfWithSingleRef.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/Category.md | 16 - .../doc/ChildWithNullable.md | 17 - .../doc/ClassModel.md | 15 - .../doc/DefaultApi.md | 51 - .../doc/DeprecatedObject.md | 15 - .../doc/Dog.md | 17 - .../doc/EnumArrays.md | 16 - .../doc/EnumTest.md | 22 - .../doc/FakeApi.md | 1028 ---------- .../doc/FakeBigDecimalMap200Response.md | 16 - .../doc/FakeClassnameTags123Api.md | 61 - .../doc/FileSchemaTestClass.md | 16 - .../doc/Foo.md | 15 - .../doc/FooGetDefaultResponse.md | 15 - .../doc/FormatTest.md | 30 - .../doc/HasOnlyReadOnly.md | 16 - .../doc/HealthCheckResult.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/ParentWithNullable.md | 16 - .../doc/Pet.md | 20 - .../doc/PetApi.md | 439 ---- .../doc/ReadOnlyFirst.md | 16 - .../doc/SingleRefType.md | 14 - .../doc/SpecialModelName.md | 15 - .../doc/StoreApi.md | 188 -- .../doc/Tag.md | 16 - ...lineFreeformAdditionalPropertiesRequest.md | 15 - .../doc/User.md | 22 - .../doc/UserApi.md | 359 ---- .../lib/openapi.dart | 21 - .../lib/src/api.dart | 110 - .../lib/src/api/another_fake_api.dart | 110 - .../lib/src/api/default_api.dart | 89 - .../lib/src/api/fake_api.dart | 1769 ----------------- .../src/api/fake_classname_tags123_api.dart | 117 -- .../lib/src/api/pet_api.dart | 765 ------- .../lib/src/api/store_api.dart | 309 --- .../lib/src/api/user_api.dart | 536 ----- .../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 - .../model/additional_properties_class.dart | 50 - .../lib/src/model/all_of_with_single_ref.dart | 44 - .../lib/src/model/animal.dart | 69 - .../lib/src/model/api_response.dart | 48 - .../model/array_of_array_of_number_only.dart | 44 - .../lib/src/model/array_of_number_only.dart | 42 - .../lib/src/model/array_test.dart | 58 - .../lib/src/model/capitalization.dart | 61 - .../lib/src/model/cat.dart | 48 - .../lib/src/model/category.dart | 44 - .../lib/src/model/child_with_nullable.dart | 56 - .../lib/src/model/class_model.dart | 40 - .../lib/src/model/deprecated_object.dart | 40 - .../lib/src/model/dog.dart | 48 - .../lib/src/model/enum_arrays.dart | 65 - .../lib/src/model/enum_test.dart | 106 - .../fake_big_decimal_map200_response.dart | 46 - .../lib/src/model/file_schema_test_class.dart | 46 - .../lib/src/model/foo.dart | 40 - .../src/model/foo_get_default_response.dart | 40 - .../lib/src/model/format_test.dart | 102 - .../lib/src/model/has_only_read_only.dart | 44 - .../lib/src/model/health_check_result.dart | 40 - .../lib/src/model/map_test.dart | 72 - ...rties_and_additional_properties_class.dart | 50 - .../lib/src/model/model200_response.dart | 44 - .../lib/src/model/model_client.dart | 40 - .../lib/src/model/model_enum_class.dart | 17 - .../lib/src/model/model_file.dart | 41 - .../lib/src/model/model_list.dart | 40 - .../lib/src/model/model_return.dart | 40 - .../lib/src/model/models.dart | 20 - .../lib/src/model/name.dart | 52 - .../lib/src/model/nullable_class.dart | 96 - .../lib/src/model/number_only.dart | 40 - .../model/object_with_deprecated_fields.dart | 54 - .../lib/src/model/order.dart | 71 - .../lib/src/model/outer_composite.dart | 48 - .../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 | 40 - .../lib/src/model/parent_with_nullable.dart | 69 - .../lib/src/model/pet.dart | 75 - .../lib/src/model/primitive_union_types.dart | 60 - .../lib/src/model/read_only_first.dart | 44 - .../lib/src/model/single_ref_type.dart | 16 - .../lib/src/model/special_model_name.dart | 40 - .../lib/src/model/tag.dart | 44 - ...reeform_additional_properties_request.dart | 40 - .../lib/src/model/user.dart | 69 - .../pubspec.yaml | 18 - .../additional_properties_class_test.dart | 21 - .../test/all_of_with_single_ref_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_test.dart | 26 - .../test/category_test.dart | 21 - .../test/child_with_nullable_test.dart | 26 - .../test/class_model_test.dart | 16 - .../test/default_api_test.dart | 16 - .../test/deprecated_object_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 | 183 -- ...fake_big_decimal_map200_response_test.dart | 21 - .../test/fake_classname_tags123_api_test.dart | 20 - .../test/file_schema_test_class_test.dart | 21 - .../test/foo_get_default_response_test.dart | 16 - .../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/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/parent_with_nullable_test.dart | 21 - .../test/pet_api_test.dart | 92 - .../test/pet_test.dart | 42 - .../test/read_only_first_test.dart | 21 - .../test/single_ref_type_test.dart | 9 - .../test/special_model_name_test.dart | 16 - .../test/store_api_test.dart | 47 - .../test/tag_test.dart | 21 - ...rm_additional_properties_request_test.dart | 16 - .../test/user_api_test.dart | 83 - .../test/user_test.dart | 52 - 324 files changed, 4 insertions(+), 16816 deletions(-) delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/build.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Apple.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Banana.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Fruit.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/apple.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/banana.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/fruit.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/models.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/primitive_union_types.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/apple_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/banana_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/fruit_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/build.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Addressable.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Apple.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Banana.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Bar.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarCreate.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRef.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRefOrValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Entity.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/EntityRef.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Extensible.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Foo.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRef.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRefOrValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Fruit.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FruitType.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pasta.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pizza.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/PizzaSpeziale.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/addressable.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/apple.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/banana.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_create.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref_or_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity_ref.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/extensible.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref_or_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit_type.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/models.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pasta.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza_speziale.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/primitive_union_types.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/addressable_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/apple_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/banana_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_create_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_or_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_ref_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/extensible_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_or_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_type_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pasta_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_speziale_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/build.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Child.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Example.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/child.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/example.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/models.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/primitive_union_types.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/child_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/example_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/build.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AllOfWithSingleRef.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Animal.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AnotherFakeApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ApiResponse.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Capitalization.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Cat.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Category.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ChildWithNullable.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ClassModel.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/DeprecatedObject.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Dog.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/EnumArrays.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/EnumTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeBigDecimalMap200Response.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeClassnameTags123Api.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FileSchemaTestClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Foo.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FooGetDefaultResponse.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FormatTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/HasOnlyReadOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/HealthCheckResult.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/MapTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Model200Response.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelClient.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelEnumClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelFile.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelList.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelReturn.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Name.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/NullableClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/NumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ObjectWithDeprecatedFields.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Order.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterComposite.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnum.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumInteger.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumIntegerDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterObjectWithEnumProperty.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ParentWithNullable.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Pet.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/PetApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ReadOnlyFirst.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/SingleRefType.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/SpecialModelName.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/StoreApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Tag.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/TestInlineFreeformAdditionalPropertiesRequest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/User.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/UserApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/additional_properties_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/all_of_with_single_ref.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/animal.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/api_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_array_of_number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/capitalization.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/cat.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/category.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/child_with_nullable.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/class_model.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/deprecated_object.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/dog.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_arrays.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/fake_big_decimal_map200_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/file_schema_test_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo_get_default_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/format_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/has_only_read_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/health_check_result.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/map_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/mixed_properties_and_additional_properties_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model200_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_client.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_enum_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_file.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_list.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_return.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/models.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/name.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/nullable_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/object_with_deprecated_fields.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/order.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_composite.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_default_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer_default_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_object_with_enum_property.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/parent_with_nullable.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/pet.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/primitive_union_types.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/read_only_first.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/single_ref_type.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/special_model_name.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/tag.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/test_inline_freeform_additional_properties_request.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/user.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/additional_properties_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/all_of_with_single_ref_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/animal_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/another_fake_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/api_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_array_of_number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/capitalization_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/cat_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/category_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/child_with_nullable_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/class_model_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/deprecated_object_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/dog_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/enum_arrays_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/enum_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_big_decimal_map200_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_classname_tags123_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/file_schema_test_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_get_default_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/format_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/has_only_read_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/health_check_result_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/map_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/mixed_properties_and_additional_properties_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model200_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_client_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_enum_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_file_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_list_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_return_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/name_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/nullable_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/object_with_deprecated_fields_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/order_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_composite_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_default_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_integer_default_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_integer_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_object_with_enum_property_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/parent_with_nullable_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/read_only_first_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/single_ref_type_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/special_model_name_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/store_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/tag_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/test_inline_freeform_additional_properties_request_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_test.dart diff --git a/bin/configs/dart-dio-oneof-freezed.yaml b/bin/configs/dart-dio-oneof-freezed.yaml index 9b9f7682a8d8..7c2baeb15adf 100644 --- a/bin/configs/dart-dio-oneof-freezed.yaml +++ b/bin/configs/dart-dio-oneof-freezed.yaml @@ -1,5 +1,5 @@ generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/oneof-freezed +outputDir: samples/openapi3/client/petstore/dart-dio/freezed/oneof inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio typeMappings: diff --git a/bin/configs/dart-dio-oneof-polymorphism-and-inheritance-freezed.yaml b/bin/configs/dart-dio-oneof-polymorphism-and-inheritance-freezed.yaml index ad469b3f81e2..df67bb1d13c2 100644 --- a/bin/configs/dart-dio-oneof-polymorphism-and-inheritance-freezed.yaml +++ b/bin/configs/dart-dio-oneof-polymorphism-and-inheritance-freezed.yaml @@ -1,5 +1,5 @@ generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed +outputDir: samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio typeMappings: diff --git a/bin/configs/dart-dio-oneof-primitive-freezed.yaml b/bin/configs/dart-dio-oneof-primitive-freezed.yaml index b0e8a3787e95..a2c948ebe086 100644 --- a/bin/configs/dart-dio-oneof-primitive-freezed.yaml +++ b/bin/configs/dart-dio-oneof-primitive-freezed.yaml @@ -1,5 +1,5 @@ generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed +outputDir: samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_primitive.yaml templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio typeMappings: diff --git a/bin/configs/dart-dio-petstore-client-lib-fake-freezed.yaml b/bin/configs/dart-dio-petstore-client-lib-fake-freezed.yaml index 166317b96d48..82723cd9c2d1 100644 --- a/bin/configs/dart-dio-petstore-client-lib-fake-freezed.yaml +++ b/bin/configs/dart-dio-petstore-client-lib-fake-freezed.yaml @@ -1,5 +1,5 @@ generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed +outputDir: samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake 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: diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# 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/oneof-freezed/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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/oneof-freezed/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/FILES deleted file mode 100644 index fa20c48ff1e4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/FILES +++ /dev/null @@ -1,22 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -build.yaml -doc/Apple.md -doc/Banana.md -doc/DefaultApi.md -doc/Fruit.md -lib/openapi.dart -lib/src/api.dart -lib/src/api/default_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/model/apple.dart -lib/src/model/banana.dart -lib/src/model/fruit.dart -lib/src/model/models.dart -lib/src/model/primitive_union_types.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/VERSION deleted file mode 100644 index 17f2442ff3bc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/README.md b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/README.md deleted file mode 100644 index e382c9ec6ea0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# openapi (EXPERIMENTAL) -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 0.0.1 -- Generator version: 7.9.0-SNAPSHOT -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.15.0+ or Flutter 2.8.0+ -* Dio 5.0.0+ (https://pub.dev/packages/dio) - -## 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().getDefaultApi(); - -try { - final response = await api.rootGet(); - print(response); -} catch on DioException (e) { - print("Exception when calling DefaultApi->rootGet: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -[*DefaultApi*](doc/DefaultApi.md) | [**rootGet**](doc/DefaultApi.md#rootget) | **GET** / | - - -## Documentation For Models - - - [Apple](doc/Apple.md) - - [Banana](doc/Banana.md) - - [Fruit](doc/Fruit.md) - - -## Documentation For Authorization - -Endpoints do not require authorization. - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/analysis_options.yaml deleted file mode 100644 index 8ff047ce7675..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/analysis_options.yaml +++ /dev/null @@ -1,11 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strict-casts: false - exclude: - - test/*.dart - - lib/src/model/*.g.dart - - lib/src/model/*.freezed.dart - errors: - deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/build.yaml b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/build.yaml deleted file mode 100644 index dee5edd67f90..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/build.yaml +++ /dev/null @@ -1,11 +0,0 @@ -targets: - $default: - builders: - freezed|freezed: - # This restricts freezed build runner to look - # files only inside models folder. - # If you prefer the build runner to scan the whole - # project for files then simply remove this build.yaml file - generate_for: - include: - - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Apple.md deleted file mode 100644 index c7f711b87cef..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Apple.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.Apple - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **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/oneof-freezed/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Banana.md deleted file mode 100644 index bef8a58a4276..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Banana.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.Banana - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **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/oneof-freezed/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/DefaultApi.md deleted file mode 100644 index b010661371f9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/DefaultApi.md +++ /dev/null @@ -1,51 +0,0 @@ -# openapi.api.DefaultApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**rootGet**](DefaultApi.md#rootget) | **GET** / | - - -# **rootGet** -> Fruit rootGet() - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.rootGet(); - print(response); -} catch on DioException (e) { - print('Exception when calling DefaultApi->rootGet: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**Fruit**](Fruit.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/oneof-freezed/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Fruit.md deleted file mode 100644 index 5d48cc6e6d38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/doc/Fruit.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.Fruit - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | **String** | | [optional] -**kind** | **String** | | [optional] -**count** | **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/oneof-freezed/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/openapi.dart deleted file mode 100644 index 581830866afb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/openapi.dart +++ /dev/null @@ -1,15 +0,0 @@ -// -// 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/bearer_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; - - -export 'package:openapi/src/api/default_api.dart'; - - -export 'package:openapi/src/model/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api.dart deleted file mode 100644 index 8943da413f65..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api.dart +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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/default_api.dart'; - -class Openapi { - static const String basePath = r'http://localhost'; - - final Dio dio; - Openapi({ - Dio? dio, - String? basePathOverride, - List? interceptors, - }) : - this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: const Duration(milliseconds: 5000), - receiveTimeout: const Duration(milliseconds: 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 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); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart deleted file mode 100644 index f2a138a7077e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/api/default_api.dart +++ /dev/null @@ -1,89 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'dart:convert'; -import '../model/models.dart'; -import 'package:dio/dio.dart'; - - -class DefaultApi { - - final Dio _dio; - - const DefaultApi(this._dio); - - /// rootGet - /// - /// - /// 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 [Fruit] as data - /// Throws [DioException] if API call or serialization fails - Future> rootGet({ - - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/'; - 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, - ); - - Fruit _responseData; - - - try { - _responseData = Fruit.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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/oneof-freezed/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/api_key_auth.dart deleted file mode 100644 index ee16e3f0f92f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/api_key_auth.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// 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/oneof-freezed/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/auth.dart deleted file mode 100644 index f7ae9bf3f11e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/auth.dart +++ /dev/null @@ -1,18 +0,0 @@ -// -// 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/oneof-freezed/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/basic_auth.dart deleted file mode 100644 index b65ccb5b71f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/basic_auth.dart +++ /dev/null @@ -1,37 +0,0 @@ -// -// 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']?.toLowerCase() == '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/oneof-freezed/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 8f46678761b2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/bearer_auth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// 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']?.toLowerCase() == '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/oneof-freezed/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/oauth.dart deleted file mode 100644 index 337cf762b0ce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/auth/oauth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// 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/oneof-freezed/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/apple.dart deleted file mode 100644 index 24e1d263d4c6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/apple.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Apple - /// - /// Properties: - /// * [kind] - -@freezed -class Apple with _$Apple { -const Apple._(); - - - const factory Apple({ - @JsonKey(name: r'kind') - String? - kind, -}) = _Apple; - - - - - factory Apple.fromJson(Map json) => _$AppleFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/banana.dart deleted file mode 100644 index 3d3bf3238989..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/banana.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Banana - /// - /// Properties: - /// * [count] - -@freezed -class Banana with _$Banana { -const Banana._(); - - - const factory Banana({ - @JsonKey(name: r'count') - num? - count, -}) = _Banana; - - - - - factory Banana.fromJson(Map json) => _$BananaFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/fruit.dart deleted file mode 100644 index 5e4dfbf65182..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/fruit.dart +++ /dev/null @@ -1,106 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Fruit - /// - /// Properties: - /// * [color] - /// * [kind] - /// * [count] - -@freezed -class Fruit with _$Fruit { -const Fruit._(); - - - - - const factory Fruit.asApple({ - required Apple appleValue - }) = FruitAsApple; - const factory Fruit.asBanana({ - required Banana bananaValue - }) = FruitAsBanana; - const factory Fruit.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([Apple,Banana,]) List possibleTypes, - @Default([]) List deserializedModels, - }) = FruitUnknown; - - - - - factory Fruit.fromJson(Map json) { - Fruit? deserializedModel; - // A discriminator property is not defined in the spec so - // we try to parse the json against all the models and try to - // return one of the valid model. Note: this approach tries - // to return one valid model and if more than one model - // is valid it then returns unknown type along with the json so - // the consumer can decide which model it is. - final fromJsonMethods = >[Apple.fromJson,Banana.fromJson,]; - final deserializedModels = []; - for (final fromJsonMethod in fromJsonMethods) { - try { - final dynamic parsedModel= fromJsonMethod.call(json); - // Note following line won't be executed if already the above parsing fails. - if (parsedModel is Apple) { - deserializedModel = Fruit.asApple( - appleValue : parsedModel, - ); - } else - if (parsedModel is Banana) { - deserializedModel = Fruit.asBanana( - bananaValue : parsedModel, - ); - } else - { - deserializedModel = Fruit.unknown(json: json); - } - deserializedModels.add(deserializedModel); - } catch (e) { - // We are suppressing the deserialization error when the json could not - // be parsed into one of the model. Because we return [Fruit.unknown] - // if the deserialization fails. - } - } - // Return an unknown type when the incoming json parses into more than one models. - // Since we pass deserializedModels, clients can still use the deserialized model. - // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. - // So we still return this as an unknown type. - if(deserializedModels.length > 1){ - deserializedModel = Fruit.unknown( - json: json, - deserializedModels: deserializedModels, - errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, - ); - } - - - return deserializedModel ?? Fruit.unknown(json: json); - } - - - - Map toJson() { - return when( - asApple: (asApple) => asApple.toJson(), - asBanana: (asBanana) => asBanana.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/models.dart deleted file mode 100644 index 3669a6b40ac4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/models.dart +++ /dev/null @@ -1,20 +0,0 @@ -//ignore_for_file: invalid_annotation_target -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:dio/dio.dart'; -import 'dart:convert'; - -part 'models.freezed.dart'; -part 'models.g.dart'; - -part 'primitive_union_types.dart'; -part 'apple.dart';part 'banana.dart';part 'fruit.dart'; - -/// A typedef used in the deserialization of OneOf and AnyOf -/// models when no discriminator mapping is provided. -typedef FromJsonMethodType = T Function(Map); - -/// Deserialization error types for OneOf and AnyOf types. -enum DeserializationErrorType { - MoreThanOneTypeSatisfied, - UnKnownType, -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/primitive_union_types.dart deleted file mode 100644 index fafa083471b8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/lib/src/model/primitive_union_types.dart +++ /dev/null @@ -1,60 +0,0 @@ -part of 'models.dart'; - -@freezed -class IntInUnion with _$IntInUnion{ - const factory IntInUnion({ - required int intValue - }) = _IntInUnion; - - factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); -} - -@freezed -class StringInUnion with _$StringInUnion{ - const factory StringInUnion({ - required String stringValue - }) = _StringInUnion; - - factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); -} -@freezed -class BoolInUnion with _$BoolInUnion{ - const factory BoolInUnion({ - required bool boolValue - }) = _BoolInUnion; - - factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); -} - -@freezed -class DoubleInUnion with _$DoubleInUnion{ - const factory DoubleInUnion({ - required double doubleValue - }) = _DoubleInUnion; - - factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); -} - -@freezed -class ObjectInUnion with _$ObjectInUnion { - const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; - - factory ObjectInUnion.fromJson(Map json) => - _$ObjectInUnionFromJson(json); -} - -@freezed -class NumInUnion with _$NumInUnion{ - const factory NumInUnion({required num numValue}) = _NumInUnion; - - factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); -} - -@freezed -class DateTimeInUnion with _$DateTimeInUnion { -const factory DateTimeInUnion({required DateTime dateTimeValue}) = -_DateTimeInUnion; - -factory DateTimeInUnion.fromJson(Map json) => -_$DateTimeInUnionFromJson(json); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/pubspec.yaml deleted file mode 100644 index 12925113115d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/pubspec.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '^3.0.0' - -dependencies: - dio: '^5.2.0' - freezed_annotation: '^2.4.4' - json_annotation: '^4.9.0' - -dev_dependencies: - freezed: '^2.5.2' - json_serializable: '^6.8.0' - build_runner: any - test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/apple_test.dart deleted file mode 100644 index 200492f8b1f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/apple_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Apple -void main() { - final Apple? instance = /* Apple(...) */ null; - // TODO add properties to the entity - - group(Apple, () { - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/banana_test.dart deleted file mode 100644 index ae681c740af5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/banana_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Banana -void main() { - final Banana? instance = /* Banana(...) */ null; - // TODO add properties to the entity - - group(Banana, () { - // num count - test('to test the property `count`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/default_api_test.dart deleted file mode 100644 index 07d256d2e554..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/default_api_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for DefaultApi -void main() { - final instance = Openapi().getDefaultApi(); - - group(DefaultApi, () { - //Future rootGet() async - test('test rootGet', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/fruit_test.dart deleted file mode 100644 index 8dfac99108f2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof-freezed/test/fruit_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Fruit -void main() { - final Fruit? instance = /* Fruit(...) */ null; - // TODO add properties to the entity - - group(Fruit, () { - // String color - test('to test the property `color`', () async { - // TODO - }); - - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - // num count - test('to test the property `count`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# 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/oneof_polymorphism_and_inheritance_freezed/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES deleted file mode 100644 index d31cbc479253..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/FILES +++ /dev/null @@ -1,54 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -build.yaml -doc/Addressable.md -doc/Apple.md -doc/Banana.md -doc/Bar.md -doc/BarApi.md -doc/BarCreate.md -doc/BarRef.md -doc/BarRefOrValue.md -doc/Entity.md -doc/EntityRef.md -doc/Extensible.md -doc/Foo.md -doc/FooApi.md -doc/FooRef.md -doc/FooRefOrValue.md -doc/Fruit.md -doc/FruitType.md -doc/Pasta.md -doc/Pizza.md -doc/PizzaSpeziale.md -lib/openapi.dart -lib/src/api.dart -lib/src/api/bar_api.dart -lib/src/api/foo_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/model/addressable.dart -lib/src/model/apple.dart -lib/src/model/banana.dart -lib/src/model/bar.dart -lib/src/model/bar_create.dart -lib/src/model/bar_ref.dart -lib/src/model/bar_ref_or_value.dart -lib/src/model/entity.dart -lib/src/model/entity_ref.dart -lib/src/model/extensible.dart -lib/src/model/foo.dart -lib/src/model/foo_ref.dart -lib/src/model/foo_ref_or_value.dart -lib/src/model/fruit.dart -lib/src/model/fruit_type.dart -lib/src/model/models.dart -lib/src/model/pasta.dart -lib/src/model/pizza.dart -lib/src/model/pizza_speziale.dart -lib/src/model/primitive_union_types.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/VERSION deleted file mode 100644 index 17f2442ff3bc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/README.md deleted file mode 100644 index 2b9a132c0aa7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# openapi (EXPERIMENTAL) -This tests for a oneOf interface representation - - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 0.0.1 -- Generator version: 7.9.0-SNAPSHOT -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.15.0+ or Flutter 2.8.0+ -* Dio 5.0.0+ (https://pub.dev/packages/dio) - -## 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().getBarApi(); -final BarCreate barCreate = ; // BarCreate | - -try { - final response = await api.createBar(barCreate); - print(response); -} catch on DioException (e) { - print("Exception when calling BarApi->createBar: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:8080* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -[*BarApi*](doc/BarApi.md) | [**createBar**](doc/BarApi.md#createbar) | **POST** /bar | Create a Bar -[*FooApi*](doc/FooApi.md) | [**createFoo**](doc/FooApi.md#createfoo) | **POST** /foo | Create a Foo -[*FooApi*](doc/FooApi.md) | [**getAllFoos**](doc/FooApi.md#getallfoos) | **GET** /foo | GET all Foos - - -## Documentation For Models - - - [Addressable](doc/Addressable.md) - - [Apple](doc/Apple.md) - - [Banana](doc/Banana.md) - - [Bar](doc/Bar.md) - - [BarCreate](doc/BarCreate.md) - - [BarRef](doc/BarRef.md) - - [BarRefOrValue](doc/BarRefOrValue.md) - - [Entity](doc/Entity.md) - - [EntityRef](doc/EntityRef.md) - - [Extensible](doc/Extensible.md) - - [Foo](doc/Foo.md) - - [FooRef](doc/FooRef.md) - - [FooRefOrValue](doc/FooRefOrValue.md) - - [Fruit](doc/Fruit.md) - - [FruitType](doc/FruitType.md) - - [Pasta](doc/Pasta.md) - - [Pizza](doc/Pizza.md) - - [PizzaSpeziale](doc/PizzaSpeziale.md) - - -## Documentation For Authorization - -Endpoints do not require authorization. - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/analysis_options.yaml deleted file mode 100644 index 8ff047ce7675..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/analysis_options.yaml +++ /dev/null @@ -1,11 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strict-casts: false - exclude: - - test/*.dart - - lib/src/model/*.g.dart - - lib/src/model/*.freezed.dart - errors: - deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/build.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/build.yaml deleted file mode 100644 index dee5edd67f90..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/build.yaml +++ /dev/null @@ -1,11 +0,0 @@ -targets: - $default: - builders: - freezed|freezed: - # This restricts freezed build runner to look - # files only inside models folder. - # If you prefer the build runner to scan the whole - # project for files then simply remove this build.yaml file - generate_for: - include: - - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Addressable.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Addressable.md deleted file mode 100644 index 0fcd81b80382..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Addressable.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Addressable - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [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/oneof_polymorphism_and_inheritance_freezed/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Apple.md deleted file mode 100644 index 13b34241ef81..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Apple.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.Apple - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**seeds** | **int** | | - -[[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/oneof_polymorphism_and_inheritance_freezed/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Banana.md deleted file mode 100644 index 4c5737d0c2e2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Banana.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.Banana - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length** | **int** | | - -[[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/oneof_polymorphism_and_inheritance_freezed/doc/Bar.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Bar.md deleted file mode 100644 index 4cccc863a489..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Bar.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.Bar - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | -**barPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] -**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/BarApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarApi.md deleted file mode 100644 index a6f23c00210c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarApi.md +++ /dev/null @@ -1,55 +0,0 @@ -# openapi.api.BarApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://localhost:8080* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createBar**](BarApi.md#createbar) | **POST** /bar | Create a Bar - - -# **createBar** -> Bar createBar(barCreate) - -Create a Bar - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getBarApi(); -final BarCreate barCreate = ; // BarCreate | - -try { - final response = api.createBar(barCreate); - print(response); -} catch on DioException (e) { - print('Exception when calling BarApi->createBar: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **barCreate** | [**BarCreate**](BarCreate.md)| | - -### Return type - -[**Bar**](Bar.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/oneof_polymorphism_and_inheritance_freezed/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarCreate.md deleted file mode 100644 index c0b4ba6edc9a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarCreate.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.BarCreate - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**barPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] -**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/BarRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRef.md deleted file mode 100644 index cab0e7e57386..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRef.md +++ /dev/null @@ -1,21 +0,0 @@ -# openapi.model.BarRef - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the related entity. | [optional] -**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRefOrValue.md deleted file mode 100644 index f88727e11aa8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/BarRefOrValue.md +++ /dev/null @@ -1,24 +0,0 @@ -# openapi.model.BarRefOrValue - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | unique identifier | -**barPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] -**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | -**name** | **String** | Name of the related entity. | [optional] -**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [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/oneof_polymorphism_and_inheritance_freezed/doc/Entity.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Entity.md deleted file mode 100644 index 5ba2144b44fe..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Entity.md +++ /dev/null @@ -1,19 +0,0 @@ -# openapi.model.Entity - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/EntityRef.md deleted file mode 100644 index 80eae55f4145..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/EntityRef.md +++ /dev/null @@ -1,21 +0,0 @@ -# openapi.model.EntityRef - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the related entity. | [optional] -**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/Extensible.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Extensible.md deleted file mode 100644 index 7a781e578ea4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Extensible.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.Extensible - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Foo.md deleted file mode 100644 index 2627691fefe5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Foo.md +++ /dev/null @@ -1,21 +0,0 @@ -# openapi.model.Foo - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fooPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/FooApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooApi.md deleted file mode 100644 index f1fe53aa31f2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooApi.md +++ /dev/null @@ -1,93 +0,0 @@ -# openapi.api.FooApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://localhost:8080* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createFoo**](FooApi.md#createfoo) | **POST** /foo | Create a Foo -[**getAllFoos**](FooApi.md#getallfoos) | **GET** /foo | GET all Foos - - -# **createFoo** -> FooRefOrValue createFoo(foo) - -Create a Foo - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFooApi(); -final Foo foo = ; // Foo | The Foo to be created - -try { - final response = api.createFoo(foo); - print(response); -} catch on DioException (e) { - print('Exception when calling FooApi->createFoo: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **foo** | [**Foo**](Foo.md)| The Foo to be created | [optional] - -### Return type - -[**FooRefOrValue**](FooRefOrValue.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json;charset=utf-8 - - **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) - -# **getAllFoos** -> List getAllFoos() - -GET all Foos - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFooApi(); - -try { - final response = api.getAllFoos(); - print(response); -} catch on DioException (e) { - print('Exception when calling FooApi->getAllFoos: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**List<FooRefOrValue>**](FooRefOrValue.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json;charset=utf-8 - -[[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/oneof_polymorphism_and_inheritance_freezed/doc/FooRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRef.md deleted file mode 100644 index bfa62bd4f54b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRef.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.FooRef - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**foorefPropA** | **String** | | [optional] -**name** | **String** | Name of the related entity. | [optional] -**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRefOrValue.md deleted file mode 100644 index 9bc8dec10571..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FooRefOrValue.md +++ /dev/null @@ -1,24 +0,0 @@ -# openapi.model.FooRefOrValue - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fooPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | -**foorefPropA** | **String** | | [optional] -**name** | **String** | Name of the related entity. | [optional] -**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [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/oneof_polymorphism_and_inheritance_freezed/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Fruit.md deleted file mode 100644 index 91c1f1cf9b55..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Fruit.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.Fruit - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | [**FruitType**](FruitType.md) | | -**seeds** | **int** | | -**length** | **int** | | - -[[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/oneof_polymorphism_and_inheritance_freezed/doc/FruitType.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FruitType.md deleted file mode 100644 index ce2329c986ad..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/FruitType.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.FruitType - -## 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/oneof_polymorphism_and_inheritance_freezed/doc/Pasta.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pasta.md deleted file mode 100644 index 034ff420d323..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pasta.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Pasta - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**vendor** | **String** | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/Pizza.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pizza.md deleted file mode 100644 index e4b040a6a79c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/Pizza.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Pizza - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pizzaSize** | **num** | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/PizzaSpeziale.md deleted file mode 100644 index 4e3800773dca..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/doc/PizzaSpeziale.md +++ /dev/null @@ -1,21 +0,0 @@ -# openapi.model.PizzaSpeziale - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**toppings** | **String** | | [optional] -**pizzaSize** | **num** | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/oneof_polymorphism_and_inheritance_freezed/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/openapi.dart deleted file mode 100644 index 2dd7aa8bee7d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/openapi.dart +++ /dev/null @@ -1,16 +0,0 @@ -// -// 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/bearer_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; - - -export 'package:openapi/src/api/bar_api.dart'; -export 'package:openapi/src/api/foo_api.dart'; - - -export 'package:openapi/src/model/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api.dart deleted file mode 100644 index 791892de5ea4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api.dart +++ /dev/null @@ -1,75 +0,0 @@ -// -// 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/bar_api.dart'; -import 'package:openapi/src/api/foo_api.dart'; - -class Openapi { - static const String basePath = r'http://localhost:8080'; - - final Dio dio; - Openapi({ - Dio? dio, - String? basePathOverride, - List? interceptors, - }) : - this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: const Duration(milliseconds: 5000), - receiveTimeout: const Duration(milliseconds: 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 BarApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - BarApi getBarApi() { - return BarApi(dio); - } - - /// Get FooApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - FooApi getFooApi() { - return FooApi(dio); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart deleted file mode 100644 index 625dff159bb3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/bar_api.dart +++ /dev/null @@ -1,110 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'dart:convert'; -import '../model/models.dart'; -import 'package:dio/dio.dart'; - - -class BarApi { - - final Dio _dio; - - const BarApi(this._dio); - - /// Create a Bar - /// - /// - /// Parameters: - /// * [barCreate] - /// * [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 [Bar] as data - /// Throws [DioException] if API call or serialization fails - Future> createBar({ - - required BarCreate barCreate, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/bar'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData=jsonEncode(barCreate); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Bar _responseData; - - - try { - _responseData = Bar.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart deleted file mode 100644 index 107218c14261..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/api/foo_api.dart +++ /dev/null @@ -1,182 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'dart:convert'; -import '../model/models.dart'; -import 'package:dio/dio.dart'; - - -class FooApi { - - final Dio _dio; - - const FooApi(this._dio); - - /// Create a Foo - /// - /// - /// Parameters: - /// * [foo] - The Foo to be created - /// * [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 [FooRefOrValue] as data - /// Throws [DioException] if API call or serialization fails - Future> createFoo({ - - Foo? foo, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json;charset=utf-8', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData=jsonEncode(foo); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - FooRefOrValue _responseData; - - - try { - _responseData = FooRefOrValue.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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, - ); - } - - /// GET all Foos - /// - /// - /// 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 [List] as data - /// Throws [DioException] if API call or serialization fails - Future>> getAllFoos({ - - 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, - ); - - List _responseData; - - - try { - final _responseDataAsList = _response.data as List; - _responseData = _responseDataAsList.map((dynamic e)=> FooRefOrValue.fromJson(e as Map)).toList(); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/api_key_auth.dart deleted file mode 100644 index ee16e3f0f92f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/api_key_auth.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// 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/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/auth.dart deleted file mode 100644 index f7ae9bf3f11e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/auth.dart +++ /dev/null @@ -1,18 +0,0 @@ -// -// 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/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/basic_auth.dart deleted file mode 100644 index b65ccb5b71f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/basic_auth.dart +++ /dev/null @@ -1,37 +0,0 @@ -// -// 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']?.toLowerCase() == '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/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 8f46678761b2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/bearer_auth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// 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']?.toLowerCase() == '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/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/oauth.dart deleted file mode 100644 index 337cf762b0ce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/auth/oauth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// 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/oneof_polymorphism_and_inheritance_freezed/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/addressable.dart deleted file mode 100644 index ff1c69a84384..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/addressable.dart +++ /dev/null @@ -1,46 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Base schema for addressable entities - /// - /// Properties: - /// * [href] - Hyperlink reference - /// * [id] - unique identifier - -@freezed -class Addressable with _$Addressable { -const Addressable._(); - - - const factory Addressable({ - /// Hyperlink reference - @JsonKey(name: r'href') - String? - href, - /// unique identifier - @JsonKey(name: r'id') - String? - id, -}) = _Addressable; - - - - - factory Addressable.fromJson(Map json) => _$AddressableFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/apple.dart deleted file mode 100644 index 143bec0d76f1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/apple.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Apple - /// - /// Properties: - /// * [seeds] - -@freezed -class Apple with _$Apple { -const Apple._(); - - - const factory Apple({ - @JsonKey(name: r'seeds') - required int - seeds, -}) = _Apple; - - - - - factory Apple.fromJson(Map json) => _$AppleFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/banana.dart deleted file mode 100644 index 9acc3dee8af8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/banana.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Banana - /// - /// Properties: - /// * [length] - -@freezed -class Banana with _$Banana { -const Banana._(); - - - const factory Banana({ - @JsonKey(name: r'length') - required int - length, -}) = _Banana; - - - - - factory Banana.fromJson(Map json) => _$BananaFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar.dart deleted file mode 100644 index 20380a5d0872..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Bar - /// - /// Properties: - /// * [id] - /// * [barPropA] - /// * [fooPropB] - /// * [foo] - /// * [href] - Hyperlink reference - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - -@freezed -class Bar with _$Bar { -const Bar._(); - - - - const factory Bar({ - @JsonKey(name: r'id') - required String - id, - @JsonKey(name: r'barPropA') - String? - barPropA, - @JsonKey(name: r'fooPropB') - String? - fooPropB, - @JsonKey(name: r'foo') - FooRefOrValue? - foo, - /// Hyperlink reference - @JsonKey(name: r'href') - String? - href, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') - String? - atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') - String? - atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') - required String - atType, -}) = _Bar; - - - - factory Bar.fromJson(Map json) => _$BarFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_create.dart deleted file mode 100644 index e781be79aaf8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_create.dart +++ /dev/null @@ -1,73 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// BarCreate - /// - /// Properties: - /// * [barPropA] - /// * [fooPropB] - /// * [foo] - /// * [href] - Hyperlink reference - /// * [id] - unique identifier - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - -@freezed -class BarCreate with _$BarCreate { -const BarCreate._(); - - - - const factory BarCreate({ - @JsonKey(name: r'barPropA') - String? - barPropA, - @JsonKey(name: r'fooPropB') - String? - fooPropB, - @JsonKey(name: r'foo') - FooRefOrValue? - foo, - /// Hyperlink reference - @JsonKey(name: r'href') - String? - href, - /// unique identifier - @JsonKey(name: r'id') - String? - id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') - String? - atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') - String? - atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') - required String - atType, -}) = _BarCreate; - - - - factory BarCreate.fromJson(Map json) => _$BarCreateFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref.dart deleted file mode 100644 index dfb59ba8a333..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// BarRef - /// - /// Properties: - /// * [name] - Name of the related entity. - /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. - /// * [href] - Hyperlink reference - /// * [id] - unique identifier - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - -@freezed -class BarRef with _$BarRef { -const BarRef._(); - - - - const factory BarRef({ - /// Name of the related entity. - @JsonKey(name: r'name') - String? - name, - /// The actual type of the target instance when needed for disambiguation. - @JsonKey(name: r'@referredType') - String? - atReferredType, - /// Hyperlink reference - @JsonKey(name: r'href') - String? - href, - /// unique identifier - @JsonKey(name: r'id') - String? - id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') - String? - atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') - String? - atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') - required String - atType, -}) = _BarRef; - - - - factory BarRef.fromJson(Map json) => _$BarRefFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref_or_value.dart deleted file mode 100644 index d0cb4074e229..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/bar_ref_or_value.dart +++ /dev/null @@ -1,113 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// BarRefOrValue - /// - /// Properties: - /// * [id] - unique identifier - /// * [barPropA] - /// * [fooPropB] - /// * [foo] - /// * [href] - Hyperlink reference - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - /// * [name] - Name of the related entity. - /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. - -@freezed -class BarRefOrValue with _$BarRefOrValue { -const BarRefOrValue._(); - - - - - const factory BarRefOrValue.asBar({ - required Bar barValue - }) = BarRefOrValueAsBar; - const factory BarRefOrValue.asBarRef({ - required BarRef barRefValue - }) = BarRefOrValueAsBarRef; - const factory BarRefOrValue.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([Bar,BarRef,]) List possibleTypes, - @Default([]) List deserializedModels, - }) = BarRefOrValueUnknown; - - - - - factory BarRefOrValue.fromJson(Map json) { - BarRefOrValue? deserializedModel; - // A discriminator property is not defined in the spec so - // we try to parse the json against all the models and try to - // return one of the valid model. Note: this approach tries - // to return one valid model and if more than one model - // is valid it then returns unknown type along with the json so - // the consumer can decide which model it is. - final fromJsonMethods = >[Bar.fromJson,BarRef.fromJson,]; - final deserializedModels = []; - for (final fromJsonMethod in fromJsonMethods) { - try { - final dynamic parsedModel= fromJsonMethod.call(json); - // Note following line won't be executed if already the above parsing fails. - if (parsedModel is Bar) { - deserializedModel = BarRefOrValue.asBar( - barValue : parsedModel, - ); - } else - if (parsedModel is BarRef) { - deserializedModel = BarRefOrValue.asBarRef( - barRefValue : parsedModel, - ); - } else - { - deserializedModel = BarRefOrValue.unknown(json: json); - } - deserializedModels.add(deserializedModel); - } catch (e) { - // We are suppressing the deserialization error when the json could not - // be parsed into one of the model. Because we return [BarRefOrValue.unknown] - // if the deserialization fails. - } - } - // Return an unknown type when the incoming json parses into more than one models. - // Since we pass deserializedModels, clients can still use the deserialized model. - // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. - // So we still return this as an unknown type. - if(deserializedModels.length > 1){ - deserializedModel = BarRefOrValue.unknown( - json: json, - deserializedModels: deserializedModels, - errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, - ); - } - - - return deserializedModel ?? BarRefOrValue.unknown(json: json); - } - - - - Map toJson() { - return when( - asBar: (asBar) => asBar.toJson(), - asBarRef: (asBarRef) => asBarRef.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity.dart deleted file mode 100644 index e1a6d61dfe82..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity.dart +++ /dev/null @@ -1,104 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Entity - /// - /// Properties: - /// * [href] - Hyperlink reference - /// * [id] - unique identifier - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - -@freezed -class Entity with _$Entity { -const Entity._(); - - - - - const factory Entity.bar({ - required Bar bar, - }) = EntityBar; - const factory Entity.barCreate({ - required BarCreate barCreate, - }) = EntityBar_create; - const factory Entity.foo({ - required Foo foo, - }) = EntityFoo; - const factory Entity.pasta({ - required Pasta pasta, - }) = EntityPasta; - const factory Entity.pizza({ - required Pizza pizza, - }) = EntityPizza; - const factory Entity.pizzaspeziale({ - required PizzaSpeziale pizzaSpeziale, - }) = EntityPizzaspeziale; - const factory Entity.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([]) List possibleTypes, - @Default([]) List deserializedModels, - }) = EntityUnknown; - - - - factory Entity.fromJson(Map json) { - switch(json['@type']){ - case 'Bar': - return Entity.bar( - bar : Bar.fromJson(json), - ); - case 'Bar_Create': - return Entity.barCreate( - barCreate : BarCreate.fromJson(json), - ); - case 'Foo': - return Entity.foo( - foo : Foo.fromJson(json), - ); - case 'Pasta': - return Entity.pasta( - pasta : Pasta.fromJson(json), - ); - case 'Pizza': - return Entity.pizza( - pizza : Pizza.fromJson(json), - ); - case 'PizzaSpeziale': - return Entity.pizzaspeziale( - pizzaSpeziale : PizzaSpeziale.fromJson(json), - ); - } - return Entity.unknown(json: json); - } - - - - Map toJson() { - return when( - bar: (bar) => bar.toJson(), - barCreate: (barCreate) => barCreate.toJson(), - foo: (foo) => foo.toJson(), - pasta: (pasta) => pasta.toJson(), - pizza: (pizza) => pizza.toJson(), - pizzaspeziale: (pizzaSpeziale) => pizzaSpeziale.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity_ref.dart deleted file mode 100644 index 9db823ea0619..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/entity_ref.dart +++ /dev/null @@ -1,74 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Entity reference schema to be use for all entityRef class. - /// - /// Properties: - /// * [name] - Name of the related entity. - /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. - /// * [href] - Hyperlink reference - /// * [id] - unique identifier - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - -@freezed -class EntityRef with _$EntityRef { -const EntityRef._(); - - - - - const factory EntityRef.barref({ - required BarRef barRef, - }) = EntityRefBarref; - const factory EntityRef.fooref({ - required FooRef fooRef, - }) = EntityRefFooref; - const factory EntityRef.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([]) List possibleTypes, - @Default([]) List deserializedModels, - }) = EntityRefUnknown; - - - - factory EntityRef.fromJson(Map json) { - switch(json['@type']){ - case 'BarRef': - return EntityRef.barref( - barRef : BarRef.fromJson(json), - ); - case 'FooRef': - return EntityRef.fooref( - fooRef : FooRef.fromJson(json), - ); - } - return EntityRef.unknown(json: json); - } - - - - Map toJson() { - return when( - barref: (barRef) => barRef.toJson(), - fooref: (fooRef) => fooRef.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/extensible.dart deleted file mode 100644 index 258fa6502a3e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/extensible.dart +++ /dev/null @@ -1,51 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Extensible - /// - /// Properties: - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - -@freezed -class Extensible with _$Extensible { -const Extensible._(); - - - const factory Extensible({ - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') - String? - atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') - String? - atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') - required String - atType, -}) = _Extensible; - - - - - factory Extensible.fromJson(Map json) => _$ExtensibleFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo.dart deleted file mode 100644 index ac75d3ce0192..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo.dart +++ /dev/null @@ -1,69 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Foo - /// - /// Properties: - /// * [fooPropA] - /// * [fooPropB] - /// * [href] - Hyperlink reference - /// * [id] - unique identifier - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - -@freezed -class Foo with _$Foo { -const Foo._(); - - - - const factory Foo({ - @JsonKey(name: r'fooPropA') - String? - fooPropA, - @JsonKey(name: r'fooPropB') - String? - fooPropB, - /// Hyperlink reference - @JsonKey(name: r'href') - String? - href, - /// unique identifier - @JsonKey(name: r'id') - String? - id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') - String? - atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') - String? - atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') - required String - atType, -}) = _Foo; - - - - factory Foo.fromJson(Map json) => _$FooFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref.dart deleted file mode 100644 index a2fbb1c3467a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref.dart +++ /dev/null @@ -1,75 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// FooRef - /// - /// Properties: - /// * [foorefPropA] - /// * [name] - Name of the related entity. - /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. - /// * [href] - Hyperlink reference - /// * [id] - unique identifier - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - -@freezed -class FooRef with _$FooRef { -const FooRef._(); - - - - const factory FooRef({ - @JsonKey(name: r'foorefPropA') - String? - foorefPropA, - /// Name of the related entity. - @JsonKey(name: r'name') - String? - name, - /// The actual type of the target instance when needed for disambiguation. - @JsonKey(name: r'@referredType') - String? - atReferredType, - /// Hyperlink reference - @JsonKey(name: r'href') - String? - href, - /// unique identifier - @JsonKey(name: r'id') - String? - id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') - String? - atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') - String? - atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') - required String - atType, -}) = _FooRef; - - - - factory FooRef.fromJson(Map json) => _$FooRefFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref_or_value.dart deleted file mode 100644 index 66ef0d5c90d9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/foo_ref_or_value.dart +++ /dev/null @@ -1,88 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// FooRefOrValue - /// - /// Properties: - /// * [fooPropA] - /// * [fooPropB] - /// * [href] - Hyperlink reference - /// * [id] - unique identifier - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - /// * [foorefPropA] - /// * [name] - Name of the related entity. - /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. - -@freezed -class FooRefOrValue with _$FooRefOrValue { -const FooRefOrValue._(); - - - - - const factory FooRefOrValue.asFoo({ - required Foo fooValue - }) = FooRefOrValueAsFoo; - const factory FooRefOrValue.asFooRef({ - required FooRef fooRefValue - }) = FooRefOrValueAsFooRef; - const factory FooRefOrValue.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([Foo,FooRef,]) List possibleTypes, - @Default([]) List deserializedModels, - }) = FooRefOrValueUnknown; - - - - - factory FooRefOrValue.fromJson(Map json) { - FooRefOrValue? deserializedModel; - // A discriminator property is specified but no mapping - // is provided in the spec, so we expect the property to - // have the value of the name of the model. Model prefix & - // suffix are ignored, as this is not known by the api provider - switch(json['@type']){ - case 'Foo': - deserializedModel = FooRefOrValue.asFoo( - fooValue : Foo.fromJson(json), - ); - break; - case 'FooRef': - deserializedModel = FooRefOrValue.asFooRef( - fooRefValue : FooRef.fromJson(json), - ); - break; - default: - break; - } - - - return deserializedModel ?? FooRefOrValue.unknown(json: json); - } - - - - Map toJson() { - return when( - asFoo: (asFoo) => asFoo.toJson(), - asFooRef: (asFooRef) => asFooRef.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit.dart deleted file mode 100644 index 17e727017cd3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit.dart +++ /dev/null @@ -1,70 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Fruit - /// - /// Properties: - /// * [fruitType] - /// * [seeds] - /// * [length] - -@freezed -class Fruit with _$Fruit { -const Fruit._(); - - - - - const factory Fruit.apple({ - required Apple apple, - }) = FruitApple; - const factory Fruit.banana({ - required Banana banana, - }) = FruitBanana; - const factory Fruit.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([Apple,Banana,]) List possibleTypes, - @Default([]) List deserializedModels, - }) = FruitUnknown; - - - - factory Fruit.fromJson(Map json) { - switch(json['fruitType']){ - case 'APPLE': - return Fruit.apple( - apple : Apple.fromJson(json), - ); - case 'BANANA': - return Fruit.banana( - banana : Banana.fromJson(json), - ); - } - return Fruit.unknown(json: json); - } - - - - Map toJson() { - return when( - apple: (apple) => apple.toJson(), - banana: (banana) => banana.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit_type.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit_type.dart deleted file mode 100644 index cd394cc4803e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/fruit_type.dart +++ /dev/null @@ -1,16 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - - -@JsonEnum(valueField: 'value') -enum FruitType { - APPLE(value: r'APPLE'), - BANANA(value: r'BANANA'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const FruitType({required this.value}); - final String value; -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/models.dart deleted file mode 100644 index 793098c8ff67..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/models.dart +++ /dev/null @@ -1,20 +0,0 @@ -//ignore_for_file: invalid_annotation_target -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:dio/dio.dart'; -import 'dart:convert'; - -part 'models.freezed.dart'; -part 'models.g.dart'; - -part 'primitive_union_types.dart'; -part 'addressable.dart';part 'apple.dart';part 'banana.dart';part 'bar.dart';part 'bar_create.dart';part 'bar_ref.dart';part 'bar_ref_or_value.dart';part 'entity.dart';part 'entity_ref.dart';part 'extensible.dart';part 'foo.dart';part 'foo_ref.dart';part 'foo_ref_or_value.dart';part 'fruit.dart';part 'fruit_type.dart';part 'pasta.dart';part 'pizza.dart';part 'pizza_speziale.dart'; - -/// A typedef used in the deserialization of OneOf and AnyOf -/// models when no discriminator mapping is provided. -typedef FromJsonMethodType = T Function(Map); - -/// Deserialization error types for OneOf and AnyOf types. -enum DeserializationErrorType { - MoreThanOneTypeSatisfied, - UnKnownType, -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pasta.dart deleted file mode 100644 index 1002c786fb26..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pasta.dart +++ /dev/null @@ -1,65 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Pasta - /// - /// Properties: - /// * [vendor] - /// * [href] - Hyperlink reference - /// * [id] - unique identifier - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - -@freezed -class Pasta with _$Pasta { -const Pasta._(); - - - - const factory Pasta({ - @JsonKey(name: r'vendor') - String? - vendor, - /// Hyperlink reference - @JsonKey(name: r'href') - String? - href, - /// unique identifier - @JsonKey(name: r'id') - String? - id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') - String? - atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') - String? - atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') - required String - atType, -}) = _Pasta; - - - - factory Pasta.fromJson(Map json) => _$PastaFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza.dart deleted file mode 100644 index 79fafb715a2c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza.dart +++ /dev/null @@ -1,65 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Pizza - /// - /// Properties: - /// * [pizzaSize] - /// * [href] - Hyperlink reference - /// * [id] - unique identifier - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - -@freezed -class Pizza with _$Pizza { -const Pizza._(); - - - - const factory Pizza({ - @JsonKey(name: r'pizzaSize') - num? - pizzaSize, - /// Hyperlink reference - @JsonKey(name: r'href') - String? - href, - /// unique identifier - @JsonKey(name: r'id') - String? - id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') - String? - atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') - String? - atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') - required String - atType, -}) = _Pizza; - - - - factory Pizza.fromJson(Map json) => _$PizzaFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza_speziale.dart deleted file mode 100644 index ed00d02d4539..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/pizza_speziale.dart +++ /dev/null @@ -1,69 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// PizzaSpeziale - /// - /// Properties: - /// * [toppings] - /// * [pizzaSize] - /// * [href] - Hyperlink reference - /// * [id] - unique identifier - /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships - /// * [atBaseType] - When sub-classing, this defines the super-class - /// * [atType] - When sub-classing, this defines the sub-class Extensible name - -@freezed -class PizzaSpeziale with _$PizzaSpeziale { -const PizzaSpeziale._(); - - - - const factory PizzaSpeziale({ - @JsonKey(name: r'toppings') - String? - toppings, - @JsonKey(name: r'pizzaSize') - num? - pizzaSize, - /// Hyperlink reference - @JsonKey(name: r'href') - String? - href, - /// unique identifier - @JsonKey(name: r'id') - String? - id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') - String? - atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') - String? - atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') - required String - atType, -}) = _PizzaSpeziale; - - - - factory PizzaSpeziale.fromJson(Map json) => _$PizzaSpezialeFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/primitive_union_types.dart deleted file mode 100644 index fafa083471b8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/lib/src/model/primitive_union_types.dart +++ /dev/null @@ -1,60 +0,0 @@ -part of 'models.dart'; - -@freezed -class IntInUnion with _$IntInUnion{ - const factory IntInUnion({ - required int intValue - }) = _IntInUnion; - - factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); -} - -@freezed -class StringInUnion with _$StringInUnion{ - const factory StringInUnion({ - required String stringValue - }) = _StringInUnion; - - factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); -} -@freezed -class BoolInUnion with _$BoolInUnion{ - const factory BoolInUnion({ - required bool boolValue - }) = _BoolInUnion; - - factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); -} - -@freezed -class DoubleInUnion with _$DoubleInUnion{ - const factory DoubleInUnion({ - required double doubleValue - }) = _DoubleInUnion; - - factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); -} - -@freezed -class ObjectInUnion with _$ObjectInUnion { - const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; - - factory ObjectInUnion.fromJson(Map json) => - _$ObjectInUnionFromJson(json); -} - -@freezed -class NumInUnion with _$NumInUnion{ - const factory NumInUnion({required num numValue}) = _NumInUnion; - - factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); -} - -@freezed -class DateTimeInUnion with _$DateTimeInUnion { -const factory DateTimeInUnion({required DateTime dateTimeValue}) = -_DateTimeInUnion; - -factory DateTimeInUnion.fromJson(Map json) => -_$DateTimeInUnionFromJson(json); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/pubspec.yaml deleted file mode 100644 index 12925113115d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/pubspec.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '^3.0.0' - -dependencies: - dio: '^5.2.0' - freezed_annotation: '^2.4.4' - json_annotation: '^4.9.0' - -dev_dependencies: - freezed: '^2.5.2' - json_serializable: '^6.8.0' - build_runner: any - test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/addressable_test.dart deleted file mode 100644 index 2c4a84f1cb39..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/addressable_test.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Addressable -void main() { - final Addressable? instance = /* Addressable(...) */ null; - // TODO add properties to the entity - - group(Addressable, () { - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/apple_test.dart deleted file mode 100644 index ff5cc46e59aa..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/apple_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Apple -void main() { - final Apple? instance = /* Apple(...) */ null; - // TODO add properties to the entity - - group(Apple, () { - // int seeds - test('to test the property `seeds`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/banana_test.dart deleted file mode 100644 index 6489e32ff77f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/banana_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Banana -void main() { - final Banana? instance = /* Banana(...) */ null; - // TODO add properties to the entity - - group(Banana, () { - // int length - test('to test the property `length`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_api_test.dart deleted file mode 100644 index 73be91c446e0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_api_test.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for BarApi -void main() { - final instance = Openapi().getBarApi(); - - group(BarApi, () { - // Create a Bar - // - //Future createBar(BarCreate barCreate) async - test('test createBar', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_create_test.dart deleted file mode 100644 index 720b7afc6e94..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_create_test.dart +++ /dev/null @@ -1,56 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BarCreate -void main() { - final BarCreate? instance = /* BarCreate(...) */ null; - // TODO add properties to the entity - - group(BarCreate, () { - // String barPropA - test('to test the property `barPropA`', () async { - // TODO - }); - - // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); - - // FooRefOrValue foo - test('to test the property `foo`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_or_value_test.dart deleted file mode 100644 index 4f79824c2388..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_or_value_test.dart +++ /dev/null @@ -1,68 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BarRefOrValue -void main() { - final BarRefOrValue? instance = /* BarRefOrValue(...) */ null; - // TODO add properties to the entity - - group(BarRefOrValue, () { - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // String barPropA - test('to test the property `barPropA`', () async { - // TODO - }); - - // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); - - // FooRefOrValue foo - test('to test the property `foo`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - // Name of the related entity. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // The actual type of the target instance when needed for disambiguation. - // String atReferredType - test('to test the property `atReferredType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_test.dart deleted file mode 100644 index 9d5acfcd10f6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_ref_test.dart +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BarRef -void main() { - final BarRef? instance = /* BarRef(...) */ null; - // TODO add properties to the entity - - group(BarRef, () { - // Name of the related entity. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // The actual type of the target instance when needed for disambiguation. - // String atReferredType - test('to test the property `atReferredType`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_test.dart deleted file mode 100644 index bacdc3d3b62d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/bar_test.dart +++ /dev/null @@ -1,55 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Bar -void main() { - final Bar? instance = /* Bar(...) */ null; - // TODO add properties to the entity - - group(Bar, () { - // String id - test('to test the property `id`', () async { - // TODO - }); - - // String barPropA - test('to test the property `barPropA`', () async { - // TODO - }); - - // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); - - // FooRefOrValue foo - test('to test the property `foo`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_ref_test.dart deleted file mode 100644 index 65fed045507a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_ref_test.dart +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for EntityRef -void main() { - final EntityRef? instance = /* EntityRef(...) */ null; - // TODO add properties to the entity - - group(EntityRef, () { - // Name of the related entity. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // The actual type of the target instance when needed for disambiguation. - // String atReferredType - test('to test the property `atReferredType`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_test.dart deleted file mode 100644 index b34dd0ec767d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/entity_test.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Entity -void main() { - final Entity? instance = /* Entity(...) */ null; - // TODO add properties to the entity - - group(Entity, () { - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/extensible_test.dart deleted file mode 100644 index df1f73c05b35..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/extensible_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Extensible -void main() { - final Extensible? instance = /* Extensible(...) */ null; - // TODO add properties to the entity - - group(Extensible, () { - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_api_test.dart deleted file mode 100644 index 40bc24e691ea..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_api_test.dart +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for FooApi -void main() { - final instance = Openapi().getFooApi(); - - group(FooApi, () { - // Create a Foo - // - //Future createFoo({ Foo foo }) async - test('test createFoo', () async { - // TODO - }); - - // GET all Foos - // - //Future> getAllFoos() async - test('test getAllFoos', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_or_value_test.dart deleted file mode 100644 index 584565158cc0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_or_value_test.dart +++ /dev/null @@ -1,68 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FooRefOrValue -void main() { - final FooRefOrValue? instance = /* FooRefOrValue(...) */ null; - // TODO add properties to the entity - - group(FooRefOrValue, () { - // String fooPropA - test('to test the property `fooPropA`', () async { - // TODO - }); - - // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - // String foorefPropA - test('to test the property `foorefPropA`', () async { - // TODO - }); - - // Name of the related entity. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // The actual type of the target instance when needed for disambiguation. - // String atReferredType - test('to test the property `atReferredType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_test.dart deleted file mode 100644 index 53529ee1c1b1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_ref_test.dart +++ /dev/null @@ -1,58 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FooRef -void main() { - final FooRef? instance = /* FooRef(...) */ null; - // TODO add properties to the entity - - group(FooRef, () { - // String foorefPropA - test('to test the property `foorefPropA`', () async { - // TODO - }); - - // Name of the related entity. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // The actual type of the target instance when needed for disambiguation. - // String atReferredType - test('to test the property `atReferredType`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_test.dart deleted file mode 100644 index e4ccad0f338a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/foo_test.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Foo -void main() { - final Foo? instance = /* Foo(...) */ null; - // TODO add properties to the entity - - group(Foo, () { - // String fooPropA - test('to test the property `fooPropA`', () async { - // TODO - }); - - // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_test.dart deleted file mode 100644 index 41ab86333d84..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Fruit -void main() { - final Fruit? instance = /* Fruit(...) */ null; - // TODO add properties to the entity - - group(Fruit, () { - // FruitType fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - // int seeds - test('to test the property `seeds`', () async { - // TODO - }); - - // int length - test('to test the property `length`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_type_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_type_test.dart deleted file mode 100644 index 9bf9b6c2dd45..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/fruit_type_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitType -void main() { - - group(FruitType, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pasta_test.dart deleted file mode 100644 index c944fa0db8e7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pasta_test.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Pasta -void main() { - final Pasta? instance = /* Pasta(...) */ null; - // TODO add properties to the entity - - group(Pasta, () { - // String vendor - test('to test the property `vendor`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_speziale_test.dart deleted file mode 100644 index 8f931321e11d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_speziale_test.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for PizzaSpeziale -void main() { - final PizzaSpeziale? instance = /* PizzaSpeziale(...) */ null; - // TODO add properties to the entity - - group(PizzaSpeziale, () { - // String toppings - test('to test the property `toppings`', () async { - // TODO - }); - - // num pizzaSize - test('to test the property `pizzaSize`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_test.dart deleted file mode 100644 index f23c37b80e8b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance_freezed/test/pizza_test.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Pizza -void main() { - final Pizza? instance = /* Pizza(...) */ null; - // TODO add properties to the entity - - group(Pizza, () { - // num pizzaSize - test('to test the property `pizzaSize`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# 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/oneof_primitive_freezed/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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/oneof_primitive_freezed/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/FILES deleted file mode 100644 index f99d1b97b0b5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/FILES +++ /dev/null @@ -1,20 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -build.yaml -doc/Child.md -doc/DefaultApi.md -doc/Example.md -lib/openapi.dart -lib/src/api.dart -lib/src/api/default_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/model/child.dart -lib/src/model/example.dart -lib/src/model/models.dart -lib/src/model/primitive_union_types.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/VERSION deleted file mode 100644 index 17f2442ff3bc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/README.md deleted file mode 100644 index e81640d8ed49..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# openapi (EXPERIMENTAL) -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Generator version: 7.9.0-SNAPSHOT -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.15.0+ or Flutter 2.8.0+ -* Dio 5.0.0+ (https://pub.dev/packages/dio) - -## 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().getDefaultApi(); - -try { - final response = await api.list(); - print(response); -} catch on DioException (e) { - print("Exception when calling DefaultApi->list: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://api.example.xyz/v1* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -[*DefaultApi*](doc/DefaultApi.md) | [**list**](doc/DefaultApi.md#list) | **GET** /example | - - -## Documentation For Models - - - [Child](doc/Child.md) - - [Example](doc/Example.md) - - -## Documentation For Authorization - -Endpoints do not require authorization. - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/analysis_options.yaml deleted file mode 100644 index 8ff047ce7675..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/analysis_options.yaml +++ /dev/null @@ -1,11 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strict-casts: false - exclude: - - test/*.dart - - lib/src/model/*.g.dart - - lib/src/model/*.freezed.dart - errors: - deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/build.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/build.yaml deleted file mode 100644 index dee5edd67f90..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/build.yaml +++ /dev/null @@ -1,11 +0,0 @@ -targets: - $default: - builders: - freezed|freezed: - # This restricts freezed build runner to look - # files only inside models folder. - # If you prefer the build runner to scan the whole - # project for files then simply remove this build.yaml file - generate_for: - include: - - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Child.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Child.md deleted file mode 100644 index bed0f2feec12..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Child.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.Child - -## 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/oneof_primitive_freezed/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/DefaultApi.md deleted file mode 100644 index c4077a67727b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/DefaultApi.md +++ /dev/null @@ -1,51 +0,0 @@ -# openapi.api.DefaultApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://api.example.xyz/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**list**](DefaultApi.md#list) | **GET** /example | - - -# **list** -> Example list() - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.list(); - print(response); -} catch on DioException (e) { - print('Exception when calling DefaultApi->list: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**Example**](Example.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/oneof_primitive_freezed/doc/Example.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Example.md deleted file mode 100644 index bf49bb137a60..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/doc/Example.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.Example - -## 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/oneof_primitive_freezed/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/openapi.dart deleted file mode 100644 index 581830866afb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/openapi.dart +++ /dev/null @@ -1,15 +0,0 @@ -// -// 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/bearer_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; - - -export 'package:openapi/src/api/default_api.dart'; - - -export 'package:openapi/src/model/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api.dart deleted file mode 100644 index 295416c42814..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api.dart +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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/default_api.dart'; - -class Openapi { - static const String basePath = r'http://api.example.xyz/v1'; - - final Dio dio; - Openapi({ - Dio? dio, - String? basePathOverride, - List? interceptors, - }) : - this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: const Duration(milliseconds: 5000), - receiveTimeout: const Duration(milliseconds: 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 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); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart deleted file mode 100644 index afce265c9b5b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/api/default_api.dart +++ /dev/null @@ -1,89 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'dart:convert'; -import '../model/models.dart'; -import 'package:dio/dio.dart'; - - -class DefaultApi { - - final Dio _dio; - - const DefaultApi(this._dio); - - /// list - /// - /// - /// 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 [Example] as data - /// Throws [DioException] if API call or serialization fails - Future> list({ - - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/example'; - 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, - ); - - Example _responseData; - - - try { - _responseData = Example.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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/oneof_primitive_freezed/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/api_key_auth.dart deleted file mode 100644 index ee16e3f0f92f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/api_key_auth.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// 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/oneof_primitive_freezed/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/auth.dart deleted file mode 100644 index f7ae9bf3f11e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/auth.dart +++ /dev/null @@ -1,18 +0,0 @@ -// -// 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/oneof_primitive_freezed/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/basic_auth.dart deleted file mode 100644 index b65ccb5b71f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/basic_auth.dart +++ /dev/null @@ -1,37 +0,0 @@ -// -// 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']?.toLowerCase() == '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/oneof_primitive_freezed/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 8f46678761b2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/bearer_auth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// 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']?.toLowerCase() == '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/oneof_primitive_freezed/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/oauth.dart deleted file mode 100644 index 337cf762b0ce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/auth/oauth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// 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/oneof_primitive_freezed/lib/src/model/child.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/child.dart deleted file mode 100644 index adffaceb0b5c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/child.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Child - /// - /// Properties: - /// * [name] - -@freezed -class Child with _$Child { -const Child._(); - - - const factory Child({ - @JsonKey(name: r'name') - String? - name, -}) = _Child; - - - - - factory Child.fromJson(Map json) => _$ChildFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/example.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/example.dart deleted file mode 100644 index dd775d489d62..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/example.dart +++ /dev/null @@ -1,104 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Example - /// - /// Properties: - /// * [name] - -@freezed -class Example with _$Example { -const Example._(); - - - - - const factory Example.asChild({ - required Child childValue - }) = ExampleAsChild; - const factory Example.asIntInUnion({ - required IntInUnion intValue - }) = ExampleAsIntInUnion; - const factory Example.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([Child,int,]) List possibleTypes, - @Default([]) List deserializedModels, - }) = ExampleUnknown; - - - - - factory Example.fromJson(Map json) { - Example? deserializedModel; - // A discriminator property is not defined in the spec so - // we try to parse the json against all the models and try to - // return one of the valid model. Note: this approach tries - // to return one valid model and if more than one model - // is valid it then returns unknown type along with the json so - // the consumer can decide which model it is. - final fromJsonMethods = >[Child.fromJson,IntInUnion.fromJson,]; - final deserializedModels = []; - for (final fromJsonMethod in fromJsonMethods) { - try { - final dynamic parsedModel= fromJsonMethod.call(json); - // Note following line won't be executed if already the above parsing fails. - if (parsedModel is Child) { - deserializedModel = Example.asChild( - childValue : parsedModel, - ); - } else - if (parsedModel is IntInUnion) { - deserializedModel = Example.asIntInUnion( - intValue : parsedModel, - ); - } else - { - deserializedModel = Example.unknown(json: json); - } - deserializedModels.add(deserializedModel); - } catch (e) { - // We are suppressing the deserialization error when the json could not - // be parsed into one of the model. Because we return [Example.unknown] - // if the deserialization fails. - } - } - // Return an unknown type when the incoming json parses into more than one models. - // Since we pass deserializedModels, clients can still use the deserialized model. - // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. - // So we still return this as an unknown type. - if(deserializedModels.length > 1){ - deserializedModel = Example.unknown( - json: json, - deserializedModels: deserializedModels, - errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, - ); - } - - - return deserializedModel ?? Example.unknown(json: json); - } - - - - Map toJson() { - return when( - asChild: (asChild) => asChild.toJson(), - asIntInUnion: (asIntInUnion) => asIntInUnion.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/models.dart deleted file mode 100644 index 3c4f94cac696..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/models.dart +++ /dev/null @@ -1,20 +0,0 @@ -//ignore_for_file: invalid_annotation_target -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:dio/dio.dart'; -import 'dart:convert'; - -part 'models.freezed.dart'; -part 'models.g.dart'; - -part 'primitive_union_types.dart'; -part 'child.dart';part 'example.dart'; - -/// A typedef used in the deserialization of OneOf and AnyOf -/// models when no discriminator mapping is provided. -typedef FromJsonMethodType = T Function(Map); - -/// Deserialization error types for OneOf and AnyOf types. -enum DeserializationErrorType { - MoreThanOneTypeSatisfied, - UnKnownType, -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/primitive_union_types.dart deleted file mode 100644 index fafa083471b8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/lib/src/model/primitive_union_types.dart +++ /dev/null @@ -1,60 +0,0 @@ -part of 'models.dart'; - -@freezed -class IntInUnion with _$IntInUnion{ - const factory IntInUnion({ - required int intValue - }) = _IntInUnion; - - factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); -} - -@freezed -class StringInUnion with _$StringInUnion{ - const factory StringInUnion({ - required String stringValue - }) = _StringInUnion; - - factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); -} -@freezed -class BoolInUnion with _$BoolInUnion{ - const factory BoolInUnion({ - required bool boolValue - }) = _BoolInUnion; - - factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); -} - -@freezed -class DoubleInUnion with _$DoubleInUnion{ - const factory DoubleInUnion({ - required double doubleValue - }) = _DoubleInUnion; - - factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); -} - -@freezed -class ObjectInUnion with _$ObjectInUnion { - const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; - - factory ObjectInUnion.fromJson(Map json) => - _$ObjectInUnionFromJson(json); -} - -@freezed -class NumInUnion with _$NumInUnion{ - const factory NumInUnion({required num numValue}) = _NumInUnion; - - factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); -} - -@freezed -class DateTimeInUnion with _$DateTimeInUnion { -const factory DateTimeInUnion({required DateTime dateTimeValue}) = -_DateTimeInUnion; - -factory DateTimeInUnion.fromJson(Map json) => -_$DateTimeInUnionFromJson(json); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/pubspec.yaml deleted file mode 100644 index 12925113115d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/pubspec.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '^3.0.0' - -dependencies: - dio: '^5.2.0' - freezed_annotation: '^2.4.4' - json_annotation: '^4.9.0' - -dev_dependencies: - freezed: '^2.5.2' - json_serializable: '^6.8.0' - build_runner: any - test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/child_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/child_test.dart deleted file mode 100644 index 5c2504f58eb3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/child_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Child -void main() { - final Child? instance = /* Child(...) */ null; - // TODO add properties to the entity - - group(Child, () { - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/default_api_test.dart deleted file mode 100644 index e4ec57077946..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/default_api_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for DefaultApi -void main() { - final instance = Openapi().getDefaultApi(); - - group(DefaultApi, () { - //Future list() async - test('test list', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/example_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/example_test.dart deleted file mode 100644 index 4cabaa4f7fce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive_freezed/test/example_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Example -void main() { - final Example? instance = /* Example(...) */ null; - // TODO add properties to the entity - - group(Example, () { - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.gitignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/FILES deleted file mode 100644 index a3f13932bea8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/FILES +++ /dev/null @@ -1,128 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -build.yaml -doc/AdditionalPropertiesClass.md -doc/AllOfWithSingleRef.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/Category.md -doc/ChildWithNullable.md -doc/ClassModel.md -doc/DefaultApi.md -doc/DeprecatedObject.md -doc/Dog.md -doc/EnumArrays.md -doc/EnumTest.md -doc/FakeApi.md -doc/FakeBigDecimalMap200Response.md -doc/FakeClassnameTags123Api.md -doc/FileSchemaTestClass.md -doc/Foo.md -doc/FooGetDefaultResponse.md -doc/FormatTest.md -doc/HasOnlyReadOnly.md -doc/HealthCheckResult.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/ParentWithNullable.md -doc/Pet.md -doc/PetApi.md -doc/ReadOnlyFirst.md -doc/SingleRefType.md -doc/SpecialModelName.md -doc/StoreApi.md -doc/Tag.md -doc/TestInlineFreeformAdditionalPropertiesRequest.md -doc/User.md -doc/UserApi.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/model/additional_properties_class.dart -lib/src/model/all_of_with_single_ref.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/category.dart -lib/src/model/child_with_nullable.dart -lib/src/model/class_model.dart -lib/src/model/deprecated_object.dart -lib/src/model/dog.dart -lib/src/model/enum_arrays.dart -lib/src/model/enum_test.dart -lib/src/model/fake_big_decimal_map200_response.dart -lib/src/model/file_schema_test_class.dart -lib/src/model/foo.dart -lib/src/model/foo_get_default_response.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/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/models.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/parent_with_nullable.dart -lib/src/model/pet.dart -lib/src/model/primitive_union_types.dart -lib/src/model/read_only_first.dart -lib/src/model/single_ref_type.dart -lib/src/model/special_model_name.dart -lib/src/model/tag.dart -lib/src/model/test_inline_freeform_additional_properties_request.dart -lib/src/model/user.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/VERSION deleted file mode 100644 index 17f2442ff3bc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/README.md deleted file mode 100644 index 516bf125066e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/README.md +++ /dev/null @@ -1,211 +0,0 @@ -# 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 -- Generator version: 7.9.0-SNAPSHOT -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.15.0+ or Flutter 2.8.0+ -* Dio 5.0.0+ (https://pub.dev/packages/dio) - -## 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 DioException (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) | [**fakeBigDecimalMap**](doc/FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | -[*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) | [**testAdditionalPropertiesReference**](doc/FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties -[*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) | [**testInlineFreeformAdditionalProperties**](doc/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties -[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -[*FakeApi*](doc/FakeApi.md) | [**testNullable**](doc/FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property -[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | -[*FakeApi*](doc/FakeApi.md) | [**testStringMapReference**](doc/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map -[*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) - - [AllOfWithSingleRef](doc/AllOfWithSingleRef.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) - - [Category](doc/Category.md) - - [ChildWithNullable](doc/ChildWithNullable.md) - - [ClassModel](doc/ClassModel.md) - - [DeprecatedObject](doc/DeprecatedObject.md) - - [Dog](doc/Dog.md) - - [EnumArrays](doc/EnumArrays.md) - - [EnumTest](doc/EnumTest.md) - - [FakeBigDecimalMap200Response](doc/FakeBigDecimalMap200Response.md) - - [FileSchemaTestClass](doc/FileSchemaTestClass.md) - - [Foo](doc/Foo.md) - - [FooGetDefaultResponse](doc/FooGetDefaultResponse.md) - - [FormatTest](doc/FormatTest.md) - - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) - - [HealthCheckResult](doc/HealthCheckResult.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) - - [ParentWithNullable](doc/ParentWithNullable.md) - - [Pet](doc/Pet.md) - - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - - [SingleRefType](doc/SingleRefType.md) - - [SpecialModelName](doc/SpecialModelName.md) - - [Tag](doc/Tag.md) - - [TestInlineFreeformAdditionalPropertiesRequest](doc/TestInlineFreeformAdditionalPropertiesRequest.md) - - [User](doc/User.md) - - -## Documentation For Authorization - - -Authentication schemes defined for the API: -### 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 - -### 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 - -### http_basic_test - -- **Type**: HTTP basic authentication - -### bearer_test - -- **Type**: HTTP Bearer Token authentication (JWT) - -### http_signature_test - -- **Type**: HTTP signature authentication - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/analysis_options.yaml deleted file mode 100644 index 8ff047ce7675..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/analysis_options.yaml +++ /dev/null @@ -1,11 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strict-casts: false - exclude: - - test/*.dart - - lib/src/model/*.g.dart - - lib/src/model/*.freezed.dart - errors: - deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/build.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/build.yaml deleted file mode 100644 index dee5edd67f90..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/build.yaml +++ /dev/null @@ -1,11 +0,0 @@ -targets: - $default: - builders: - freezed|freezed: - # This restricts freezed build runner to look - # files only inside models folder. - # If you prefer the build runner to scan the whole - # project for files then simply remove this build.yaml file - generate_for: - include: - - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AdditionalPropertiesClass.md deleted file mode 100644 index 863b8503db83..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AdditionalPropertiesClass.md +++ /dev/null @@ -1,16 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AllOfWithSingleRef.md deleted file mode 100644 index 4c6f3ab2fe11..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AllOfWithSingleRef.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.AllOfWithSingleRef - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **String** | | [optional] -**singleRefType** | [**SingleRefType**](SingleRefType.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/petstore_client_lib_fake-freezed/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Animal.md deleted file mode 100644 index 415b56e9bc2e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Animal.md +++ /dev/null @@ -1,16 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AnotherFakeApi.md deleted file mode 100644 index 36a94e6bb703..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/AnotherFakeApi.md +++ /dev/null @@ -1,57 +0,0 @@ -# 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 DioException (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/petstore_client_lib_fake-freezed/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ApiResponse.md deleted file mode 100644 index 7ad5da0f89e4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ApiResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index e5b9d669a436..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayOfNumberOnly.md deleted file mode 100644 index fe8e071eb45c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayOfNumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayTest.md deleted file mode 100644 index 8ae11de10022..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ArrayTest.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Capitalization.md deleted file mode 100644 index 4a07b4eb820d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Capitalization.md +++ /dev/null @@ -1,20 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Cat.md deleted file mode 100644 index 6552eea4b435..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Cat.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/Category.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Category.md deleted file mode 100644 index ae6bc52e89d8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Category.md +++ /dev/null @@ -1,16 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/ChildWithNullable.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ChildWithNullable.md deleted file mode 100644 index 770494fcf4cc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ChildWithNullable.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.ChildWithNullable - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | | [optional] -**nullableProperty** | **String** | | [optional] -**otherProperty** | **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/petstore_client_lib_fake-freezed/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ClassModel.md deleted file mode 100644 index 13ae5d3a4708..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ClassModel.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/DefaultApi.md deleted file mode 100644 index 6abd2b44f9c4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/DefaultApi.md +++ /dev/null @@ -1,51 +0,0 @@ -# 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** -> FooGetDefaultResponse fooGet() - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.fooGet(); - print(response); -} catch on DioException (e) { - print('Exception when calling DefaultApi->fooGet: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**FooGetDefaultResponse**](FooGetDefaultResponse.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/petstore_client_lib_fake-freezed/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/DeprecatedObject.md deleted file mode 100644 index bf2ef67a26fc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/DeprecatedObject.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Dog.md deleted file mode 100644 index d36439b767bb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Dog.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/EnumArrays.md deleted file mode 100644 index 1d4fd1363b59..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/EnumArrays.md +++ /dev/null @@ -1,16 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/EnumTest.md deleted file mode 100644 index 7c24fe2347b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/EnumTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeApi.md deleted file mode 100644 index 1b5e1ca297c8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeApi.md +++ /dev/null @@ -1,1028 +0,0 @@ -# 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 -------------- | ------------- | ------------- -[**fakeBigDecimalMap**](FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | -[**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 | -[**testAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties -[**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 -[**testInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties -[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -[**testNullable**](FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property -[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | -[**testStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map - - -# **fakeBigDecimalMap** -> FakeBigDecimalMap200Response fakeBigDecimalMap() - - - -for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); - -try { - final response = api.fakeBigDecimalMap(); - print(response); -} catch on DioException (e) { - print('Exception when calling FakeApi->fakeBigDecimalMap: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **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) - -# **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 DioException (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'; - -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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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) - -# **testAdditionalPropertiesReference** -> testAdditionalPropertiesReference(requestBody) - -test referenced additionalProperties - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final Map requestBody = Object; // Map | request body - -try { - api.testAdditionalPropertiesReference(requestBody); -} catch on DioException (e) { - print('Exception when calling FakeApi->testAdditionalPropertiesReference: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requestBody** | [**Map<String, Object>**](Object.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) - -# **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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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'; - -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 DioException (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 DioException (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) - -# **testInlineFreeformAdditionalProperties** -> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) - -test inline free-form additionalProperties - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = ; // TestInlineFreeformAdditionalPropertiesRequest | request body - -try { - api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); -} catch on DioException (e) { - print('Exception when calling FakeApi->testInlineFreeformAdditionalProperties: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.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 DioException (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) - -# **testNullable** -> testNullable(childWithNullable) - -test nullable parent property - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final ChildWithNullable childWithNullable = ; // ChildWithNullable | request body - -try { - api.testNullable(childWithNullable); -} catch on DioException (e) { - print('Exception when calling FakeApi->testNullable: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **childWithNullable** | [**ChildWithNullable**](ChildWithNullable.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) - -# **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 DioException (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) - -# **testStringMapReference** -> testStringMapReference(requestBody) - -test referenced string map - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final Map requestBody = ; // Map | request body - -try { - api.testStringMapReference(requestBody); -} catch on DioException (e) { - print('Exception when calling FakeApi->testStringMapReference: $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) - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeBigDecimalMap200Response.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeBigDecimalMap200Response.md deleted file mode 100644 index 281dfc44fd8c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeBigDecimalMap200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.FakeBigDecimalMap200Response - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**someId** | **num** | | [optional] -**someMap** | **Map<String, 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/petstore_client_lib_fake-freezed/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeClassnameTags123Api.md deleted file mode 100644 index 645aebf399f0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FakeClassnameTags123Api.md +++ /dev/null @@ -1,61 +0,0 @@ -# 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 DioException (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/petstore_client_lib_fake-freezed/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FileSchemaTestClass.md deleted file mode 100644 index d14ac319d294..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FileSchemaTestClass.md +++ /dev/null @@ -1,16 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Foo.md deleted file mode 100644 index 185b76e3f5b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Foo.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FooGetDefaultResponse.md deleted file mode 100644 index 10d0133abd95..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FooGetDefaultResponse.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.FooGetDefaultResponse - -## 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/petstore_client_lib_fake-freezed/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FormatTest.md deleted file mode 100644 index 83b60545eb61..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/FormatTest.md +++ /dev/null @@ -1,30 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/HasOnlyReadOnly.md deleted file mode 100644 index 32cae937155d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/HasOnlyReadOnly.md +++ /dev/null @@ -1,16 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/HealthCheckResult.md deleted file mode 100644 index 4d6aeb75d965..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/HealthCheckResult.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/MapTest.md deleted file mode 100644 index 197fe780a25a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/MapTest.md +++ /dev/null @@ -1,18 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index 66d0d39c42be..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Model200Response.md deleted file mode 100644 index 5aa3fb97c32e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Model200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelClient.md deleted file mode 100644 index f7b922f4a398..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelClient.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelEnumClass.md deleted file mode 100644 index ebaafb44c7f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelEnumClass.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelFile.md deleted file mode 100644 index 4be260e93f6e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelFile.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelList.md deleted file mode 100644 index 283aa1f6b711..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelList.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelReturn.md deleted file mode 100644 index bc02df7a3692..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ModelReturn.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/Name.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Name.md deleted file mode 100644 index 25f49ea946b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Name.md +++ /dev/null @@ -1,18 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/NullableClass.md deleted file mode 100644 index 70ac1091d417..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/NullableClass.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/NumberOnly.md deleted file mode 100644 index d8096a3db37a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/NumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ObjectWithDeprecatedFields.md deleted file mode 100644 index dda2836d8d54..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ObjectWithDeprecatedFields.md +++ /dev/null @@ -1,18 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/Order.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Order.md deleted file mode 100644 index bde5ffe51a2c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Order.md +++ /dev/null @@ -1,20 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterComposite.md deleted file mode 100644 index 04bab7eff5d1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterComposite.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnum.md deleted file mode 100644 index af62ad87ab2e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnum.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumDefaultValue.md deleted file mode 100644 index c1bf8b0dec44..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumDefaultValue.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumInteger.md deleted file mode 100644 index 8c80a9e5c85f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumInteger.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumIntegerDefaultValue.md deleted file mode 100644 index eb8b55d70249..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterEnumIntegerDefaultValue.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterObjectWithEnumProperty.md deleted file mode 100644 index eab2ae8f66b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/OuterObjectWithEnumProperty.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/ParentWithNullable.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ParentWithNullable.md deleted file mode 100644 index 17aa5ca02941..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ParentWithNullable.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.ParentWithNullable - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | | [optional] -**nullableProperty** | **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/petstore_client_lib_fake-freezed/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Pet.md deleted file mode 100644 index 3cd230bfb213..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Pet.md +++ /dev/null @@ -1,20 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/PetApi.md deleted file mode 100644 index 5fc7fbd2657f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/PetApi.md +++ /dev/null @@ -1,439 +0,0 @@ -# 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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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/petstore_client_lib_fake-freezed/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ReadOnlyFirst.md deleted file mode 100644 index 8f612e8ba19f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/ReadOnlyFirst.md +++ /dev/null @@ -1,16 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/SingleRefType.md deleted file mode 100644 index 0dc93840cd7f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/SingleRefType.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.SingleRefType - -## 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/petstore_client_lib_fake-freezed/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/SpecialModelName.md deleted file mode 100644 index 5fcfa98e0b36..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/SpecialModelName.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/StoreApi.md deleted file mode 100644 index 42028947229f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/StoreApi.md +++ /dev/null @@ -1,188 +0,0 @@ -# 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 DioException (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 DioException (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 generate 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 DioException (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 DioException (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/petstore_client_lib_fake-freezed/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Tag.md deleted file mode 100644 index c219f987c19c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/Tag.md +++ /dev/null @@ -1,16 +0,0 @@ -# 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/petstore_client_lib_fake-freezed/doc/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/TestInlineFreeformAdditionalPropertiesRequest.md deleted file mode 100644 index e2b2f1fd4468..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/TestInlineFreeformAdditionalPropertiesRequest.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.TestInlineFreeformAdditionalPropertiesRequest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**someProperty** | **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/petstore_client_lib_fake-freezed/doc/User.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/User.md deleted file mode 100644 index fa87e64d8595..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/User.md +++ /dev/null @@ -1,22 +0,0 @@ -# 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] - -[[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/petstore_client_lib_fake-freezed/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/UserApi.md deleted file mode 100644 index 49b79d76b8a1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/doc/UserApi.md +++ /dev/null @@ -1,359 +0,0 @@ -# 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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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/petstore_client_lib_fake-freezed/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/openapi.dart deleted file mode 100644 index 53e0ea635366..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/openapi.dart +++ /dev/null @@ -1,21 +0,0 @@ -// -// 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/bearer_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/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api.dart deleted file mode 100644 index 835b76584b2d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api.dart +++ /dev/null @@ -1,110 +0,0 @@ -// -// 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: const Duration(milliseconds: 5000), - receiveTimeout: const Duration(milliseconds: 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/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart deleted file mode 100644 index 0848266271ea..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/another_fake_api.dart +++ /dev/null @@ -1,110 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'dart:convert'; -import '../model/models.dart'; -import 'package:dio/dio.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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient _responseData; - - - try { - _responseData = ModelClient.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart deleted file mode 100644 index 1d8e607e18f3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/default_api.dart +++ /dev/null @@ -1,89 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'dart:convert'; -import '../model/models.dart'; -import 'package:dio/dio.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 [FooGetDefaultResponse] as data - /// Throws [DioException] 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, - ); - - FooGetDefaultResponse _responseData; - - - try { - _responseData = FooGetDefaultResponse.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart deleted file mode 100644 index 33ae292a61e7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_api.dart +++ /dev/null @@ -1,1769 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'dart:convert'; -import '../model/models.dart'; -import 'package:dio/dio.dart'; - - -class FakeApi { - - final Dio _dio; - - const FakeApi(this._dio); - - /// fakeBigDecimalMap - /// for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys - /// - /// 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 [FakeBigDecimalMap200Response] as data - /// Throws [DioException] if API call or serialization fails - Future> fakeBigDecimalMap({ - - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/BigDecimalMap'; - 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, - ); - - FakeBigDecimalMap200Response _responseData; - - - try { - _responseData = FakeBigDecimalMap200Response.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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, - ); - } - - /// 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 [DioException] 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 = HealthCheckResult.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 = body; - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - bool _responseData; - - - try { - _responseData = _response.data as bool; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - OuterComposite _responseData; - - - try { - _responseData = OuterComposite.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 = body; - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - num _responseData; - - - try { - _responseData = _response.data as num; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 = body; - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - String _responseData; - - - try { - _responseData = _response.data as String; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - OuterObjectWithEnumProperty _responseData; - - - try { - _responseData = OuterObjectWithEnumProperty.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 referenced 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 [DioException] if API call or serialization fails - Future> testAdditionalPropertiesReference({ - - required Map requestBody, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/additionalProperties-reference'; - 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// 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 [DioException] 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 = body?.finalize(); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient _responseData; - - - try { - _responseData = ModelClient.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 { - _bodyData = { - if (integer != null) r'integer': integer, - if (int32 != null) r'int32': int32, - if (int64 != null) r'int64': int64, - r'number': number, - if (float != null) r'float': float, - r'double': double_, - if (string != null) r'string': string, - r'pattern_without_delimiter': patternWithoutDelimiter, - r'byte': byte, - if (binary != null) r'binary': binary, - if (date != null) r'date': date, - if (dateTime != null) r'dateTime': dateTime, - if (password != null) r'password': password, - if (callback != null) r'callback': callback, - }; - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 { - _bodyData = { - if (enumFormStringArray != null) r'enum_form_string_array': enumFormStringArray, - if (enumFormString != null) r'enum_form_string': enumFormString, - }; - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// test inline free-form additionalProperties - /// - /// - /// Parameters: - /// * [testInlineFreeformAdditionalPropertiesRequest] - 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 [DioException] if API call or serialization fails - Future> testInlineFreeformAdditionalProperties({ - - required TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/inline-freeform-additionalProperties'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData=jsonEncode(testInlineFreeformAdditionalPropertiesRequest); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 { - _bodyData = { - r'param': param, - r'param2': param2, - }; - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// test nullable parent property - /// - /// - /// Parameters: - /// * [childWithNullable] - 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 [DioException] if API call or serialization fails - Future> testNullable({ - - required ChildWithNullable childWithNullable, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/nullable'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData=jsonEncode(childWithNullable); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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; - } - - /// test referenced string map - /// - /// - /// 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 [DioException] if API call or serialization fails - Future> testStringMapReference({ - - required Map requestBody, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/stringMap-reference'; - 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart deleted file mode 100644 index e4df96000116..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/fake_classname_tags123_api.dart +++ /dev/null @@ -1,117 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'dart:convert'; -import '../model/models.dart'; -import 'package:dio/dio.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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient _responseData; - - - try { - _responseData = ModelClient.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart deleted file mode 100644 index 353d3b783c25..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/pet_api.dart +++ /dev/null @@ -1,765 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'dart:convert'; -import '../model/models.dart'; -import 'package:dio/dio.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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 [DioException] if API call or serialization fails - Future>> findPetsByStatus({ - - @Deprecated('status is deprecated') 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 { - final _responseDataAsList = _response.data as List; - _responseData = _responseDataAsList.map((dynamic e)=> Pet.fromJson(e as Map)).toList(); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 { - final _responseDataAsSet = _response.data as List; - _responseData = _responseDataAsSet.map((dynamic e)=> Pet.fromJson(e as Map)).toSet(); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 = Pet.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 { - _bodyData = { - if (name != null) r'name': name, - if (status != null) r'status': status, - }; - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 { - _bodyData = FormData.fromMap({ - if (additionalMetadata != null) - r'additionalMetadata': - - jsonEncode(additionalMetadata), - if (file != null) - r'file': - file - , - }); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ApiResponse _responseData; - - - try { - _responseData = ApiResponse.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 { - _bodyData = FormData.fromMap({ - if (additionalMetadata != null) - r'additionalMetadata': - - jsonEncode(additionalMetadata), -r'requiredFile': - requiredFile - , - }); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ApiResponse _responseData; - - - try { - _responseData = ApiResponse.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart deleted file mode 100644 index 37987c684ef2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/store_api.dart +++ /dev/null @@ -1,309 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'dart:convert'; -import '../model/models.dart'; -import 'package:dio/dio.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 [DioException] 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 [DioException] 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 = _response.data as Map; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 generate 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 [DioException] 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 = Order.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Order _responseData; - - - try { - _responseData = Order.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart deleted file mode 100644 index a68b3f17dad1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/api/user_api.dart +++ /dev/null @@ -1,536 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'dart:convert'; -import '../model/models.dart'; -import 'package:dio/dio.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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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 [DioException] 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 [DioException] 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 = User.fromJson(_response.data as Map); - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 = _response.data as String; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - 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 [DioException] 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 [DioException] 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 DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - 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/petstore_client_lib_fake-freezed/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/api_key_auth.dart deleted file mode 100644 index ee16e3f0f92f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/api_key_auth.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// 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/petstore_client_lib_fake-freezed/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/auth.dart deleted file mode 100644 index f7ae9bf3f11e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/auth.dart +++ /dev/null @@ -1,18 +0,0 @@ -// -// 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/petstore_client_lib_fake-freezed/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/basic_auth.dart deleted file mode 100644 index b65ccb5b71f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/basic_auth.dart +++ /dev/null @@ -1,37 +0,0 @@ -// -// 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']?.toLowerCase() == '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/petstore_client_lib_fake-freezed/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 8f46678761b2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/bearer_auth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// 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']?.toLowerCase() == '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/petstore_client_lib_fake-freezed/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/oauth.dart deleted file mode 100644 index 337cf762b0ce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/auth/oauth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// 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/petstore_client_lib_fake-freezed/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/additional_properties_class.dart deleted file mode 100644 index 12c438f0b974..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/additional_properties_class.dart +++ /dev/null @@ -1,50 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// AdditionalPropertiesClass - /// - /// Properties: - /// * [mapProperty] - /// * [mapOfMapProperty] - -@freezed -class AdditionalPropertiesClass with _$AdditionalPropertiesClass { -const AdditionalPropertiesClass._(); - - - const factory AdditionalPropertiesClass({ - @JsonKey(name: r'map_property') - Map? - mapProperty, - @JsonKey(name: r'map_of_map_property') - Map? ->? - mapOfMapProperty, -}) = _AdditionalPropertiesClass; - - - - - factory AdditionalPropertiesClass.fromJson(Map json) => _$AdditionalPropertiesClassFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/all_of_with_single_ref.dart deleted file mode 100644 index 04b3738b81b8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/all_of_with_single_ref.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// AllOfWithSingleRef - /// - /// Properties: - /// * [username] - /// * [singleRefType] - -@freezed -class AllOfWithSingleRef with _$AllOfWithSingleRef { -const AllOfWithSingleRef._(); - - - const factory AllOfWithSingleRef({ - @JsonKey(name: r'username') - String? - username, - @JsonKey(name: r'SingleRefType') - SingleRefType? - singleRefType, -}) = _AllOfWithSingleRef; - - - - - factory AllOfWithSingleRef.fromJson(Map json) => _$AllOfWithSingleRefFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/animal.dart deleted file mode 100644 index ab4f4a5383c6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/animal.dart +++ /dev/null @@ -1,69 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Animal - /// - /// Properties: - /// * [className] - /// * [color] - -@freezed -class Animal with _$Animal { -const Animal._(); - - - const factory Animal.cat({ - required Cat cat, - }) = AnimalCat; - const factory Animal.dog({ - required Dog dog, - }) = AnimalDog; - const factory Animal.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([]) List possibleTypes, - @Default([]) List deserializedModels, - }) = AnimalUnknown; - - - - - factory Animal.fromJson(Map json) { - switch(json['className']){ - case 'CAT': - return Animal.cat( - cat : Cat.fromJson(json), - ); - case 'DOG': - return Animal.dog( - dog : Dog.fromJson(json), - ); - } - return Animal.unknown(json: json); - } - - - - - Map toJson() { - return when( - cat: (cat) => cat.toJson(), - dog: (dog) => dog.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/api_response.dart deleted file mode 100644 index e8608ad60603..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/api_response.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// ApiResponse - /// - /// Properties: - /// * [code] - /// * [type] - /// * [message] - -@freezed -class ApiResponse with _$ApiResponse { -const ApiResponse._(); - - - const factory ApiResponse({ - @JsonKey(name: r'code') - int? - code, - @JsonKey(name: r'type') - String? - type, - @JsonKey(name: r'message') - String? - message, -}) = _ApiResponse; - - - - - factory ApiResponse.fromJson(Map json) => _$ApiResponseFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_array_of_number_only.dart deleted file mode 100644 index 82381d375158..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_array_of_number_only.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// ArrayOfArrayOfNumberOnly - /// - /// Properties: - /// * [arrayArrayNumber] - -@freezed -class ArrayOfArrayOfNumberOnly with _$ArrayOfArrayOfNumberOnly { -const ArrayOfArrayOfNumberOnly._(); - - - const factory ArrayOfArrayOfNumberOnly({ - @JsonKey(name: r'ArrayArrayNumber') - List< - List< - num? ->? ->? - arrayArrayNumber, -}) = _ArrayOfArrayOfNumberOnly; - - - - - factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfArrayOfNumberOnlyFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_number_only.dart deleted file mode 100644 index 623dbe6d5d58..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_of_number_only.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// ArrayOfNumberOnly - /// - /// Properties: - /// * [arrayNumber] - -@freezed -class ArrayOfNumberOnly with _$ArrayOfNumberOnly { -const ArrayOfNumberOnly._(); - - - const factory ArrayOfNumberOnly({ - @JsonKey(name: r'ArrayNumber') - List< - num? ->? - arrayNumber, -}) = _ArrayOfNumberOnly; - - - - - factory ArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfNumberOnlyFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_test.dart deleted file mode 100644 index 1c793fc302a9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/array_test.dart +++ /dev/null @@ -1,58 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// ArrayTest - /// - /// Properties: - /// * [arrayOfString] - /// * [arrayArrayOfInteger] - /// * [arrayArrayOfModel] - -@freezed -class ArrayTest with _$ArrayTest { -const ArrayTest._(); - - - const factory ArrayTest({ - @JsonKey(name: r'array_of_string') - List< - String? ->? - arrayOfString, - @JsonKey(name: r'array_array_of_integer') - List< - List< - int? ->? ->? - arrayArrayOfInteger, - @JsonKey(name: r'array_array_of_model') - List< - List< - ReadOnlyFirst? ->? ->? - arrayArrayOfModel, -}) = _ArrayTest; - - - - - factory ArrayTest.fromJson(Map json) => _$ArrayTestFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/capitalization.dart deleted file mode 100644 index 525d1f04e549..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/capitalization.dart +++ /dev/null @@ -1,61 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Capitalization - /// - /// Properties: - /// * [smallCamel] - /// * [capitalCamel] - /// * [smallSnake] - /// * [capitalSnake] - /// * [sCAETHFlowPoints] - /// * [ATT_NAME] - Name of the pet - -@freezed -class Capitalization with _$Capitalization { -const Capitalization._(); - - - const factory Capitalization({ - @JsonKey(name: r'smallCamel') - String? - smallCamel, - @JsonKey(name: r'CapitalCamel') - String? - capitalCamel, - @JsonKey(name: r'small_Snake') - String? - smallSnake, - @JsonKey(name: r'Capital_Snake') - String? - capitalSnake, - @JsonKey(name: r'SCA_ETH_Flow_Points') - String? - sCAETHFlowPoints, - /// Name of the pet - @JsonKey(name: r'ATT_NAME') - String? - ATT_NAME, -}) = _Capitalization; - - - - - factory Capitalization.fromJson(Map json) => _$CapitalizationFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/cat.dart deleted file mode 100644 index a60babcaddc1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/cat.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Cat - /// - /// Properties: - /// * [className] - /// * [color] - /// * [declawed] - -@freezed -class Cat with _$Cat { -const Cat._(); - - - - const factory Cat({ - @JsonKey(name: r'className') - required String - className, - @JsonKey(name: r'color') - String? - color, - @JsonKey(name: r'declawed') - bool? - declawed, -}) = _Cat; - - - - factory Cat.fromJson(Map json) => _$CatFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/category.dart deleted file mode 100644 index 5f4054076196..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/category.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Category - /// - /// Properties: - /// * [id] - /// * [name] - -@freezed -class Category with _$Category { -const Category._(); - - - const factory Category({ - @JsonKey(name: r'id') - int? - id, - @JsonKey(name: r'name') - required String - name, -}) = _Category; - - - - - factory Category.fromJson(Map json) => _$CategoryFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/child_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/child_with_nullable.dart deleted file mode 100644 index 7b43ddac31c2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/child_with_nullable.dart +++ /dev/null @@ -1,56 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// ChildWithNullable - /// - /// Properties: - /// * [type] - /// * [nullableProperty] - /// * [otherProperty] - -@freezed -class ChildWithNullable with _$ChildWithNullable { -const ChildWithNullable._(); - - - - const factory ChildWithNullable({ - @JsonKey(name: r'type') - ChildWithNullableTypeEnum? - type, - @JsonKey(name: r'nullableProperty') - String? - nullableProperty, - @JsonKey(name: r'otherProperty') - String? - otherProperty, -}) = _ChildWithNullable; - - - - factory ChildWithNullable.fromJson(Map json) => _$ChildWithNullableFromJson(json); - - - - - - - - -} - - - - -@JsonEnum(valueField: 'value') -enum ChildWithNullableTypeEnum { - childWithNullable(value: r'ChildWithNullable'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const ChildWithNullableTypeEnum({required this.value}); - final String value; -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/class_model.dart deleted file mode 100644 index cb16c798fde3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/class_model.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Model for testing model with \"_class\" property - /// - /// Properties: - /// * [class_] - -@freezed -class ClassModel with _$ClassModel { -const ClassModel._(); - - - const factory ClassModel({ - @JsonKey(name: r'_class') - String? - class_, -}) = _ClassModel; - - - - - factory ClassModel.fromJson(Map json) => _$ClassModelFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/deprecated_object.dart deleted file mode 100644 index 373d5863c1dd..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/deprecated_object.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// DeprecatedObject - /// - /// Properties: - /// * [name] - -@freezed -class DeprecatedObject with _$DeprecatedObject { -const DeprecatedObject._(); - - - const factory DeprecatedObject({ - @JsonKey(name: r'name') - String? - name, -}) = _DeprecatedObject; - - - - - factory DeprecatedObject.fromJson(Map json) => _$DeprecatedObjectFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/dog.dart deleted file mode 100644 index 9df086abe547..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/dog.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Dog - /// - /// Properties: - /// * [className] - /// * [color] - /// * [breed] - -@freezed -class Dog with _$Dog { -const Dog._(); - - - - const factory Dog({ - @JsonKey(name: r'className') - required String - className, - @JsonKey(name: r'color') - String? - color, - @JsonKey(name: r'breed') - String? - breed, -}) = _Dog; - - - - factory Dog.fromJson(Map json) => _$DogFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_arrays.dart deleted file mode 100644 index 6fd9a450ca7b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_arrays.dart +++ /dev/null @@ -1,65 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// EnumArrays - /// - /// Properties: - /// * [justSymbol] - /// * [arrayEnum] - -@freezed -class EnumArrays with _$EnumArrays { -const EnumArrays._(); - - - const factory EnumArrays({ - @JsonKey(name: r'just_symbol') - EnumArraysJustSymbolEnum? - justSymbol, - @JsonKey(name: r'array_enum') - List< - EnumArraysArrayEnumEnum? ->? - arrayEnum, -}) = _EnumArrays; - - - - - factory EnumArrays.fromJson(Map json) => _$EnumArraysFromJson(json); - - - - - - - - -} - - - - -@JsonEnum(valueField: 'value') -enum EnumArraysJustSymbolEnum { - greaterThanEqual(value: r'>='), - dollar(value: r'$'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const EnumArraysJustSymbolEnum({required this.value}); - final String value; -} - - -@JsonEnum(valueField: 'value') -enum EnumArraysArrayEnumEnum { - fish(value: r'fish'), - crab(value: r'crab'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const EnumArraysArrayEnumEnum({required this.value}); - final String value; -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_test.dart deleted file mode 100644 index 55b5cfe74ece..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/enum_test.dart +++ /dev/null @@ -1,106 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// EnumTest - /// - /// Properties: - /// * [enumString] - /// * [enumStringRequired] - /// * [enumInteger] - /// * [enumNumber] - /// * [outerEnum] - /// * [outerEnumInteger] - /// * [outerEnumDefaultValue] - /// * [outerEnumIntegerDefaultValue] - -@freezed -class EnumTest with _$EnumTest { -const EnumTest._(); - - - const factory EnumTest({ - @JsonKey(name: r'enum_string') - EnumTestEnumStringEnum? - enumString, - @JsonKey(name: r'enum_string_required') - required EnumTestEnumStringRequiredEnum - enumStringRequired, - @JsonKey(name: r'enum_integer') - EnumTestEnumIntegerEnum? - enumInteger, - @JsonKey(name: r'enum_number') - EnumTestEnumNumberEnum? - enumNumber, - @JsonKey(name: r'outerEnum') - OuterEnum? - outerEnum, - @JsonKey(name: r'outerEnumInteger') - OuterEnumInteger? - outerEnumInteger, - @JsonKey(name: r'outerEnumDefaultValue') - OuterEnumDefaultValue? - outerEnumDefaultValue, - @JsonKey(name: r'outerEnumIntegerDefaultValue') - OuterEnumIntegerDefaultValue? - outerEnumIntegerDefaultValue, -}) = _EnumTest; - - - - - factory EnumTest.fromJson(Map json) => _$EnumTestFromJson(json); - - - - - - - - -} - - - - -@JsonEnum(valueField: 'value') -enum EnumTestEnumStringEnum { - UPPER(value: r'UPPER'), - lower(value: r'lower'), - empty(value: r''), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const EnumTestEnumStringEnum({required this.value}); - final String value; -} - -@JsonEnum(valueField: 'value') -enum EnumTestEnumStringRequiredEnum { - UPPER(value: r'UPPER'), - lower(value: r'lower'), - empty(value: r''), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const EnumTestEnumStringRequiredEnum({required this.value}); - final String value; -} - -@JsonEnum(valueField: 'value') -enum EnumTestEnumIntegerEnum { - number1(value: 1), - numberNegative1(value: -1), - unknownDefaultOpenApi(value: 11184809); - const EnumTestEnumIntegerEnum({required this.value}); - final int value; -} - -@JsonEnum(valueField: 'value') -enum EnumTestEnumNumberEnum { - number1Period1(value: '1.1'), - numberNegative1Period2(value: '-1.2'), - unknownDefaultOpenApi(value: '11184809'); - const EnumTestEnumNumberEnum({required this.value}); - final double value; -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/fake_big_decimal_map200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/fake_big_decimal_map200_response.dart deleted file mode 100644 index 58f1f2fb2971..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/fake_big_decimal_map200_response.dart +++ /dev/null @@ -1,46 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// FakeBigDecimalMap200Response - /// - /// Properties: - /// * [someId] - /// * [someMap] - -@freezed -class FakeBigDecimalMap200Response with _$FakeBigDecimalMap200Response { -const FakeBigDecimalMap200Response._(); - - - const factory FakeBigDecimalMap200Response({ - @JsonKey(name: r'someId') - num? - someId, - @JsonKey(name: r'someMap') - Map? - someMap, -}) = _FakeBigDecimalMap200Response; - - - - - factory FakeBigDecimalMap200Response.fromJson(Map json) => _$FakeBigDecimalMap200ResponseFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/file_schema_test_class.dart deleted file mode 100644 index 45eed25fb283..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/file_schema_test_class.dart +++ /dev/null @@ -1,46 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// FileSchemaTestClass - /// - /// Properties: - /// * [file] - /// * [files] - -@freezed -class FileSchemaTestClass with _$FileSchemaTestClass { -const FileSchemaTestClass._(); - - - const factory FileSchemaTestClass({ - @JsonKey(name: r'file') - ModelFile? - file, - @JsonKey(name: r'files') - List< - ModelFile? ->? - files, -}) = _FileSchemaTestClass; - - - - - factory FileSchemaTestClass.fromJson(Map json) => _$FileSchemaTestClassFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo.dart deleted file mode 100644 index e1d42e6f0a5a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Foo - /// - /// Properties: - /// * [bar] - -@freezed -class Foo with _$Foo { -const Foo._(); - - - const factory Foo({ - @JsonKey(name: r'bar') - String? - bar, -}) = _Foo; - - - - - factory Foo.fromJson(Map json) => _$FooFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo_get_default_response.dart deleted file mode 100644 index 06c214baa9e2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/foo_get_default_response.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// FooGetDefaultResponse - /// - /// Properties: - /// * [string] - -@freezed -class FooGetDefaultResponse with _$FooGetDefaultResponse { -const FooGetDefaultResponse._(); - - - const factory FooGetDefaultResponse({ - @JsonKey(name: r'string') - Foo? - string, -}) = _FooGetDefaultResponse; - - - - - factory FooGetDefaultResponse.fromJson(Map json) => _$FooGetDefaultResponseFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/format_test.dart deleted file mode 100644 index c5a2780e3aae..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/format_test.dart +++ /dev/null @@ -1,102 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// FormatTest - /// - /// Properties: - /// * [integer] - /// * [int32] - /// * [int64] - /// * [number] - /// * [float] - /// * [double_] - /// * [decimal] - /// * [string] - /// * [byte] - /// * [binary] - /// * [date] - /// * [dateTime] - /// * [uuid] - /// * [password] - /// * [patternWithDigits] - A string that is a 10 digit number. Can have leading zeros. - /// * [patternWithDigitsAndDelimiter] - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - -@freezed -class FormatTest with _$FormatTest { -const FormatTest._(); - - - const factory FormatTest({ - @JsonKey(name: r'integer') - int? - integer, - @JsonKey(name: r'int32') - int? - int32, - @JsonKey(name: r'int64') - int? - int64, - @JsonKey(name: r'number') - required num - number, - @JsonKey(name: r'float') - double? - float, - @JsonKey(name: r'double') - double? - double_, - @JsonKey(name: r'decimal') - double? - decimal, - @JsonKey(name: r'string') - String? - string, - @JsonKey(name: r'byte') - required String - byte, - @JsonKey(name: r'binary') - MultipartFile? - binary, - @JsonKey(name: r'date') - required DateTime - date, - @JsonKey(name: r'dateTime') - DateTime? - dateTime, - @JsonKey(name: r'uuid') - String? - uuid, - @JsonKey(name: r'password') - required String - password, - /// A string that is a 10 digit number. Can have leading zeros. - @JsonKey(name: r'pattern_with_digits') - 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') - String? - patternWithDigitsAndDelimiter, -}) = _FormatTest; - - - - - factory FormatTest.fromJson(Map json) => _$FormatTestFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/has_only_read_only.dart deleted file mode 100644 index 7761a7315928..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/has_only_read_only.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// HasOnlyReadOnly - /// - /// Properties: - /// * [bar] - /// * [foo] - -@freezed -class HasOnlyReadOnly with _$HasOnlyReadOnly { -const HasOnlyReadOnly._(); - - - const factory HasOnlyReadOnly({ - @JsonKey(name: r'bar') - String? - bar, - @JsonKey(name: r'foo') - String? - foo, -}) = _HasOnlyReadOnly; - - - - - factory HasOnlyReadOnly.fromJson(Map json) => _$HasOnlyReadOnlyFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/health_check_result.dart deleted file mode 100644 index 9dfdbc5c1a82..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/health_check_result.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - /// - /// Properties: - /// * [nullableMessage] - -@freezed -class HealthCheckResult with _$HealthCheckResult { -const HealthCheckResult._(); - - - const factory HealthCheckResult({ - @JsonKey(name: r'NullableMessage') - String? - nullableMessage, -}) = _HealthCheckResult; - - - - - factory HealthCheckResult.fromJson(Map json) => _$HealthCheckResultFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/map_test.dart deleted file mode 100644 index edeeb9fe5649..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/map_test.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// MapTest - /// - /// Properties: - /// * [mapMapOfString] - /// * [mapOfEnumString] - /// * [directMap] - /// * [indirectMap] - -@freezed -class MapTest with _$MapTest { -const MapTest._(); - - - const factory MapTest({ - @JsonKey(name: r'map_map_of_string') - Map? ->? - mapMapOfString, - @JsonKey(name: r'map_of_enum_string') - Map? - mapOfEnumString, - @JsonKey(name: r'direct_map') - Map? - directMap, - @JsonKey(name: r'indirect_map') - Map? - indirectMap, -}) = _MapTest; - - - - - factory MapTest.fromJson(Map json) => _$MapTestFromJson(json); - - - - - - - - -} - - - - - -@JsonEnum(valueField: 'value') -enum MapTestMapOfEnumStringEnum { - UPPER(value: r'UPPER'), - lower(value: r'lower'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const MapTestMapOfEnumStringEnum({required this.value}); - final String value; -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/mixed_properties_and_additional_properties_class.dart deleted file mode 100644 index eb12475fc3b7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ /dev/null @@ -1,50 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// MixedPropertiesAndAdditionalPropertiesClass - /// - /// Properties: - /// * [uuid] - /// * [dateTime] - /// * [map] - -@freezed -class MixedPropertiesAndAdditionalPropertiesClass with _$MixedPropertiesAndAdditionalPropertiesClass { -const MixedPropertiesAndAdditionalPropertiesClass._(); - - - const factory MixedPropertiesAndAdditionalPropertiesClass({ - @JsonKey(name: r'uuid') - String? - uuid, - @JsonKey(name: r'dateTime') - DateTime? - dateTime, - @JsonKey(name: r'map') - Map? - map, -}) = _MixedPropertiesAndAdditionalPropertiesClass; - - - - - factory MixedPropertiesAndAdditionalPropertiesClass.fromJson(Map json) => _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model200_response.dart deleted file mode 100644 index cbc0c625c0e9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model200_response.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Model for testing model name starting with number - /// - /// Properties: - /// * [name] - /// * [class_] - -@freezed -class Model200Response with _$Model200Response { -const Model200Response._(); - - - const factory Model200Response({ - @JsonKey(name: r'name') - int? - name, - @JsonKey(name: r'class') - String? - class_, -}) = _Model200Response; - - - - - factory Model200Response.fromJson(Map json) => _$Model200ResponseFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_client.dart deleted file mode 100644 index 5e7d477fc2c5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_client.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// ModelClient - /// - /// Properties: - /// * [client] - -@freezed -class ModelClient with _$ModelClient { -const ModelClient._(); - - - const factory ModelClient({ - @JsonKey(name: r'client') - String? - client, -}) = _ModelClient; - - - - - factory ModelClient.fromJson(Map json) => _$ModelClientFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_enum_class.dart deleted file mode 100644 index 46f700a2c015..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_enum_class.dart +++ /dev/null @@ -1,17 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - - -@JsonEnum(valueField: 'value') -enum ModelEnumClass { - abc(value: r'_abc'), - efg(value: r'-efg'), - leftParenthesisXyzRightParenthesis(value: r'(xyz)'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const ModelEnumClass({required this.value}); - final String value; -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_file.dart deleted file mode 100644 index 7585fead5f37..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_file.dart +++ /dev/null @@ -1,41 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Must be named `File` for test. - /// - /// Properties: - /// * [sourceURI] - Test capitalization - -@freezed -class ModelFile with _$ModelFile { -const ModelFile._(); - - - const factory ModelFile({ - /// Test capitalization - @JsonKey(name: r'sourceURI') - String? - sourceURI, -}) = _ModelFile; - - - - - factory ModelFile.fromJson(Map json) => _$ModelFileFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_list.dart deleted file mode 100644 index 5f9e176b5ffd..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_list.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// ModelList - /// - /// Properties: - /// * [n123list] - -@freezed -class ModelList with _$ModelList { -const ModelList._(); - - - const factory ModelList({ - @JsonKey(name: r'123-list') - String? - n123list, -}) = _ModelList; - - - - - factory ModelList.fromJson(Map json) => _$ModelListFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_return.dart deleted file mode 100644 index 29d509a235cf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/model_return.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Model for testing reserved words - /// - /// Properties: - /// * [return_] - -@freezed -class ModelReturn with _$ModelReturn { -const ModelReturn._(); - - - const factory ModelReturn({ - @JsonKey(name: r'return') - int? - return_, -}) = _ModelReturn; - - - - - factory ModelReturn.fromJson(Map json) => _$ModelReturnFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/models.dart deleted file mode 100644 index 1591d5519c42..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/models.dart +++ /dev/null @@ -1,20 +0,0 @@ -//ignore_for_file: invalid_annotation_target -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:dio/dio.dart'; -import 'dart:convert'; - -part 'models.freezed.dart'; -part 'models.g.dart'; - -part 'primitive_union_types.dart'; -part 'additional_properties_class.dart';part 'all_of_with_single_ref.dart';part 'animal.dart';part 'api_response.dart';part 'array_of_array_of_number_only.dart';part 'array_of_number_only.dart';part 'array_test.dart';part 'capitalization.dart';part 'cat.dart';part 'category.dart';part 'child_with_nullable.dart';part 'class_model.dart';part 'deprecated_object.dart';part 'dog.dart';part 'enum_arrays.dart';part 'enum_test.dart';part 'fake_big_decimal_map200_response.dart';part 'file_schema_test_class.dart';part 'foo.dart';part 'foo_get_default_response.dart';part 'format_test.dart';part 'has_only_read_only.dart';part 'health_check_result.dart';part 'map_test.dart';part 'mixed_properties_and_additional_properties_class.dart';part 'model200_response.dart';part 'model_client.dart';part 'model_enum_class.dart';part 'model_file.dart';part 'model_list.dart';part 'model_return.dart';part 'name.dart';part 'nullable_class.dart';part 'number_only.dart';part 'object_with_deprecated_fields.dart';part 'order.dart';part 'outer_composite.dart';part 'outer_enum.dart';part 'outer_enum_default_value.dart';part 'outer_enum_integer.dart';part 'outer_enum_integer_default_value.dart';part 'outer_object_with_enum_property.dart';part 'parent_with_nullable.dart';part 'pet.dart';part 'read_only_first.dart';part 'single_ref_type.dart';part 'special_model_name.dart';part 'tag.dart';part 'test_inline_freeform_additional_properties_request.dart';part 'user.dart'; - -/// A typedef used in the deserialization of OneOf and AnyOf -/// models when no discriminator mapping is provided. -typedef FromJsonMethodType = T Function(Map); - -/// Deserialization error types for OneOf and AnyOf types. -enum DeserializationErrorType { - MoreThanOneTypeSatisfied, - UnKnownType, -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/name.dart deleted file mode 100644 index 2cf00d19f6e6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/name.dart +++ /dev/null @@ -1,52 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Model for testing model name same as property name - /// - /// Properties: - /// * [name] - /// * [snakeCase] - /// * [property] - /// * [n123number] - -@freezed -class Name with _$Name { -const Name._(); - - - const factory Name({ - @JsonKey(name: r'name') - required int - name, - @JsonKey(name: r'snake_case') - int? - snakeCase, - @JsonKey(name: r'property') - String? - property, - @JsonKey(name: r'123Number') - int? - n123number, -}) = _Name; - - - - - factory Name.fromJson(Map json) => _$NameFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/nullable_class.dart deleted file mode 100644 index d97933988453..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/nullable_class.dart +++ /dev/null @@ -1,96 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// NullableClass - /// - /// Properties: - /// * [integerProp] - /// * [numberProp] - /// * [booleanProp] - /// * [stringProp] - /// * [dateProp] - /// * [datetimeProp] - /// * [arrayNullableProp] - /// * [arrayAndItemsNullableProp] - /// * [arrayItemsNullable] - /// * [objectNullableProp] - /// * [objectAndItemsNullableProp] - /// * [objectItemsNullable] - -@freezed -class NullableClass with _$NullableClass { -const NullableClass._(); - - - const factory NullableClass({ - @JsonKey(name: r'integer_prop') - int? - integerProp, - @JsonKey(name: r'number_prop') - num? - numberProp, - @JsonKey(name: r'boolean_prop') - bool? - booleanProp, - @JsonKey(name: r'string_prop') - String? - stringProp, - @JsonKey(name: r'date_prop') - DateTime? - dateProp, - @JsonKey(name: r'datetime_prop') - DateTime? - datetimeProp, - @JsonKey(name: r'array_nullable_prop') - List< - Object? ->? - arrayNullableProp, - @JsonKey(name: r'array_and_items_nullable_prop') - List< - Object? ->? - arrayAndItemsNullableProp, - @JsonKey(name: r'array_items_nullable') - List< - Object? ->? - arrayItemsNullable, - @JsonKey(name: r'object_nullable_prop') - Map? - objectNullableProp, - @JsonKey(name: r'object_and_items_nullable_prop') - Map? - objectAndItemsNullableProp, - @JsonKey(name: r'object_items_nullable') - Map? - objectItemsNullable, -}) = _NullableClass; - - - - - factory NullableClass.fromJson(Map json) => _$NullableClassFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/number_only.dart deleted file mode 100644 index 6e59c27d03af..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/number_only.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// NumberOnly - /// - /// Properties: - /// * [justNumber] - -@freezed -class NumberOnly with _$NumberOnly { -const NumberOnly._(); - - - const factory NumberOnly({ - @JsonKey(name: r'JustNumber') - num? - justNumber, -}) = _NumberOnly; - - - - - factory NumberOnly.fromJson(Map json) => _$NumberOnlyFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/object_with_deprecated_fields.dart deleted file mode 100644 index 8c78bdadaf8b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/object_with_deprecated_fields.dart +++ /dev/null @@ -1,54 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// ObjectWithDeprecatedFields - /// - /// Properties: - /// * [uuid] - /// * [id] - /// * [deprecatedRef] - /// * [bars] - -@freezed -class ObjectWithDeprecatedFields with _$ObjectWithDeprecatedFields { -const ObjectWithDeprecatedFields._(); - - - const factory ObjectWithDeprecatedFields({ - @JsonKey(name: r'uuid') - String? - uuid, - @JsonKey(name: r'id') - num? - id, - @JsonKey(name: r'deprecatedRef') - DeprecatedObject? - deprecatedRef, - @JsonKey(name: r'bars') - List< - String? ->? - bars, -}) = _ObjectWithDeprecatedFields; - - - - - factory ObjectWithDeprecatedFields.fromJson(Map json) => _$ObjectWithDeprecatedFieldsFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/order.dart deleted file mode 100644 index 543d035c9fa3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/order.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Order - /// - /// Properties: - /// * [id] - /// * [petId] - /// * [quantity] - /// * [shipDate] - /// * [status] - Order Status - /// * [complete] - -@freezed -class Order with _$Order { -const Order._(); - - - const factory Order({ - @JsonKey(name: r'id') - int? - id, - @JsonKey(name: r'petId') - int? - petId, - @JsonKey(name: r'quantity') - int? - quantity, - @JsonKey(name: r'shipDate') - DateTime? - shipDate, - /// Order Status - @JsonKey(name: r'status') - OrderStatusEnum? - status, - @JsonKey(name: r'complete') - bool? - complete, -}) = _Order; - - - - - factory Order.fromJson(Map json) => _$OrderFromJson(json); - - - - - - - - -} - - - - /// Order Status -@JsonEnum(valueField: 'value') -enum OrderStatusEnum { - placed(value: r'placed'), - approved(value: r'approved'), - delivered(value: r'delivered'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const OrderStatusEnum({required this.value}); - final String value; -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_composite.dart deleted file mode 100644 index b683fc76db42..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_composite.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// OuterComposite - /// - /// Properties: - /// * [myNumber] - /// * [myString] - /// * [myBoolean] - -@freezed -class OuterComposite with _$OuterComposite { -const OuterComposite._(); - - - const factory OuterComposite({ - @JsonKey(name: r'my_number') - num? - myNumber, - @JsonKey(name: r'my_string') - String? - myString, - @JsonKey(name: r'my_boolean') - bool? - myBoolean, -}) = _OuterComposite; - - - - - factory OuterComposite.fromJson(Map json) => _$OuterCompositeFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum.dart deleted file mode 100644 index d1fbeffabb32..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum.dart +++ /dev/null @@ -1,17 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - - -@JsonEnum(valueField: 'value') -enum OuterEnum { - placed(value: r'placed'), - approved(value: r'approved'), - delivered(value: r'delivered'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const OuterEnum({required this.value}); - final String value; -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_default_value.dart deleted file mode 100644 index 40b234a78af5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_default_value.dart +++ /dev/null @@ -1,17 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - - -@JsonEnum(valueField: 'value') -enum OuterEnumDefaultValue { - placed(value: r'placed'), - approved(value: r'approved'), - delivered(value: r'delivered'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const OuterEnumDefaultValue({required this.value}); - final String value; -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer.dart deleted file mode 100644 index ed4e09fba4bf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer.dart +++ /dev/null @@ -1,17 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - - -@JsonEnum(valueField: 'value') -enum OuterEnumInteger { - number0(value: 0), - number1(value: 1), - number2(value: 2), - unknownDefaultOpenApi(value: 11184809); - const OuterEnumInteger({required this.value}); - final int value; -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer_default_value.dart deleted file mode 100644 index cc4104b1dd49..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_enum_integer_default_value.dart +++ /dev/null @@ -1,17 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - - -@JsonEnum(valueField: 'value') -enum OuterEnumIntegerDefaultValue { - number0(value: 0), - number1(value: 1), - number2(value: 2), - unknownDefaultOpenApi(value: 11184809); - const OuterEnumIntegerDefaultValue({required this.value}); - final int value; -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_object_with_enum_property.dart deleted file mode 100644 index 9a7e946faecf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/outer_object_with_enum_property.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// OuterObjectWithEnumProperty - /// - /// Properties: - /// * [value] - -@freezed -class OuterObjectWithEnumProperty with _$OuterObjectWithEnumProperty { -const OuterObjectWithEnumProperty._(); - - - const factory OuterObjectWithEnumProperty({ - @JsonKey(name: r'value') - required OuterEnumInteger - value, -}) = _OuterObjectWithEnumProperty; - - - - - factory OuterObjectWithEnumProperty.fromJson(Map json) => _$OuterObjectWithEnumPropertyFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/parent_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/parent_with_nullable.dart deleted file mode 100644 index f4ebcfe43f60..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/parent_with_nullable.dart +++ /dev/null @@ -1,69 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// ParentWithNullable - /// - /// Properties: - /// * [type] - /// * [nullableProperty] - -@freezed -class ParentWithNullable with _$ParentWithNullable { -const ParentWithNullable._(); - - - const factory ParentWithNullable.childwithnullable({ - required ChildWithNullable childWithNullable, - }) = ParentWithNullableChildwithnullable; - const factory ParentWithNullable.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([]) List possibleTypes, - @Default([]) List deserializedModels, - }) = ParentWithNullableUnknown; - - - - - factory ParentWithNullable.fromJson(Map json) { - switch(json['type']){ - case 'ChildWithNullable': - return ParentWithNullable.childwithnullable( - childWithNullable : ChildWithNullable.fromJson(json), - ); - } - return ParentWithNullable.unknown(json: json); - } - - - - - Map toJson() { - return when( - childwithnullable: (childWithNullable) => childWithNullable.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } - - - - -} - - - - -@JsonEnum(valueField: 'value') -enum ParentWithNullableTypeEnum { - childWithNullable(value: r'ChildWithNullable'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const ParentWithNullableTypeEnum({required this.value}); - final String value; -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/pet.dart deleted file mode 100644 index bf4bbab02440..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/pet.dart +++ /dev/null @@ -1,75 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Pet - /// - /// Properties: - /// * [id] - /// * [category] - /// * [name] - /// * [photoUrls] - /// * [tags] - /// * [status] - pet status in the store - -@freezed -class Pet with _$Pet { -const Pet._(); - - - const factory Pet({ - @JsonKey(name: r'id') - int? - id, - @JsonKey(name: r'category') - Category? - category, - @JsonKey(name: r'name') - required String - name, - @JsonKey(name: r'photoUrls') - required Set< - String? -> - photoUrls, - @JsonKey(name: r'tags') - List< - Tag? ->? - tags, - /// pet status in the store - @JsonKey(name: r'status') - PetStatusEnum? - status, -}) = _Pet; - - - - - factory Pet.fromJson(Map json) => _$PetFromJson(json); - - - - - - - - -} - - - - /// pet status in the store -@JsonEnum(valueField: 'value') -enum PetStatusEnum { - available(value: r'available'), - pending(value: r'pending'), - sold(value: r'sold'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const PetStatusEnum({required this.value}); - final String value; -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/primitive_union_types.dart deleted file mode 100644 index fafa083471b8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/primitive_union_types.dart +++ /dev/null @@ -1,60 +0,0 @@ -part of 'models.dart'; - -@freezed -class IntInUnion with _$IntInUnion{ - const factory IntInUnion({ - required int intValue - }) = _IntInUnion; - - factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); -} - -@freezed -class StringInUnion with _$StringInUnion{ - const factory StringInUnion({ - required String stringValue - }) = _StringInUnion; - - factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); -} -@freezed -class BoolInUnion with _$BoolInUnion{ - const factory BoolInUnion({ - required bool boolValue - }) = _BoolInUnion; - - factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); -} - -@freezed -class DoubleInUnion with _$DoubleInUnion{ - const factory DoubleInUnion({ - required double doubleValue - }) = _DoubleInUnion; - - factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); -} - -@freezed -class ObjectInUnion with _$ObjectInUnion { - const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; - - factory ObjectInUnion.fromJson(Map json) => - _$ObjectInUnionFromJson(json); -} - -@freezed -class NumInUnion with _$NumInUnion{ - const factory NumInUnion({required num numValue}) = _NumInUnion; - - factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); -} - -@freezed -class DateTimeInUnion with _$DateTimeInUnion { -const factory DateTimeInUnion({required DateTime dateTimeValue}) = -_DateTimeInUnion; - -factory DateTimeInUnion.fromJson(Map json) => -_$DateTimeInUnionFromJson(json); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/read_only_first.dart deleted file mode 100644 index 95486163ea5f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/read_only_first.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// ReadOnlyFirst - /// - /// Properties: - /// * [bar] - /// * [baz] - -@freezed -class ReadOnlyFirst with _$ReadOnlyFirst { -const ReadOnlyFirst._(); - - - const factory ReadOnlyFirst({ - @JsonKey(name: r'bar') - String? - bar, - @JsonKey(name: r'baz') - String? - baz, -}) = _ReadOnlyFirst; - - - - - factory ReadOnlyFirst.fromJson(Map json) => _$ReadOnlyFirstFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/single_ref_type.dart deleted file mode 100644 index 098b49b176e0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/single_ref_type.dart +++ /dev/null @@ -1,16 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - - -@JsonEnum(valueField: 'value') -enum SingleRefType { - admin(value: r'admin'), - user(value: r'user'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const SingleRefType({required this.value}); - final String value; -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/special_model_name.dart deleted file mode 100644 index 6919aa67e9cb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/special_model_name.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// SpecialModelName - /// - /// Properties: - /// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] - -@freezed -class SpecialModelName with _$SpecialModelName { -const SpecialModelName._(); - - - const factory SpecialModelName({ - @JsonKey(name: r'$special[property.name]') - int? - dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, -}) = _SpecialModelName; - - - - - factory SpecialModelName.fromJson(Map json) => _$SpecialModelNameFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/tag.dart deleted file mode 100644 index ecf57fea0818..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/tag.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// Tag - /// - /// Properties: - /// * [id] - /// * [name] - -@freezed -class Tag with _$Tag { -const Tag._(); - - - const factory Tag({ - @JsonKey(name: r'id') - int? - id, - @JsonKey(name: r'name') - String? - name, -}) = _Tag; - - - - - factory Tag.fromJson(Map json) => _$TagFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/test_inline_freeform_additional_properties_request.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/test_inline_freeform_additional_properties_request.dart deleted file mode 100644 index 931a021a8cd9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/test_inline_freeform_additional_properties_request.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// TestInlineFreeformAdditionalPropertiesRequest - /// - /// Properties: - /// * [someProperty] - -@freezed -class TestInlineFreeformAdditionalPropertiesRequest with _$TestInlineFreeformAdditionalPropertiesRequest { -const TestInlineFreeformAdditionalPropertiesRequest._(); - - - const factory TestInlineFreeformAdditionalPropertiesRequest({ - @JsonKey(name: r'someProperty') - String? - someProperty, -}) = _TestInlineFreeformAdditionalPropertiesRequest; - - - - - factory TestInlineFreeformAdditionalPropertiesRequest.fromJson(Map json) => _$TestInlineFreeformAdditionalPropertiesRequestFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/user.dart deleted file mode 100644 index 06bc9e1c887d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/lib/src/model/user.dart +++ /dev/null @@ -1,69 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element, invalid_annotation_target -part of 'models.dart'; - -/// User - /// - /// Properties: - /// * [id] - /// * [username] - /// * [firstName] - /// * [lastName] - /// * [email] - /// * [password] - /// * [phone] - /// * [userStatus] - User Status - -@freezed -class User with _$User { -const User._(); - - - const factory User({ - @JsonKey(name: r'id') - int? - id, - @JsonKey(name: r'username') - String? - username, - @JsonKey(name: r'firstName') - String? - firstName, - @JsonKey(name: r'lastName') - String? - lastName, - @JsonKey(name: r'email') - String? - email, - @JsonKey(name: r'password') - String? - password, - @JsonKey(name: r'phone') - String? - phone, - /// User Status - @JsonKey(name: r'userStatus') - int? - userStatus, -}) = _User; - - - - - factory User.fromJson(Map json) => _$UserFromJson(json); - - - - - - - - -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/pubspec.yaml deleted file mode 100644 index 12925113115d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/pubspec.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '^3.0.0' - -dependencies: - dio: '^5.2.0' - freezed_annotation: '^2.4.4' - json_annotation: '^4.9.0' - -dev_dependencies: - freezed: '^2.5.2' - json_serializable: '^6.8.0' - build_runner: any - test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/additional_properties_class_test.dart deleted file mode 100644 index fd8299fb998f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/additional_properties_class_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AdditionalPropertiesClass -void main() { - final AdditionalPropertiesClass? instance = /* AdditionalPropertiesClass(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/all_of_with_single_ref_test.dart deleted file mode 100644 index ad5da909f6e3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/all_of_with_single_ref_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AllOfWithSingleRef -void main() { - final AllOfWithSingleRef? instance = /* AllOfWithSingleRef(...) */ null; - // TODO add properties to the entity - - group(AllOfWithSingleRef, () { - // String username - test('to test the property `username`', () async { - // TODO - }); - - // SingleRefType singleRefType - test('to test the property `singleRefType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/animal_test.dart deleted file mode 100644 index 83c65b22bfc3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/animal_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Animal -void main() { - final Animal? instance = /* Animal(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/another_fake_api_test.dart deleted file mode 100644 index ddafef2a831b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/another_fake_api_test.dart +++ /dev/null @@ -1,20 +0,0 @@ -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/petstore_client_lib_fake-freezed/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/api_response_test.dart deleted file mode 100644 index 9487afd7f58c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/api_response_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ApiResponse -void main() { - final ApiResponse? instance = /* ApiResponse(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_array_of_number_only_test.dart deleted file mode 100644 index 79c0d3f3bba8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_array_of_number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayOfArrayOfNumberOnly -void main() { - final ArrayOfArrayOfNumberOnly? instance = /* ArrayOfArrayOfNumberOnly(...) */ null; - // TODO add properties to the entity - - group(ArrayOfArrayOfNumberOnly, () { - // List> arrayArrayNumber - test('to test the property `arrayArrayNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_number_only_test.dart deleted file mode 100644 index d80be97cf147..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_of_number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayOfNumberOnly -void main() { - final ArrayOfNumberOnly? instance = /* ArrayOfNumberOnly(...) */ null; - // TODO add properties to the entity - - group(ArrayOfNumberOnly, () { - // List arrayNumber - test('to test the property `arrayNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_test_test.dart deleted file mode 100644 index bfe7c84fd122..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/array_test_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayTest -void main() { - final ArrayTest? instance = /* ArrayTest(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/capitalization_test.dart deleted file mode 100644 index 156b0ee4993c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/capitalization_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Capitalization -void main() { - final Capitalization? instance = /* Capitalization(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/cat_test.dart deleted file mode 100644 index 0a8811bd37f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/cat_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Cat -void main() { - final Cat? instance = /* Cat(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/category_test.dart deleted file mode 100644 index 0ed6921ae7fc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/category_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Category -void main() { - final Category? instance = /* Category(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/child_with_nullable_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/child_with_nullable_test.dart deleted file mode 100644 index ce2afd9a8a6e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/child_with_nullable_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ChildWithNullable -void main() { - final ChildWithNullable? instance = /* ChildWithNullable(...) */ null; - // TODO add properties to the entity - - group(ChildWithNullable, () { - // String type - test('to test the property `type`', () async { - // TODO - }); - - // String nullableProperty - test('to test the property `nullableProperty`', () async { - // TODO - }); - - // String otherProperty - test('to test the property `otherProperty`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/class_model_test.dart deleted file mode 100644 index e2dda7bab74e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/class_model_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ClassModel -void main() { - final ClassModel? instance = /* ClassModel(...) */ null; - // TODO add properties to the entity - - group(ClassModel, () { - // String class_ - test('to test the property `class_`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/default_api_test.dart deleted file mode 100644 index f079565f9785..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/default_api_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -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/petstore_client_lib_fake-freezed/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/deprecated_object_test.dart deleted file mode 100644 index 1b2214668577..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/deprecated_object_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DeprecatedObject -void main() { - final DeprecatedObject? instance = /* DeprecatedObject(...) */ null; - // TODO add properties to the entity - - group(DeprecatedObject, () { - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/dog_test.dart deleted file mode 100644 index 98097bd4bf25..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/dog_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Dog -void main() { - final Dog? instance = /* Dog(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/enum_arrays_test.dart deleted file mode 100644 index 30d12204ba17..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/enum_arrays_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for EnumArrays -void main() { - final EnumArrays? instance = /* EnumArrays(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/enum_test_test.dart deleted file mode 100644 index befb9901ce9d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/enum_test_test.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for EnumTest -void main() { - final EnumTest? instance = /* EnumTest(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_api_test.dart deleted file mode 100644 index 67950bf50ce9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_api_test.dart +++ /dev/null @@ -1,183 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for FakeApi -void main() { - final instance = Openapi().getFakeApi(); - - group(FakeApi, () { - // for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys - // - //Future fakeBigDecimalMap() async - test('test fakeBigDecimalMap', () async { - // TODO - }); - - // 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 - }); - - // test referenced additionalProperties - // - // - // - //Future testAdditionalPropertiesReference(Map requestBody) async - test('test testAdditionalPropertiesReference', () 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 inline free-form additionalProperties - // - // - // - //Future testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) async - test('test testInlineFreeformAdditionalProperties', () async { - // TODO - }); - - // test json serialization of form data - // - // - // - //Future testJsonFormData(String param, String param2) async - test('test testJsonFormData', () async { - // TODO - }); - - // test nullable parent property - // - // - // - //Future testNullable(ChildWithNullable childWithNullable) async - test('test testNullable', () 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 - }); - - // test referenced string map - // - // - // - //Future testStringMapReference(Map requestBody) async - test('test testStringMapReference', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_big_decimal_map200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_big_decimal_map200_response_test.dart deleted file mode 100644 index 1279b8d0ff25..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_big_decimal_map200_response_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FakeBigDecimalMap200Response -void main() { - final FakeBigDecimalMap200Response? instance = /* FakeBigDecimalMap200Response(...) */ null; - // TODO add properties to the entity - - group(FakeBigDecimalMap200Response, () { - // num someId - test('to test the property `someId`', () async { - // TODO - }); - - // Map someMap - test('to test the property `someMap`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_classname_tags123_api_test.dart deleted file mode 100644 index 3075147f52fd..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/fake_classname_tags123_api_test.dart +++ /dev/null @@ -1,20 +0,0 @@ -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/petstore_client_lib_fake-freezed/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/file_schema_test_class_test.dart deleted file mode 100644 index 2ccd0d450ce7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/file_schema_test_class_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FileSchemaTestClass -void main() { - final FileSchemaTestClass? instance = /* FileSchemaTestClass(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/foo_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_get_default_response_test.dart deleted file mode 100644 index 4282326fe61f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_get_default_response_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FooGetDefaultResponse -void main() { - final FooGetDefaultResponse? instance = /* FooGetDefaultResponse(...) */ null; - // TODO add properties to the entity - - group(FooGetDefaultResponse, () { - // Foo string - test('to test the property `string`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_test.dart deleted file mode 100644 index 28ae9a5b5e13..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/foo_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Foo -void main() { - final Foo? instance = /* Foo(...) */ null; - // TODO add properties to the entity - - group(Foo, () { - // String bar (default value: 'bar') - test('to test the property `bar`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/format_test_test.dart deleted file mode 100644 index b08838d81a37..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/format_test_test.dart +++ /dev/null @@ -1,93 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FormatTest -void main() { - final FormatTest? instance = /* FormatTest(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/has_only_read_only_test.dart deleted file mode 100644 index d72429a31bb5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/has_only_read_only_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for HasOnlyReadOnly -void main() { - final HasOnlyReadOnly? instance = /* HasOnlyReadOnly(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/health_check_result_test.dart deleted file mode 100644 index b2b48337b76c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/health_check_result_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for HealthCheckResult -void main() { - final HealthCheckResult? instance = /* HealthCheckResult(...) */ null; - // TODO add properties to the entity - - group(HealthCheckResult, () { - // String nullableMessage - test('to test the property `nullableMessage`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/map_test_test.dart deleted file mode 100644 index 909415df7540..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/map_test_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for MapTest -void main() { - final MapTest? instance = /* MapTest(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/mixed_properties_and_additional_properties_class_test.dart deleted file mode 100644 index 0115f01ed6be..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/mixed_properties_and_additional_properties_class_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for MixedPropertiesAndAdditionalPropertiesClass -void main() { - final MixedPropertiesAndAdditionalPropertiesClass? instance = /* MixedPropertiesAndAdditionalPropertiesClass(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model200_response_test.dart deleted file mode 100644 index de8cf3037b6b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model200_response_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Model200Response -void main() { - final Model200Response? instance = /* Model200Response(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_client_test.dart deleted file mode 100644 index 44faf62f15b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_client_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelClient -void main() { - final ModelClient? instance = /* ModelClient(...) */ null; - // TODO add properties to the entity - - group(ModelClient, () { - // String client - test('to test the property `client`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_enum_class_test.dart deleted file mode 100644 index 03e5855bf004..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_enum_class_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -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/petstore_client_lib_fake-freezed/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_file_test.dart deleted file mode 100644 index 8ea65f6ccb41..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_file_test.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelFile -void main() { - final ModelFile? instance = /* ModelFile(...) */ null; - // TODO add properties to the entity - - group(ModelFile, () { - // Test capitalization - // String sourceURI - test('to test the property `sourceURI`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_list_test.dart deleted file mode 100644 index f748eee993ac..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_list_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelList -void main() { - final ModelList? instance = /* ModelList(...) */ null; - // TODO add properties to the entity - - group(ModelList, () { - // String n123list - test('to test the property `n123list`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_return_test.dart deleted file mode 100644 index cfc17807c151..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/model_return_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelReturn -void main() { - final ModelReturn? instance = /* ModelReturn(...) */ null; - // TODO add properties to the entity - - group(ModelReturn, () { - // int return_ - test('to test the property `return_`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/name_test.dart deleted file mode 100644 index 4f3f7f633728..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/name_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Name -void main() { - final Name? instance = /* Name(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/nullable_class_test.dart deleted file mode 100644 index 0ab76167983b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/nullable_class_test.dart +++ /dev/null @@ -1,71 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for NullableClass -void main() { - final NullableClass? instance = /* NullableClass(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/number_only_test.dart deleted file mode 100644 index 12b19c59dfb7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for NumberOnly -void main() { - final NumberOnly? instance = /* NumberOnly(...) */ null; - // TODO add properties to the entity - - group(NumberOnly, () { - // num justNumber - test('to test the property `justNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/object_with_deprecated_fields_test.dart deleted file mode 100644 index e197bd0ad807..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/object_with_deprecated_fields_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ObjectWithDeprecatedFields -void main() { - final ObjectWithDeprecatedFields? instance = /* ObjectWithDeprecatedFields(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/order_test.dart deleted file mode 100644 index 45b02097daed..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/order_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Order -void main() { - final Order? instance = /* Order(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_composite_test.dart deleted file mode 100644 index a5f0172ba21c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_composite_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterComposite -void main() { - final OuterComposite? instance = /* OuterComposite(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_default_value_test.dart deleted file mode 100644 index 502c8326be58..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_default_value_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -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/petstore_client_lib_fake-freezed/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_integer_default_value_test.dart deleted file mode 100644 index c535fe8ac354..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_integer_default_value_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -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/petstore_client_lib_fake-freezed/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_integer_test.dart deleted file mode 100644 index d945bc8c489d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_integer_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -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/petstore_client_lib_fake-freezed/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_test.dart deleted file mode 100644 index 8e11eb02fb8a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_enum_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -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/petstore_client_lib_fake-freezed/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_object_with_enum_property_test.dart deleted file mode 100644 index 3d72c6188e17..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/outer_object_with_enum_property_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterObjectWithEnumProperty -void main() { - final OuterObjectWithEnumProperty? instance = /* OuterObjectWithEnumProperty(...) */ null; - // TODO add properties to the entity - - group(OuterObjectWithEnumProperty, () { - // OuterEnumInteger value - test('to test the property `value`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/parent_with_nullable_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/parent_with_nullable_test.dart deleted file mode 100644 index b501d4220624..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/parent_with_nullable_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ParentWithNullable -void main() { - final ParentWithNullable? instance = /* ParentWithNullable(...) */ null; - // TODO add properties to the entity - - group(ParentWithNullable, () { - // String type - test('to test the property `type`', () async { - // TODO - }); - - // String nullableProperty - test('to test the property `nullableProperty`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_api_test.dart deleted file mode 100644 index 85a28bcfbe53..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_api_test.dart +++ /dev/null @@ -1,92 +0,0 @@ -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/petstore_client_lib_fake-freezed/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_test.dart deleted file mode 100644 index 20b5e3e06735..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/pet_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Pet -void main() { - final Pet? instance = /* Pet(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/read_only_first_test.dart deleted file mode 100644 index bcefd75befb6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/read_only_first_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ReadOnlyFirst -void main() { - final ReadOnlyFirst? instance = /* ReadOnlyFirst(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/single_ref_type_test.dart deleted file mode 100644 index 5cd85add393e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/single_ref_type_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for SingleRefType -void main() { - - group(SingleRefType, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/special_model_name_test.dart deleted file mode 100644 index 23b58324ef99..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/special_model_name_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for SpecialModelName -void main() { - final SpecialModelName? instance = /* SpecialModelName(...) */ null; - // TODO add properties to the entity - - group(SpecialModelName, () { - // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket - test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/store_api_test.dart deleted file mode 100644 index 08f7f738043b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/store_api_test.dart +++ /dev/null @@ -1,47 +0,0 @@ -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 generate 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/petstore_client_lib_fake-freezed/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/tag_test.dart deleted file mode 100644 index ffe49b3179c3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/tag_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Tag -void main() { - final Tag? instance = /* Tag(...) */ null; - // TODO add properties to the entity - - 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/petstore_client_lib_fake-freezed/test/test_inline_freeform_additional_properties_request_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/test_inline_freeform_additional_properties_request_test.dart deleted file mode 100644 index 8c60d3f11f36..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/test_inline_freeform_additional_properties_request_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for TestInlineFreeformAdditionalPropertiesRequest -void main() { - final TestInlineFreeformAdditionalPropertiesRequest? instance = /* TestInlineFreeformAdditionalPropertiesRequest(...) */ null; - // TODO add properties to the entity - - group(TestInlineFreeformAdditionalPropertiesRequest, () { - // String someProperty - test('to test the property `someProperty`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_api_test.dart deleted file mode 100644 index 4bf28b67623b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_api_test.dart +++ /dev/null @@ -1,83 +0,0 @@ -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/petstore_client_lib_fake-freezed/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_test.dart deleted file mode 100644 index 847b14196b93..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-freezed/test/user_test.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for User -void main() { - final User? instance = /* User(...) */ null; - // TODO add properties to the entity - - 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 - }); - - }); -} From 60149151f6761ca7ecc5f76b034f0e097685a667 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 7 Sep 2024 08:39:58 +0200 Subject: [PATCH 42/48] chore: regenerate samples --- .../dart-dio/freezed/oneof/.gitignore | 41 + .../freezed/oneof/.openapi-generator-ignore | 23 + .../freezed/oneof/.openapi-generator/FILES | 27 + .../freezed/oneof/.openapi-generator/VERSION | 1 + .../petstore/dart-dio/freezed/oneof/README.md | 85 + .../freezed/oneof/analysis_options.yaml | 11 + .../dart-dio/freezed/oneof/build.yaml | 11 + .../dart-dio/freezed/oneof/doc/Apple.md | 15 + .../dart-dio/freezed/oneof/doc/Banana.md | 15 + .../dart-dio/freezed/oneof/doc/DefaultApi.md | 51 + .../dart-dio/freezed/oneof/doc/Fruit.md | 17 + .../dart-dio/freezed/oneof/lib/openapi.dart | 15 + .../dart-dio/freezed/oneof/lib/src/api.dart | 68 + .../oneof/lib/src/api/default_api.dart | 89 + .../oneof/lib/src/auth/api_key_auth.dart | 30 + .../freezed/oneof/lib/src/auth/auth.dart | 18 + .../oneof/lib/src/auth/basic_auth.dart | 37 + .../oneof/lib/src/auth/bearer_auth.dart | 26 + .../freezed/oneof/lib/src/auth/oauth.dart | 26 + .../freezed/oneof/lib/src/model/apple.dart | 40 + .../freezed/oneof/lib/src/model/banana.dart | 40 + .../freezed/oneof/lib/src/model/fruit.dart | 106 + .../freezed/oneof/lib/src/model/models.dart | 20 + .../lib/src/model/primitive_union_types.dart | 60 + .../dart-dio/freezed/oneof/pubspec.yaml | 18 + .../freezed/oneof/test/apple_test.dart | 16 + .../freezed/oneof/test/banana_test.dart | 16 + .../freezed/oneof/test/default_api_test.dart | 16 + .../freezed/oneof/test/fruit_test.dart | 26 + .../.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 75 + .../.openapi-generator/VERSION | 1 + .../README.md | 104 + .../analysis_options.yaml | 11 + .../build.yaml | 11 + .../doc/Addressable.md | 16 + .../doc/Apple.md | 15 + .../doc/Banana.md | 15 + .../doc/Bar.md | 22 + .../doc/BarApi.md | 55 + .../doc/BarCreate.md | 22 + .../doc/BarRef.md | 21 + .../doc/BarRefOrValue.md | 24 + .../doc/Entity.md | 19 + .../doc/EntityRef.md | 21 + .../doc/Extensible.md | 17 + .../doc/Foo.md | 21 + .../doc/FooApi.md | 93 + .../doc/FooRef.md | 22 + .../doc/FooRefOrValue.md | 24 + .../doc/Fruit.md | 17 + .../doc/FruitType.md | 14 + .../doc/Pasta.md | 20 + .../doc/Pizza.md | 20 + .../doc/PizzaSpeziale.md | 21 + .../lib/openapi.dart | 16 + .../lib/src/api.dart | 75 + .../lib/src/api/bar_api.dart | 110 + .../lib/src/api/foo_api.dart | 182 ++ .../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/model/addressable.dart | 46 + .../lib/src/model/apple.dart | 40 + .../lib/src/model/banana.dart | 40 + .../lib/src/model/bar.dart | 72 + .../lib/src/model/bar_create.dart | 73 + .../lib/src/model/bar_ref.dart | 71 + .../lib/src/model/bar_ref_or_value.dart | 113 ++ .../lib/src/model/entity.dart | 104 + .../lib/src/model/entity_ref.dart | 74 + .../lib/src/model/extensible.dart | 51 + .../lib/src/model/foo.dart | 69 + .../lib/src/model/foo_ref.dart | 75 + .../lib/src/model/foo_ref_or_value.dart | 88 + .../lib/src/model/fruit.dart | 70 + .../lib/src/model/fruit_type.dart | 16 + .../lib/src/model/models.dart | 20 + .../lib/src/model/pasta.dart | 65 + .../lib/src/model/pizza.dart | 65 + .../lib/src/model/pizza_speziale.dart | 69 + .../lib/src/model/primitive_union_types.dart | 60 + .../pubspec.yaml | 18 + .../test/addressable_test.dart | 23 + .../test/apple_test.dart | 16 + .../test/banana_test.dart | 16 + .../test/bar_api_test.dart | 18 + .../test/bar_create_test.dart | 56 + .../test/bar_ref_or_value_test.dart | 68 + .../test/bar_ref_test.dart | 53 + .../test/bar_test.dart | 55 + .../test/entity_ref_test.dart | 53 + .../test/entity_test.dart | 41 + .../test/extensible_test.dart | 29 + .../test/foo_api_test.dart | 25 + .../test/foo_ref_or_value_test.dart | 68 + .../test/foo_ref_test.dart | 58 + .../test/foo_test.dart | 51 + .../test/fruit_test.dart | 26 + .../test/fruit_type_test.dart | 9 + .../test/pasta_test.dart | 46 + .../test/pizza_speziale_test.dart | 51 + .../test/pizza_test.dart | 46 + .../freezed/oneof_primitive/.gitignore | 41 + .../oneof_primitive/.openapi-generator-ignore | 23 + .../oneof_primitive/.openapi-generator/FILES | 24 + .../.openapi-generator/VERSION | 1 + .../freezed/oneof_primitive/README.md | 84 + .../oneof_primitive/analysis_options.yaml | 11 + .../freezed/oneof_primitive/build.yaml | 11 + .../freezed/oneof_primitive/doc/Child.md | 15 + .../freezed/oneof_primitive/doc/DefaultApi.md | 51 + .../freezed/oneof_primitive/doc/Example.md | 15 + .../freezed/oneof_primitive/lib/openapi.dart | 15 + .../freezed/oneof_primitive/lib/src/api.dart | 68 + .../lib/src/api/default_api.dart | 89 + .../lib/src/auth/api_key_auth.dart | 30 + .../oneof_primitive/lib/src/auth/auth.dart | 18 + .../lib/src/auth/basic_auth.dart | 37 + .../lib/src/auth/bearer_auth.dart | 26 + .../oneof_primitive/lib/src/auth/oauth.dart | 26 + .../oneof_primitive/lib/src/model/child.dart | 40 + .../lib/src/model/example.dart | 104 + .../oneof_primitive/lib/src/model/models.dart | 20 + .../lib/src/model/primitive_union_types.dart | 60 + .../freezed/oneof_primitive/pubspec.yaml | 18 + .../oneof_primitive/test/child_test.dart | 16 + .../test/default_api_test.dart | 16 + .../oneof_primitive/test/example_test.dart | 16 + .../petstore_client_lib_fake/.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 186 ++ .../.openapi-generator/VERSION | 1 + .../petstore_client_lib_fake/README.md | 211 ++ .../analysis_options.yaml | 11 + .../petstore_client_lib_fake/build.yaml | 11 + .../doc/AdditionalPropertiesClass.md | 16 + .../doc/AllOfWithSingleRef.md | 16 + .../petstore_client_lib_fake/doc/Animal.md | 16 + .../doc/AnotherFakeApi.md | 57 + .../doc/ApiResponse.md | 17 + .../doc/ArrayOfArrayOfNumberOnly.md | 15 + .../doc/ArrayOfNumberOnly.md | 15 + .../petstore_client_lib_fake/doc/ArrayTest.md | 17 + .../doc/Capitalization.md | 20 + .../petstore_client_lib_fake/doc/Cat.md | 17 + .../petstore_client_lib_fake/doc/Category.md | 16 + .../doc/ChildWithNullable.md | 17 + .../doc/ClassModel.md | 15 + .../doc/DefaultApi.md | 51 + .../doc/DeprecatedObject.md | 15 + .../petstore_client_lib_fake/doc/Dog.md | 17 + .../doc/EnumArrays.md | 16 + .../petstore_client_lib_fake/doc/EnumTest.md | 22 + .../petstore_client_lib_fake/doc/FakeApi.md | 1028 ++++++++++ .../doc/FakeBigDecimalMap200Response.md | 16 + .../doc/FakeClassnameTags123Api.md | 61 + .../doc/FileSchemaTestClass.md | 16 + .../petstore_client_lib_fake/doc/Foo.md | 15 + .../doc/FooGetDefaultResponse.md | 15 + .../doc/FormatTest.md | 30 + .../doc/HasOnlyReadOnly.md | 16 + .../doc/HealthCheckResult.md | 15 + .../petstore_client_lib_fake/doc/MapTest.md | 18 + ...dPropertiesAndAdditionalPropertiesClass.md | 17 + .../doc/Model200Response.md | 16 + .../doc/ModelClient.md | 15 + .../doc/ModelEnumClass.md | 14 + .../petstore_client_lib_fake/doc/ModelFile.md | 15 + .../petstore_client_lib_fake/doc/ModelList.md | 15 + .../doc/ModelReturn.md | 15 + .../petstore_client_lib_fake/doc/Name.md | 18 + .../doc/NullableClass.md | 26 + .../doc/NumberOnly.md | 15 + .../doc/ObjectWithDeprecatedFields.md | 18 + .../petstore_client_lib_fake/doc/Order.md | 20 + .../doc/OuterComposite.md | 17 + .../petstore_client_lib_fake/doc/OuterEnum.md | 14 + .../doc/OuterEnumDefaultValue.md | 14 + .../doc/OuterEnumInteger.md | 14 + .../doc/OuterEnumIntegerDefaultValue.md | 14 + .../doc/OuterObjectWithEnumProperty.md | 15 + .../doc/ParentWithNullable.md | 16 + .../petstore_client_lib_fake/doc/Pet.md | 20 + .../petstore_client_lib_fake/doc/PetApi.md | 439 ++++ .../doc/ReadOnlyFirst.md | 16 + .../doc/SingleRefType.md | 14 + .../doc/SpecialModelName.md | 15 + .../petstore_client_lib_fake/doc/StoreApi.md | 188 ++ .../petstore_client_lib_fake/doc/Tag.md | 16 + ...lineFreeformAdditionalPropertiesRequest.md | 15 + .../petstore_client_lib_fake/doc/User.md | 22 + .../petstore_client_lib_fake/doc/UserApi.md | 359 ++++ .../petstore_client_lib_fake/lib/openapi.dart | 21 + .../petstore_client_lib_fake/lib/src/api.dart | 110 + .../lib/src/api/another_fake_api.dart | 110 + .../lib/src/api/default_api.dart | 89 + .../lib/src/api/fake_api.dart | 1769 +++++++++++++++++ .../src/api/fake_classname_tags123_api.dart | 117 ++ .../lib/src/api/pet_api.dart | 765 +++++++ .../lib/src/api/store_api.dart | 309 +++ .../lib/src/api/user_api.dart | 536 +++++ .../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 + .../model/additional_properties_class.dart | 50 + .../lib/src/model/all_of_with_single_ref.dart | 44 + .../lib/src/model/animal.dart | 69 + .../lib/src/model/api_response.dart | 48 + .../model/array_of_array_of_number_only.dart | 44 + .../lib/src/model/array_of_number_only.dart | 42 + .../lib/src/model/array_test.dart | 58 + .../lib/src/model/capitalization.dart | 61 + .../lib/src/model/cat.dart | 48 + .../lib/src/model/category.dart | 44 + .../lib/src/model/child_with_nullable.dart | 56 + .../lib/src/model/class_model.dart | 40 + .../lib/src/model/deprecated_object.dart | 40 + .../lib/src/model/dog.dart | 48 + .../lib/src/model/enum_arrays.dart | 65 + .../lib/src/model/enum_test.dart | 106 + .../fake_big_decimal_map200_response.dart | 46 + .../lib/src/model/file_schema_test_class.dart | 46 + .../lib/src/model/foo.dart | 40 + .../src/model/foo_get_default_response.dart | 40 + .../lib/src/model/format_test.dart | 102 + .../lib/src/model/has_only_read_only.dart | 44 + .../lib/src/model/health_check_result.dart | 40 + .../lib/src/model/map_test.dart | 72 + ...rties_and_additional_properties_class.dart | 50 + .../lib/src/model/model200_response.dart | 44 + .../lib/src/model/model_client.dart | 40 + .../lib/src/model/model_enum_class.dart | 17 + .../lib/src/model/model_file.dart | 41 + .../lib/src/model/model_list.dart | 40 + .../lib/src/model/model_return.dart | 40 + .../lib/src/model/models.dart | 20 + .../lib/src/model/name.dart | 52 + .../lib/src/model/nullable_class.dart | 96 + .../lib/src/model/number_only.dart | 40 + .../model/object_with_deprecated_fields.dart | 54 + .../lib/src/model/order.dart | 71 + .../lib/src/model/outer_composite.dart | 48 + .../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 | 40 + .../lib/src/model/parent_with_nullable.dart | 69 + .../lib/src/model/pet.dart | 75 + .../lib/src/model/primitive_union_types.dart | 60 + .../lib/src/model/read_only_first.dart | 44 + .../lib/src/model/single_ref_type.dart | 16 + .../lib/src/model/special_model_name.dart | 40 + .../lib/src/model/tag.dart | 44 + ...reeform_additional_properties_request.dart | 40 + .../lib/src/model/user.dart | 69 + .../petstore_client_lib_fake/pubspec.yaml | 18 + .../additional_properties_class_test.dart | 21 + .../test/all_of_with_single_ref_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_test.dart | 26 + .../test/category_test.dart | 21 + .../test/child_with_nullable_test.dart | 26 + .../test/class_model_test.dart | 16 + .../test/default_api_test.dart | 16 + .../test/deprecated_object_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 | 183 ++ ...fake_big_decimal_map200_response_test.dart | 21 + .../test/fake_classname_tags123_api_test.dart | 20 + .../test/file_schema_test_class_test.dart | 21 + .../test/foo_get_default_response_test.dart | 16 + .../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/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/parent_with_nullable_test.dart | 21 + .../test/pet_api_test.dart | 92 + .../test/pet_test.dart | 42 + .../test/read_only_first_test.dart | 21 + .../test/single_ref_type_test.dart | 9 + .../test/special_model_name_test.dart | 16 + .../test/store_api_test.dart | 47 + .../test/tag_test.dart | 21 + ...rm_additional_properties_request_test.dart | 16 + .../test/user_api_test.dart | 83 + .../test/user_test.dart | 52 + 320 files changed, 16900 insertions(+) create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/build.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Apple.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Banana.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Fruit.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/apple.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/banana.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/fruit.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/models.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/primitive_union_types.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/apple_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/banana_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/fruit_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/build.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Addressable.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Apple.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Banana.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Bar.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarCreate.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Entity.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/EntityRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Extensible.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Foo.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FooApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FooRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Fruit.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FruitType.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Pasta.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Pizza.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/apple.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/banana.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit_type.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/models.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/primitive_union_types.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/addressable_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/apple_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/banana_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_create_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/entity_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/extensible_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/fruit_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/fruit_type_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pasta_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pizza_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/build.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/doc/Child.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/doc/Example.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/child.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/example.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/models.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/primitive_union_types.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/test/child_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/test/example_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/build.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/AllOfWithSingleRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Animal.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Capitalization.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Cat.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Category.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ChildWithNullable.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ClassModel.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/DeprecatedObject.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Dog.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/EnumTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FakeBigDecimalMap200Response.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Foo.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FooGetDefaultResponse.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FormatTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/MapTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Model200Response.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ModelClient.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ModelEnumClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ModelFile.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ModelList.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Name.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/NullableClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Order.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ParentWithNullable.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Pet.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/PetApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/SingleRefType.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/StoreApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Tag.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/TestInlineFreeformAdditionalPropertiesRequest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/User.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/UserApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/another_fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/pet_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/store_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/user_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/animal.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/api_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/capitalization.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/cat.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/category.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/child_with_nullable.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/class_model.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/deprecated_object.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/dog.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_arrays.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/format_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/health_check_result.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/map_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model200_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_client.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_enum_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_file.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_list.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_return.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/models.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/nullable_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/order.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_composite.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/parent_with_nullable.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/pet.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/primitive_union_types.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/read_only_first.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/single_ref_type.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/special_model_name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/tag.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/test_inline_freeform_additional_properties_request.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/user.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/animal_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/another_fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/api_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/array_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/capitalization_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/cat_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/category_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/child_with_nullable_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/class_model_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/deprecated_object_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/dog_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/enum_arrays_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/enum_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/fake_big_decimal_map200_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/file_schema_test_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/foo_get_default_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/foo_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/format_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/has_only_read_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/health_check_result_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/map_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model200_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_client_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_enum_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_file_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_list_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_return_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/nullable_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/order_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_composite_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_enum_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_enum_integer_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/parent_with_nullable_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/pet_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/pet_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/read_only_first_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/single_ref_type_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/special_model_name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/store_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/tag_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/test_inline_freeform_additional_properties_request_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/user_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.gitignore b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.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/freezed/oneof/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.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/freezed/oneof/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/FILES new file mode 100644 index 000000000000..38595461c322 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/FILES @@ -0,0 +1,27 @@ +.gitignore +.openapi-generator-ignore +README.md +analysis_options.yaml +build.yaml +doc/Apple.md +doc/Banana.md +doc/DefaultApi.md +doc/Fruit.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/default_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/model/apple.dart +lib/src/model/banana.dart +lib/src/model/fruit.dart +lib/src/model/models.dart +lib/src/model/primitive_union_types.dart +pubspec.yaml +test/apple_test.dart +test/banana_test.dart +test/default_api_test.dart +test/fruit_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/VERSION new file mode 100644 index 000000000000..17f2442ff3bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/README.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/README.md new file mode 100644 index 000000000000..e382c9ec6ea0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/README.md @@ -0,0 +1,85 @@ +# openapi (EXPERIMENTAL) +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.0.1 +- Generator version: 7.9.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## 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().getDefaultApi(); + +try { + final response = await api.rootGet(); + print(response); +} catch on DioException (e) { + print("Exception when calling DefaultApi->rootGet: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*DefaultApi*](doc/DefaultApi.md) | [**rootGet**](doc/DefaultApi.md#rootget) | **GET** / | + + +## Documentation For Models + + - [Apple](doc/Apple.md) + - [Banana](doc/Banana.md) + - [Fruit](doc/Fruit.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/analysis_options.yaml new file mode 100644 index 000000000000..8ff047ce7675 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strict-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart + - lib/src/model/*.freezed.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/build.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/build.yaml new file mode 100644 index 000000000000..dee5edd67f90 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/build.yaml @@ -0,0 +1,11 @@ +targets: + $default: + builders: + freezed|freezed: + # This restricts freezed build runner to look + # files only inside models folder. + # If you prefer the build runner to scan the whole + # project for files then simply remove this build.yaml file + generate_for: + include: + - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Apple.md new file mode 100644 index 000000000000..c7f711b87cef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Apple.md @@ -0,0 +1,15 @@ +# openapi.model.Apple + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **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/freezed/oneof/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Banana.md new file mode 100644 index 000000000000..bef8a58a4276 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Banana.md @@ -0,0 +1,15 @@ +# openapi.model.Banana + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **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/freezed/oneof/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/DefaultApi.md new file mode 100644 index 000000000000..b010661371f9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/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://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**rootGet**](DefaultApi.md#rootget) | **GET** / | + + +# **rootGet** +> Fruit rootGet() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.rootGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->rootGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Fruit**](Fruit.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/freezed/oneof/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Fruit.md new file mode 100644 index 000000000000..5d48cc6e6d38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Fruit.md @@ -0,0 +1,17 @@ +# openapi.model.Fruit + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**kind** | **String** | | [optional] +**count** | **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/freezed/oneof/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/openapi.dart new file mode 100644 index 000000000000..581830866afb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/openapi.dart @@ -0,0 +1,15 @@ +// +// 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/bearer_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; + + +export 'package:openapi/src/api/default_api.dart'; + + +export 'package:openapi/src/model/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/api.dart new file mode 100644 index 000000000000..8943da413f65 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/api.dart @@ -0,0 +1,68 @@ +// +// 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/default_api.dart'; + +class Openapi { + static const String basePath = r'http://localhost'; + + final Dio dio; + Openapi({ + Dio? dio, + String? basePathOverride, + List? interceptors, + }) : + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 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 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); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/api/default_api.dart new file mode 100644 index 000000000000..f2a138a7077e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/api/default_api.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.dart'; + + +class DefaultApi { + + final Dio _dio; + + const DefaultApi(this._dio); + + /// rootGet + /// + /// + /// 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 [Fruit] as data + /// Throws [DioException] if API call or serialization fails + Future> rootGet({ + + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/'; + 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, + ); + + Fruit _responseData; + + + try { + _responseData = Fruit.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/freezed/oneof/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/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/freezed/oneof/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/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/freezed/oneof/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b65ccb5b71f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/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']?.toLowerCase() == '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/freezed/oneof/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..8f46678761b2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/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']?.toLowerCase() == '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/freezed/oneof/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/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/freezed/oneof/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/apple.dart new file mode 100644 index 000000000000..24e1d263d4c6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/apple.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Apple + /// + /// Properties: + /// * [kind] + +@freezed +class Apple with _$Apple { +const Apple._(); + + + const factory Apple({ + @JsonKey(name: r'kind') + String? + kind, +}) = _Apple; + + + + + factory Apple.fromJson(Map json) => _$AppleFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/banana.dart new file mode 100644 index 000000000000..3d3bf3238989 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/banana.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Banana + /// + /// Properties: + /// * [count] + +@freezed +class Banana with _$Banana { +const Banana._(); + + + const factory Banana({ + @JsonKey(name: r'count') + num? + count, +}) = _Banana; + + + + + factory Banana.fromJson(Map json) => _$BananaFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/fruit.dart new file mode 100644 index 000000000000..5e4dfbf65182 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/fruit.dart @@ -0,0 +1,106 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Fruit + /// + /// Properties: + /// * [color] + /// * [kind] + /// * [count] + +@freezed +class Fruit with _$Fruit { +const Fruit._(); + + + + + const factory Fruit.asApple({ + required Apple appleValue + }) = FruitAsApple; + const factory Fruit.asBanana({ + required Banana bananaValue + }) = FruitAsBanana; + const factory Fruit.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([Apple,Banana,]) List possibleTypes, + @Default([]) List deserializedModels, + }) = FruitUnknown; + + + + + factory Fruit.fromJson(Map json) { + Fruit? deserializedModel; + // A discriminator property is not defined in the spec so + // we try to parse the json against all the models and try to + // return one of the valid model. Note: this approach tries + // to return one valid model and if more than one model + // is valid it then returns unknown type along with the json so + // the consumer can decide which model it is. + final fromJsonMethods = >[Apple.fromJson,Banana.fromJson,]; + final deserializedModels = []; + for (final fromJsonMethod in fromJsonMethods) { + try { + final dynamic parsedModel= fromJsonMethod.call(json); + // Note following line won't be executed if already the above parsing fails. + if (parsedModel is Apple) { + deserializedModel = Fruit.asApple( + appleValue : parsedModel, + ); + } else + if (parsedModel is Banana) { + deserializedModel = Fruit.asBanana( + bananaValue : parsedModel, + ); + } else + { + deserializedModel = Fruit.unknown(json: json); + } + deserializedModels.add(deserializedModel); + } catch (e) { + // We are suppressing the deserialization error when the json could not + // be parsed into one of the model. Because we return [Fruit.unknown] + // if the deserialization fails. + } + } + // Return an unknown type when the incoming json parses into more than one models. + // Since we pass deserializedModels, clients can still use the deserialized model. + // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. + // So we still return this as an unknown type. + if(deserializedModels.length > 1){ + deserializedModel = Fruit.unknown( + json: json, + deserializedModels: deserializedModels, + errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, + ); + } + + + return deserializedModel ?? Fruit.unknown(json: json); + } + + + + Map toJson() { + return when( + asApple: (asApple) => asApple.toJson(), + asBanana: (asBanana) => asBanana.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/models.dart new file mode 100644 index 000000000000..3669a6b40ac4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/models.dart @@ -0,0 +1,20 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:dio/dio.dart'; +import 'dart:convert'; + +part 'models.freezed.dart'; +part 'models.g.dart'; + +part 'primitive_union_types.dart'; +part 'apple.dart';part 'banana.dart';part 'fruit.dart'; + +/// A typedef used in the deserialization of OneOf and AnyOf +/// models when no discriminator mapping is provided. +typedef FromJsonMethodType = T Function(Map); + +/// Deserialization error types for OneOf and AnyOf types. +enum DeserializationErrorType { + MoreThanOneTypeSatisfied, + UnKnownType, +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/primitive_union_types.dart new file mode 100644 index 000000000000..fafa083471b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/primitive_union_types.dart @@ -0,0 +1,60 @@ +part of 'models.dart'; + +@freezed +class IntInUnion with _$IntInUnion{ + const factory IntInUnion({ + required int intValue + }) = _IntInUnion; + + factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); +} + +@freezed +class StringInUnion with _$StringInUnion{ + const factory StringInUnion({ + required String stringValue + }) = _StringInUnion; + + factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); +} +@freezed +class BoolInUnion with _$BoolInUnion{ + const factory BoolInUnion({ + required bool boolValue + }) = _BoolInUnion; + + factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); +} + +@freezed +class DoubleInUnion with _$DoubleInUnion{ + const factory DoubleInUnion({ + required double doubleValue + }) = _DoubleInUnion; + + factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); +} + +@freezed +class ObjectInUnion with _$ObjectInUnion { + const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; + + factory ObjectInUnion.fromJson(Map json) => + _$ObjectInUnionFromJson(json); +} + +@freezed +class NumInUnion with _$NumInUnion{ + const factory NumInUnion({required num numValue}) = _NumInUnion; + + factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); +} + +@freezed +class DateTimeInUnion with _$DateTimeInUnion { +const factory DateTimeInUnion({required DateTime dateTimeValue}) = +_DateTimeInUnion; + +factory DateTimeInUnion.fromJson(Map json) => +_$DateTimeInUnionFromJson(json); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/pubspec.yaml new file mode 100644 index 000000000000..12925113115d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/pubspec.yaml @@ -0,0 +1,18 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '^3.0.0' + +dependencies: + dio: '^5.2.0' + freezed_annotation: '^2.4.4' + json_annotation: '^4.9.0' + +dev_dependencies: + freezed: '^2.5.2' + json_serializable: '^6.8.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/apple_test.dart new file mode 100644 index 000000000000..200492f8b1f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/apple_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Apple +void main() { + final Apple? instance = /* Apple(...) */ null; + // TODO add properties to the entity + + group(Apple, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/banana_test.dart new file mode 100644 index 000000000000..ae681c740af5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/banana_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Banana +void main() { + final Banana? instance = /* Banana(...) */ null; + // TODO add properties to the entity + + group(Banana, () { + // num count + test('to test the property `count`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/default_api_test.dart new file mode 100644 index 000000000000..07d256d2e554 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/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 rootGet() async + test('test rootGet', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/fruit_test.dart new file mode 100644 index 000000000000..8dfac99108f2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/fruit_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Fruit +void main() { + final Fruit? instance = /* Fruit(...) */ null; + // TODO add properties to the entity + + group(Fruit, () { + // String color + test('to test the property `color`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // num count + test('to test the property `count`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.gitignore b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.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/freezed/oneof_polymorphism_and_inheritance/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.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/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/FILES new file mode 100644 index 000000000000..ba0ca88ef8b5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/FILES @@ -0,0 +1,75 @@ +.gitignore +.openapi-generator-ignore +README.md +analysis_options.yaml +build.yaml +doc/Addressable.md +doc/Apple.md +doc/Banana.md +doc/Bar.md +doc/BarApi.md +doc/BarCreate.md +doc/BarRef.md +doc/BarRefOrValue.md +doc/Entity.md +doc/EntityRef.md +doc/Extensible.md +doc/Foo.md +doc/FooApi.md +doc/FooRef.md +doc/FooRefOrValue.md +doc/Fruit.md +doc/FruitType.md +doc/Pasta.md +doc/Pizza.md +doc/PizzaSpeziale.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/bar_api.dart +lib/src/api/foo_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/model/addressable.dart +lib/src/model/apple.dart +lib/src/model/banana.dart +lib/src/model/bar.dart +lib/src/model/bar_create.dart +lib/src/model/bar_ref.dart +lib/src/model/bar_ref_or_value.dart +lib/src/model/entity.dart +lib/src/model/entity_ref.dart +lib/src/model/extensible.dart +lib/src/model/foo.dart +lib/src/model/foo_ref.dart +lib/src/model/foo_ref_or_value.dart +lib/src/model/fruit.dart +lib/src/model/fruit_type.dart +lib/src/model/models.dart +lib/src/model/pasta.dart +lib/src/model/pizza.dart +lib/src/model/pizza_speziale.dart +lib/src/model/primitive_union_types.dart +pubspec.yaml +test/addressable_test.dart +test/apple_test.dart +test/banana_test.dart +test/bar_api_test.dart +test/bar_create_test.dart +test/bar_ref_or_value_test.dart +test/bar_ref_test.dart +test/bar_test.dart +test/entity_ref_test.dart +test/entity_test.dart +test/extensible_test.dart +test/foo_api_test.dart +test/foo_ref_or_value_test.dart +test/foo_ref_test.dart +test/foo_test.dart +test/fruit_test.dart +test/fruit_type_test.dart +test/pasta_test.dart +test/pizza_speziale_test.dart +test/pizza_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION new file mode 100644 index 000000000000..17f2442ff3bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/README.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/README.md new file mode 100644 index 000000000000..2b9a132c0aa7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/README.md @@ -0,0 +1,104 @@ +# openapi (EXPERIMENTAL) +This tests for a oneOf interface representation + + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.0.1 +- Generator version: 7.9.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## 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().getBarApi(); +final BarCreate barCreate = ; // BarCreate | + +try { + final response = await api.createBar(barCreate); + print(response); +} catch on DioException (e) { + print("Exception when calling BarApi->createBar: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:8080* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*BarApi*](doc/BarApi.md) | [**createBar**](doc/BarApi.md#createbar) | **POST** /bar | Create a Bar +[*FooApi*](doc/FooApi.md) | [**createFoo**](doc/FooApi.md#createfoo) | **POST** /foo | Create a Foo +[*FooApi*](doc/FooApi.md) | [**getAllFoos**](doc/FooApi.md#getallfoos) | **GET** /foo | GET all Foos + + +## Documentation For Models + + - [Addressable](doc/Addressable.md) + - [Apple](doc/Apple.md) + - [Banana](doc/Banana.md) + - [Bar](doc/Bar.md) + - [BarCreate](doc/BarCreate.md) + - [BarRef](doc/BarRef.md) + - [BarRefOrValue](doc/BarRefOrValue.md) + - [Entity](doc/Entity.md) + - [EntityRef](doc/EntityRef.md) + - [Extensible](doc/Extensible.md) + - [Foo](doc/Foo.md) + - [FooRef](doc/FooRef.md) + - [FooRefOrValue](doc/FooRefOrValue.md) + - [Fruit](doc/Fruit.md) + - [FruitType](doc/FruitType.md) + - [Pasta](doc/Pasta.md) + - [Pizza](doc/Pizza.md) + - [PizzaSpeziale](doc/PizzaSpeziale.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/analysis_options.yaml new file mode 100644 index 000000000000..8ff047ce7675 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strict-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart + - lib/src/model/*.freezed.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/build.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/build.yaml new file mode 100644 index 000000000000..dee5edd67f90 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/build.yaml @@ -0,0 +1,11 @@ +targets: + $default: + builders: + freezed|freezed: + # This restricts freezed build runner to look + # files only inside models folder. + # If you prefer the build runner to scan the whole + # project for files then simply remove this build.yaml file + generate_for: + include: + - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Addressable.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Addressable.md new file mode 100644 index 000000000000..0fcd81b80382 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Addressable.md @@ -0,0 +1,16 @@ +# openapi.model.Addressable + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [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/freezed/oneof_polymorphism_and_inheritance/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Apple.md new file mode 100644 index 000000000000..13b34241ef81 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Apple.md @@ -0,0 +1,15 @@ +# openapi.model.Apple + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | + +[[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/freezed/oneof_polymorphism_and_inheritance/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Banana.md new file mode 100644 index 000000000000..4c5737d0c2e2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Banana.md @@ -0,0 +1,15 @@ +# openapi.model.Banana + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | + +[[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/freezed/oneof_polymorphism_and_inheritance/doc/Bar.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Bar.md new file mode 100644 index 000000000000..4cccc863a489 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Bar.md @@ -0,0 +1,22 @@ +# openapi.model.Bar + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/freezed/oneof_polymorphism_and_inheritance/doc/BarApi.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarApi.md new file mode 100644 index 000000000000..a6f23c00210c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarApi.md @@ -0,0 +1,55 @@ +# openapi.api.BarApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:8080* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createBar**](BarApi.md#createbar) | **POST** /bar | Create a Bar + + +# **createBar** +> Bar createBar(barCreate) + +Create a Bar + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getBarApi(); +final BarCreate barCreate = ; // BarCreate | + +try { + final response = api.createBar(barCreate); + print(response); +} catch on DioException (e) { + print('Exception when calling BarApi->createBar: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **barCreate** | [**BarCreate**](BarCreate.md)| | + +### Return type + +[**Bar**](Bar.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/freezed/oneof_polymorphism_and_inheritance/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarCreate.md new file mode 100644 index 000000000000..c0b4ba6edc9a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarCreate.md @@ -0,0 +1,22 @@ +# openapi.model.BarCreate + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/freezed/oneof_polymorphism_and_inheritance/doc/BarRef.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarRef.md new file mode 100644 index 000000000000..cab0e7e57386 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarRef.md @@ -0,0 +1,21 @@ +# openapi.model.BarRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/freezed/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md new file mode 100644 index 000000000000..f88727e11aa8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md @@ -0,0 +1,24 @@ +# openapi.model.BarRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | unique identifier | +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [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/freezed/oneof_polymorphism_and_inheritance/doc/Entity.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Entity.md new file mode 100644 index 000000000000..5ba2144b44fe --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Entity.md @@ -0,0 +1,19 @@ +# openapi.model.Entity + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/freezed/oneof_polymorphism_and_inheritance/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/EntityRef.md new file mode 100644 index 000000000000..80eae55f4145 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/EntityRef.md @@ -0,0 +1,21 @@ +# openapi.model.EntityRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/freezed/oneof_polymorphism_and_inheritance/doc/Extensible.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Extensible.md new file mode 100644 index 000000000000..7a781e578ea4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Extensible.md @@ -0,0 +1,17 @@ +# openapi.model.Extensible + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/freezed/oneof_polymorphism_and_inheritance/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Foo.md new file mode 100644 index 000000000000..2627691fefe5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Foo.md @@ -0,0 +1,21 @@ +# openapi.model.Foo + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fooPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/freezed/oneof_polymorphism_and_inheritance/doc/FooApi.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FooApi.md new file mode 100644 index 000000000000..f1fe53aa31f2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FooApi.md @@ -0,0 +1,93 @@ +# openapi.api.FooApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:8080* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createFoo**](FooApi.md#createfoo) | **POST** /foo | Create a Foo +[**getAllFoos**](FooApi.md#getallfoos) | **GET** /foo | GET all Foos + + +# **createFoo** +> FooRefOrValue createFoo(foo) + +Create a Foo + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFooApi(); +final Foo foo = ; // Foo | The Foo to be created + +try { + final response = api.createFoo(foo); + print(response); +} catch on DioException (e) { + print('Exception when calling FooApi->createFoo: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **foo** | [**Foo**](Foo.md)| The Foo to be created | [optional] + +### Return type + +[**FooRefOrValue**](FooRefOrValue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json;charset=utf-8 + - **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) + +# **getAllFoos** +> List getAllFoos() + +GET all Foos + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFooApi(); + +try { + final response = api.getAllFoos(); + print(response); +} catch on DioException (e) { + print('Exception when calling FooApi->getAllFoos: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<FooRefOrValue>**](FooRefOrValue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json;charset=utf-8 + +[[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/freezed/oneof_polymorphism_and_inheritance/doc/FooRef.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FooRef.md new file mode 100644 index 000000000000..bfa62bd4f54b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FooRef.md @@ -0,0 +1,22 @@ +# openapi.model.FooRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foorefPropA** | **String** | | [optional] +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/freezed/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md new file mode 100644 index 000000000000..9bc8dec10571 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md @@ -0,0 +1,24 @@ +# openapi.model.FooRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fooPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**foorefPropA** | **String** | | [optional] +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [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/freezed/oneof_polymorphism_and_inheritance/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Fruit.md new file mode 100644 index 000000000000..91c1f1cf9b55 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Fruit.md @@ -0,0 +1,17 @@ +# openapi.model.Fruit + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | [**FruitType**](FruitType.md) | | +**seeds** | **int** | | +**length** | **int** | | + +[[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/freezed/oneof_polymorphism_and_inheritance/doc/FruitType.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FruitType.md new file mode 100644 index 000000000000..ce2329c986ad --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/FruitType.md @@ -0,0 +1,14 @@ +# openapi.model.FruitType + +## 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/freezed/oneof_polymorphism_and_inheritance/doc/Pasta.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Pasta.md new file mode 100644 index 000000000000..034ff420d323 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Pasta.md @@ -0,0 +1,20 @@ +# openapi.model.Pasta + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vendor** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/freezed/oneof_polymorphism_and_inheritance/doc/Pizza.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Pizza.md new file mode 100644 index 000000000000..e4b040a6a79c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Pizza.md @@ -0,0 +1,20 @@ +# openapi.model.Pizza + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pizzaSize** | **num** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/freezed/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md new file mode 100644 index 000000000000..4e3800773dca --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md @@ -0,0 +1,21 @@ +# openapi.model.PizzaSpeziale + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toppings** | **String** | | [optional] +**pizzaSize** | **num** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible 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/freezed/oneof_polymorphism_and_inheritance/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/openapi.dart new file mode 100644 index 000000000000..2dd7aa8bee7d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/openapi.dart @@ -0,0 +1,16 @@ +// +// 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/bearer_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; + + +export 'package:openapi/src/api/bar_api.dart'; +export 'package:openapi/src/api/foo_api.dart'; + + +export 'package:openapi/src/model/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/api.dart new file mode 100644 index 000000000000..791892de5ea4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/api.dart @@ -0,0 +1,75 @@ +// +// 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/bar_api.dart'; +import 'package:openapi/src/api/foo_api.dart'; + +class Openapi { + static const String basePath = r'http://localhost:8080'; + + final Dio dio; + Openapi({ + Dio? dio, + String? basePathOverride, + List? interceptors, + }) : + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 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 BarApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + BarApi getBarApi() { + return BarApi(dio); + } + + /// Get FooApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FooApi getFooApi() { + return FooApi(dio); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart new file mode 100644 index 000000000000..625dff159bb3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart @@ -0,0 +1,110 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.dart'; + + +class BarApi { + + final Dio _dio; + + const BarApi(this._dio); + + /// Create a Bar + /// + /// + /// Parameters: + /// * [barCreate] + /// * [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 [Bar] as data + /// Throws [DioException] if API call or serialization fails + Future> createBar({ + + required BarCreate barCreate, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/bar'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData=jsonEncode(barCreate); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Bar _responseData; + + + try { + _responseData = Bar.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/freezed/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart new file mode 100644 index 000000000000..107218c14261 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart @@ -0,0 +1,182 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.dart'; + + +class FooApi { + + final Dio _dio; + + const FooApi(this._dio); + + /// Create a Foo + /// + /// + /// Parameters: + /// * [foo] - The Foo to be created + /// * [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 [FooRefOrValue] as data + /// Throws [DioException] if API call or serialization fails + Future> createFoo({ + + Foo? foo, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json;charset=utf-8', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData=jsonEncode(foo); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FooRefOrValue _responseData; + + + try { + _responseData = FooRefOrValue.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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, + ); + } + + /// GET all Foos + /// + /// + /// 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 [List] as data + /// Throws [DioException] if API call or serialization fails + Future>> getAllFoos({ + + 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, + ); + + List _responseData; + + + try { + final _responseDataAsList = _response.data as List; + _responseData = _responseDataAsList.map((dynamic e)=> FooRefOrValue.fromJson(e as Map)).toList(); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/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/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/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/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b65ccb5b71f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/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']?.toLowerCase() == '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/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..8f46678761b2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/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']?.toLowerCase() == '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/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/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/freezed/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart new file mode 100644 index 000000000000..ff1c69a84384 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Base schema for addressable entities + /// + /// Properties: + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + +@freezed +class Addressable with _$Addressable { +const Addressable._(); + + + const factory Addressable({ + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, +}) = _Addressable; + + + + + factory Addressable.fromJson(Map json) => _$AddressableFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/apple.dart new file mode 100644 index 000000000000..143bec0d76f1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/apple.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Apple + /// + /// Properties: + /// * [seeds] + +@freezed +class Apple with _$Apple { +const Apple._(); + + + const factory Apple({ + @JsonKey(name: r'seeds') + required int + seeds, +}) = _Apple; + + + + + factory Apple.fromJson(Map json) => _$AppleFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/banana.dart new file mode 100644 index 000000000000..9acc3dee8af8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/banana.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Banana + /// + /// Properties: + /// * [length] + +@freezed +class Banana with _$Banana { +const Banana._(); + + + const factory Banana({ + @JsonKey(name: r'length') + required int + length, +}) = _Banana; + + + + + factory Banana.fromJson(Map json) => _$BananaFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart new file mode 100644 index 000000000000..20380a5d0872 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Bar + /// + /// Properties: + /// * [id] + /// * [barPropA] + /// * [fooPropB] + /// * [foo] + /// * [href] - Hyperlink reference + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Bar with _$Bar { +const Bar._(); + + + + const factory Bar({ + @JsonKey(name: r'id') + required String + id, + @JsonKey(name: r'barPropA') + String? + barPropA, + @JsonKey(name: r'fooPropB') + String? + fooPropB, + @JsonKey(name: r'foo') + FooRefOrValue? + foo, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _Bar; + + + + factory Bar.fromJson(Map json) => _$BarFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart new file mode 100644 index 000000000000..e781be79aaf8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart @@ -0,0 +1,73 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// BarCreate + /// + /// Properties: + /// * [barPropA] + /// * [fooPropB] + /// * [foo] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class BarCreate with _$BarCreate { +const BarCreate._(); + + + + const factory BarCreate({ + @JsonKey(name: r'barPropA') + String? + barPropA, + @JsonKey(name: r'fooPropB') + String? + fooPropB, + @JsonKey(name: r'foo') + FooRefOrValue? + foo, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _BarCreate; + + + + factory BarCreate.fromJson(Map json) => _$BarCreateFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart new file mode 100644 index 000000000000..dfb59ba8a333 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// BarRef + /// + /// Properties: + /// * [name] - Name of the related entity. + /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class BarRef with _$BarRef { +const BarRef._(); + + + + const factory BarRef({ + /// Name of the related entity. + @JsonKey(name: r'name') + String? + name, + /// The actual type of the target instance when needed for disambiguation. + @JsonKey(name: r'@referredType') + String? + atReferredType, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _BarRef; + + + + factory BarRef.fromJson(Map json) => _$BarRefFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart new file mode 100644 index 000000000000..d0cb4074e229 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// BarRefOrValue + /// + /// Properties: + /// * [id] - unique identifier + /// * [barPropA] + /// * [fooPropB] + /// * [foo] + /// * [href] - Hyperlink reference + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + /// * [name] - Name of the related entity. + /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. + +@freezed +class BarRefOrValue with _$BarRefOrValue { +const BarRefOrValue._(); + + + + + const factory BarRefOrValue.asBar({ + required Bar barValue + }) = BarRefOrValueAsBar; + const factory BarRefOrValue.asBarRef({ + required BarRef barRefValue + }) = BarRefOrValueAsBarRef; + const factory BarRefOrValue.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([Bar,BarRef,]) List possibleTypes, + @Default([]) List deserializedModels, + }) = BarRefOrValueUnknown; + + + + + factory BarRefOrValue.fromJson(Map json) { + BarRefOrValue? deserializedModel; + // A discriminator property is not defined in the spec so + // we try to parse the json against all the models and try to + // return one of the valid model. Note: this approach tries + // to return one valid model and if more than one model + // is valid it then returns unknown type along with the json so + // the consumer can decide which model it is. + final fromJsonMethods = >[Bar.fromJson,BarRef.fromJson,]; + final deserializedModels = []; + for (final fromJsonMethod in fromJsonMethods) { + try { + final dynamic parsedModel= fromJsonMethod.call(json); + // Note following line won't be executed if already the above parsing fails. + if (parsedModel is Bar) { + deserializedModel = BarRefOrValue.asBar( + barValue : parsedModel, + ); + } else + if (parsedModel is BarRef) { + deserializedModel = BarRefOrValue.asBarRef( + barRefValue : parsedModel, + ); + } else + { + deserializedModel = BarRefOrValue.unknown(json: json); + } + deserializedModels.add(deserializedModel); + } catch (e) { + // We are suppressing the deserialization error when the json could not + // be parsed into one of the model. Because we return [BarRefOrValue.unknown] + // if the deserialization fails. + } + } + // Return an unknown type when the incoming json parses into more than one models. + // Since we pass deserializedModels, clients can still use the deserialized model. + // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. + // So we still return this as an unknown type. + if(deserializedModels.length > 1){ + deserializedModel = BarRefOrValue.unknown( + json: json, + deserializedModels: deserializedModels, + errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, + ); + } + + + return deserializedModel ?? BarRefOrValue.unknown(json: json); + } + + + + Map toJson() { + return when( + asBar: (asBar) => asBar.toJson(), + asBarRef: (asBarRef) => asBarRef.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart new file mode 100644 index 000000000000..e1a6d61dfe82 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart @@ -0,0 +1,104 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Entity + /// + /// Properties: + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Entity with _$Entity { +const Entity._(); + + + + + const factory Entity.bar({ + required Bar bar, + }) = EntityBar; + const factory Entity.barCreate({ + required BarCreate barCreate, + }) = EntityBar_create; + const factory Entity.foo({ + required Foo foo, + }) = EntityFoo; + const factory Entity.pasta({ + required Pasta pasta, + }) = EntityPasta; + const factory Entity.pizza({ + required Pizza pizza, + }) = EntityPizza; + const factory Entity.pizzaspeziale({ + required PizzaSpeziale pizzaSpeziale, + }) = EntityPizzaspeziale; + const factory Entity.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([]) List possibleTypes, + @Default([]) List deserializedModels, + }) = EntityUnknown; + + + + factory Entity.fromJson(Map json) { + switch(json['@type']){ + case 'Bar': + return Entity.bar( + bar : Bar.fromJson(json), + ); + case 'Bar_Create': + return Entity.barCreate( + barCreate : BarCreate.fromJson(json), + ); + case 'Foo': + return Entity.foo( + foo : Foo.fromJson(json), + ); + case 'Pasta': + return Entity.pasta( + pasta : Pasta.fromJson(json), + ); + case 'Pizza': + return Entity.pizza( + pizza : Pizza.fromJson(json), + ); + case 'PizzaSpeziale': + return Entity.pizzaspeziale( + pizzaSpeziale : PizzaSpeziale.fromJson(json), + ); + } + return Entity.unknown(json: json); + } + + + + Map toJson() { + return when( + bar: (bar) => bar.toJson(), + barCreate: (barCreate) => barCreate.toJson(), + foo: (foo) => foo.toJson(), + pasta: (pasta) => pasta.toJson(), + pizza: (pizza) => pizza.toJson(), + pizzaspeziale: (pizzaSpeziale) => pizzaSpeziale.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart new file mode 100644 index 000000000000..9db823ea0619 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart @@ -0,0 +1,74 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Entity reference schema to be use for all entityRef class. + /// + /// Properties: + /// * [name] - Name of the related entity. + /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class EntityRef with _$EntityRef { +const EntityRef._(); + + + + + const factory EntityRef.barref({ + required BarRef barRef, + }) = EntityRefBarref; + const factory EntityRef.fooref({ + required FooRef fooRef, + }) = EntityRefFooref; + const factory EntityRef.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([]) List possibleTypes, + @Default([]) List deserializedModels, + }) = EntityRefUnknown; + + + + factory EntityRef.fromJson(Map json) { + switch(json['@type']){ + case 'BarRef': + return EntityRef.barref( + barRef : BarRef.fromJson(json), + ); + case 'FooRef': + return EntityRef.fooref( + fooRef : FooRef.fromJson(json), + ); + } + return EntityRef.unknown(json: json); + } + + + + Map toJson() { + return when( + barref: (barRef) => barRef.toJson(), + fooref: (fooRef) => fooRef.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart new file mode 100644 index 000000000000..258fa6502a3e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Extensible + /// + /// Properties: + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Extensible with _$Extensible { +const Extensible._(); + + + const factory Extensible({ + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _Extensible; + + + + + factory Extensible.fromJson(Map json) => _$ExtensibleFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart new file mode 100644 index 000000000000..ac75d3ce0192 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Foo + /// + /// Properties: + /// * [fooPropA] + /// * [fooPropB] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Foo with _$Foo { +const Foo._(); + + + + const factory Foo({ + @JsonKey(name: r'fooPropA') + String? + fooPropA, + @JsonKey(name: r'fooPropB') + String? + fooPropB, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _Foo; + + + + factory Foo.fromJson(Map json) => _$FooFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart new file mode 100644 index 000000000000..a2fbb1c3467a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FooRef + /// + /// Properties: + /// * [foorefPropA] + /// * [name] - Name of the related entity. + /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class FooRef with _$FooRef { +const FooRef._(); + + + + const factory FooRef({ + @JsonKey(name: r'foorefPropA') + String? + foorefPropA, + /// Name of the related entity. + @JsonKey(name: r'name') + String? + name, + /// The actual type of the target instance when needed for disambiguation. + @JsonKey(name: r'@referredType') + String? + atReferredType, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _FooRef; + + + + factory FooRef.fromJson(Map json) => _$FooRefFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart new file mode 100644 index 000000000000..66ef0d5c90d9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FooRefOrValue + /// + /// Properties: + /// * [fooPropA] + /// * [fooPropB] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + /// * [foorefPropA] + /// * [name] - Name of the related entity. + /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. + +@freezed +class FooRefOrValue with _$FooRefOrValue { +const FooRefOrValue._(); + + + + + const factory FooRefOrValue.asFoo({ + required Foo fooValue + }) = FooRefOrValueAsFoo; + const factory FooRefOrValue.asFooRef({ + required FooRef fooRefValue + }) = FooRefOrValueAsFooRef; + const factory FooRefOrValue.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([Foo,FooRef,]) List possibleTypes, + @Default([]) List deserializedModels, + }) = FooRefOrValueUnknown; + + + + + factory FooRefOrValue.fromJson(Map json) { + FooRefOrValue? deserializedModel; + // A discriminator property is specified but no mapping + // is provided in the spec, so we expect the property to + // have the value of the name of the model. Model prefix & + // suffix are ignored, as this is not known by the api provider + switch(json['@type']){ + case 'Foo': + deserializedModel = FooRefOrValue.asFoo( + fooValue : Foo.fromJson(json), + ); + break; + case 'FooRef': + deserializedModel = FooRefOrValue.asFooRef( + fooRefValue : FooRef.fromJson(json), + ); + break; + default: + break; + } + + + return deserializedModel ?? FooRefOrValue.unknown(json: json); + } + + + + Map toJson() { + return when( + asFoo: (asFoo) => asFoo.toJson(), + asFooRef: (asFooRef) => asFooRef.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit.dart new file mode 100644 index 000000000000..17e727017cd3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Fruit + /// + /// Properties: + /// * [fruitType] + /// * [seeds] + /// * [length] + +@freezed +class Fruit with _$Fruit { +const Fruit._(); + + + + + const factory Fruit.apple({ + required Apple apple, + }) = FruitApple; + const factory Fruit.banana({ + required Banana banana, + }) = FruitBanana; + const factory Fruit.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([Apple,Banana,]) List possibleTypes, + @Default([]) List deserializedModels, + }) = FruitUnknown; + + + + factory Fruit.fromJson(Map json) { + switch(json['fruitType']){ + case 'APPLE': + return Fruit.apple( + apple : Apple.fromJson(json), + ); + case 'BANANA': + return Fruit.banana( + banana : Banana.fromJson(json), + ); + } + return Fruit.unknown(json: json); + } + + + + Map toJson() { + return when( + apple: (apple) => apple.toJson(), + banana: (banana) => banana.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit_type.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit_type.dart new file mode 100644 index 000000000000..cd394cc4803e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit_type.dart @@ -0,0 +1,16 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum FruitType { + APPLE(value: r'APPLE'), + BANANA(value: r'BANANA'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const FruitType({required this.value}); + final String value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/models.dart new file mode 100644 index 000000000000..793098c8ff67 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/models.dart @@ -0,0 +1,20 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:dio/dio.dart'; +import 'dart:convert'; + +part 'models.freezed.dart'; +part 'models.g.dart'; + +part 'primitive_union_types.dart'; +part 'addressable.dart';part 'apple.dart';part 'banana.dart';part 'bar.dart';part 'bar_create.dart';part 'bar_ref.dart';part 'bar_ref_or_value.dart';part 'entity.dart';part 'entity_ref.dart';part 'extensible.dart';part 'foo.dart';part 'foo_ref.dart';part 'foo_ref_or_value.dart';part 'fruit.dart';part 'fruit_type.dart';part 'pasta.dart';part 'pizza.dart';part 'pizza_speziale.dart'; + +/// A typedef used in the deserialization of OneOf and AnyOf +/// models when no discriminator mapping is provided. +typedef FromJsonMethodType = T Function(Map); + +/// Deserialization error types for OneOf and AnyOf types. +enum DeserializationErrorType { + MoreThanOneTypeSatisfied, + UnKnownType, +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart new file mode 100644 index 000000000000..1002c786fb26 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart @@ -0,0 +1,65 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Pasta + /// + /// Properties: + /// * [vendor] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Pasta with _$Pasta { +const Pasta._(); + + + + const factory Pasta({ + @JsonKey(name: r'vendor') + String? + vendor, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _Pasta; + + + + factory Pasta.fromJson(Map json) => _$PastaFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart new file mode 100644 index 000000000000..79fafb715a2c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart @@ -0,0 +1,65 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Pizza + /// + /// Properties: + /// * [pizzaSize] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class Pizza with _$Pizza { +const Pizza._(); + + + + const factory Pizza({ + @JsonKey(name: r'pizzaSize') + num? + pizzaSize, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _Pizza; + + + + factory Pizza.fromJson(Map json) => _$PizzaFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart new file mode 100644 index 000000000000..ed00d02d4539 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// PizzaSpeziale + /// + /// Properties: + /// * [toppings] + /// * [pizzaSize] + /// * [href] - Hyperlink reference + /// * [id] - unique identifier + /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships + /// * [atBaseType] - When sub-classing, this defines the super-class + /// * [atType] - When sub-classing, this defines the sub-class Extensible name + +@freezed +class PizzaSpeziale with _$PizzaSpeziale { +const PizzaSpeziale._(); + + + + const factory PizzaSpeziale({ + @JsonKey(name: r'toppings') + String? + toppings, + @JsonKey(name: r'pizzaSize') + num? + pizzaSize, + /// Hyperlink reference + @JsonKey(name: r'href') + String? + href, + /// unique identifier + @JsonKey(name: r'id') + String? + id, + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') + String? + atSchemaLocation, + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') + String? + atBaseType, + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') + required String + atType, +}) = _PizzaSpeziale; + + + + factory PizzaSpeziale.fromJson(Map json) => _$PizzaSpezialeFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/primitive_union_types.dart new file mode 100644 index 000000000000..fafa083471b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/primitive_union_types.dart @@ -0,0 +1,60 @@ +part of 'models.dart'; + +@freezed +class IntInUnion with _$IntInUnion{ + const factory IntInUnion({ + required int intValue + }) = _IntInUnion; + + factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); +} + +@freezed +class StringInUnion with _$StringInUnion{ + const factory StringInUnion({ + required String stringValue + }) = _StringInUnion; + + factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); +} +@freezed +class BoolInUnion with _$BoolInUnion{ + const factory BoolInUnion({ + required bool boolValue + }) = _BoolInUnion; + + factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); +} + +@freezed +class DoubleInUnion with _$DoubleInUnion{ + const factory DoubleInUnion({ + required double doubleValue + }) = _DoubleInUnion; + + factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); +} + +@freezed +class ObjectInUnion with _$ObjectInUnion { + const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; + + factory ObjectInUnion.fromJson(Map json) => + _$ObjectInUnionFromJson(json); +} + +@freezed +class NumInUnion with _$NumInUnion{ + const factory NumInUnion({required num numValue}) = _NumInUnion; + + factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); +} + +@freezed +class DateTimeInUnion with _$DateTimeInUnion { +const factory DateTimeInUnion({required DateTime dateTimeValue}) = +_DateTimeInUnion; + +factory DateTimeInUnion.fromJson(Map json) => +_$DateTimeInUnionFromJson(json); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/pubspec.yaml new file mode 100644 index 000000000000..12925113115d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/pubspec.yaml @@ -0,0 +1,18 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '^3.0.0' + +dependencies: + dio: '^5.2.0' + freezed_annotation: '^2.4.4' + json_annotation: '^4.9.0' + +dev_dependencies: + freezed: '^2.5.2' + json_serializable: '^6.8.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/addressable_test.dart new file mode 100644 index 000000000000..2c4a84f1cb39 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/addressable_test.dart @@ -0,0 +1,23 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Addressable +void main() { + final Addressable? instance = /* Addressable(...) */ null; + // TODO add properties to the entity + + group(Addressable, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/apple_test.dart new file mode 100644 index 000000000000..ff5cc46e59aa --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/apple_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Apple +void main() { + final Apple? instance = /* Apple(...) */ null; + // TODO add properties to the entity + + group(Apple, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/banana_test.dart new file mode 100644 index 000000000000..6489e32ff77f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/banana_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Banana +void main() { + final Banana? instance = /* Banana(...) */ null; + // TODO add properties to the entity + + group(Banana, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_api_test.dart new file mode 100644 index 000000000000..73be91c446e0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_api_test.dart @@ -0,0 +1,18 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for BarApi +void main() { + final instance = Openapi().getBarApi(); + + group(BarApi, () { + // Create a Bar + // + //Future createBar(BarCreate barCreate) async + test('test createBar', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_create_test.dart new file mode 100644 index 000000000000..720b7afc6e94 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_create_test.dart @@ -0,0 +1,56 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarCreate +void main() { + final BarCreate? instance = /* BarCreate(...) */ null; + // TODO add properties to the entity + + group(BarCreate, () { + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart new file mode 100644 index 000000000000..4f79824c2388 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart @@ -0,0 +1,68 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRefOrValue +void main() { + final BarRefOrValue? instance = /* BarRefOrValue(...) */ null; + // TODO add properties to the entity + + group(BarRefOrValue, () { + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart new file mode 100644 index 000000000000..9d5acfcd10f6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart @@ -0,0 +1,53 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRef +void main() { + final BarRef? instance = /* BarRef(...) */ null; + // TODO add properties to the entity + + group(BarRef, () { + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_test.dart new file mode 100644 index 000000000000..bacdc3d3b62d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/bar_test.dart @@ -0,0 +1,55 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Bar +void main() { + final Bar? instance = /* Bar(...) */ null; + // TODO add properties to the entity + + group(Bar, () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart new file mode 100644 index 000000000000..65fed045507a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart @@ -0,0 +1,53 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EntityRef +void main() { + final EntityRef? instance = /* EntityRef(...) */ null; + // TODO add properties to the entity + + group(EntityRef, () { + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/entity_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/entity_test.dart new file mode 100644 index 000000000000..b34dd0ec767d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/entity_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Entity +void main() { + final Entity? instance = /* Entity(...) */ null; + // TODO add properties to the entity + + group(Entity, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/extensible_test.dart new file mode 100644 index 000000000000..df1f73c05b35 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/extensible_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Extensible +void main() { + final Extensible? instance = /* Extensible(...) */ null; + // TODO add properties to the entity + + group(Extensible, () { + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_api_test.dart new file mode 100644 index 000000000000..40bc24e691ea --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_api_test.dart @@ -0,0 +1,25 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FooApi +void main() { + final instance = Openapi().getFooApi(); + + group(FooApi, () { + // Create a Foo + // + //Future createFoo({ Foo foo }) async + test('test createFoo', () async { + // TODO + }); + + // GET all Foos + // + //Future> getAllFoos() async + test('test getAllFoos', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart new file mode 100644 index 000000000000..584565158cc0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart @@ -0,0 +1,68 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRefOrValue +void main() { + final FooRefOrValue? instance = /* FooRefOrValue(...) */ null; + // TODO add properties to the entity + + group(FooRefOrValue, () { + // String fooPropA + test('to test the property `fooPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + // String foorefPropA + test('to test the property `foorefPropA`', () async { + // TODO + }); + + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart new file mode 100644 index 000000000000..53529ee1c1b1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart @@ -0,0 +1,58 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRef +void main() { + final FooRef? instance = /* FooRef(...) */ null; + // TODO add properties to the entity + + group(FooRef, () { + // String foorefPropA + test('to test the property `foorefPropA`', () async { + // TODO + }); + + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_test.dart new file mode 100644 index 000000000000..e4ccad0f338a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/foo_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final Foo? instance = /* Foo(...) */ null; + // TODO add properties to the entity + + group(Foo, () { + // String fooPropA + test('to test the property `fooPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/fruit_test.dart new file mode 100644 index 000000000000..41ab86333d84 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/fruit_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Fruit +void main() { + final Fruit? instance = /* Fruit(...) */ null; + // TODO add properties to the entity + + group(Fruit, () { + // FruitType fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // int length + test('to test the property `length`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/fruit_type_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/fruit_type_test.dart new file mode 100644 index 000000000000..9bf9b6c2dd45 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/fruit_type_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitType +void main() { + + group(FruitType, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pasta_test.dart new file mode 100644 index 000000000000..c944fa0db8e7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pasta_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pasta +void main() { + final Pasta? instance = /* Pasta(...) */ null; + // TODO add properties to the entity + + group(Pasta, () { + // String vendor + test('to test the property `vendor`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart new file mode 100644 index 000000000000..8f931321e11d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PizzaSpeziale +void main() { + final PizzaSpeziale? instance = /* PizzaSpeziale(...) */ null; + // TODO add properties to the entity + + group(PizzaSpeziale, () { + // String toppings + test('to test the property `toppings`', () async { + // TODO + }); + + // num pizzaSize + test('to test the property `pizzaSize`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pizza_test.dart new file mode 100644 index 000000000000..f23c37b80e8b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/pizza_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pizza +void main() { + final Pizza? instance = /* Pizza(...) */ null; + // TODO add properties to the entity + + group(Pizza, () { + // num pizzaSize + test('to test the property `pizzaSize`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.gitignore b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.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/freezed/oneof_primitive/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.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/freezed/oneof_primitive/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/FILES new file mode 100644 index 000000000000..ed2e12c2c53a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/FILES @@ -0,0 +1,24 @@ +.gitignore +.openapi-generator-ignore +README.md +analysis_options.yaml +build.yaml +doc/Child.md +doc/DefaultApi.md +doc/Example.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/default_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/model/child.dart +lib/src/model/example.dart +lib/src/model/models.dart +lib/src/model/primitive_union_types.dart +pubspec.yaml +test/child_test.dart +test/default_api_test.dart +test/example_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/VERSION new file mode 100644 index 000000000000..17f2442ff3bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/README.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/README.md new file mode 100644 index 000000000000..e81640d8ed49 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/README.md @@ -0,0 +1,84 @@ +# openapi (EXPERIMENTAL) +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Generator version: 7.9.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## 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().getDefaultApi(); + +try { + final response = await api.list(); + print(response); +} catch on DioException (e) { + print("Exception when calling DefaultApi->list: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://api.example.xyz/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*DefaultApi*](doc/DefaultApi.md) | [**list**](doc/DefaultApi.md#list) | **GET** /example | + + +## Documentation For Models + + - [Child](doc/Child.md) + - [Example](doc/Example.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/analysis_options.yaml new file mode 100644 index 000000000000..8ff047ce7675 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strict-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart + - lib/src/model/*.freezed.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/build.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/build.yaml new file mode 100644 index 000000000000..dee5edd67f90 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/build.yaml @@ -0,0 +1,11 @@ +targets: + $default: + builders: + freezed|freezed: + # This restricts freezed build runner to look + # files only inside models folder. + # If you prefer the build runner to scan the whole + # project for files then simply remove this build.yaml file + generate_for: + include: + - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/doc/Child.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/doc/Child.md new file mode 100644 index 000000000000..bed0f2feec12 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/doc/Child.md @@ -0,0 +1,15 @@ +# openapi.model.Child + +## 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/freezed/oneof_primitive/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/doc/DefaultApi.md new file mode 100644 index 000000000000..c4077a67727b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/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://api.example.xyz/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list**](DefaultApi.md#list) | **GET** /example | + + +# **list** +> Example list() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.list(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->list: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Example**](Example.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/freezed/oneof_primitive/doc/Example.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/doc/Example.md new file mode 100644 index 000000000000..bf49bb137a60 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/doc/Example.md @@ -0,0 +1,15 @@ +# openapi.model.Example + +## 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/freezed/oneof_primitive/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/openapi.dart new file mode 100644 index 000000000000..581830866afb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/openapi.dart @@ -0,0 +1,15 @@ +// +// 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/bearer_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; + + +export 'package:openapi/src/api/default_api.dart'; + + +export 'package:openapi/src/model/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/api.dart new file mode 100644 index 000000000000..295416c42814 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/api.dart @@ -0,0 +1,68 @@ +// +// 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/default_api.dart'; + +class Openapi { + static const String basePath = r'http://api.example.xyz/v1'; + + final Dio dio; + Openapi({ + Dio? dio, + String? basePathOverride, + List? interceptors, + }) : + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 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 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); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/api/default_api.dart new file mode 100644 index 000000000000..afce265c9b5b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/api/default_api.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.dart'; + + +class DefaultApi { + + final Dio _dio; + + const DefaultApi(this._dio); + + /// list + /// + /// + /// 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 [Example] as data + /// Throws [DioException] if API call or serialization fails + Future> list({ + + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/example'; + 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, + ); + + Example _responseData; + + + try { + _responseData = Example.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/freezed/oneof_primitive/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/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/freezed/oneof_primitive/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/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/freezed/oneof_primitive/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b65ccb5b71f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/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']?.toLowerCase() == '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/freezed/oneof_primitive/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..8f46678761b2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/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']?.toLowerCase() == '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/freezed/oneof_primitive/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/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/freezed/oneof_primitive/lib/src/model/child.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/child.dart new file mode 100644 index 000000000000..adffaceb0b5c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/child.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Child + /// + /// Properties: + /// * [name] + +@freezed +class Child with _$Child { +const Child._(); + + + const factory Child({ + @JsonKey(name: r'name') + String? + name, +}) = _Child; + + + + + factory Child.fromJson(Map json) => _$ChildFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/example.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/example.dart new file mode 100644 index 000000000000..dd775d489d62 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/example.dart @@ -0,0 +1,104 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Example + /// + /// Properties: + /// * [name] + +@freezed +class Example with _$Example { +const Example._(); + + + + + const factory Example.asChild({ + required Child childValue + }) = ExampleAsChild; + const factory Example.asIntInUnion({ + required IntInUnion intValue + }) = ExampleAsIntInUnion; + const factory Example.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([Child,int,]) List possibleTypes, + @Default([]) List deserializedModels, + }) = ExampleUnknown; + + + + + factory Example.fromJson(Map json) { + Example? deserializedModel; + // A discriminator property is not defined in the spec so + // we try to parse the json against all the models and try to + // return one of the valid model. Note: this approach tries + // to return one valid model and if more than one model + // is valid it then returns unknown type along with the json so + // the consumer can decide which model it is. + final fromJsonMethods = >[Child.fromJson,IntInUnion.fromJson,]; + final deserializedModels = []; + for (final fromJsonMethod in fromJsonMethods) { + try { + final dynamic parsedModel= fromJsonMethod.call(json); + // Note following line won't be executed if already the above parsing fails. + if (parsedModel is Child) { + deserializedModel = Example.asChild( + childValue : parsedModel, + ); + } else + if (parsedModel is IntInUnion) { + deserializedModel = Example.asIntInUnion( + intValue : parsedModel, + ); + } else + { + deserializedModel = Example.unknown(json: json); + } + deserializedModels.add(deserializedModel); + } catch (e) { + // We are suppressing the deserialization error when the json could not + // be parsed into one of the model. Because we return [Example.unknown] + // if the deserialization fails. + } + } + // Return an unknown type when the incoming json parses into more than one models. + // Since we pass deserializedModels, clients can still use the deserialized model. + // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. + // So we still return this as an unknown type. + if(deserializedModels.length > 1){ + deserializedModel = Example.unknown( + json: json, + deserializedModels: deserializedModels, + errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, + ); + } + + + return deserializedModel ?? Example.unknown(json: json); + } + + + + Map toJson() { + return when( + asChild: (asChild) => asChild.toJson(), + asIntInUnion: (asIntInUnion) => asIntInUnion.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/models.dart new file mode 100644 index 000000000000..3c4f94cac696 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/models.dart @@ -0,0 +1,20 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:dio/dio.dart'; +import 'dart:convert'; + +part 'models.freezed.dart'; +part 'models.g.dart'; + +part 'primitive_union_types.dart'; +part 'child.dart';part 'example.dart'; + +/// A typedef used in the deserialization of OneOf and AnyOf +/// models when no discriminator mapping is provided. +typedef FromJsonMethodType = T Function(Map); + +/// Deserialization error types for OneOf and AnyOf types. +enum DeserializationErrorType { + MoreThanOneTypeSatisfied, + UnKnownType, +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/primitive_union_types.dart new file mode 100644 index 000000000000..fafa083471b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/primitive_union_types.dart @@ -0,0 +1,60 @@ +part of 'models.dart'; + +@freezed +class IntInUnion with _$IntInUnion{ + const factory IntInUnion({ + required int intValue + }) = _IntInUnion; + + factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); +} + +@freezed +class StringInUnion with _$StringInUnion{ + const factory StringInUnion({ + required String stringValue + }) = _StringInUnion; + + factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); +} +@freezed +class BoolInUnion with _$BoolInUnion{ + const factory BoolInUnion({ + required bool boolValue + }) = _BoolInUnion; + + factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); +} + +@freezed +class DoubleInUnion with _$DoubleInUnion{ + const factory DoubleInUnion({ + required double doubleValue + }) = _DoubleInUnion; + + factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); +} + +@freezed +class ObjectInUnion with _$ObjectInUnion { + const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; + + factory ObjectInUnion.fromJson(Map json) => + _$ObjectInUnionFromJson(json); +} + +@freezed +class NumInUnion with _$NumInUnion{ + const factory NumInUnion({required num numValue}) = _NumInUnion; + + factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); +} + +@freezed +class DateTimeInUnion with _$DateTimeInUnion { +const factory DateTimeInUnion({required DateTime dateTimeValue}) = +_DateTimeInUnion; + +factory DateTimeInUnion.fromJson(Map json) => +_$DateTimeInUnionFromJson(json); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/pubspec.yaml new file mode 100644 index 000000000000..12925113115d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/pubspec.yaml @@ -0,0 +1,18 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '^3.0.0' + +dependencies: + dio: '^5.2.0' + freezed_annotation: '^2.4.4' + json_annotation: '^4.9.0' + +dev_dependencies: + freezed: '^2.5.2' + json_serializable: '^6.8.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/test/child_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/test/child_test.dart new file mode 100644 index 000000000000..5c2504f58eb3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/test/child_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Child +void main() { + final Child? instance = /* Child(...) */ null; + // TODO add properties to the entity + + group(Child, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/test/default_api_test.dart new file mode 100644 index 000000000000..e4ec57077946 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/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 list() async + test('test list', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/test/example_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/test/example_test.dart new file mode 100644 index 000000000000..4cabaa4f7fce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/test/example_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Example +void main() { + final Example? instance = /* Example(...) */ null; + // TODO add properties to the entity + + group(Example, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.gitignore b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.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/freezed/petstore_client_lib_fake/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.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/freezed/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/FILES new file mode 100644 index 000000000000..818c11cee664 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/FILES @@ -0,0 +1,186 @@ +.gitignore +.openapi-generator-ignore +README.md +analysis_options.yaml +build.yaml +doc/AdditionalPropertiesClass.md +doc/AllOfWithSingleRef.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/Category.md +doc/ChildWithNullable.md +doc/ClassModel.md +doc/DefaultApi.md +doc/DeprecatedObject.md +doc/Dog.md +doc/EnumArrays.md +doc/EnumTest.md +doc/FakeApi.md +doc/FakeBigDecimalMap200Response.md +doc/FakeClassnameTags123Api.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FooGetDefaultResponse.md +doc/FormatTest.md +doc/HasOnlyReadOnly.md +doc/HealthCheckResult.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/ParentWithNullable.md +doc/Pet.md +doc/PetApi.md +doc/ReadOnlyFirst.md +doc/SingleRefType.md +doc/SpecialModelName.md +doc/StoreApi.md +doc/Tag.md +doc/TestInlineFreeformAdditionalPropertiesRequest.md +doc/User.md +doc/UserApi.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/model/additional_properties_class.dart +lib/src/model/all_of_with_single_ref.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/category.dart +lib/src/model/child_with_nullable.dart +lib/src/model/class_model.dart +lib/src/model/deprecated_object.dart +lib/src/model/dog.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/fake_big_decimal_map200_response.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/foo_get_default_response.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/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/models.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/parent_with_nullable.dart +lib/src/model/pet.dart +lib/src/model/primitive_union_types.dart +lib/src/model/read_only_first.dart +lib/src/model/single_ref_type.dart +lib/src/model/special_model_name.dart +lib/src/model/tag.dart +lib/src/model/test_inline_freeform_additional_properties_request.dart +lib/src/model/user.dart +pubspec.yaml +test/additional_properties_class_test.dart +test/all_of_with_single_ref_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_test.dart +test/category_test.dart +test/child_with_nullable_test.dart +test/class_model_test.dart +test/default_api_test.dart +test/deprecated_object_test.dart +test/dog_test.dart +test/enum_arrays_test.dart +test/enum_test_test.dart +test/fake_api_test.dart +test/fake_big_decimal_map200_response_test.dart +test/fake_classname_tags123_api_test.dart +test/file_schema_test_class_test.dart +test/foo_get_default_response_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/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/parent_with_nullable_test.dart +test/pet_api_test.dart +test/pet_test.dart +test/read_only_first_test.dart +test/single_ref_type_test.dart +test/special_model_name_test.dart +test/store_api_test.dart +test/tag_test.dart +test/test_inline_freeform_additional_properties_request_test.dart +test/user_api_test.dart +test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/VERSION new file mode 100644 index 000000000000..17f2442ff3bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.9.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/README.md new file mode 100644 index 000000000000..516bf125066e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/README.md @@ -0,0 +1,211 @@ +# 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 +- Generator version: 7.9.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## 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 DioException (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) | [**fakeBigDecimalMap**](doc/FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | +[*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) | [**testAdditionalPropertiesReference**](doc/FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +[*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) | [**testInlineFreeformAdditionalProperties**](doc/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[*FakeApi*](doc/FakeApi.md) | [**testNullable**](doc/FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property +[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +[*FakeApi*](doc/FakeApi.md) | [**testStringMapReference**](doc/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map +[*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) + - [AllOfWithSingleRef](doc/AllOfWithSingleRef.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) + - [Category](doc/Category.md) + - [ChildWithNullable](doc/ChildWithNullable.md) + - [ClassModel](doc/ClassModel.md) + - [DeprecatedObject](doc/DeprecatedObject.md) + - [Dog](doc/Dog.md) + - [EnumArrays](doc/EnumArrays.md) + - [EnumTest](doc/EnumTest.md) + - [FakeBigDecimalMap200Response](doc/FakeBigDecimalMap200Response.md) + - [FileSchemaTestClass](doc/FileSchemaTestClass.md) + - [Foo](doc/Foo.md) + - [FooGetDefaultResponse](doc/FooGetDefaultResponse.md) + - [FormatTest](doc/FormatTest.md) + - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) + - [HealthCheckResult](doc/HealthCheckResult.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) + - [ParentWithNullable](doc/ParentWithNullable.md) + - [Pet](doc/Pet.md) + - [ReadOnlyFirst](doc/ReadOnlyFirst.md) + - [SingleRefType](doc/SingleRefType.md) + - [SpecialModelName](doc/SpecialModelName.md) + - [Tag](doc/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](doc/TestInlineFreeformAdditionalPropertiesRequest.md) + - [User](doc/User.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### 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 + +### 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 + +### http_basic_test + +- **Type**: HTTP basic authentication + +### bearer_test + +- **Type**: HTTP Bearer Token authentication (JWT) + +### http_signature_test + +- **Type**: HTTP signature authentication + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/analysis_options.yaml new file mode 100644 index 000000000000..8ff047ce7675 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strict-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart + - lib/src/model/*.freezed.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/build.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/build.yaml new file mode 100644 index 000000000000..dee5edd67f90 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/build.yaml @@ -0,0 +1,11 @@ +targets: + $default: + builders: + freezed|freezed: + # This restricts freezed build runner to look + # files only inside models folder. + # If you prefer the build runner to scan the whole + # project for files then simply remove this build.yaml file + generate_for: + include: + - "lib/src/model/**.dart" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..863b8503db83 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4c6f3ab2fe11 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/AllOfWithSingleRef.md @@ -0,0 +1,16 @@ +# openapi.model.AllOfWithSingleRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **String** | | [optional] +**singleRefType** | [**SingleRefType**](SingleRefType.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/freezed/petstore_client_lib_fake/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Animal.md new file mode 100644 index 000000000000..415b56e9bc2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/AnotherFakeApi.md new file mode 100644 index 000000000000..36a94e6bb703 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 DioException (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/freezed/petstore_client_lib_fake/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ApiResponse.md new file mode 100644 index 000000000000..7ad5da0f89e4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..e5b9d669a436 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..fe8e071eb45c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ArrayTest.md new file mode 100644 index 000000000000..8ae11de10022 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Capitalization.md new file mode 100644 index 000000000000..4a07b4eb820d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Cat.md new file mode 100644 index 000000000000..6552eea4b435 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/Category.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Category.md new file mode 100644 index 000000000000..ae6bc52e89d8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/ChildWithNullable.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ChildWithNullable.md new file mode 100644 index 000000000000..770494fcf4cc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ChildWithNullable.md @@ -0,0 +1,17 @@ +# openapi.model.ChildWithNullable + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | | [optional] +**nullableProperty** | **String** | | [optional] +**otherProperty** | **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/freezed/petstore_client_lib_fake/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ClassModel.md new file mode 100644 index 000000000000..13ae5d3a4708 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/DefaultApi.md new file mode 100644 index 000000000000..6abd2b44f9c4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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** +> FooGetDefaultResponse fooGet() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.fooGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->fooGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.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/freezed/petstore_client_lib_fake/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/DeprecatedObject.md new file mode 100644 index 000000000000..bf2ef67a26fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Dog.md new file mode 100644 index 000000000000..d36439b767bb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/EnumArrays.md new file mode 100644 index 000000000000..1d4fd1363b59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/EnumTest.md new file mode 100644 index 000000000000..7c24fe2347b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FakeApi.md new file mode 100644 index 000000000000..1b5e1ca297c8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FakeApi.md @@ -0,0 +1,1028 @@ +# 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 +------------- | ------------- | ------------- +[**fakeBigDecimalMap**](FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | +[**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 | +[**testAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +[**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 +[**testInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**testNullable**](FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property +[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +[**testStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map + + +# **fakeBigDecimalMap** +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); + +try { + final response = api.fakeBigDecimalMap(); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeBigDecimalMap: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **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 DioException (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'; + +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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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) + +# **testAdditionalPropertiesReference** +> testAdditionalPropertiesReference(requestBody) + +test referenced additionalProperties + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final Map requestBody = Object; // Map | request body + +try { + api.testAdditionalPropertiesReference(requestBody); +} catch on DioException (e) { + print('Exception when calling FakeApi->testAdditionalPropertiesReference: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Map<String, Object>**](Object.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) + +# **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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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'; + +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 DioException (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 DioException (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) + +# **testInlineFreeformAdditionalProperties** +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = ; // TestInlineFreeformAdditionalPropertiesRequest | request body + +try { + api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); +} catch on DioException (e) { + print('Exception when calling FakeApi->testInlineFreeformAdditionalProperties: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.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 DioException (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) + +# **testNullable** +> testNullable(childWithNullable) + +test nullable parent property + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final ChildWithNullable childWithNullable = ; // ChildWithNullable | request body + +try { + api.testNullable(childWithNullable); +} catch on DioException (e) { + print('Exception when calling FakeApi->testNullable: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **childWithNullable** | [**ChildWithNullable**](ChildWithNullable.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) + +# **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 DioException (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) + +# **testStringMapReference** +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final Map requestBody = ; // Map | request body + +try { + api.testStringMapReference(requestBody); +} catch on DioException (e) { + print('Exception when calling FakeApi->testStringMapReference: $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) + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FakeBigDecimalMap200Response.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..281dfc44fd8c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FakeBigDecimalMap200Response.md @@ -0,0 +1,16 @@ +# openapi.model.FakeBigDecimalMap200Response + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someId** | **num** | | [optional] +**someMap** | **Map<String, 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/freezed/petstore_client_lib_fake/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..645aebf399f0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 DioException (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/freezed/petstore_client_lib_fake/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FileSchemaTestClass.md new file mode 100644 index 000000000000..d14ac319d294 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Foo.md new file mode 100644 index 000000000000..185b76e3f5b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FooGetDefaultResponse.md new file mode 100644 index 000000000000..10d0133abd95 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FooGetDefaultResponse.md @@ -0,0 +1,15 @@ +# openapi.model.FooGetDefaultResponse + +## 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/freezed/petstore_client_lib_fake/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/FormatTest.md new file mode 100644 index 000000000000..83b60545eb61 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/HasOnlyReadOnly.md new file mode 100644 index 000000000000..32cae937155d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/HealthCheckResult.md new file mode 100644 index 000000000000..4d6aeb75d965 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/MapTest.md new file mode 100644 index 000000000000..197fe780a25a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..66d0d39c42be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Model200Response.md new file mode 100644 index 000000000000..5aa3fb97c32e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ModelClient.md new file mode 100644 index 000000000000..f7b922f4a398 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ModelEnumClass.md new file mode 100644 index 000000000000..ebaafb44c7f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ModelFile.md new file mode 100644 index 000000000000..4be260e93f6e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ModelList.md new file mode 100644 index 000000000000..283aa1f6b711 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ModelReturn.md new file mode 100644 index 000000000000..bc02df7a3692 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/Name.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Name.md new file mode 100644 index 000000000000..25f49ea946b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/NullableClass.md new file mode 100644 index 000000000000..70ac1091d417 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/NumberOnly.md new file mode 100644 index 000000000000..d8096a3db37a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..dda2836d8d54 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/Order.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Order.md new file mode 100644 index 000000000000..bde5ffe51a2c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterComposite.md new file mode 100644 index 000000000000..04bab7eff5d1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterEnum.md new file mode 100644 index 000000000000..af62ad87ab2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..c1bf8b0dec44 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterEnumInteger.md new file mode 100644 index 000000000000..8c80a9e5c85f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..eb8b55d70249 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..eab2ae8f66b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/ParentWithNullable.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ParentWithNullable.md new file mode 100644 index 000000000000..17aa5ca02941 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ParentWithNullable.md @@ -0,0 +1,16 @@ +# openapi.model.ParentWithNullable + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | | [optional] +**nullableProperty** | **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/freezed/petstore_client_lib_fake/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Pet.md new file mode 100644 index 000000000000..3cd230bfb213 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/PetApi.md new file mode 100644 index 000000000000..5fc7fbd2657f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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/freezed/petstore_client_lib_fake/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/ReadOnlyFirst.md new file mode 100644 index 000000000000..8f612e8ba19f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/SingleRefType.md new file mode 100644 index 000000000000..0dc93840cd7f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/SingleRefType.md @@ -0,0 +1,14 @@ +# openapi.model.SingleRefType + +## 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/freezed/petstore_client_lib_fake/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/SpecialModelName.md new file mode 100644 index 000000000000..5fcfa98e0b36 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/StoreApi.md new file mode 100644 index 000000000000..42028947229f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 DioException (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 DioException (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 generate 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 DioException (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 DioException (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/freezed/petstore_client_lib_fake/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/Tag.md new file mode 100644 index 000000000000..c219f987c19c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/doc/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 000000000000..e2b2f1fd4468 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,15 @@ +# openapi.model.TestInlineFreeformAdditionalPropertiesRequest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProperty** | **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/freezed/petstore_client_lib_fake/doc/User.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/User.md new file mode 100644 index 000000000000..fa87e64d8595 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/User.md @@ -0,0 +1,22 @@ +# 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] + +[[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/freezed/petstore_client_lib_fake/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/doc/UserApi.md new file mode 100644 index 000000000000..49b79d76b8a1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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 DioException (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/freezed/petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/openapi.dart new file mode 100644 index 000000000000..53e0ea635366 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/openapi.dart @@ -0,0 +1,21 @@ +// +// 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/bearer_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/models.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api.dart new file mode 100644 index 000000000000..835b76584b2d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 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/freezed/petstore_client_lib_fake/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/another_fake_api.dart new file mode 100644 index 000000000000..0848266271ea --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/another_fake_api.dart @@ -0,0 +1,110 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient _responseData; + + + try { + _responseData = ModelClient.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/freezed/petstore_client_lib_fake/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/default_api.dart new file mode 100644 index 000000000000..1d8e607e18f3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/default_api.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [FooGetDefaultResponse] as data + /// Throws [DioException] 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, + ); + + FooGetDefaultResponse _responseData; + + + try { + _responseData = FooGetDefaultResponse.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/freezed/petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/fake_api.dart new file mode 100644 index 000000000000..33ae292a61e7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/fake_api.dart @@ -0,0 +1,1769 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.dart'; + + +class FakeApi { + + final Dio _dio; + + const FakeApi(this._dio); + + /// fakeBigDecimalMap + /// for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + /// + /// 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 [FakeBigDecimalMap200Response] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeBigDecimalMap({ + + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/BigDecimalMap'; + 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, + ); + + FakeBigDecimalMap200Response _responseData; + + + try { + _responseData = FakeBigDecimalMap200Response.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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, + ); + } + + /// 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 [DioException] 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 = HealthCheckResult.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 = body; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + bool _responseData; + + + try { + _responseData = _response.data as bool; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterComposite _responseData; + + + try { + _responseData = OuterComposite.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 = body; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + num _responseData; + + + try { + _responseData = _response.data as num; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 = body; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String _responseData; + + + try { + _responseData = _response.data as String; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterObjectWithEnumProperty _responseData; + + + try { + _responseData = OuterObjectWithEnumProperty.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 referenced 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 [DioException] if API call or serialization fails + Future> testAdditionalPropertiesReference({ + + required Map requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/additionalProperties-reference'; + 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// 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 [DioException] 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 = body?.finalize(); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient _responseData; + + + try { + _responseData = ModelClient.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = { + if (integer != null) r'integer': integer, + if (int32 != null) r'int32': int32, + if (int64 != null) r'int64': int64, + r'number': number, + if (float != null) r'float': float, + r'double': double_, + if (string != null) r'string': string, + r'pattern_without_delimiter': patternWithoutDelimiter, + r'byte': byte, + if (binary != null) r'binary': binary, + if (date != null) r'date': date, + if (dateTime != null) r'dateTime': dateTime, + if (password != null) r'password': password, + if (callback != null) r'callback': callback, + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = { + if (enumFormStringArray != null) r'enum_form_string_array': enumFormStringArray, + if (enumFormString != null) r'enum_form_string': enumFormString, + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test inline free-form additionalProperties + /// + /// + /// Parameters: + /// * [testInlineFreeformAdditionalPropertiesRequest] - 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 [DioException] if API call or serialization fails + Future> testInlineFreeformAdditionalProperties({ + + required TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/inline-freeform-additionalProperties'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData=jsonEncode(testInlineFreeformAdditionalPropertiesRequest); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = { + r'param': param, + r'param2': param2, + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test nullable parent property + /// + /// + /// Parameters: + /// * [childWithNullable] - 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 [DioException] if API call or serialization fails + Future> testNullable({ + + required ChildWithNullable childWithNullable, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/nullable'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData=jsonEncode(childWithNullable); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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; + } + + /// test referenced string map + /// + /// + /// 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 [DioException] if API call or serialization fails + Future> testStringMapReference({ + + required Map requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/stringMap-reference'; + 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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/freezed/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart new file mode 100644 index 000000000000..e4df96000116 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart @@ -0,0 +1,117 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient _responseData; + + + try { + _responseData = ModelClient.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/freezed/petstore_client_lib_fake/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/pet_api.dart new file mode 100644 index 000000000000..353d3b783c25 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/pet_api.dart @@ -0,0 +1,765 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 [DioException] if API call or serialization fails + Future>> findPetsByStatus({ + + @Deprecated('status is deprecated') 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 { + final _responseDataAsList = _response.data as List; + _responseData = _responseDataAsList.map((dynamic e)=> Pet.fromJson(e as Map)).toList(); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 { + final _responseDataAsSet = _response.data as List; + _responseData = _responseDataAsSet.map((dynamic e)=> Pet.fromJson(e as Map)).toSet(); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 = Pet.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = { + if (name != null) r'name': name, + if (status != null) r'status': status, + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = FormData.fromMap({ + if (additionalMetadata != null) + r'additionalMetadata': + + jsonEncode(additionalMetadata), + if (file != null) + r'file': + file + , + }); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse _responseData; + + + try { + _responseData = ApiResponse.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 { + _bodyData = FormData.fromMap({ + if (additionalMetadata != null) + r'additionalMetadata': + + jsonEncode(additionalMetadata), +r'requiredFile': + requiredFile + , + }); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse _responseData; + + + try { + _responseData = ApiResponse.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/freezed/petstore_client_lib_fake/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/store_api.dart new file mode 100644 index 000000000000..37987c684ef2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/store_api.dart @@ -0,0 +1,309 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [DioException] 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 [DioException] 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 = _response.data as Map; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 generate 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 [DioException] 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 = Order.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Order _responseData; + + + try { + _responseData = Order.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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/freezed/petstore_client_lib_fake/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/user_api.dart new file mode 100644 index 000000000000..a68b3f17dad1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/api/user_api.dart @@ -0,0 +1,536 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'dart:convert'; +import '../model/models.dart'; +import 'package:dio/dio.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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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 [DioException] 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 [DioException] 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 = User.fromJson(_response.data as Map); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 = _response.data as String; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + 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 [DioException] 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 [DioException] 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 DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + 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/freezed/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b65ccb5b71f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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']?.toLowerCase() == '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/freezed/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..8f46678761b2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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']?.toLowerCase() == '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/freezed/petstore_client_lib_fake/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart new file mode 100644 index 000000000000..12c438f0b974 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart @@ -0,0 +1,50 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// AdditionalPropertiesClass + /// + /// Properties: + /// * [mapProperty] + /// * [mapOfMapProperty] + +@freezed +class AdditionalPropertiesClass with _$AdditionalPropertiesClass { +const AdditionalPropertiesClass._(); + + + const factory AdditionalPropertiesClass({ + @JsonKey(name: r'map_property') + Map? + mapProperty, + @JsonKey(name: r'map_of_map_property') + Map? +>? + mapOfMapProperty, +}) = _AdditionalPropertiesClass; + + + + + factory AdditionalPropertiesClass.fromJson(Map json) => _$AdditionalPropertiesClassFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart new file mode 100644 index 000000000000..04b3738b81b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// AllOfWithSingleRef + /// + /// Properties: + /// * [username] + /// * [singleRefType] + +@freezed +class AllOfWithSingleRef with _$AllOfWithSingleRef { +const AllOfWithSingleRef._(); + + + const factory AllOfWithSingleRef({ + @JsonKey(name: r'username') + String? + username, + @JsonKey(name: r'SingleRefType') + SingleRefType? + singleRefType, +}) = _AllOfWithSingleRef; + + + + + factory AllOfWithSingleRef.fromJson(Map json) => _$AllOfWithSingleRefFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/animal.dart new file mode 100644 index 000000000000..ab4f4a5383c6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/animal.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Animal + /// + /// Properties: + /// * [className] + /// * [color] + +@freezed +class Animal with _$Animal { +const Animal._(); + + + const factory Animal.cat({ + required Cat cat, + }) = AnimalCat; + const factory Animal.dog({ + required Dog dog, + }) = AnimalDog; + const factory Animal.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([]) List possibleTypes, + @Default([]) List deserializedModels, + }) = AnimalUnknown; + + + + + factory Animal.fromJson(Map json) { + switch(json['className']){ + case 'CAT': + return Animal.cat( + cat : Cat.fromJson(json), + ); + case 'DOG': + return Animal.dog( + dog : Dog.fromJson(json), + ); + } + return Animal.unknown(json: json); + } + + + + + Map toJson() { + return when( + cat: (cat) => cat.toJson(), + dog: (dog) => dog.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/api_response.dart new file mode 100644 index 000000000000..e8608ad60603 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/api_response.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ApiResponse + /// + /// Properties: + /// * [code] + /// * [type] + /// * [message] + +@freezed +class ApiResponse with _$ApiResponse { +const ApiResponse._(); + + + const factory ApiResponse({ + @JsonKey(name: r'code') + int? + code, + @JsonKey(name: r'type') + String? + type, + @JsonKey(name: r'message') + String? + message, +}) = _ApiResponse; + + + + + factory ApiResponse.fromJson(Map json) => _$ApiResponseFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart new file mode 100644 index 000000000000..82381d375158 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ArrayOfArrayOfNumberOnly + /// + /// Properties: + /// * [arrayArrayNumber] + +@freezed +class ArrayOfArrayOfNumberOnly with _$ArrayOfArrayOfNumberOnly { +const ArrayOfArrayOfNumberOnly._(); + + + const factory ArrayOfArrayOfNumberOnly({ + @JsonKey(name: r'ArrayArrayNumber') + List< + List< + num? +>? +>? + arrayArrayNumber, +}) = _ArrayOfArrayOfNumberOnly; + + + + + factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfArrayOfNumberOnlyFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart new file mode 100644 index 000000000000..623dbe6d5d58 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ArrayOfNumberOnly + /// + /// Properties: + /// * [arrayNumber] + +@freezed +class ArrayOfNumberOnly with _$ArrayOfNumberOnly { +const ArrayOfNumberOnly._(); + + + const factory ArrayOfNumberOnly({ + @JsonKey(name: r'ArrayNumber') + List< + num? +>? + arrayNumber, +}) = _ArrayOfNumberOnly; + + + + + factory ArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfNumberOnlyFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_test.dart new file mode 100644 index 000000000000..1c793fc302a9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_test.dart @@ -0,0 +1,58 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ArrayTest + /// + /// Properties: + /// * [arrayOfString] + /// * [arrayArrayOfInteger] + /// * [arrayArrayOfModel] + +@freezed +class ArrayTest with _$ArrayTest { +const ArrayTest._(); + + + const factory ArrayTest({ + @JsonKey(name: r'array_of_string') + List< + String? +>? + arrayOfString, + @JsonKey(name: r'array_array_of_integer') + List< + List< + int? +>? +>? + arrayArrayOfInteger, + @JsonKey(name: r'array_array_of_model') + List< + List< + ReadOnlyFirst? +>? +>? + arrayArrayOfModel, +}) = _ArrayTest; + + + + + factory ArrayTest.fromJson(Map json) => _$ArrayTestFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/capitalization.dart new file mode 100644 index 000000000000..525d1f04e549 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/capitalization.dart @@ -0,0 +1,61 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Capitalization + /// + /// Properties: + /// * [smallCamel] + /// * [capitalCamel] + /// * [smallSnake] + /// * [capitalSnake] + /// * [sCAETHFlowPoints] + /// * [ATT_NAME] - Name of the pet + +@freezed +class Capitalization with _$Capitalization { +const Capitalization._(); + + + const factory Capitalization({ + @JsonKey(name: r'smallCamel') + String? + smallCamel, + @JsonKey(name: r'CapitalCamel') + String? + capitalCamel, + @JsonKey(name: r'small_Snake') + String? + smallSnake, + @JsonKey(name: r'Capital_Snake') + String? + capitalSnake, + @JsonKey(name: r'SCA_ETH_Flow_Points') + String? + sCAETHFlowPoints, + /// Name of the pet + @JsonKey(name: r'ATT_NAME') + String? + ATT_NAME, +}) = _Capitalization; + + + + + factory Capitalization.fromJson(Map json) => _$CapitalizationFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/cat.dart new file mode 100644 index 000000000000..a60babcaddc1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/cat.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Cat + /// + /// Properties: + /// * [className] + /// * [color] + /// * [declawed] + +@freezed +class Cat with _$Cat { +const Cat._(); + + + + const factory Cat({ + @JsonKey(name: r'className') + required String + className, + @JsonKey(name: r'color') + String? + color, + @JsonKey(name: r'declawed') + bool? + declawed, +}) = _Cat; + + + + factory Cat.fromJson(Map json) => _$CatFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/category.dart new file mode 100644 index 000000000000..5f4054076196 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/category.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Category + /// + /// Properties: + /// * [id] + /// * [name] + +@freezed +class Category with _$Category { +const Category._(); + + + const factory Category({ + @JsonKey(name: r'id') + int? + id, + @JsonKey(name: r'name') + required String + name, +}) = _Category; + + + + + factory Category.fromJson(Map json) => _$CategoryFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/child_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/child_with_nullable.dart new file mode 100644 index 000000000000..7b43ddac31c2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/child_with_nullable.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ChildWithNullable + /// + /// Properties: + /// * [type] + /// * [nullableProperty] + /// * [otherProperty] + +@freezed +class ChildWithNullable with _$ChildWithNullable { +const ChildWithNullable._(); + + + + const factory ChildWithNullable({ + @JsonKey(name: r'type') + ChildWithNullableTypeEnum? + type, + @JsonKey(name: r'nullableProperty') + String? + nullableProperty, + @JsonKey(name: r'otherProperty') + String? + otherProperty, +}) = _ChildWithNullable; + + + + factory ChildWithNullable.fromJson(Map json) => _$ChildWithNullableFromJson(json); + + + + + + + + +} + + + + +@JsonEnum(valueField: 'value') +enum ChildWithNullableTypeEnum { + childWithNullable(value: r'ChildWithNullable'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const ChildWithNullableTypeEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/class_model.dart new file mode 100644 index 000000000000..cb16c798fde3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/class_model.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Model for testing model with \"_class\" property + /// + /// Properties: + /// * [class_] + +@freezed +class ClassModel with _$ClassModel { +const ClassModel._(); + + + const factory ClassModel({ + @JsonKey(name: r'_class') + String? + class_, +}) = _ClassModel; + + + + + factory ClassModel.fromJson(Map json) => _$ClassModelFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/deprecated_object.dart new file mode 100644 index 000000000000..373d5863c1dd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/deprecated_object.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// DeprecatedObject + /// + /// Properties: + /// * [name] + +@freezed +class DeprecatedObject with _$DeprecatedObject { +const DeprecatedObject._(); + + + const factory DeprecatedObject({ + @JsonKey(name: r'name') + String? + name, +}) = _DeprecatedObject; + + + + + factory DeprecatedObject.fromJson(Map json) => _$DeprecatedObjectFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/dog.dart new file mode 100644 index 000000000000..9df086abe547 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/dog.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Dog + /// + /// Properties: + /// * [className] + /// * [color] + /// * [breed] + +@freezed +class Dog with _$Dog { +const Dog._(); + + + + const factory Dog({ + @JsonKey(name: r'className') + required String + className, + @JsonKey(name: r'color') + String? + color, + @JsonKey(name: r'breed') + String? + breed, +}) = _Dog; + + + + factory Dog.fromJson(Map json) => _$DogFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_arrays.dart new file mode 100644 index 000000000000..6fd9a450ca7b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_arrays.dart @@ -0,0 +1,65 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// EnumArrays + /// + /// Properties: + /// * [justSymbol] + /// * [arrayEnum] + +@freezed +class EnumArrays with _$EnumArrays { +const EnumArrays._(); + + + const factory EnumArrays({ + @JsonKey(name: r'just_symbol') + EnumArraysJustSymbolEnum? + justSymbol, + @JsonKey(name: r'array_enum') + List< + EnumArraysArrayEnumEnum? +>? + arrayEnum, +}) = _EnumArrays; + + + + + factory EnumArrays.fromJson(Map json) => _$EnumArraysFromJson(json); + + + + + + + + +} + + + + +@JsonEnum(valueField: 'value') +enum EnumArraysJustSymbolEnum { + greaterThanEqual(value: r'>='), + dollar(value: r'$'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumArraysJustSymbolEnum({required this.value}); + final String value; +} + + +@JsonEnum(valueField: 'value') +enum EnumArraysArrayEnumEnum { + fish(value: r'fish'), + crab(value: r'crab'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumArraysArrayEnumEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_test.dart new file mode 100644 index 000000000000..55b5cfe74ece --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_test.dart @@ -0,0 +1,106 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// EnumTest + /// + /// Properties: + /// * [enumString] + /// * [enumStringRequired] + /// * [enumInteger] + /// * [enumNumber] + /// * [outerEnum] + /// * [outerEnumInteger] + /// * [outerEnumDefaultValue] + /// * [outerEnumIntegerDefaultValue] + +@freezed +class EnumTest with _$EnumTest { +const EnumTest._(); + + + const factory EnumTest({ + @JsonKey(name: r'enum_string') + EnumTestEnumStringEnum? + enumString, + @JsonKey(name: r'enum_string_required') + required EnumTestEnumStringRequiredEnum + enumStringRequired, + @JsonKey(name: r'enum_integer') + EnumTestEnumIntegerEnum? + enumInteger, + @JsonKey(name: r'enum_number') + EnumTestEnumNumberEnum? + enumNumber, + @JsonKey(name: r'outerEnum') + OuterEnum? + outerEnum, + @JsonKey(name: r'outerEnumInteger') + OuterEnumInteger? + outerEnumInteger, + @JsonKey(name: r'outerEnumDefaultValue') + OuterEnumDefaultValue? + outerEnumDefaultValue, + @JsonKey(name: r'outerEnumIntegerDefaultValue') + OuterEnumIntegerDefaultValue? + outerEnumIntegerDefaultValue, +}) = _EnumTest; + + + + + factory EnumTest.fromJson(Map json) => _$EnumTestFromJson(json); + + + + + + + + +} + + + + +@JsonEnum(valueField: 'value') +enum EnumTestEnumStringEnum { + UPPER(value: r'UPPER'), + lower(value: r'lower'), + empty(value: r''), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumTestEnumStringEnum({required this.value}); + final String value; +} + +@JsonEnum(valueField: 'value') +enum EnumTestEnumStringRequiredEnum { + UPPER(value: r'UPPER'), + lower(value: r'lower'), + empty(value: r''), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumTestEnumStringRequiredEnum({required this.value}); + final String value; +} + +@JsonEnum(valueField: 'value') +enum EnumTestEnumIntegerEnum { + number1(value: 1), + numberNegative1(value: -1), + unknownDefaultOpenApi(value: 11184809); + const EnumTestEnumIntegerEnum({required this.value}); + final int value; +} + +@JsonEnum(valueField: 'value') +enum EnumTestEnumNumberEnum { + number1Period1(value: '1.1'), + numberNegative1Period2(value: '-1.2'), + unknownDefaultOpenApi(value: '11184809'); + const EnumTestEnumNumberEnum({required this.value}); + final double value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart new file mode 100644 index 000000000000..58f1f2fb2971 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FakeBigDecimalMap200Response + /// + /// Properties: + /// * [someId] + /// * [someMap] + +@freezed +class FakeBigDecimalMap200Response with _$FakeBigDecimalMap200Response { +const FakeBigDecimalMap200Response._(); + + + const factory FakeBigDecimalMap200Response({ + @JsonKey(name: r'someId') + num? + someId, + @JsonKey(name: r'someMap') + Map? + someMap, +}) = _FakeBigDecimalMap200Response; + + + + + factory FakeBigDecimalMap200Response.fromJson(Map json) => _$FakeBigDecimalMap200ResponseFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart new file mode 100644 index 000000000000..45eed25fb283 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FileSchemaTestClass + /// + /// Properties: + /// * [file] + /// * [files] + +@freezed +class FileSchemaTestClass with _$FileSchemaTestClass { +const FileSchemaTestClass._(); + + + const factory FileSchemaTestClass({ + @JsonKey(name: r'file') + ModelFile? + file, + @JsonKey(name: r'files') + List< + ModelFile? +>? + files, +}) = _FileSchemaTestClass; + + + + + factory FileSchemaTestClass.fromJson(Map json) => _$FileSchemaTestClassFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo.dart new file mode 100644 index 000000000000..e1d42e6f0a5a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Foo + /// + /// Properties: + /// * [bar] + +@freezed +class Foo with _$Foo { +const Foo._(); + + + const factory Foo({ + @JsonKey(name: r'bar') + String? + bar, +}) = _Foo; + + + + + factory Foo.fromJson(Map json) => _$FooFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart new file mode 100644 index 000000000000..06c214baa9e2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FooGetDefaultResponse + /// + /// Properties: + /// * [string] + +@freezed +class FooGetDefaultResponse with _$FooGetDefaultResponse { +const FooGetDefaultResponse._(); + + + const factory FooGetDefaultResponse({ + @JsonKey(name: r'string') + Foo? + string, +}) = _FooGetDefaultResponse; + + + + + factory FooGetDefaultResponse.fromJson(Map json) => _$FooGetDefaultResponseFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/format_test.dart new file mode 100644 index 000000000000..c5a2780e3aae --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/format_test.dart @@ -0,0 +1,102 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// FormatTest + /// + /// Properties: + /// * [integer] + /// * [int32] + /// * [int64] + /// * [number] + /// * [float] + /// * [double_] + /// * [decimal] + /// * [string] + /// * [byte] + /// * [binary] + /// * [date] + /// * [dateTime] + /// * [uuid] + /// * [password] + /// * [patternWithDigits] - A string that is a 10 digit number. Can have leading zeros. + /// * [patternWithDigitsAndDelimiter] - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + +@freezed +class FormatTest with _$FormatTest { +const FormatTest._(); + + + const factory FormatTest({ + @JsonKey(name: r'integer') + int? + integer, + @JsonKey(name: r'int32') + int? + int32, + @JsonKey(name: r'int64') + int? + int64, + @JsonKey(name: r'number') + required num + number, + @JsonKey(name: r'float') + double? + float, + @JsonKey(name: r'double') + double? + double_, + @JsonKey(name: r'decimal') + double? + decimal, + @JsonKey(name: r'string') + String? + string, + @JsonKey(name: r'byte') + required String + byte, + @JsonKey(name: r'binary') + MultipartFile? + binary, + @JsonKey(name: r'date') + required DateTime + date, + @JsonKey(name: r'dateTime') + DateTime? + dateTime, + @JsonKey(name: r'uuid') + String? + uuid, + @JsonKey(name: r'password') + required String + password, + /// A string that is a 10 digit number. Can have leading zeros. + @JsonKey(name: r'pattern_with_digits') + 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') + String? + patternWithDigitsAndDelimiter, +}) = _FormatTest; + + + + + factory FormatTest.fromJson(Map json) => _$FormatTestFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart new file mode 100644 index 000000000000..7761a7315928 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// HasOnlyReadOnly + /// + /// Properties: + /// * [bar] + /// * [foo] + +@freezed +class HasOnlyReadOnly with _$HasOnlyReadOnly { +const HasOnlyReadOnly._(); + + + const factory HasOnlyReadOnly({ + @JsonKey(name: r'bar') + String? + bar, + @JsonKey(name: r'foo') + String? + foo, +}) = _HasOnlyReadOnly; + + + + + factory HasOnlyReadOnly.fromJson(Map json) => _$HasOnlyReadOnlyFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/health_check_result.dart new file mode 100644 index 000000000000..9dfdbc5c1a82 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/health_check_result.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + /// Properties: + /// * [nullableMessage] + +@freezed +class HealthCheckResult with _$HealthCheckResult { +const HealthCheckResult._(); + + + const factory HealthCheckResult({ + @JsonKey(name: r'NullableMessage') + String? + nullableMessage, +}) = _HealthCheckResult; + + + + + factory HealthCheckResult.fromJson(Map json) => _$HealthCheckResultFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/map_test.dart new file mode 100644 index 000000000000..edeeb9fe5649 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/map_test.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// MapTest + /// + /// Properties: + /// * [mapMapOfString] + /// * [mapOfEnumString] + /// * [directMap] + /// * [indirectMap] + +@freezed +class MapTest with _$MapTest { +const MapTest._(); + + + const factory MapTest({ + @JsonKey(name: r'map_map_of_string') + Map? +>? + mapMapOfString, + @JsonKey(name: r'map_of_enum_string') + Map? + mapOfEnumString, + @JsonKey(name: r'direct_map') + Map? + directMap, + @JsonKey(name: r'indirect_map') + Map? + indirectMap, +}) = _MapTest; + + + + + factory MapTest.fromJson(Map json) => _$MapTestFromJson(json); + + + + + + + + +} + + + + + +@JsonEnum(valueField: 'value') +enum MapTestMapOfEnumStringEnum { + UPPER(value: r'UPPER'), + lower(value: r'lower'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const MapTestMapOfEnumStringEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart new file mode 100644 index 000000000000..eb12475fc3b7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -0,0 +1,50 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// MixedPropertiesAndAdditionalPropertiesClass + /// + /// Properties: + /// * [uuid] + /// * [dateTime] + /// * [map] + +@freezed +class MixedPropertiesAndAdditionalPropertiesClass with _$MixedPropertiesAndAdditionalPropertiesClass { +const MixedPropertiesAndAdditionalPropertiesClass._(); + + + const factory MixedPropertiesAndAdditionalPropertiesClass({ + @JsonKey(name: r'uuid') + String? + uuid, + @JsonKey(name: r'dateTime') + DateTime? + dateTime, + @JsonKey(name: r'map') + Map? + map, +}) = _MixedPropertiesAndAdditionalPropertiesClass; + + + + + factory MixedPropertiesAndAdditionalPropertiesClass.fromJson(Map json) => _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model200_response.dart new file mode 100644 index 000000000000..cbc0c625c0e9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model200_response.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Model for testing model name starting with number + /// + /// Properties: + /// * [name] + /// * [class_] + +@freezed +class Model200Response with _$Model200Response { +const Model200Response._(); + + + const factory Model200Response({ + @JsonKey(name: r'name') + int? + name, + @JsonKey(name: r'class') + String? + class_, +}) = _Model200Response; + + + + + factory Model200Response.fromJson(Map json) => _$Model200ResponseFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_client.dart new file mode 100644 index 000000000000..5e7d477fc2c5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_client.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ModelClient + /// + /// Properties: + /// * [client] + +@freezed +class ModelClient with _$ModelClient { +const ModelClient._(); + + + const factory ModelClient({ + @JsonKey(name: r'client') + String? + client, +}) = _ModelClient; + + + + + factory ModelClient.fromJson(Map json) => _$ModelClientFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_enum_class.dart new file mode 100644 index 000000000000..46f700a2c015 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_enum_class.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum ModelEnumClass { + abc(value: r'_abc'), + efg(value: r'-efg'), + leftParenthesisXyzRightParenthesis(value: r'(xyz)'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const ModelEnumClass({required this.value}); + final String value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_file.dart new file mode 100644 index 000000000000..7585fead5f37 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_file.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Must be named `File` for test. + /// + /// Properties: + /// * [sourceURI] - Test capitalization + +@freezed +class ModelFile with _$ModelFile { +const ModelFile._(); + + + const factory ModelFile({ + /// Test capitalization + @JsonKey(name: r'sourceURI') + String? + sourceURI, +}) = _ModelFile; + + + + + factory ModelFile.fromJson(Map json) => _$ModelFileFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_list.dart new file mode 100644 index 000000000000..5f9e176b5ffd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_list.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ModelList + /// + /// Properties: + /// * [n123list] + +@freezed +class ModelList with _$ModelList { +const ModelList._(); + + + const factory ModelList({ + @JsonKey(name: r'123-list') + String? + n123list, +}) = _ModelList; + + + + + factory ModelList.fromJson(Map json) => _$ModelListFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_return.dart new file mode 100644 index 000000000000..29d509a235cf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_return.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Model for testing reserved words + /// + /// Properties: + /// * [return_] + +@freezed +class ModelReturn with _$ModelReturn { +const ModelReturn._(); + + + const factory ModelReturn({ + @JsonKey(name: r'return') + int? + return_, +}) = _ModelReturn; + + + + + factory ModelReturn.fromJson(Map json) => _$ModelReturnFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/models.dart new file mode 100644 index 000000000000..1591d5519c42 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/models.dart @@ -0,0 +1,20 @@ +//ignore_for_file: invalid_annotation_target +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:dio/dio.dart'; +import 'dart:convert'; + +part 'models.freezed.dart'; +part 'models.g.dart'; + +part 'primitive_union_types.dart'; +part 'additional_properties_class.dart';part 'all_of_with_single_ref.dart';part 'animal.dart';part 'api_response.dart';part 'array_of_array_of_number_only.dart';part 'array_of_number_only.dart';part 'array_test.dart';part 'capitalization.dart';part 'cat.dart';part 'category.dart';part 'child_with_nullable.dart';part 'class_model.dart';part 'deprecated_object.dart';part 'dog.dart';part 'enum_arrays.dart';part 'enum_test.dart';part 'fake_big_decimal_map200_response.dart';part 'file_schema_test_class.dart';part 'foo.dart';part 'foo_get_default_response.dart';part 'format_test.dart';part 'has_only_read_only.dart';part 'health_check_result.dart';part 'map_test.dart';part 'mixed_properties_and_additional_properties_class.dart';part 'model200_response.dart';part 'model_client.dart';part 'model_enum_class.dart';part 'model_file.dart';part 'model_list.dart';part 'model_return.dart';part 'name.dart';part 'nullable_class.dart';part 'number_only.dart';part 'object_with_deprecated_fields.dart';part 'order.dart';part 'outer_composite.dart';part 'outer_enum.dart';part 'outer_enum_default_value.dart';part 'outer_enum_integer.dart';part 'outer_enum_integer_default_value.dart';part 'outer_object_with_enum_property.dart';part 'parent_with_nullable.dart';part 'pet.dart';part 'read_only_first.dart';part 'single_ref_type.dart';part 'special_model_name.dart';part 'tag.dart';part 'test_inline_freeform_additional_properties_request.dart';part 'user.dart'; + +/// A typedef used in the deserialization of OneOf and AnyOf +/// models when no discriminator mapping is provided. +typedef FromJsonMethodType = T Function(Map); + +/// Deserialization error types for OneOf and AnyOf types. +enum DeserializationErrorType { + MoreThanOneTypeSatisfied, + UnKnownType, +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/name.dart new file mode 100644 index 000000000000..2cf00d19f6e6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/name.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Model for testing model name same as property name + /// + /// Properties: + /// * [name] + /// * [snakeCase] + /// * [property] + /// * [n123number] + +@freezed +class Name with _$Name { +const Name._(); + + + const factory Name({ + @JsonKey(name: r'name') + required int + name, + @JsonKey(name: r'snake_case') + int? + snakeCase, + @JsonKey(name: r'property') + String? + property, + @JsonKey(name: r'123Number') + int? + n123number, +}) = _Name; + + + + + factory Name.fromJson(Map json) => _$NameFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/nullable_class.dart new file mode 100644 index 000000000000..d97933988453 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/nullable_class.dart @@ -0,0 +1,96 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// NullableClass + /// + /// Properties: + /// * [integerProp] + /// * [numberProp] + /// * [booleanProp] + /// * [stringProp] + /// * [dateProp] + /// * [datetimeProp] + /// * [arrayNullableProp] + /// * [arrayAndItemsNullableProp] + /// * [arrayItemsNullable] + /// * [objectNullableProp] + /// * [objectAndItemsNullableProp] + /// * [objectItemsNullable] + +@freezed +class NullableClass with _$NullableClass { +const NullableClass._(); + + + const factory NullableClass({ + @JsonKey(name: r'integer_prop') + int? + integerProp, + @JsonKey(name: r'number_prop') + num? + numberProp, + @JsonKey(name: r'boolean_prop') + bool? + booleanProp, + @JsonKey(name: r'string_prop') + String? + stringProp, + @JsonKey(name: r'date_prop') + DateTime? + dateProp, + @JsonKey(name: r'datetime_prop') + DateTime? + datetimeProp, + @JsonKey(name: r'array_nullable_prop') + List< + Object? +>? + arrayNullableProp, + @JsonKey(name: r'array_and_items_nullable_prop') + List< + Object? +>? + arrayAndItemsNullableProp, + @JsonKey(name: r'array_items_nullable') + List< + Object? +>? + arrayItemsNullable, + @JsonKey(name: r'object_nullable_prop') + Map? + objectNullableProp, + @JsonKey(name: r'object_and_items_nullable_prop') + Map? + objectAndItemsNullableProp, + @JsonKey(name: r'object_items_nullable') + Map? + objectItemsNullable, +}) = _NullableClass; + + + + + factory NullableClass.fromJson(Map json) => _$NullableClassFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/number_only.dart new file mode 100644 index 000000000000..6e59c27d03af --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/number_only.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// NumberOnly + /// + /// Properties: + /// * [justNumber] + +@freezed +class NumberOnly with _$NumberOnly { +const NumberOnly._(); + + + const factory NumberOnly({ + @JsonKey(name: r'JustNumber') + num? + justNumber, +}) = _NumberOnly; + + + + + factory NumberOnly.fromJson(Map json) => _$NumberOnlyFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart new file mode 100644 index 000000000000..8c78bdadaf8b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ObjectWithDeprecatedFields + /// + /// Properties: + /// * [uuid] + /// * [id] + /// * [deprecatedRef] + /// * [bars] + +@freezed +class ObjectWithDeprecatedFields with _$ObjectWithDeprecatedFields { +const ObjectWithDeprecatedFields._(); + + + const factory ObjectWithDeprecatedFields({ + @JsonKey(name: r'uuid') + String? + uuid, + @JsonKey(name: r'id') + num? + id, + @JsonKey(name: r'deprecatedRef') + DeprecatedObject? + deprecatedRef, + @JsonKey(name: r'bars') + List< + String? +>? + bars, +}) = _ObjectWithDeprecatedFields; + + + + + factory ObjectWithDeprecatedFields.fromJson(Map json) => _$ObjectWithDeprecatedFieldsFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/order.dart new file mode 100644 index 000000000000..543d035c9fa3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/order.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Order + /// + /// Properties: + /// * [id] + /// * [petId] + /// * [quantity] + /// * [shipDate] + /// * [status] - Order Status + /// * [complete] + +@freezed +class Order with _$Order { +const Order._(); + + + const factory Order({ + @JsonKey(name: r'id') + int? + id, + @JsonKey(name: r'petId') + int? + petId, + @JsonKey(name: r'quantity') + int? + quantity, + @JsonKey(name: r'shipDate') + DateTime? + shipDate, + /// Order Status + @JsonKey(name: r'status') + OrderStatusEnum? + status, + @JsonKey(name: r'complete') + bool? + complete, +}) = _Order; + + + + + factory Order.fromJson(Map json) => _$OrderFromJson(json); + + + + + + + + +} + + + + /// Order Status +@JsonEnum(valueField: 'value') +enum OrderStatusEnum { + placed(value: r'placed'), + approved(value: r'approved'), + delivered(value: r'delivered'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const OrderStatusEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_composite.dart new file mode 100644 index 000000000000..b683fc76db42 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_composite.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// OuterComposite + /// + /// Properties: + /// * [myNumber] + /// * [myString] + /// * [myBoolean] + +@freezed +class OuterComposite with _$OuterComposite { +const OuterComposite._(); + + + const factory OuterComposite({ + @JsonKey(name: r'my_number') + num? + myNumber, + @JsonKey(name: r'my_string') + String? + myString, + @JsonKey(name: r'my_boolean') + bool? + myBoolean, +}) = _OuterComposite; + + + + + factory OuterComposite.fromJson(Map json) => _$OuterCompositeFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum.dart new file mode 100644 index 000000000000..d1fbeffabb32 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum OuterEnum { + placed(value: r'placed'), + approved(value: r'approved'), + delivered(value: r'delivered'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const OuterEnum({required this.value}); + final String value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart new file mode 100644 index 000000000000..40b234a78af5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum OuterEnumDefaultValue { + placed(value: r'placed'), + approved(value: r'approved'), + delivered(value: r'delivered'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const OuterEnumDefaultValue({required this.value}); + final String value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart new file mode 100644 index 000000000000..ed4e09fba4bf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum OuterEnumInteger { + number0(value: 0), + number1(value: 1), + number2(value: 2), + unknownDefaultOpenApi(value: 11184809); + const OuterEnumInteger({required this.value}); + final int value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart new file mode 100644 index 000000000000..cc4104b1dd49 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum OuterEnumIntegerDefaultValue { + number0(value: 0), + number1(value: 1), + number2(value: 2), + unknownDefaultOpenApi(value: 11184809); + const OuterEnumIntegerDefaultValue({required this.value}); + final int value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart new file mode 100644 index 000000000000..9a7e946faecf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// OuterObjectWithEnumProperty + /// + /// Properties: + /// * [value] + +@freezed +class OuterObjectWithEnumProperty with _$OuterObjectWithEnumProperty { +const OuterObjectWithEnumProperty._(); + + + const factory OuterObjectWithEnumProperty({ + @JsonKey(name: r'value') + required OuterEnumInteger + value, +}) = _OuterObjectWithEnumProperty; + + + + + factory OuterObjectWithEnumProperty.fromJson(Map json) => _$OuterObjectWithEnumPropertyFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/parent_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/parent_with_nullable.dart new file mode 100644 index 000000000000..f4ebcfe43f60 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/parent_with_nullable.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ParentWithNullable + /// + /// Properties: + /// * [type] + /// * [nullableProperty] + +@freezed +class ParentWithNullable with _$ParentWithNullable { +const ParentWithNullable._(); + + + const factory ParentWithNullable.childwithnullable({ + required ChildWithNullable childWithNullable, + }) = ParentWithNullableChildwithnullable; + const factory ParentWithNullable.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + @Default([]) List possibleTypes, + @Default([]) List deserializedModels, + }) = ParentWithNullableUnknown; + + + + + factory ParentWithNullable.fromJson(Map json) { + switch(json['type']){ + case 'ChildWithNullable': + return ParentWithNullable.childwithnullable( + childWithNullable : ChildWithNullable.fromJson(json), + ); + } + return ParentWithNullable.unknown(json: json); + } + + + + + Map toJson() { + return when( + childwithnullable: (childWithNullable) => childWithNullable.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + + + + +} + + + + +@JsonEnum(valueField: 'value') +enum ParentWithNullableTypeEnum { + childWithNullable(value: r'ChildWithNullable'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const ParentWithNullableTypeEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/pet.dart new file mode 100644 index 000000000000..bf4bbab02440 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/pet.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Pet + /// + /// Properties: + /// * [id] + /// * [category] + /// * [name] + /// * [photoUrls] + /// * [tags] + /// * [status] - pet status in the store + +@freezed +class Pet with _$Pet { +const Pet._(); + + + const factory Pet({ + @JsonKey(name: r'id') + int? + id, + @JsonKey(name: r'category') + Category? + category, + @JsonKey(name: r'name') + required String + name, + @JsonKey(name: r'photoUrls') + required Set< + String? +> + photoUrls, + @JsonKey(name: r'tags') + List< + Tag? +>? + tags, + /// pet status in the store + @JsonKey(name: r'status') + PetStatusEnum? + status, +}) = _Pet; + + + + + factory Pet.fromJson(Map json) => _$PetFromJson(json); + + + + + + + + +} + + + + /// pet status in the store +@JsonEnum(valueField: 'value') +enum PetStatusEnum { + available(value: r'available'), + pending(value: r'pending'), + sold(value: r'sold'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const PetStatusEnum({required this.value}); + final String value; +} + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/primitive_union_types.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/primitive_union_types.dart new file mode 100644 index 000000000000..fafa083471b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/primitive_union_types.dart @@ -0,0 +1,60 @@ +part of 'models.dart'; + +@freezed +class IntInUnion with _$IntInUnion{ + const factory IntInUnion({ + required int intValue + }) = _IntInUnion; + + factory IntInUnion.fromJson(Map json) => _$IntInUnionFromJson(json); +} + +@freezed +class StringInUnion with _$StringInUnion{ + const factory StringInUnion({ + required String stringValue + }) = _StringInUnion; + + factory StringInUnion.fromJson(Map json) => _$StringInUnionFromJson(json); +} +@freezed +class BoolInUnion with _$BoolInUnion{ + const factory BoolInUnion({ + required bool boolValue + }) = _BoolInUnion; + + factory BoolInUnion.fromJson(Map json) => _$BoolInUnionFromJson(json); +} + +@freezed +class DoubleInUnion with _$DoubleInUnion{ + const factory DoubleInUnion({ + required double doubleValue + }) = _DoubleInUnion; + + factory DoubleInUnion.fromJson(Map json) => _$DoubleInUnionFromJson(json); +} + +@freezed +class ObjectInUnion with _$ObjectInUnion { + const factory ObjectInUnion({required Object objectValue}) = _ObjectInUnion; + + factory ObjectInUnion.fromJson(Map json) => + _$ObjectInUnionFromJson(json); +} + +@freezed +class NumInUnion with _$NumInUnion{ + const factory NumInUnion({required num numValue}) = _NumInUnion; + + factory NumInUnion.fromJson(Map json) => _$NumInUnionFromJson(json); +} + +@freezed +class DateTimeInUnion with _$DateTimeInUnion { +const factory DateTimeInUnion({required DateTime dateTimeValue}) = +_DateTimeInUnion; + +factory DateTimeInUnion.fromJson(Map json) => +_$DateTimeInUnionFromJson(json); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/read_only_first.dart new file mode 100644 index 000000000000..95486163ea5f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/read_only_first.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// ReadOnlyFirst + /// + /// Properties: + /// * [bar] + /// * [baz] + +@freezed +class ReadOnlyFirst with _$ReadOnlyFirst { +const ReadOnlyFirst._(); + + + const factory ReadOnlyFirst({ + @JsonKey(name: r'bar') + String? + bar, + @JsonKey(name: r'baz') + String? + baz, +}) = _ReadOnlyFirst; + + + + + factory ReadOnlyFirst.fromJson(Map json) => _$ReadOnlyFirstFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/single_ref_type.dart new file mode 100644 index 000000000000..098b49b176e0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/single_ref_type.dart @@ -0,0 +1,16 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + + +@JsonEnum(valueField: 'value') +enum SingleRefType { + admin(value: r'admin'), + user(value: r'user'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const SingleRefType({required this.value}); + final String value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/special_model_name.dart new file mode 100644 index 000000000000..6919aa67e9cb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/special_model_name.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// SpecialModelName + /// + /// Properties: + /// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] + +@freezed +class SpecialModelName with _$SpecialModelName { +const SpecialModelName._(); + + + const factory SpecialModelName({ + @JsonKey(name: r'$special[property.name]') + int? + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, +}) = _SpecialModelName; + + + + + factory SpecialModelName.fromJson(Map json) => _$SpecialModelNameFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/tag.dart new file mode 100644 index 000000000000..ecf57fea0818 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/tag.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Tag + /// + /// Properties: + /// * [id] + /// * [name] + +@freezed +class Tag with _$Tag { +const Tag._(); + + + const factory Tag({ + @JsonKey(name: r'id') + int? + id, + @JsonKey(name: r'name') + String? + name, +}) = _Tag; + + + + + factory Tag.fromJson(Map json) => _$TagFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/test_inline_freeform_additional_properties_request.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/test_inline_freeform_additional_properties_request.dart new file mode 100644 index 000000000000..931a021a8cd9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/test_inline_freeform_additional_properties_request.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// TestInlineFreeformAdditionalPropertiesRequest + /// + /// Properties: + /// * [someProperty] + +@freezed +class TestInlineFreeformAdditionalPropertiesRequest with _$TestInlineFreeformAdditionalPropertiesRequest { +const TestInlineFreeformAdditionalPropertiesRequest._(); + + + const factory TestInlineFreeformAdditionalPropertiesRequest({ + @JsonKey(name: r'someProperty') + String? + someProperty, +}) = _TestInlineFreeformAdditionalPropertiesRequest; + + + + + factory TestInlineFreeformAdditionalPropertiesRequest.fromJson(Map json) => _$TestInlineFreeformAdditionalPropertiesRequestFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/user.dart new file mode 100644 index 000000000000..06bc9e1c887d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/user.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// User + /// + /// Properties: + /// * [id] + /// * [username] + /// * [firstName] + /// * [lastName] + /// * [email] + /// * [password] + /// * [phone] + /// * [userStatus] - User Status + +@freezed +class User with _$User { +const User._(); + + + const factory User({ + @JsonKey(name: r'id') + int? + id, + @JsonKey(name: r'username') + String? + username, + @JsonKey(name: r'firstName') + String? + firstName, + @JsonKey(name: r'lastName') + String? + lastName, + @JsonKey(name: r'email') + String? + email, + @JsonKey(name: r'password') + String? + password, + @JsonKey(name: r'phone') + String? + phone, + /// User Status + @JsonKey(name: r'userStatus') + int? + userStatus, +}) = _User; + + + + + factory User.fromJson(Map json) => _$UserFromJson(json); + + + + + + + + +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/pubspec.yaml new file mode 100644 index 000000000000..12925113115d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/pubspec.yaml @@ -0,0 +1,18 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '^3.0.0' + +dependencies: + dio: '^5.2.0' + freezed_annotation: '^2.4.4' + json_annotation: '^4.9.0' + +dev_dependencies: + freezed: '^2.5.2' + json_serializable: '^6.8.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/additional_properties_class_test.dart new file mode 100644 index 000000000000..fd8299fb998f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 AdditionalPropertiesClass? instance = /* AdditionalPropertiesClass(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart new file mode 100644 index 000000000000..ad5da909f6e3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AllOfWithSingleRef +void main() { + final AllOfWithSingleRef? instance = /* AllOfWithSingleRef(...) */ null; + // TODO add properties to the entity + + group(AllOfWithSingleRef, () { + // String username + test('to test the property `username`', () async { + // TODO + }); + + // SingleRefType singleRefType + test('to test the property `singleRefType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/animal_test.dart new file mode 100644 index 000000000000..83c65b22bfc3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/animal_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Animal +void main() { + final Animal? instance = /* Animal(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/another_fake_api_test.dart new file mode 100644 index 000000000000..ddafef2a831b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/api_response_test.dart new file mode 100644 index 000000000000..9487afd7f58c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 ApiResponse? instance = /* ApiResponse(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart new file mode 100644 index 000000000000..79c0d3f3bba8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 ArrayOfArrayOfNumberOnly? instance = /* ArrayOfArrayOfNumberOnly(...) */ null; + // TODO add properties to the entity + + group(ArrayOfArrayOfNumberOnly, () { + // List> arrayArrayNumber + test('to test the property `arrayArrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/array_of_number_only_test.dart new file mode 100644 index 000000000000..d80be97cf147 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 ArrayOfNumberOnly? instance = /* ArrayOfNumberOnly(...) */ null; + // TODO add properties to the entity + + group(ArrayOfNumberOnly, () { + // List arrayNumber + test('to test the property `arrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/array_test_test.dart new file mode 100644 index 000000000000..bfe7c84fd122 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 ArrayTest? instance = /* ArrayTest(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/capitalization_test.dart new file mode 100644 index 000000000000..156b0ee4993c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/capitalization_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Capitalization +void main() { + final Capitalization? instance = /* Capitalization(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/cat_test.dart new file mode 100644 index 000000000000..0a8811bd37f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/cat_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Cat +void main() { + final Cat? instance = /* Cat(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/category_test.dart new file mode 100644 index 000000000000..0ed6921ae7fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/category_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Category +void main() { + final Category? instance = /* Category(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/child_with_nullable_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/child_with_nullable_test.dart new file mode 100644 index 000000000000..ce2afd9a8a6e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/child_with_nullable_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ChildWithNullable +void main() { + final ChildWithNullable? instance = /* ChildWithNullable(...) */ null; + // TODO add properties to the entity + + group(ChildWithNullable, () { + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String nullableProperty + test('to test the property `nullableProperty`', () async { + // TODO + }); + + // String otherProperty + test('to test the property `otherProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/class_model_test.dart new file mode 100644 index 000000000000..e2dda7bab74e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 ClassModel? instance = /* ClassModel(...) */ null; + // TODO add properties to the entity + + group(ClassModel, () { + // String class_ + test('to test the property `class_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/default_api_test.dart new file mode 100644 index 000000000000..f079565f9785 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/deprecated_object_test.dart new file mode 100644 index 000000000000..1b2214668577 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 DeprecatedObject? instance = /* DeprecatedObject(...) */ null; + // TODO add properties to the entity + + group(DeprecatedObject, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/dog_test.dart new file mode 100644 index 000000000000..98097bd4bf25 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/dog_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Dog +void main() { + final Dog? instance = /* Dog(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/enum_arrays_test.dart new file mode 100644 index 000000000000..30d12204ba17 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 EnumArrays? instance = /* EnumArrays(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/enum_test_test.dart new file mode 100644 index 000000000000..befb9901ce9d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 EnumTest? instance = /* EnumTest(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/fake_api_test.dart new file mode 100644 index 000000000000..67950bf50ce9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/fake_api_test.dart @@ -0,0 +1,183 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FakeApi +void main() { + final instance = Openapi().getFakeApi(); + + group(FakeApi, () { + // for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + // + //Future fakeBigDecimalMap() async + test('test fakeBigDecimalMap', () async { + // TODO + }); + + // 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 + }); + + // test referenced additionalProperties + // + // + // + //Future testAdditionalPropertiesReference(Map requestBody) async + test('test testAdditionalPropertiesReference', () 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 inline free-form additionalProperties + // + // + // + //Future testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) async + test('test testInlineFreeformAdditionalProperties', () async { + // TODO + }); + + // test json serialization of form data + // + // + // + //Future testJsonFormData(String param, String param2) async + test('test testJsonFormData', () async { + // TODO + }); + + // test nullable parent property + // + // + // + //Future testNullable(ChildWithNullable childWithNullable) async + test('test testNullable', () 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 + }); + + // test referenced string map + // + // + // + //Future testStringMapReference(Map requestBody) async + test('test testStringMapReference', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/fake_big_decimal_map200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/fake_big_decimal_map200_response_test.dart new file mode 100644 index 000000000000..1279b8d0ff25 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/fake_big_decimal_map200_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FakeBigDecimalMap200Response +void main() { + final FakeBigDecimalMap200Response? instance = /* FakeBigDecimalMap200Response(...) */ null; + // TODO add properties to the entity + + group(FakeBigDecimalMap200Response, () { + // num someId + test('to test the property `someId`', () async { + // TODO + }); + + // Map someMap + test('to test the property `someMap`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart new file mode 100644 index 000000000000..3075147f52fd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/file_schema_test_class_test.dart new file mode 100644 index 000000000000..2ccd0d450ce7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 FileSchemaTestClass? instance = /* FileSchemaTestClass(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/foo_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/foo_get_default_response_test.dart new file mode 100644 index 000000000000..4282326fe61f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/foo_get_default_response_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooGetDefaultResponse +void main() { + final FooGetDefaultResponse? instance = /* FooGetDefaultResponse(...) */ null; + // TODO add properties to the entity + + group(FooGetDefaultResponse, () { + // Foo string + test('to test the property `string`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/foo_test.dart new file mode 100644 index 000000000000..28ae9a5b5e13 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/foo_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final Foo? instance = /* Foo(...) */ null; + // TODO add properties to the entity + + group(Foo, () { + // String bar (default value: 'bar') + test('to test the property `bar`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/format_test_test.dart new file mode 100644 index 000000000000..b08838d81a37 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 FormatTest? instance = /* FormatTest(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/has_only_read_only_test.dart new file mode 100644 index 000000000000..d72429a31bb5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 HasOnlyReadOnly? instance = /* HasOnlyReadOnly(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/health_check_result_test.dart new file mode 100644 index 000000000000..b2b48337b76c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 HealthCheckResult? instance = /* HealthCheckResult(...) */ null; + // TODO add properties to the entity + + group(HealthCheckResult, () { + // String nullableMessage + test('to test the property `nullableMessage`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/map_test_test.dart new file mode 100644 index 000000000000..909415df7540 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 MapTest? instance = /* MapTest(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart new file mode 100644 index 000000000000..0115f01ed6be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 MixedPropertiesAndAdditionalPropertiesClass? instance = /* MixedPropertiesAndAdditionalPropertiesClass(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model200_response_test.dart new file mode 100644 index 000000000000..de8cf3037b6b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 Model200Response? instance = /* Model200Response(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_client_test.dart new file mode 100644 index 000000000000..44faf62f15b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 ModelClient? instance = /* ModelClient(...) */ null; + // TODO add properties to the entity + + group(ModelClient, () { + // String client + test('to test the property `client`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_enum_class_test.dart new file mode 100644 index 000000000000..03e5855bf004 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_file_test.dart new file mode 100644 index 000000000000..8ea65f6ccb41 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 ModelFile? instance = /* ModelFile(...) */ null; + // TODO add properties to the entity + + group(ModelFile, () { + // Test capitalization + // String sourceURI + test('to test the property `sourceURI`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_list_test.dart new file mode 100644 index 000000000000..f748eee993ac --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 ModelList? instance = /* ModelList(...) */ null; + // TODO add properties to the entity + + group(ModelList, () { + // String n123list + test('to test the property `n123list`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/model_return_test.dart new file mode 100644 index 000000000000..cfc17807c151 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 ModelReturn? instance = /* ModelReturn(...) */ null; + // TODO add properties to the entity + + group(ModelReturn, () { + // int return_ + test('to test the property `return_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/name_test.dart new file mode 100644 index 000000000000..4f3f7f633728 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/name_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Name +void main() { + final Name? instance = /* Name(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/nullable_class_test.dart new file mode 100644 index 000000000000..0ab76167983b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 NullableClass? instance = /* NullableClass(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/number_only_test.dart new file mode 100644 index 000000000000..12b19c59dfb7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 NumberOnly? instance = /* NumberOnly(...) */ null; + // TODO add properties to the entity + + group(NumberOnly, () { + // num justNumber + test('to test the property `justNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart new file mode 100644 index 000000000000..e197bd0ad807 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 ObjectWithDeprecatedFields? instance = /* ObjectWithDeprecatedFields(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/order_test.dart new file mode 100644 index 000000000000..45b02097daed --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/order_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Order +void main() { + final Order? instance = /* Order(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_composite_test.dart new file mode 100644 index 000000000000..a5f0172ba21c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 OuterComposite? instance = /* OuterComposite(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_enum_default_value_test.dart new file mode 100644 index 000000000000..502c8326be58 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart new file mode 100644 index 000000000000..c535fe8ac354 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_enum_integer_test.dart new file mode 100644 index 000000000000..d945bc8c489d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_enum_test.dart new file mode 100644 index 000000000000..8e11eb02fb8a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart new file mode 100644 index 000000000000..3d72c6188e17 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 OuterObjectWithEnumProperty? instance = /* OuterObjectWithEnumProperty(...) */ null; + // TODO add properties to the entity + + group(OuterObjectWithEnumProperty, () { + // OuterEnumInteger value + test('to test the property `value`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/parent_with_nullable_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/parent_with_nullable_test.dart new file mode 100644 index 000000000000..b501d4220624 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/parent_with_nullable_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ParentWithNullable +void main() { + final ParentWithNullable? instance = /* ParentWithNullable(...) */ null; + // TODO add properties to the entity + + group(ParentWithNullable, () { + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String nullableProperty + test('to test the property `nullableProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/pet_api_test.dart new file mode 100644 index 000000000000..85a28bcfbe53 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/pet_test.dart new file mode 100644 index 000000000000..20b5e3e06735 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/pet_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pet +void main() { + final Pet? instance = /* Pet(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/read_only_first_test.dart new file mode 100644 index 000000000000..bcefd75befb6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 ReadOnlyFirst? instance = /* ReadOnlyFirst(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/single_ref_type_test.dart new file mode 100644 index 000000000000..5cd85add393e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/single_ref_type_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SingleRefType +void main() { + + group(SingleRefType, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/special_model_name_test.dart new file mode 100644 index 000000000000..23b58324ef99 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 SpecialModelName? instance = /* SpecialModelName(...) */ null; + // TODO add properties to the entity + + group(SpecialModelName, () { + // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/store_api_test.dart new file mode 100644 index 000000000000..08f7f738043b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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 generate 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/freezed/petstore_client_lib_fake/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/tag_test.dart new file mode 100644 index 000000000000..ffe49b3179c3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/tag_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Tag +void main() { + final Tag? instance = /* Tag(...) */ null; + // TODO add properties to the entity + + 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/freezed/petstore_client_lib_fake/test/test_inline_freeform_additional_properties_request_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/test_inline_freeform_additional_properties_request_test.dart new file mode 100644 index 000000000000..8c60d3f11f36 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/test_inline_freeform_additional_properties_request_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for TestInlineFreeformAdditionalPropertiesRequest +void main() { + final TestInlineFreeformAdditionalPropertiesRequest? instance = /* TestInlineFreeformAdditionalPropertiesRequest(...) */ null; + // TODO add properties to the entity + + group(TestInlineFreeformAdditionalPropertiesRequest, () { + // String someProperty + test('to test the property `someProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/user_api_test.dart new file mode 100644 index 000000000000..4bf28b67623b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/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/freezed/petstore_client_lib_fake/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/user_test.dart new file mode 100644 index 000000000000..847b14196b93 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/test/user_test.dart @@ -0,0 +1,52 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for User +void main() { + final User? instance = /* User(...) */ null; + // TODO add properties to the entity + + 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 + }); + + }); +} From d000309410577a2aa5bb54ac3b8e70f4168f640a Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 7 Sep 2024 08:48:33 +0200 Subject: [PATCH 43/48] chore: add github workflow file for samples. --- .github/workflows/samples-dart-freezed.yaml | 39 +++++++++++++++++++++ .github/workflows/samples-dart.yaml | 2 ++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/samples-dart-freezed.yaml diff --git a/.github/workflows/samples-dart-freezed.yaml b/.github/workflows/samples-dart-freezed.yaml new file mode 100644 index 000000000000..4b66b55e5007 --- /dev/null +++ b/.github/workflows/samples-dart-freezed.yaml @@ -0,0 +1,39 @@ +name: Samples Dart + +on: + push: + branches: + - master + - '[5-9]+.[0-9]+.x' + pull_request: + branches: + - master + - '[5-9]+.[0-9]+.x' + paths: + - 'samples/openapi3/client/petstore/dart*/freezed' + +jobs: + tests-dart: + name: Tests Dart + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 11 + cache: maven + - name: Cache test dependencies + uses: actions/cache@v4 + env: + cache-name: pub-cache + with: + path: $PUB_CACHE + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('samples/**/pubspec.*') }} + - uses: dart-lang/setup-dart@v1 + with: + sdk: 3.0.0 + - name: Run tests + uses: ./.github/actions/run-samples + with: + name: samples.dart diff --git a/.github/workflows/samples-dart.yaml b/.github/workflows/samples-dart.yaml index 02b6c487ac88..177261a25086 100644 --- a/.github/workflows/samples-dart.yaml +++ b/.github/workflows/samples-dart.yaml @@ -11,6 +11,8 @@ on: - '[5-9]+.[0-9]+.x' paths: - 'samples/openapi3/client/petstore/dart*/**' + - '!samples/openapi3/client/petstore/dart*/freezed' + jobs: tests-dart: From 8367bf23f3f3ae07b40ad8903ab1f44cb7e32e3a Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Tue, 7 Oct 2025 17:20:53 +0200 Subject: [PATCH 44/48] Fixes the missing discriminator mapping logic. Also handled the cases for anyOF models and models whose descriminators are defined in the parent class. --- .../languages/DartDioClientCodegen.java | 1 + ...using_discriminator_mapping_value.mustache | 6 + .../freezed_union_for_oneof_anyof.mustache | 34 ++++ .../parse_json_iteratively.mustache | 41 +++++ .../to_json_oneof_anyof.mustache | 21 +++ .../freezed/class_factory.mustache | 79 ++++----- .../freezed/class_from_json.mustache | 154 +++++++++--------- .../freezed/class_to_json.mustache | 31 ++-- 8 files changed, 219 insertions(+), 148 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/freezed_union_for_oneof_anyof.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/parse_json_iteratively.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/to_json_oneof_anyof.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 99015f11f4b4..0bc43f7ef953 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -24,6 +24,7 @@ import lombok.Getter; import lombok.Setter; import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.CodegenDiscriminator.MappedModel; import org.openapitools.codegen.api.TemplatePathLocator; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value.mustache new file mode 100644 index 000000000000..1147c41a6a03 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value.mustache @@ -0,0 +1,6 @@ +{{#mappedModels}} + case '{{mappingName}}': + return {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}Value : {{modelName}}.fromJson(json), + ); +{{/mappedModels}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/freezed_union_for_oneof_anyof.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/freezed_union_for_oneof_anyof.mustache new file mode 100644 index 000000000000..bffbb0d993bc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/freezed_union_for_oneof_anyof.mustache @@ -0,0 +1,34 @@ +{{#anyOf}} + const factory {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}({ + required {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}} {{#lambda.camelcase}}{{{.}}}Value{{/lambda.camelcase}} + }) = {{classname}}As{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}; +{{/anyOf}} +{{#oneOf}} + const factory {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}({ + required {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}} {{#lambda.camelcase}}{{{.}}}Value{{/lambda.camelcase}} + }) = {{classname}}As{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}; +{{/oneOf}} +{{! Sometimes discrintors are mentioned in parent classes}} +{{! TODO: Following block is doesn't handle duplicated mapping of models. Not sure how to handle that yet. For example red_apple and green_apple both mapping to Apple model.}} +{{^anyOf}} + {{^oneOf}} + {{#mappedModels}} + const factory {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}({ + required {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{modelName}}{{/PrimitiveInUnion}}{{/lambda.titlecase}} {{#lambda.camelcase}}{{modelName}}Value{{/lambda.camelcase}} + }) = {{classname}}As{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}; + {{/mappedModels}} + {{/oneOf}} +{{/anyOf}} +const factory {{classname}}.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + + @Default([{{#anyOf}}{{{.}}},{{/anyOf}}{{#oneOf}}{{{.}}},{{/oneOf}}]) + List possibleTypes, + + @Default(<{{classname}}>[]) + List<{{classname}}> deserializedModels, +}) = {{classname}}Unknown; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/parse_json_iteratively.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/parse_json_iteratively.mustache new file mode 100644 index 000000000000..0cab7b060962 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/parse_json_iteratively.mustache @@ -0,0 +1,41 @@ +final fromJsonMethods = >[{{#anyOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/anyOf}}{{#oneOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/oneOf}}]; +final deserializedModels = <{{classname}}>[]; +for (final fromJsonMethod in fromJsonMethods) { + try { + final dynamic parsedModel= fromJsonMethod.call(json); + // Note following line won't be executed if already the above parsing fails. + {{#anyOf}} + if (parsedModel is {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) { + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel, + ); + } else + {{/anyOf}} + {{#oneOf}} + if (parsedModel is {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) { + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel, + ); + } else + {{/oneOf}} + { + deserializedModel = {{classname}}.unknown(json: json); + } + deserializedModels.add(deserializedModel); + } catch (e) { + // We are suppressing the deserialization error when the json could not + // be parsed into one of the model. Because we return [{{classname}}.unknown] + // if the deserialization fails. + } +} +// Return an unknown type when the incoming json parses into more than one models. +// Since we pass deserializedModels, clients can still use the deserialized model. +// EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. +// So we still return this as an unknown type. +if(deserializedModels.length > 1){ + deserializedModel = {{classname}}.unknown( + json: json, + deserializedModels: deserializedModels, + errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, + ); +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/to_json_oneof_anyof.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/to_json_oneof_anyof.mustache new file mode 100644 index 000000000000..d12c9e1b3365 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/to_json_oneof_anyof.mustache @@ -0,0 +1,21 @@ +Map toJson() { + return when( + {{#anyOf}} + as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: (as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) => as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.toJson(), + {{/anyOf}} + {{#oneOf}} + as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: (as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) => as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.toJson(), + {{/oneOf}} + {{! Sometimes discrintors are mentioned in parent classes}} + {{! TODO: Following block is doesn't handle duplicated mapping of models. Not sure how to handle that yet. For example red_apple and green_apple both mapping to Apple model.}} + {{^anyOf}} + {{^oneOf}} + {{#mappedModels}} + as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: (as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) => as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.toJson(), + {{/mappedModels}} + {{/oneOf}} + {{/anyOf}} + {{! adds an unknown case to handle one Of}} + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache index 6dba8b93d1e6..bd469ecc2f13 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache @@ -4,19 +4,14 @@ {{/hasDiscriminatorWithNonEmptyMapping}} {{#hasDiscriminatorWithNonEmptyMapping}} {{#discriminator}} - {{#mappedModels}} - const factory {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}({ - required {{modelName}} {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}, - }) = {{classname}}{{#lambda.titlecase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.titlecase}}; - {{/mappedModels}} - const factory {{classname}}.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([{{#anyOf}}{{{.}}},{{/anyOf}}{{#oneOf}}{{{.}}},{{/oneOf}}]) List possibleTypes, - @Default(<{{classname}}>[]) List<{{classname}}> deserializedModels, - }) = {{classname}}Unknown; + // Path 1 + {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} + {{/discriminator}} + {{^discriminator}} + {{#vendorExtensions.x-parent-discriminator}} + // Path 2 + {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} + {{/vendorExtensions.x-parent-discriminator}} {{/discriminator}} {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-pure}} @@ -24,51 +19,43 @@ {{^vendorExtensions.x-is-pure}} {{#vendorExtensions.x-is-child}} {{^hasDiscriminatorWithNonEmptyMapping}} + // Path 3 {{>serialization/freezed/class_factory_general}} {{/hasDiscriminatorWithNonEmptyMapping}} + {{#hasDiscriminatorWithNonEmptyMapping}} + {{#discriminator}} + // Path 4 + {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} + {{/discriminator}} + {{^discriminator}} + {{#vendorExtensions.x-parent-discriminator}} + // Path 5 + {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} + {{/vendorExtensions.x-parent-discriminator}} + {{/discriminator}} + {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-child}} {{/vendorExtensions.x-is-pure}} {{^vendorExtensions.x-is-pure}} {{#hasDiscriminatorWithNonEmptyMapping}} - {{#discriminator}} - {{#mappedModels}} - const factory {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}({ - required {{modelName}} {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}, - }) = {{classname}}{{#lambda.titlecase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.titlecase}}; - {{/mappedModels}} - const factory {{classname}}.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([{{#anyOf}}{{{.}}},{{/anyOf}}{{#oneOf}}{{{.}}},{{/oneOf}}]) List possibleTypes, - @Default(<{{classname}}>[]) List<{{classname}}> deserializedModels, - }) = {{classname}}Unknown; - {{/discriminator}} + {{#discriminator}} + // Path 6 + {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} + {{/discriminator}} + {{^discriminator}} + {{#vendorExtensions.x-parent-discriminator}} + // Path 7 + {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} + {{/vendorExtensions.x-parent-discriminator}} + {{/discriminator}} {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-pure}} {{^vendorExtensions.x-is-pure}} {{^vendorExtensions.x-is-child}} {{^hasDiscriminatorWithNonEmptyMapping}} - {{#anyOf}} - const factory {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}({ - required {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}} {{#lambda.camelcase}}{{{.}}}Value{{/lambda.camelcase}} - }) = {{classname}}As{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}; - {{/anyOf}} - {{#oneOf}} - const factory {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}({ - required {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}} {{#lambda.camelcase}}{{{.}}}Value{{/lambda.camelcase}} - }) = {{classname}}As{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}; - {{/oneOf}} - const factory {{classname}}.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([{{#anyOf}}{{{.}}},{{/anyOf}}{{#oneOf}}{{{.}}},{{/oneOf}}]) List possibleTypes, - @Default(<{{classname}}>[]) List<{{classname}}> deserializedModels, - }) = {{classname}}Unknown; + // Path 8 + {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-child}} {{/vendorExtensions.x-is-pure}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache index e937bd72d231..9c9d27dea4e4 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache @@ -4,17 +4,33 @@ {{/hasDiscriminatorWithNonEmptyMapping}} {{#hasDiscriminatorWithNonEmptyMapping}} factory {{classname}}.fromJson(Map json) { - {{#discriminator}} - switch(json['{{propertyBaseName}}']){ - {{#mappedModels}} - case '{{mappingName}}': - return {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}( - {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} : {{modelName}}.fromJson(json), - ); - {{/mappedModels}} - } - {{/discriminator}} - return {{classname}}.unknown(json: json); + {{#discriminator}} + switch(json['{{propertyBaseName}}']){ + {{>serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value}} + } + return {{classname}}.unknown(json: json); + {{/discriminator}} + {{^discriminator}} + {{#vendorExtensions.x-parent-discriminator}} + // So we try to parse the json based on the discriminator value and try to + // return one of the valid model. Note: this approach tries + // to return one valid model and if more than one model + // is valid it then returns unknown type along with the json so the + // consumer can decide which model it is. + switch(json['{{propertyBaseName}}']){ + {{>serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value}} + default: + /// If deserializedModel is still null, then we try to parse + /// the json against all the models and try to return one of the valid model. + /// Note: this approach tries to return one valid model and if more than one model + /// is valid it then returns unknown type along with the json so + /// the consumer can decide which model it is. + {{classname}}? deserializedModel; + {{>serialization/freezed/additional_templates/parse_json_iteratively}} + return deserializedModel ?? {{classname}}.unknown(json: json); + } + {{/vendorExtensions.x-parent-discriminator}} + {{/discriminator}} } {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-pure}} @@ -27,51 +43,68 @@ {{/vendorExtensions.x-is-pure}} {{^vendorExtensions.x-is-pure}} -{{#hasDiscriminatorWithNonEmptyMapping}} - factory {{classname}}.fromJson(Map json) { - {{#discriminator}} - switch(json['{{propertyBaseName}}']){ - {{#mappedModels}} - case '{{mappingName}}': - return {{classname}}.{{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}( - {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}} : {{modelName}}.fromJson(json), - ); - {{/mappedModels}} - } - {{/discriminator}} - return {{classname}}.unknown(json: json); - } -{{/hasDiscriminatorWithNonEmptyMapping}} + {{#hasDiscriminatorWithNonEmptyMapping}} + factory {{classname}}.fromJson(Map json) { + {{#discriminator}} + switch(json['{{propertyBaseName}}']){ + {{>serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value}} + } + return {{classname}}.unknown(json: json); + {{/discriminator}} + {{^discriminator}} + {{#vendorExtensions.x-parent-discriminator}} + // So we try to parse the json based on the discriminator value and try to + // return one of the valid model. Note: this approach tries + // to return one valid model and if more than one model + // is valid it then returns unknown type along with the json so the + // consumer can decide which model it is. + switch(json['{{propertyBaseName}}']){ + {{>serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value}} + default: + /// If deserializedModel is still null, then we try to parse + /// the json against all the models and try to return one of the valid model. + /// Note: this approach tries to return one valid model and if more than one model + /// is valid it then returns unknown type along with the json so + /// the consumer can decide which model it is. + {{classname}}? deserializedModel; + {{>serialization/freezed/additional_templates/parse_json_iteratively}} + return deserializedModel ?? {{classname}}.unknown(json: json); + } + {{/vendorExtensions.x-parent-discriminator}} + {{/discriminator}} + } + {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-pure}} {{^vendorExtensions.x-is-pure}} {{^vendorExtensions.x-is-child}} {{^hasDiscriminatorWithNonEmptyMapping}} factory {{classname}}.fromJson(Map json) { - {{classname}}? deserializedModel; {{#discriminator}} + {{classname}}? deserializedModel; // A discriminator property is specified but no mapping // is provided in the spec, so we expect the property to // have the value of the name of the model. Model prefix & // suffix are ignored, as this is not known by the api provider switch(json['{{propertyBaseName}}']){ {{#anyOf}} - case '{{#DelModelNamePrefixSuffix}}{{{.}}}{{/DelModelNamePrefixSuffix}}': - deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( - {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.fromJson(json), - ); - break; + {{>serialization/freezed/additional_templates/case_parse_json_using_model_name}} + break; {{/anyOf}} {{#oneOf}} - case '{{#DelModelNamePrefixSuffix}}{{{.}}}{{/DelModelNamePrefixSuffix}}': - deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( - {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.fromJson(json), - ); - break; + {{>serialization/freezed/additional_templates/case_parse_json_using_model_name}} + break; {{/oneOf}} default: + /// If deserializedModel is still null, then we try to parse + /// the json against all the models and try to return one of the valid model. + /// Note: this approach tries to return one valid model and if more than one model + /// is valid it then returns unknown type along with the json so + /// the consumer can decide which model it is. + {{>serialization/freezed/additional_templates/parse_json_iteratively}} break; } + return deserializedModel ?? {{classname}}.unknown(json: json); {{/discriminator}} {{^discriminator}} // A discriminator property is not defined in the spec so @@ -80,51 +113,10 @@ // to return one valid model and if more than one model // is valid it then returns unknown type along with the json so // the consumer can decide which model it is. - final fromJsonMethods = >[{{#anyOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/anyOf}}{{#oneOf}}{{#lambda.titlecase}}{{#PrimitiveFromJson}}{{{.}}}{{/PrimitiveFromJson}}{{/lambda.titlecase}}.fromJson,{{/oneOf}}]; - final deserializedModels = <{{classname}}>[]; - for (final fromJsonMethod in fromJsonMethods) { - try { - final dynamic parsedModel= fromJsonMethod.call(json); - // Note following line won't be executed if already the above parsing fails. - {{#anyOf}} - if (parsedModel is {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) { - deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( - {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel, - ); - } else - {{/anyOf}} - {{#oneOf}} - if (parsedModel is {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) { - deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( - {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : parsedModel, - ); - } else - {{/oneOf}} - { - deserializedModel = {{classname}}.unknown(json: json); - } - deserializedModels.add(deserializedModel); - } catch (e) { - // We are suppressing the deserialization error when the json could not - // be parsed into one of the model. Because we return [{{classname}}.unknown] - // if the deserialization fails. - } - } - // Return an unknown type when the incoming json parses into more than one models. - // Since we pass deserializedModels, clients can still use the deserialized model. - // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. - // So we still return this as an unknown type. - if(deserializedModels.length > 1){ - deserializedModel = {{classname}}.unknown( - json: json, - deserializedModels: deserializedModels, - errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, - ); - } + {{classname}}? deserializedModel; + {{>serialization/freezed/additional_templates/parse_json_iteratively}} + return deserializedModel ?? {{classname}}.unknown(json: json); {{/discriminator}} - - - return deserializedModel ?? {{classname}}.unknown(json: json); } {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-child}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache index e42fb1f52540..351370206ca4 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache @@ -1,32 +1,21 @@ {{#hasDiscriminatorWithNonEmptyMapping}} {{#discriminator}} - Map toJson() { - return when( - {{#mappedModels}} - {{#lambda.camelcase}}{{#lambda.lowercase}}{{mappingName}}{{/lambda.lowercase}}{{/lambda.camelcase}}: ({{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}) => {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}.toJson(), - {{/mappedModels}} - {{! adds an unknown case to handle one Of}} - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } + // path 1 + {{>serialization/freezed/additional_templates/to_json_oneof_anyof}} + {{/discriminator}} + {{^discriminator}} + {{#vendorExtensions.x-parent-discriminator}} + // path 2 + {{>serialization/freezed/additional_templates/to_json_oneof_anyof}} + {{/vendorExtensions.x-parent-discriminator}} {{/discriminator}} {{/hasDiscriminatorWithNonEmptyMapping}} {{^vendorExtensions.x-is-pure}} {{^vendorExtensions.x-is-child}} {{^hasDiscriminatorWithNonEmptyMapping}} - Map toJson() { - return when( - {{#anyOf}} - as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: (as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) => as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.toJson(), - {{/anyOf}} - {{#oneOf}} - as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}: (as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}) => as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.toJson(), - {{/oneOf}} - {{! adds an unknown case to handle one Of}} - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } + // path 3 + {{>serialization/freezed/additional_templates/to_json_oneof_anyof}} {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-child}} {{/vendorExtensions.x-is-pure}} \ No newline at end of file From 2253da20134d662c4953aeef084e0dc3eed286de Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Wed, 8 Oct 2025 13:17:04 +0200 Subject: [PATCH 45/48] removes old comments and adds missing mustach reference back. --- ...json_using_discriminator_mapping_value.mustache | 4 ++-- .../case_parse_json_using_model_name.mustache | 14 ++++++++++++++ .../serialization/freezed/class_factory.mustache | 8 -------- .../serialization/freezed/class_from_json.mustache | 13 +++---------- .../serialization/freezed/class_to_json.mustache | 3 --- 5 files changed, 19 insertions(+), 23 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_model_name.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value.mustache index 1147c41a6a03..0c4e371b60ca 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value.mustache @@ -1,6 +1,6 @@ {{#mappedModels}} case '{{mappingName}}': - return {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( - {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}Value : {{modelName}}.fromJson(json), + return {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{modelName}}{{/lambda.camelcase}}Value : {{modelName}}.fromJson(json), ); {{/mappedModels}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_model_name.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_model_name.mustache new file mode 100644 index 000000000000..96711921f042 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/case_parse_json_using_model_name.mustache @@ -0,0 +1,14 @@ +{{#anyOf}} + case '{{#DelModelNamePrefixSuffix}}{{{.}}}{{/DelModelNamePrefixSuffix}}': + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.fromJson(json), + ); + break; +{{/anyOf}} +{{#oneOf}} + case '{{#DelModelNamePrefixSuffix}}{{{.}}}{{/DelModelNamePrefixSuffix}}': + deserializedModel = {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}( + {{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}Value : {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}.fromJson(json), + ); + break; +{{/oneOf}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache index bd469ecc2f13..3f5bd6b86fdf 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache @@ -4,12 +4,10 @@ {{/hasDiscriminatorWithNonEmptyMapping}} {{#hasDiscriminatorWithNonEmptyMapping}} {{#discriminator}} - // Path 1 {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} {{/discriminator}} {{^discriminator}} {{#vendorExtensions.x-parent-discriminator}} - // Path 2 {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} {{/vendorExtensions.x-parent-discriminator}} {{/discriminator}} @@ -19,17 +17,14 @@ {{^vendorExtensions.x-is-pure}} {{#vendorExtensions.x-is-child}} {{^hasDiscriminatorWithNonEmptyMapping}} - // Path 3 {{>serialization/freezed/class_factory_general}} {{/hasDiscriminatorWithNonEmptyMapping}} {{#hasDiscriminatorWithNonEmptyMapping}} {{#discriminator}} - // Path 4 {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} {{/discriminator}} {{^discriminator}} {{#vendorExtensions.x-parent-discriminator}} - // Path 5 {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} {{/vendorExtensions.x-parent-discriminator}} {{/discriminator}} @@ -40,12 +35,10 @@ {{^vendorExtensions.x-is-pure}} {{#hasDiscriminatorWithNonEmptyMapping}} {{#discriminator}} - // Path 6 {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} {{/discriminator}} {{^discriminator}} {{#vendorExtensions.x-parent-discriminator}} - // Path 7 {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} {{/vendorExtensions.x-parent-discriminator}} {{/discriminator}} @@ -54,7 +47,6 @@ {{^vendorExtensions.x-is-pure}} {{^vendorExtensions.x-is-child}} {{^hasDiscriminatorWithNonEmptyMapping}} - // Path 8 {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-child}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache index 9c9d27dea4e4..f9c12c8f8997 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_from_json.mustache @@ -6,7 +6,7 @@ factory {{classname}}.fromJson(Map json) { {{#discriminator}} switch(json['{{propertyBaseName}}']){ - {{>serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value}} + {{>serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value}} } return {{classname}}.unknown(json: json); {{/discriminator}} @@ -18,7 +18,7 @@ // is valid it then returns unknown type along with the json so the // consumer can decide which model it is. switch(json['{{propertyBaseName}}']){ - {{>serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value}} + {{>serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value}} default: /// If deserializedModel is still null, then we try to parse /// the json against all the models and try to return one of the valid model. @@ -47,7 +47,7 @@ factory {{classname}}.fromJson(Map json) { {{#discriminator}} switch(json['{{propertyBaseName}}']){ - {{>serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value}} + {{>serialization/freezed/additional_templates/case_parse_json_using_discriminator_mapping_value}} } return {{classname}}.unknown(json: json); {{/discriminator}} @@ -87,14 +87,7 @@ // have the value of the name of the model. Model prefix & // suffix are ignored, as this is not known by the api provider switch(json['{{propertyBaseName}}']){ - {{#anyOf}} - {{>serialization/freezed/additional_templates/case_parse_json_using_model_name}} - break; - {{/anyOf}} - {{#oneOf}} {{>serialization/freezed/additional_templates/case_parse_json_using_model_name}} - break; - {{/oneOf}} default: /// If deserializedModel is still null, then we try to parse /// the json against all the models and try to return one of the valid model. diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache index 351370206ca4..31cdf88a01a5 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_to_json.mustache @@ -1,11 +1,9 @@ {{#hasDiscriminatorWithNonEmptyMapping}} {{#discriminator}} - // path 1 {{>serialization/freezed/additional_templates/to_json_oneof_anyof}} {{/discriminator}} {{^discriminator}} {{#vendorExtensions.x-parent-discriminator}} - // path 2 {{>serialization/freezed/additional_templates/to_json_oneof_anyof}} {{/vendorExtensions.x-parent-discriminator}} {{/discriminator}} @@ -14,7 +12,6 @@ {{^vendorExtensions.x-is-pure}} {{^vendorExtensions.x-is-child}} {{^hasDiscriminatorWithNonEmptyMapping}} - // path 3 {{>serialization/freezed/additional_templates/to_json_oneof_anyof}} {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-child}} From e69686bc8bed731b3523e0e3c1d5414d9a5ae1ac Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Wed, 8 Oct 2025 17:54:29 +0200 Subject: [PATCH 46/48] Set all freezed unions to be Sealed classes. --- .../freezed_union_for_oneof_anyof.mustache | 4 ++++ .../libraries/dio/serialization/freezed/class.mustache | 5 ----- .../dio/serialization/freezed/class_factory.mustache | 10 ---------- .../freezed/class_factory_general.mustache | 4 ++++ 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/freezed_union_for_oneof_anyof.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/freezed_union_for_oneof_anyof.mustache index bffbb0d993bc..c7bb47d453a0 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/freezed_union_for_oneof_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/additional_templates/freezed_union_for_oneof_anyof.mustache @@ -1,3 +1,7 @@ +@freezed +sealed class {{classname}} with _${{classname}} { +const {{classname}}._(); + {{#anyOf}} const factory {{classname}}.as{{#lambda.titlecase}}{{#PrimitiveInUnion}}{{#lambda.camelcase}}{{{.}}}{{/lambda.camelcase}}{{/PrimitiveInUnion}}{{/lambda.titlecase}}({ required {{#lambda.titlecase}}{{#PrimitiveInUnion}}{{{.}}}{{/PrimitiveInUnion}}{{/lambda.titlecase}} {{#lambda.camelcase}}{{{.}}}Value{{/lambda.camelcase}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache index 3d2bcabe507e..b3b1ebfa08d6 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class.mustache @@ -9,11 +9,6 @@ part of 'models.dart'; {{/allVars}} {{/hasVars}} -@freezed -class {{classname}} with _${{classname}} { -const {{classname}}._(); - - {{>serialization/freezed/class_factory}} {{>serialization/freezed/class_from_json}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache index 3f5bd6b86fdf..9a2647243094 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory.mustache @@ -19,16 +19,6 @@ {{^hasDiscriminatorWithNonEmptyMapping}} {{>serialization/freezed/class_factory_general}} {{/hasDiscriminatorWithNonEmptyMapping}} - {{#hasDiscriminatorWithNonEmptyMapping}} - {{#discriminator}} - {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} - {{/discriminator}} - {{^discriminator}} - {{#vendorExtensions.x-parent-discriminator}} - {{>serialization/freezed/additional_templates/freezed_union_for_oneof_anyof}} - {{/vendorExtensions.x-parent-discriminator}} - {{/discriminator}} - {{/hasDiscriminatorWithNonEmptyMapping}} {{/vendorExtensions.x-is-child}} {{/vendorExtensions.x-is-pure}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory_general.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory_general.mustache index bdfb074a1f89..a625abfc8202 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory_general.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/class_factory_general.mustache @@ -1,3 +1,7 @@ +@freezed +class {{classname}} with _${{classname}} { +const {{classname}}._(); + const factory {{classname}}({ {{#vars}} {{#description}} From 7f80b9c8687d348759e76d7c9a4b0176e9a646b5 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Wed, 8 Oct 2025 17:56:23 +0200 Subject: [PATCH 47/48] Set all freezed unions to be Sealed classes. --- .../dio/serialization/freezed/response_models.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/response_models.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/response_models.mustache index 857b97c843f6..82852bdf7249 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/response_models.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/freezed/response_models.mustache @@ -4,7 +4,7 @@ part of 'models.dart'; {{#operations}} {{#operation}} @freezed - class {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data with _${{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data { + sealed class {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data with _${{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data { const {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data._(); {{#responses}} const factory {{#lambda.titlecase}}{{nickname}}{{/lambda.titlecase}}Data.as{{code}}{{^returnType}}Void{{/returnType}}({ From 9873202ceb8b0690f73a85374f570bc091832e92 Mon Sep 17 00:00:00 2001 From: Abhilash Chandran Date: Sat, 11 Oct 2025 08:27:18 +0200 Subject: [PATCH 48/48] Commit files after test running generate-samples.sh --- .../freezed/oneof/.openapi-generator/FILES | 8 +- .../freezed/oneof/.openapi-generator/VERSION | 2 +- .../petstore/dart-dio/freezed/oneof/README.md | 3 +- .../dart-dio/freezed/oneof/doc/Fruit.md | 1 + .../dart-dio/freezed/oneof/doc/Orange.md | 15 ++ .../freezed/oneof/lib/src/model/apple.dart | 18 +-- .../freezed/oneof/lib/src/model/banana.dart | 18 +-- .../freezed/oneof/lib/src/model/fruit.dart | 79 ++++++----- .../freezed/oneof/lib/src/model/models.dart | 2 +- .../freezed/oneof/lib/src/model/orange.dart | 34 +++++ .../dart-dio/freezed/oneof/pubspec.yaml | 5 +- .../freezed/oneof/test/orange_test.dart | 16 +++ .../.openapi-generator/FILES | 30 ++-- .../.openapi-generator/VERSION | 2 +- .../README.md | 5 +- .../doc/Animal.md | 16 +++ .../doc/Cat.md | 15 ++ .../doc/Dog.md | 15 ++ .../lib/src/model/addressable.dart | 24 ++-- .../lib/src/model/animal.dart | 100 ++++++++++++++ .../lib/src/model/apple.dart | 18 +-- .../lib/src/model/banana.dart | 18 +-- .../lib/src/model/bar.dart | 40 +++--- .../lib/src/model/bar_create.dart | 42 +++--- .../lib/src/model/bar_ref.dart | 44 +++--- .../lib/src/model/bar_ref_or_value.dart | 63 ++++----- .../lib/src/model/cat.dart | 34 +++++ .../lib/src/model/dog.dart | 34 +++++ .../lib/src/model/entity.dart | 130 +++++++++--------- .../lib/src/model/entity_ref.dart | 74 +++++----- .../lib/src/model/extensible.dart | 28 ++-- .../lib/src/model/foo.dart | 40 +++--- .../lib/src/model/foo_ref.dart | 46 +++---- .../lib/src/model/foo_ref_or_value.dart | 117 ++++++++++------ .../lib/src/model/fruit.dart | 74 +++++----- .../lib/src/model/models.dart | 2 +- .../lib/src/model/pasta.dart | 38 +++-- .../lib/src/model/pizza.dart | 38 +++-- .../lib/src/model/pizza_speziale.dart | 40 +++--- .../pubspec.yaml | 5 +- .../test/animal_test.dart | 21 +++ .../test/cat_test.dart | 16 +++ .../test/dog_test.dart | 16 +++ .../oneof_primitive/.openapi-generator/FILES | 4 - .../.openapi-generator/VERSION | 2 +- .../freezed/oneof_primitive/README.md | 2 +- .../oneof_primitive/lib/src/model/child.dart | 18 +-- .../lib/src/model/example.dart | 63 ++++----- .../freezed/oneof_primitive/pubspec.yaml | 5 +- .../.openapi-generator/FILES | 58 -------- .../.openapi-generator/VERSION | 2 +- .../petstore_client_lib_fake/README.md | 2 +- .../model/additional_properties_class.dart | 20 +-- .../lib/src/model/all_of_with_single_ref.dart | 20 +-- .../lib/src/model/animal.dart | 84 ++++++----- .../lib/src/model/api_response.dart | 22 ++- .../model/array_of_array_of_number_only.dart | 18 +-- .../lib/src/model/array_of_number_only.dart | 18 +-- .../lib/src/model/array_test.dart | 22 ++- .../lib/src/model/capitalization.dart | 30 ++-- .../lib/src/model/cat.dart | 22 ++- .../lib/src/model/category.dart | 20 +-- .../lib/src/model/child_with_nullable.dart | 37 ++--- .../lib/src/model/class_model.dart | 18 +-- .../lib/src/model/deprecated_object.dart | 18 +-- .../lib/src/model/dog.dart | 22 ++- .../lib/src/model/enum_arrays.dart | 54 ++++---- .../lib/src/model/enum_test.dart | 104 +++++++------- .../fake_big_decimal_map200_response.dart | 20 +-- .../lib/src/model/file_schema_test_class.dart | 20 +-- .../lib/src/model/foo.dart | 18 +-- .../src/model/foo_get_default_response.dart | 18 +-- .../lib/src/model/format_test.dart | 52 ++++--- .../lib/src/model/has_only_read_only.dart | 20 +-- .../lib/src/model/health_check_result.dart | 18 +-- .../lib/src/model/map_test.dart | 41 +++--- ...rties_and_additional_properties_class.dart | 22 ++- .../lib/src/model/model200_response.dart | 20 +-- .../lib/src/model/model_client.dart | 18 +-- .../lib/src/model/model_file.dart | 20 +-- .../lib/src/model/model_list.dart | 18 +-- .../lib/src/model/model_return.dart | 18 +-- .../lib/src/model/name.dart | 24 ++-- .../lib/src/model/nullable_class.dart | 40 +++--- .../lib/src/model/number_only.dart | 18 +-- .../model/object_with_deprecated_fields.dart | 24 ++-- .../lib/src/model/order.dart | 49 +++---- .../lib/src/model/outer_composite.dart | 22 ++- .../outer_object_with_enum_property.dart | 18 +-- .../lib/src/model/parent_with_nullable.dart | 83 ++++++----- .../lib/src/model/pet.dart | 49 +++---- .../lib/src/model/read_only_first.dart | 20 +-- .../lib/src/model/special_model_name.dart | 18 +-- .../lib/src/model/tag.dart | 20 +-- ...reeform_additional_properties_request.dart | 18 +-- .../lib/src/model/user.dart | 34 ++--- .../petstore_client_lib_fake/pubspec.yaml | 5 +- 97 files changed, 1385 insertions(+), 1451 deletions(-) create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Orange.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/orange.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/orange_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Animal.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Cat.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Dog.md create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/animal.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/cat.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/dog.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/animal_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/cat_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/dog_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/FILES index 38595461c322..2fc04eeca8a5 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md analysis_options.yaml build.yaml @@ -7,6 +6,7 @@ doc/Apple.md doc/Banana.md doc/DefaultApi.md doc/Fruit.md +doc/Orange.md lib/openapi.dart lib/src/api.dart lib/src/api/default_api.dart @@ -19,9 +19,7 @@ lib/src/model/apple.dart lib/src/model/banana.dart lib/src/model/fruit.dart lib/src/model/models.dart +lib/src/model/orange.dart lib/src/model/primitive_union_types.dart pubspec.yaml -test/apple_test.dart -test/banana_test.dart -test/default_api_test.dart -test/fruit_test.dart +test/orange_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/VERSION index 17f2442ff3bc..9e0e9bce84b2 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/.openapi-generator/VERSION @@ -1 +1 @@ -7.9.0-SNAPSHOT +7.17.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/README.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/README.md index e382c9ec6ea0..433ce79b90c3 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/README.md +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/README.md @@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 0.0.1 -- Generator version: 7.9.0-SNAPSHOT +- Generator version: 7.17.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.DartDioClientCodegen ## Requirements @@ -72,6 +72,7 @@ Class | Method | HTTP request | Description - [Apple](doc/Apple.md) - [Banana](doc/Banana.md) - [Fruit](doc/Fruit.md) + - [Orange](doc/Orange.md) ## Documentation For Authorization diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Fruit.md index 5d48cc6e6d38..5239c1160576 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Fruit.md +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Fruit.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **color** | **String** | | [optional] **kind** | **String** | | [optional] **count** | **num** | | [optional] +**sweet** | **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/freezed/oneof/doc/Orange.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Orange.md new file mode 100644 index 000000000000..a07836f00534 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/doc/Orange.md @@ -0,0 +1,15 @@ +# openapi.model.Orange + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sweet** | **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/freezed/oneof/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/apple.dart index 24e1d263d4c6..28f19b8a5ddb 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/apple.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/apple.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [kind] -@freezed -class Apple with _$Apple { -const Apple._(); - - + @freezed + class Apple with _$Apple { + const Apple._(); + const factory Apple({ - @JsonKey(name: r'kind') + @JsonKey(name: r'kind') String? kind, -}) = _Apple; - - + }) = _Apple; factory Apple.fromJson(Map json) => _$AppleFromJson(json); @@ -31,10 +28,7 @@ const Apple._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/banana.dart index 3d3bf3238989..e0b1850f002b 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/banana.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/banana.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [count] -@freezed -class Banana with _$Banana { -const Banana._(); - - + @freezed + class Banana with _$Banana { + const Banana._(); + const factory Banana({ - @JsonKey(name: r'count') + @JsonKey(name: r'count') num? count, -}) = _Banana; - - + }) = _Banana; factory Banana.fromJson(Map json) => _$BananaFromJson(json); @@ -31,10 +28,7 @@ const Banana._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/fruit.dart index 5e4dfbf65182..884ebb562460 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/fruit.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/fruit.dart @@ -11,47 +11,53 @@ part of 'models.dart'; /// * [color] /// * [kind] /// * [count] - -@freezed -class Fruit with _$Fruit { -const Fruit._(); - - - - - const factory Fruit.asApple({ - required Apple appleValue - }) = FruitAsApple; - const factory Fruit.asBanana({ - required Banana bananaValue - }) = FruitAsBanana; - const factory Fruit.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([Apple,Banana,]) List possibleTypes, - @Default([]) List deserializedModels, - }) = FruitUnknown; - - + /// * [sweet] + + + + @freezed + sealed class Fruit with _$Fruit { + const Fruit._(); + + const factory Fruit.asApple({ + required Apple appleValue + }) = FruitAsApple; + const factory Fruit.asBanana({ + required Banana bananaValue + }) = FruitAsBanana; + const factory Fruit.asOrange({ + required Orange orangeValue + }) = FruitAsOrange; + const factory Fruit.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + + @Default([Apple,Banana,Orange,]) + List possibleTypes, + + @Default([]) + List deserializedModels, + }) = FruitUnknown; factory Fruit.fromJson(Map json) { - Fruit? deserializedModel; // A discriminator property is not defined in the spec so // we try to parse the json against all the models and try to // return one of the valid model. Note: this approach tries // to return one valid model and if more than one model // is valid it then returns unknown type along with the json so // the consumer can decide which model it is. - final fromJsonMethods = >[Apple.fromJson,Banana.fromJson,]; + Fruit? deserializedModel; + final fromJsonMethods = >[Apple.fromJson,Banana.fromJson,Orange.fromJson,]; final deserializedModels = []; for (final fromJsonMethod in fromJsonMethods) { try { final dynamic parsedModel= fromJsonMethod.call(json); // Note following line won't be executed if already the above parsing fails. - if (parsedModel is Apple) { + if (parsedModel is Apple) { deserializedModel = Fruit.asApple( appleValue : parsedModel, ); @@ -61,6 +67,11 @@ const Fruit._(); bananaValue : parsedModel, ); } else + if (parsedModel is Orange) { + deserializedModel = Fruit.asOrange( + orangeValue : parsedModel, + ); + } else { deserializedModel = Fruit.unknown(json: json); } @@ -81,26 +92,20 @@ const Fruit._(); deserializedModels: deserializedModels, errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, ); - } - - - return deserializedModel ?? Fruit.unknown(json: json); + } return deserializedModel ?? Fruit.unknown(json: json); } - Map toJson() { return when( - asApple: (asApple) => asApple.toJson(), + asApple: (asApple) => asApple.toJson(), asBanana: (asBanana) => asBanana.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + asOrange: (asOrange) => asOrange.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, ); } - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/models.dart index 3669a6b40ac4..2ca05d7e966a 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/models.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/models.dart @@ -7,7 +7,7 @@ part 'models.freezed.dart'; part 'models.g.dart'; part 'primitive_union_types.dart'; -part 'apple.dart';part 'banana.dart';part 'fruit.dart'; +part 'apple.dart';part 'banana.dart';part 'fruit.dart';part 'orange.dart'; /// A typedef used in the deserialization of OneOf and AnyOf /// models when no discriminator mapping is provided. diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/orange.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/orange.dart new file mode 100644 index 000000000000..74af33183487 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/lib/src/model/orange.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Orange + /// + /// Properties: + /// * [sweet] + + @freezed + class Orange with _$Orange { + const Orange._(); + + const factory Orange({ + @JsonKey(name: r'sweet') + bool? + sweet, + }) = _Orange; + + + factory Orange.fromJson(Map json) => _$OrangeFromJson(json); + + + + + + +} + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/pubspec.yaml index 12925113115d..445bc9f8f04d 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/pubspec.yaml @@ -3,11 +3,12 @@ version: 1.0.0 description: OpenAPI API client homepage: homepage + environment: sdk: '^3.0.0' dependencies: - dio: '^5.2.0' + dio: '^5.7.0' freezed_annotation: '^2.4.4' json_annotation: '^4.9.0' @@ -15,4 +16,4 @@ dev_dependencies: freezed: '^2.5.2' json_serializable: '^6.8.0' build_runner: any - test: ^1.16.0 + test: '^1.16.0' diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/orange_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/orange_test.dart new file mode 100644 index 000000000000..f46011b6a10b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof/test/orange_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Orange +void main() { + final Orange? instance = /* Orange(...) */ null; + // TODO add properties to the entity + + group(Orange, () { + // bool sweet + test('to test the property `sweet`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/FILES index ba0ca88ef8b5..cbcb26ac79e1 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/FILES @@ -1,9 +1,9 @@ .gitignore -.openapi-generator-ignore README.md analysis_options.yaml build.yaml doc/Addressable.md +doc/Animal.md doc/Apple.md doc/Banana.md doc/Bar.md @@ -11,6 +11,8 @@ doc/BarApi.md doc/BarCreate.md doc/BarRef.md doc/BarRefOrValue.md +doc/Cat.md +doc/Dog.md doc/Entity.md doc/EntityRef.md doc/Extensible.md @@ -33,12 +35,15 @@ lib/src/auth/basic_auth.dart lib/src/auth/bearer_auth.dart lib/src/auth/oauth.dart lib/src/model/addressable.dart +lib/src/model/animal.dart lib/src/model/apple.dart lib/src/model/banana.dart lib/src/model/bar.dart lib/src/model/bar_create.dart lib/src/model/bar_ref.dart lib/src/model/bar_ref_or_value.dart +lib/src/model/cat.dart +lib/src/model/dog.dart lib/src/model/entity.dart lib/src/model/entity_ref.dart lib/src/model/extensible.dart @@ -53,23 +58,6 @@ lib/src/model/pizza.dart lib/src/model/pizza_speziale.dart lib/src/model/primitive_union_types.dart pubspec.yaml -test/addressable_test.dart -test/apple_test.dart -test/banana_test.dart -test/bar_api_test.dart -test/bar_create_test.dart -test/bar_ref_or_value_test.dart -test/bar_ref_test.dart -test/bar_test.dart -test/entity_ref_test.dart -test/entity_test.dart -test/extensible_test.dart -test/foo_api_test.dart -test/foo_ref_or_value_test.dart -test/foo_ref_test.dart -test/foo_test.dart -test/fruit_test.dart -test/fruit_type_test.dart -test/pasta_test.dart -test/pizza_speziale_test.dart -test/pizza_test.dart +test/animal_test.dart +test/cat_test.dart +test/dog_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION index 17f2442ff3bc..9e0e9bce84b2 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION @@ -1 +1 @@ -7.9.0-SNAPSHOT +7.17.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/README.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/README.md index 2b9a132c0aa7..5ecec7840099 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/README.md +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/README.md @@ -5,7 +5,7 @@ This tests for a oneOf interface representation This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 0.0.1 -- Generator version: 7.9.0-SNAPSHOT +- Generator version: 7.17.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.DartDioClientCodegen ## Requirements @@ -74,12 +74,15 @@ Class | Method | HTTP request | Description ## Documentation For Models - [Addressable](doc/Addressable.md) + - [Animal](doc/Animal.md) - [Apple](doc/Apple.md) - [Banana](doc/Banana.md) - [Bar](doc/Bar.md) - [BarCreate](doc/BarCreate.md) - [BarRef](doc/BarRef.md) - [BarRefOrValue](doc/BarRefOrValue.md) + - [Cat](doc/Cat.md) + - [Dog](doc/Dog.md) - [Entity](doc/Entity.md) - [EntityRef](doc/EntityRef.md) - [Extensible](doc/Extensible.md) diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Animal.md new file mode 100644 index 000000000000..b30398312c77 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/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 +------------ | ------------- | ------------- | ------------- +**bark** | **bool** | | [optional] +**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/freezed/oneof_polymorphism_and_inheritance/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Cat.md new file mode 100644 index 000000000000..c1c078d2b65e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Cat.md @@ -0,0 +1,15 @@ +# openapi.model.Cat + +## 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/freezed/oneof_polymorphism_and_inheritance/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Dog.md new file mode 100644 index 000000000000..c6cc069e2563 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/doc/Dog.md @@ -0,0 +1,15 @@ +# openapi.model.Dog + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bark** | **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/freezed/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart index ff1c69a84384..986158c15a64 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart @@ -11,23 +11,20 @@ part of 'models.dart'; /// * [href] - Hyperlink reference /// * [id] - unique identifier -@freezed -class Addressable with _$Addressable { -const Addressable._(); - - + @freezed + class Addressable with _$Addressable { + const Addressable._(); + const factory Addressable({ - /// Hyperlink reference - @JsonKey(name: r'href') + /// Hyperlink reference + @JsonKey(name: r'href') String? href, - /// unique identifier - @JsonKey(name: r'id') + /// unique identifier + @JsonKey(name: r'id') String? id, -}) = _Addressable; - - + }) = _Addressable; factory Addressable.fromJson(Map json) => _$AddressableFromJson(json); @@ -37,10 +34,7 @@ const Addressable._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/animal.dart new file mode 100644 index 000000000000..2f8aeff2012c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/animal.dart @@ -0,0 +1,100 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Animal + /// + /// Properties: + /// * [bark] + /// * [declawed] + + + + @freezed + sealed class Animal with _$Animal { + const Animal._(); + + const factory Animal.asCat({ + required Cat catValue + }) = AnimalAsCat; + const factory Animal.asDog({ + required Dog dogValue + }) = AnimalAsDog; + const factory Animal.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + + @Default([Cat,Dog,]) + List possibleTypes, + + @Default([]) + List deserializedModels, + }) = AnimalUnknown; + + + factory Animal.fromJson(Map json) { + // A discriminator property is not defined in the spec so + // we try to parse the json against all the models and try to + // return one of the valid model. Note: this approach tries + // to return one valid model and if more than one model + // is valid it then returns unknown type along with the json so + // the consumer can decide which model it is. + Animal? deserializedModel; + final fromJsonMethods = >[Cat.fromJson,Dog.fromJson,]; + final deserializedModels = []; + for (final fromJsonMethod in fromJsonMethods) { + try { + final dynamic parsedModel= fromJsonMethod.call(json); + // Note following line won't be executed if already the above parsing fails. + if (parsedModel is Cat) { + deserializedModel = Animal.asCat( + catValue : parsedModel, + ); + } else + if (parsedModel is Dog) { + deserializedModel = Animal.asDog( + dogValue : parsedModel, + ); + } else + { + deserializedModel = Animal.unknown(json: json); + } + deserializedModels.add(deserializedModel); + } catch (e) { + // We are suppressing the deserialization error when the json could not + // be parsed into one of the model. Because we return [Animal.unknown] + // if the deserialization fails. + } + } + // Return an unknown type when the incoming json parses into more than one models. + // Since we pass deserializedModels, clients can still use the deserialized model. + // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. + // So we still return this as an unknown type. + if(deserializedModels.length > 1){ + deserializedModel = Animal.unknown( + json: json, + deserializedModels: deserializedModels, + errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, + ); + } return deserializedModel ?? Animal.unknown(json: json); + } + + + Map toJson() { + return when( + asCat: (asCat) => asCat.toJson(), + asDog: (asDog) => asDog.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } + +} + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/apple.dart index 143bec0d76f1..14df49f70340 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/apple.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/apple.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [seeds] -@freezed -class Apple with _$Apple { -const Apple._(); - - + @freezed + class Apple with _$Apple { + const Apple._(); + const factory Apple({ - @JsonKey(name: r'seeds') + @JsonKey(name: r'seeds') required int seeds, -}) = _Apple; - - + }) = _Apple; factory Apple.fromJson(Map json) => _$AppleFromJson(json); @@ -31,10 +28,7 @@ const Apple._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/banana.dart index 9acc3dee8af8..b13824357890 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/banana.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/banana.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [length] -@freezed -class Banana with _$Banana { -const Banana._(); - - + @freezed + class Banana with _$Banana { + const Banana._(); + const factory Banana({ - @JsonKey(name: r'length') + @JsonKey(name: r'length') required int length, -}) = _Banana; - - + }) = _Banana; factory Banana.fromJson(Map json) => _$BananaFromJson(json); @@ -31,10 +28,7 @@ const Banana._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart index 20380a5d0872..69db1d9ba3b6 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart @@ -17,44 +17,41 @@ part of 'models.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -@freezed -class Bar with _$Bar { -const Bar._(); - - + @freezed + class Bar with _$Bar { + const Bar._(); + const factory Bar({ - @JsonKey(name: r'id') + @JsonKey(name: r'id') required String id, - @JsonKey(name: r'barPropA') + @JsonKey(name: r'barPropA') String? barPropA, - @JsonKey(name: r'fooPropB') + @JsonKey(name: r'fooPropB') String? fooPropB, - @JsonKey(name: r'foo') + @JsonKey(name: r'foo') FooRefOrValue? foo, - /// Hyperlink reference - @JsonKey(name: r'href') + /// Hyperlink reference + @JsonKey(name: r'href') String? href, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') String? atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') String? atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') required String atType, -}) = _Bar; - - + }) = _Bar; factory Bar.fromJson(Map json) => _$BarFromJson(json); @@ -63,10 +60,7 @@ const Bar._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart index e781be79aaf8..d9ffbcecbf39 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart @@ -17,45 +17,42 @@ part of 'models.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -@freezed -class BarCreate with _$BarCreate { -const BarCreate._(); - - + @freezed + class BarCreate with _$BarCreate { + const BarCreate._(); + const factory BarCreate({ - @JsonKey(name: r'barPropA') + @JsonKey(name: r'barPropA') String? barPropA, - @JsonKey(name: r'fooPropB') + @JsonKey(name: r'fooPropB') String? fooPropB, - @JsonKey(name: r'foo') + @JsonKey(name: r'foo') FooRefOrValue? foo, - /// Hyperlink reference - @JsonKey(name: r'href') + /// Hyperlink reference + @JsonKey(name: r'href') String? href, - /// unique identifier - @JsonKey(name: r'id') + /// unique identifier + @JsonKey(name: r'id') String? id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') String? atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') String? atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') required String atType, -}) = _BarCreate; - - + }) = _BarCreate; factory BarCreate.fromJson(Map json) => _$BarCreateFromJson(json); @@ -64,10 +61,7 @@ const BarCreate._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart index dfb59ba8a333..0b4e45e7b4b8 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart @@ -16,44 +16,41 @@ part of 'models.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -@freezed -class BarRef with _$BarRef { -const BarRef._(); - - + @freezed + class BarRef with _$BarRef { + const BarRef._(); + const factory BarRef({ - /// Name of the related entity. - @JsonKey(name: r'name') + /// Name of the related entity. + @JsonKey(name: r'name') String? name, - /// The actual type of the target instance when needed for disambiguation. - @JsonKey(name: r'@referredType') + /// The actual type of the target instance when needed for disambiguation. + @JsonKey(name: r'@referredType') String? atReferredType, - /// Hyperlink reference - @JsonKey(name: r'href') + /// Hyperlink reference + @JsonKey(name: r'href') String? href, - /// unique identifier - @JsonKey(name: r'id') + /// unique identifier + @JsonKey(name: r'id') String? id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') String? atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') String? atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') required String atType, -}) = _BarRef; - - + }) = _BarRef; factory BarRef.fromJson(Map json) => _$BarRefFromJson(json); @@ -62,10 +59,7 @@ const BarRef._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart index d0cb4074e229..677cb2400e47 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart @@ -19,46 +19,48 @@ part of 'models.dart'; /// * [name] - Name of the related entity. /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. -@freezed -class BarRefOrValue with _$BarRefOrValue { -const BarRefOrValue._(); - - - - - const factory BarRefOrValue.asBar({ - required Bar barValue - }) = BarRefOrValueAsBar; - const factory BarRefOrValue.asBarRef({ - required BarRef barRefValue - }) = BarRefOrValueAsBarRef; - const factory BarRefOrValue.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([Bar,BarRef,]) List possibleTypes, - @Default([]) List deserializedModels, - }) = BarRefOrValueUnknown; + @freezed + sealed class BarRefOrValue with _$BarRefOrValue { + const BarRefOrValue._(); + + const factory BarRefOrValue.asBar({ + required Bar barValue + }) = BarRefOrValueAsBar; + const factory BarRefOrValue.asBarRef({ + required BarRef barRefValue + }) = BarRefOrValueAsBarRef; + const factory BarRefOrValue.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + + @Default([Bar,BarRef,]) + List possibleTypes, + + @Default([]) + List deserializedModels, + }) = BarRefOrValueUnknown; factory BarRefOrValue.fromJson(Map json) { - BarRefOrValue? deserializedModel; // A discriminator property is not defined in the spec so // we try to parse the json against all the models and try to // return one of the valid model. Note: this approach tries // to return one valid model and if more than one model // is valid it then returns unknown type along with the json so // the consumer can decide which model it is. - final fromJsonMethods = >[Bar.fromJson,BarRef.fromJson,]; + BarRefOrValue? deserializedModel; + final fromJsonMethods = >[Bar.fromJson,BarRef.fromJson,]; final deserializedModels = []; for (final fromJsonMethod in fromJsonMethods) { try { final dynamic parsedModel= fromJsonMethod.call(json); // Note following line won't be executed if already the above parsing fails. - if (parsedModel is Bar) { + if (parsedModel is Bar) { deserializedModel = BarRefOrValue.asBar( barValue : parsedModel, ); @@ -88,26 +90,19 @@ const BarRefOrValue._(); deserializedModels: deserializedModels, errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, ); - } - - - return deserializedModel ?? BarRefOrValue.unknown(json: json); + } return deserializedModel ?? BarRefOrValue.unknown(json: json); } - Map toJson() { return when( - asBar: (asBar) => asBar.toJson(), + asBar: (asBar) => asBar.toJson(), asBarRef: (asBarRef) => asBarRef.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, ); } - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/cat.dart new file mode 100644 index 000000000000..0448cc5a570b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/cat.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Cat + /// + /// Properties: + /// * [declawed] + + @freezed + class Cat with _$Cat { + const Cat._(); + + const factory Cat({ + @JsonKey(name: r'declawed') + bool? + declawed, + }) = _Cat; + + + factory Cat.fromJson(Map json) => _$CatFromJson(json); + + + + + + +} + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/dog.dart new file mode 100644 index 000000000000..8efdc6314feb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/dog.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element, invalid_annotation_target +part of 'models.dart'; + +/// Dog + /// + /// Properties: + /// * [bark] + + @freezed + class Dog with _$Dog { + const Dog._(); + + const factory Dog({ + @JsonKey(name: r'bark') + bool? + bark, + }) = _Dog; + + + factory Dog.fromJson(Map json) => _$DogFromJson(json); + + + + + + +} + + + diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart index e1a6d61dfe82..fcc0e5854817 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart @@ -14,91 +14,89 @@ part of 'models.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -@freezed -class Entity with _$Entity { -const Entity._(); - - - const factory Entity.bar({ - required Bar bar, - }) = EntityBar; - const factory Entity.barCreate({ - required BarCreate barCreate, - }) = EntityBar_create; - const factory Entity.foo({ - required Foo foo, - }) = EntityFoo; - const factory Entity.pasta({ - required Pasta pasta, - }) = EntityPasta; - const factory Entity.pizza({ - required Pizza pizza, - }) = EntityPizza; - const factory Entity.pizzaspeziale({ - required PizzaSpeziale pizzaSpeziale, - }) = EntityPizzaspeziale; - const factory Entity.unknown({ + @freezed + sealed class Entity with _$Entity { + const Entity._(); + + const factory Entity.asBar({ + required Bar barValue + }) = EntityAsBar; + const factory Entity.asBarCreate({ + required BarCreate barCreateValue + }) = EntityAsBarCreate; + const factory Entity.asFoo({ + required Foo fooValue + }) = EntityAsFoo; + const factory Entity.asPasta({ + required Pasta pastaValue + }) = EntityAsPasta; + const factory Entity.asPizza({ + required Pizza pizzaValue + }) = EntityAsPizza; + const factory Entity.asPizzaSpeziale({ + required PizzaSpeziale pizzaSpezialeValue + }) = EntityAsPizzaSpeziale; + const factory Entity.unknown({ @Default('Json does not satisfy any available types') String message, required Map json, + @Default(DeserializationErrorType.UnKnownType) DeserializationErrorType errorType, - @Default([]) List possibleTypes, - @Default([]) List deserializedModels, + + @Default([]) + List possibleTypes, + + @Default([]) + List deserializedModels, }) = EntityUnknown; - - - factory Entity.fromJson(Map json) { - switch(json['@type']){ - case 'Bar': - return Entity.bar( - bar : Bar.fromJson(json), + factory Entity.fromJson(Map json) { + switch(json['@type']){ + case 'Bar': + return Entity.asBar( + barValue : Bar.fromJson(json), ); - case 'Bar_Create': - return Entity.barCreate( - barCreate : BarCreate.fromJson(json), + case 'Bar_Create': + return Entity.asBarCreate( + barCreateValue : BarCreate.fromJson(json), ); - case 'Foo': - return Entity.foo( - foo : Foo.fromJson(json), + case 'Foo': + return Entity.asFoo( + fooValue : Foo.fromJson(json), ); - case 'Pasta': - return Entity.pasta( - pasta : Pasta.fromJson(json), + case 'Pasta': + return Entity.asPasta( + pastaValue : Pasta.fromJson(json), ); - case 'Pizza': - return Entity.pizza( - pizza : Pizza.fromJson(json), + case 'Pizza': + return Entity.asPizza( + pizzaValue : Pizza.fromJson(json), ); - case 'PizzaSpeziale': - return Entity.pizzaspeziale( - pizzaSpeziale : PizzaSpeziale.fromJson(json), + case 'PizzaSpeziale': + return Entity.asPizzaSpeziale( + pizzaSpezialeValue : PizzaSpeziale.fromJson(json), ); - } - return Entity.unknown(json: json); - } - - - - Map toJson() { - return when( - bar: (bar) => bar.toJson(), - barCreate: (barCreate) => barCreate.toJson(), - foo: (foo) => foo.toJson(), - pasta: (pasta) => pasta.toJson(), - pizza: (pizza) => pizza.toJson(), - pizzaspeziale: (pizzaSpeziale) => pizzaSpeziale.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } + } + return Entity.unknown(json: json); + } + Map toJson() { + return when( + asBar: (asBar) => asBar.toJson(), + asBarCreate: (asBarCreate) => asBarCreate.toJson(), + asFoo: (asFoo) => asFoo.toJson(), + asPasta: (asPasta) => asPasta.toJson(), + asPizza: (asPizza) => asPizza.toJson(), + asPizzaSpeziale: (asPizzaSpeziale) => asPizzaSpeziale.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart index 9db823ea0619..fee53b08ca87 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart @@ -16,59 +16,57 @@ part of 'models.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -@freezed -class EntityRef with _$EntityRef { -const EntityRef._(); - - - const factory EntityRef.barref({ - required BarRef barRef, - }) = EntityRefBarref; - const factory EntityRef.fooref({ - required FooRef fooRef, - }) = EntityRefFooref; - const factory EntityRef.unknown({ + @freezed + sealed class EntityRef with _$EntityRef { + const EntityRef._(); + + const factory EntityRef.asBarRef({ + required BarRef barRefValue + }) = EntityRefAsBarRef; + const factory EntityRef.asFooRef({ + required FooRef fooRefValue + }) = EntityRefAsFooRef; + const factory EntityRef.unknown({ @Default('Json does not satisfy any available types') String message, required Map json, + @Default(DeserializationErrorType.UnKnownType) DeserializationErrorType errorType, - @Default([]) List possibleTypes, - @Default([]) List deserializedModels, + + @Default([]) + List possibleTypes, + + @Default([]) + List deserializedModels, }) = EntityRefUnknown; - - - factory EntityRef.fromJson(Map json) { - switch(json['@type']){ - case 'BarRef': - return EntityRef.barref( - barRef : BarRef.fromJson(json), + factory EntityRef.fromJson(Map json) { + switch(json['@type']){ + case 'BarRef': + return EntityRef.asBarRef( + barRefValue : BarRef.fromJson(json), ); - case 'FooRef': - return EntityRef.fooref( - fooRef : FooRef.fromJson(json), + case 'FooRef': + return EntityRef.asFooRef( + fooRefValue : FooRef.fromJson(json), ); - } - return EntityRef.unknown(json: json); - } - - - - Map toJson() { - return when( - barref: (barRef) => barRef.toJson(), - fooref: (fooRef) => fooRef.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } + } + return EntityRef.unknown(json: json); + } + Map toJson() { + return when( + asBarRef: (asBarRef) => asBarRef.toJson(), + asFooRef: (asFooRef) => asFooRef.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart index 258fa6502a3e..dc0fdb3a2070 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart @@ -12,27 +12,24 @@ part of 'models.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -@freezed -class Extensible with _$Extensible { -const Extensible._(); - - + @freezed + class Extensible with _$Extensible { + const Extensible._(); + const factory Extensible({ - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') String? atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') String? atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') required String atType, -}) = _Extensible; - - + }) = _Extensible; factory Extensible.fromJson(Map json) => _$ExtensibleFromJson(json); @@ -42,10 +39,7 @@ const Extensible._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart index ac75d3ce0192..f7800d15e550 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart @@ -16,42 +16,39 @@ part of 'models.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -@freezed -class Foo with _$Foo { -const Foo._(); - - + @freezed + class Foo with _$Foo { + const Foo._(); + const factory Foo({ - @JsonKey(name: r'fooPropA') + @JsonKey(name: r'fooPropA') String? fooPropA, - @JsonKey(name: r'fooPropB') + @JsonKey(name: r'fooPropB') String? fooPropB, - /// Hyperlink reference - @JsonKey(name: r'href') + /// Hyperlink reference + @JsonKey(name: r'href') String? href, - /// unique identifier - @JsonKey(name: r'id') + /// unique identifier + @JsonKey(name: r'id') String? id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') String? atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') String? atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') required String atType, -}) = _Foo; - - + }) = _Foo; factory Foo.fromJson(Map json) => _$FooFromJson(json); @@ -60,10 +57,7 @@ const Foo._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart index a2fbb1c3467a..b28b7807623d 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart @@ -17,47 +17,44 @@ part of 'models.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -@freezed -class FooRef with _$FooRef { -const FooRef._(); - - + @freezed + class FooRef with _$FooRef { + const FooRef._(); + const factory FooRef({ - @JsonKey(name: r'foorefPropA') + @JsonKey(name: r'foorefPropA') String? foorefPropA, - /// Name of the related entity. - @JsonKey(name: r'name') + /// Name of the related entity. + @JsonKey(name: r'name') String? name, - /// The actual type of the target instance when needed for disambiguation. - @JsonKey(name: r'@referredType') + /// The actual type of the target instance when needed for disambiguation. + @JsonKey(name: r'@referredType') String? atReferredType, - /// Hyperlink reference - @JsonKey(name: r'href') + /// Hyperlink reference + @JsonKey(name: r'href') String? href, - /// unique identifier - @JsonKey(name: r'id') + /// unique identifier + @JsonKey(name: r'id') String? id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') String? atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') String? atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') required String atType, -}) = _FooRef; - - + }) = _FooRef; factory FooRef.fromJson(Map json) => _$FooRefFromJson(json); @@ -66,10 +63,7 @@ const FooRef._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart index 66ef0d5c90d9..fd5fba328f05 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart @@ -19,70 +19,107 @@ part of 'models.dart'; /// * [name] - Name of the related entity. /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. -@freezed -class FooRefOrValue with _$FooRefOrValue { -const FooRefOrValue._(); - - - - - const factory FooRefOrValue.asFoo({ - required Foo fooValue - }) = FooRefOrValueAsFoo; - const factory FooRefOrValue.asFooRef({ - required FooRef fooRefValue - }) = FooRefOrValueAsFooRef; - const factory FooRefOrValue.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([Foo,FooRef,]) List possibleTypes, - @Default([]) List deserializedModels, - }) = FooRefOrValueUnknown; + @freezed + sealed class FooRefOrValue with _$FooRefOrValue { + const FooRefOrValue._(); + + const factory FooRefOrValue.asFoo({ + required Foo fooValue + }) = FooRefOrValueAsFoo; + const factory FooRefOrValue.asFooRef({ + required FooRef fooRefValue + }) = FooRefOrValueAsFooRef; + const factory FooRefOrValue.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + + @Default([Foo,FooRef,]) + List possibleTypes, + + @Default([]) + List deserializedModels, + }) = FooRefOrValueUnknown; factory FooRefOrValue.fromJson(Map json) { - FooRefOrValue? deserializedModel; + FooRefOrValue? deserializedModel; // A discriminator property is specified but no mapping // is provided in the spec, so we expect the property to // have the value of the name of the model. Model prefix & // suffix are ignored, as this is not known by the api provider switch(json['@type']){ - case 'Foo': - deserializedModel = FooRefOrValue.asFoo( - fooValue : Foo.fromJson(json), - ); + case 'Foo': + deserializedModel = FooRefOrValue.asFoo( + fooValue : Foo.fromJson(json), + ); break; - case 'FooRef': - deserializedModel = FooRefOrValue.asFooRef( - fooRefValue : FooRef.fromJson(json), - ); + case 'FooRef': + deserializedModel = FooRefOrValue.asFooRef( + fooRefValue : FooRef.fromJson(json), + ); break; default: - break; + /// If deserializedModel is still null, then we try to parse + /// the json against all the models and try to return one of the valid model. + /// Note: this approach tries to return one valid model and if more than one model + /// is valid it then returns unknown type along with the json so + /// the consumer can decide which model it is. + final fromJsonMethods = >[Foo.fromJson,FooRef.fromJson,]; + final deserializedModels = []; + for (final fromJsonMethod in fromJsonMethods) { + try { + final dynamic parsedModel= fromJsonMethod.call(json); + // Note following line won't be executed if already the above parsing fails. + if (parsedModel is Foo) { + deserializedModel = FooRefOrValue.asFoo( + fooValue : parsedModel, + ); + } else + if (parsedModel is FooRef) { + deserializedModel = FooRefOrValue.asFooRef( + fooRefValue : parsedModel, + ); + } else + { + deserializedModel = FooRefOrValue.unknown(json: json); + } + deserializedModels.add(deserializedModel); + } catch (e) { + // We are suppressing the deserialization error when the json could not + // be parsed into one of the model. Because we return [FooRefOrValue.unknown] + // if the deserialization fails. + } + } + // Return an unknown type when the incoming json parses into more than one models. + // Since we pass deserializedModels, clients can still use the deserialized model. + // EvenThough this is valid for AnyOf types, Dart doesn't have polymorphic types. + // So we still return this as an unknown type. + if(deserializedModels.length > 1){ + deserializedModel = FooRefOrValue.unknown( + json: json, + deserializedModels: deserializedModels, + errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, + ); + } break; } - - - return deserializedModel ?? FooRefOrValue.unknown(json: json); + return deserializedModel ?? FooRefOrValue.unknown(json: json); } - Map toJson() { return when( - asFoo: (asFoo) => asFoo.toJson(), + asFoo: (asFoo) => asFoo.toJson(), asFooRef: (asFooRef) => asFooRef.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, ); } - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit.dart index 17e727017cd3..963269e1a3c9 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/fruit.dart @@ -12,59 +12,57 @@ part of 'models.dart'; /// * [seeds] /// * [length] -@freezed -class Fruit with _$Fruit { -const Fruit._(); - - - const factory Fruit.apple({ - required Apple apple, - }) = FruitApple; - const factory Fruit.banana({ - required Banana banana, - }) = FruitBanana; - const factory Fruit.unknown({ + @freezed + sealed class Fruit with _$Fruit { + const Fruit._(); + + const factory Fruit.asApple({ + required Apple appleValue + }) = FruitAsApple; + const factory Fruit.asBanana({ + required Banana bananaValue + }) = FruitAsBanana; + const factory Fruit.unknown({ @Default('Json does not satisfy any available types') String message, required Map json, + @Default(DeserializationErrorType.UnKnownType) DeserializationErrorType errorType, - @Default([Apple,Banana,]) List possibleTypes, - @Default([]) List deserializedModels, + + @Default([Apple,Banana,]) + List possibleTypes, + + @Default([]) + List deserializedModels, }) = FruitUnknown; - - - factory Fruit.fromJson(Map json) { - switch(json['fruitType']){ - case 'APPLE': - return Fruit.apple( - apple : Apple.fromJson(json), + factory Fruit.fromJson(Map json) { + switch(json['fruitType']){ + case 'APPLE': + return Fruit.asApple( + appleValue : Apple.fromJson(json), ); - case 'BANANA': - return Fruit.banana( - banana : Banana.fromJson(json), + case 'BANANA': + return Fruit.asBanana( + bananaValue : Banana.fromJson(json), ); - } - return Fruit.unknown(json: json); - } - - - - Map toJson() { - return when( - apple: (apple) => apple.toJson(), - banana: (banana) => banana.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } + } + return Fruit.unknown(json: json); + } + Map toJson() { + return when( + asApple: (asApple) => asApple.toJson(), + asBanana: (asBanana) => asBanana.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/models.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/models.dart index 793098c8ff67..97c279ce5e04 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/models.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/models.dart @@ -7,7 +7,7 @@ part 'models.freezed.dart'; part 'models.g.dart'; part 'primitive_union_types.dart'; -part 'addressable.dart';part 'apple.dart';part 'banana.dart';part 'bar.dart';part 'bar_create.dart';part 'bar_ref.dart';part 'bar_ref_or_value.dart';part 'entity.dart';part 'entity_ref.dart';part 'extensible.dart';part 'foo.dart';part 'foo_ref.dart';part 'foo_ref_or_value.dart';part 'fruit.dart';part 'fruit_type.dart';part 'pasta.dart';part 'pizza.dart';part 'pizza_speziale.dart'; +part 'addressable.dart';part 'animal.dart';part 'apple.dart';part 'banana.dart';part 'bar.dart';part 'bar_create.dart';part 'bar_ref.dart';part 'bar_ref_or_value.dart';part 'cat.dart';part 'dog.dart';part 'entity.dart';part 'entity_ref.dart';part 'extensible.dart';part 'foo.dart';part 'foo_ref.dart';part 'foo_ref_or_value.dart';part 'fruit.dart';part 'fruit_type.dart';part 'pasta.dart';part 'pizza.dart';part 'pizza_speziale.dart'; /// A typedef used in the deserialization of OneOf and AnyOf /// models when no discriminator mapping is provided. diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart index 1002c786fb26..e29f49044d96 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart @@ -15,39 +15,36 @@ part of 'models.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -@freezed -class Pasta with _$Pasta { -const Pasta._(); - - + @freezed + class Pasta with _$Pasta { + const Pasta._(); + const factory Pasta({ - @JsonKey(name: r'vendor') + @JsonKey(name: r'vendor') String? vendor, - /// Hyperlink reference - @JsonKey(name: r'href') + /// Hyperlink reference + @JsonKey(name: r'href') String? href, - /// unique identifier - @JsonKey(name: r'id') + /// unique identifier + @JsonKey(name: r'id') String? id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') String? atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') String? atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') required String atType, -}) = _Pasta; - - + }) = _Pasta; factory Pasta.fromJson(Map json) => _$PastaFromJson(json); @@ -56,10 +53,7 @@ const Pasta._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart index 79fafb715a2c..b1340e55336b 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart @@ -15,39 +15,36 @@ part of 'models.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -@freezed -class Pizza with _$Pizza { -const Pizza._(); - - + @freezed + class Pizza with _$Pizza { + const Pizza._(); + const factory Pizza({ - @JsonKey(name: r'pizzaSize') + @JsonKey(name: r'pizzaSize') num? pizzaSize, - /// Hyperlink reference - @JsonKey(name: r'href') + /// Hyperlink reference + @JsonKey(name: r'href') String? href, - /// unique identifier - @JsonKey(name: r'id') + /// unique identifier + @JsonKey(name: r'id') String? id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') String? atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') String? atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') required String atType, -}) = _Pizza; - - + }) = _Pizza; factory Pizza.fromJson(Map json) => _$PizzaFromJson(json); @@ -56,10 +53,7 @@ const Pizza._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart index ed00d02d4539..0d2456d49da4 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart @@ -16,42 +16,39 @@ part of 'models.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -@freezed -class PizzaSpeziale with _$PizzaSpeziale { -const PizzaSpeziale._(); - - + @freezed + class PizzaSpeziale with _$PizzaSpeziale { + const PizzaSpeziale._(); + const factory PizzaSpeziale({ - @JsonKey(name: r'toppings') + @JsonKey(name: r'toppings') String? toppings, - @JsonKey(name: r'pizzaSize') + @JsonKey(name: r'pizzaSize') num? pizzaSize, - /// Hyperlink reference - @JsonKey(name: r'href') + /// Hyperlink reference + @JsonKey(name: r'href') String? href, - /// unique identifier - @JsonKey(name: r'id') + /// unique identifier + @JsonKey(name: r'id') String? id, - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation') + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation') String? atSchemaLocation, - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType') + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType') String? atBaseType, - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type') + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type') required String atType, -}) = _PizzaSpeziale; - - + }) = _PizzaSpeziale; factory PizzaSpeziale.fromJson(Map json) => _$PizzaSpezialeFromJson(json); @@ -60,10 +57,7 @@ const PizzaSpeziale._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/pubspec.yaml index 12925113115d..445bc9f8f04d 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/pubspec.yaml @@ -3,11 +3,12 @@ version: 1.0.0 description: OpenAPI API client homepage: homepage + environment: sdk: '^3.0.0' dependencies: - dio: '^5.2.0' + dio: '^5.7.0' freezed_annotation: '^2.4.4' json_annotation: '^4.9.0' @@ -15,4 +16,4 @@ dev_dependencies: freezed: '^2.5.2' json_serializable: '^6.8.0' build_runner: any - test: ^1.16.0 + test: '^1.16.0' diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/animal_test.dart new file mode 100644 index 000000000000..f10b2b96ffe1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/animal_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Animal +void main() { + final Animal? instance = /* Animal(...) */ null; + // TODO add properties to the entity + + group(Animal, () { + // bool bark + test('to test the property `bark`', () async { + // TODO + }); + + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/cat_test.dart new file mode 100644 index 000000000000..5db9e41691fd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/cat_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Cat +void main() { + final Cat? instance = /* Cat(...) */ null; + // TODO add properties to the entity + + group(Cat, () { + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/dog_test.dart new file mode 100644 index 000000000000..93f3e1cb3f76 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_polymorphism_and_inheritance/test/dog_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Dog +void main() { + final Dog? instance = /* Dog(...) */ null; + // TODO add properties to the entity + + group(Dog, () { + // bool bark + test('to test the property `bark`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/FILES index ed2e12c2c53a..f99d1b97b0b5 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md analysis_options.yaml build.yaml @@ -19,6 +18,3 @@ lib/src/model/example.dart lib/src/model/models.dart lib/src/model/primitive_union_types.dart pubspec.yaml -test/child_test.dart -test/default_api_test.dart -test/example_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/VERSION index 17f2442ff3bc..9e0e9bce84b2 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/.openapi-generator/VERSION @@ -1 +1 @@ -7.9.0-SNAPSHOT +7.17.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/README.md b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/README.md index e81640d8ed49..673e46a500a2 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/README.md +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/README.md @@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- Generator version: 7.9.0-SNAPSHOT +- Generator version: 7.17.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.DartDioClientCodegen ## Requirements diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/child.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/child.dart index adffaceb0b5c..b75f2f2e357d 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/child.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/child.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [name] -@freezed -class Child with _$Child { -const Child._(); - - + @freezed + class Child with _$Child { + const Child._(); + const factory Child({ - @JsonKey(name: r'name') + @JsonKey(name: r'name') String? name, -}) = _Child; - - + }) = _Child; factory Child.fromJson(Map json) => _$ChildFromJson(json); @@ -31,10 +28,7 @@ const Child._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/example.dart b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/example.dart index dd775d489d62..bbcd66fa1290 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/example.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/lib/src/model/example.dart @@ -10,46 +10,48 @@ part of 'models.dart'; /// Properties: /// * [name] -@freezed -class Example with _$Example { -const Example._(); - - - - - const factory Example.asChild({ - required Child childValue - }) = ExampleAsChild; - const factory Example.asIntInUnion({ - required IntInUnion intValue - }) = ExampleAsIntInUnion; - const factory Example.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([Child,int,]) List possibleTypes, - @Default([]) List deserializedModels, - }) = ExampleUnknown; + @freezed + sealed class Example with _$Example { + const Example._(); + + const factory Example.asChild({ + required Child childValue + }) = ExampleAsChild; + const factory Example.asIntInUnion({ + required IntInUnion intValue + }) = ExampleAsIntInUnion; + const factory Example.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + + @Default([Child,int,]) + List possibleTypes, + + @Default([]) + List deserializedModels, + }) = ExampleUnknown; factory Example.fromJson(Map json) { - Example? deserializedModel; // A discriminator property is not defined in the spec so // we try to parse the json against all the models and try to // return one of the valid model. Note: this approach tries // to return one valid model and if more than one model // is valid it then returns unknown type along with the json so // the consumer can decide which model it is. - final fromJsonMethods = >[Child.fromJson,IntInUnion.fromJson,]; + Example? deserializedModel; + final fromJsonMethods = >[Child.fromJson,IntInUnion.fromJson,]; final deserializedModels = []; for (final fromJsonMethod in fromJsonMethods) { try { final dynamic parsedModel= fromJsonMethod.call(json); // Note following line won't be executed if already the above parsing fails. - if (parsedModel is Child) { + if (parsedModel is Child) { deserializedModel = Example.asChild( childValue : parsedModel, ); @@ -79,26 +81,19 @@ const Example._(); deserializedModels: deserializedModels, errorType: DeserializationErrorType.MoreThanOneTypeSatisfied, ); - } - - - return deserializedModel ?? Example.unknown(json: json); + } return deserializedModel ?? Example.unknown(json: json); } - Map toJson() { return when( - asChild: (asChild) => asChild.toJson(), + asChild: (asChild) => asChild.toJson(), asIntInUnion: (asIntInUnion) => asIntInUnion.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, ); } - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/pubspec.yaml index 12925113115d..445bc9f8f04d 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/freezed/oneof_primitive/pubspec.yaml @@ -3,11 +3,12 @@ version: 1.0.0 description: OpenAPI API client homepage: homepage + environment: sdk: '^3.0.0' dependencies: - dio: '^5.2.0' + dio: '^5.7.0' freezed_annotation: '^2.4.4' json_annotation: '^4.9.0' @@ -15,4 +16,4 @@ dev_dependencies: freezed: '^2.5.2' json_serializable: '^6.8.0' build_runner: any - test: ^1.16.0 + test: '^1.16.0' diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/FILES index 818c11cee664..a3f13932bea8 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md analysis_options.yaml build.yaml @@ -127,60 +126,3 @@ lib/src/model/tag.dart lib/src/model/test_inline_freeform_additional_properties_request.dart lib/src/model/user.dart pubspec.yaml -test/additional_properties_class_test.dart -test/all_of_with_single_ref_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_test.dart -test/category_test.dart -test/child_with_nullable_test.dart -test/class_model_test.dart -test/default_api_test.dart -test/deprecated_object_test.dart -test/dog_test.dart -test/enum_arrays_test.dart -test/enum_test_test.dart -test/fake_api_test.dart -test/fake_big_decimal_map200_response_test.dart -test/fake_classname_tags123_api_test.dart -test/file_schema_test_class_test.dart -test/foo_get_default_response_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/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/parent_with_nullable_test.dart -test/pet_api_test.dart -test/pet_test.dart -test/read_only_first_test.dart -test/single_ref_type_test.dart -test/special_model_name_test.dart -test/store_api_test.dart -test/tag_test.dart -test/test_inline_freeform_additional_properties_request_test.dart -test/user_api_test.dart -test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/VERSION index 17f2442ff3bc..9e0e9bce84b2 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -7.9.0-SNAPSHOT +7.17.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/README.md index 516bf125066e..b50f9daf7ed9 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/README.md @@ -4,7 +4,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- Generator version: 7.9.0-SNAPSHOT +- Generator version: 7.17.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.DartDioClientCodegen ## Requirements diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart index 12c438f0b974..9cdb358a3bfd 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart @@ -11,27 +11,24 @@ part of 'models.dart'; /// * [mapProperty] /// * [mapOfMapProperty] -@freezed -class AdditionalPropertiesClass with _$AdditionalPropertiesClass { -const AdditionalPropertiesClass._(); - - + @freezed + class AdditionalPropertiesClass with _$AdditionalPropertiesClass { + const AdditionalPropertiesClass._(); + const factory AdditionalPropertiesClass({ - @JsonKey(name: r'map_property') + @JsonKey(name: r'map_property') Map? mapProperty, - @JsonKey(name: r'map_of_map_property') + @JsonKey(name: r'map_of_map_property') Map? >? mapOfMapProperty, -}) = _AdditionalPropertiesClass; - - + }) = _AdditionalPropertiesClass; factory AdditionalPropertiesClass.fromJson(Map json) => _$AdditionalPropertiesClassFromJson(json); @@ -41,10 +38,7 @@ const AdditionalPropertiesClass._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart index 04b3738b81b8..857a695716b1 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart @@ -11,21 +11,18 @@ part of 'models.dart'; /// * [username] /// * [singleRefType] -@freezed -class AllOfWithSingleRef with _$AllOfWithSingleRef { -const AllOfWithSingleRef._(); - - + @freezed + class AllOfWithSingleRef with _$AllOfWithSingleRef { + const AllOfWithSingleRef._(); + const factory AllOfWithSingleRef({ - @JsonKey(name: r'username') + @JsonKey(name: r'username') String? username, - @JsonKey(name: r'SingleRefType') + @JsonKey(name: r'SingleRefType') SingleRefType? singleRefType, -}) = _AllOfWithSingleRef; - - + }) = _AllOfWithSingleRef; factory AllOfWithSingleRef.fromJson(Map json) => _$AllOfWithSingleRefFromJson(json); @@ -35,10 +32,7 @@ const AllOfWithSingleRef._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/animal.dart index ab4f4a5383c6..30b413209090 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/animal.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/animal.dart @@ -11,59 +11,57 @@ part of 'models.dart'; /// * [className] /// * [color] -@freezed -class Animal with _$Animal { -const Animal._(); - - - const factory Animal.cat({ - required Cat cat, - }) = AnimalCat; - const factory Animal.dog({ - required Dog dog, - }) = AnimalDog; - const factory Animal.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([]) List possibleTypes, - @Default([]) List deserializedModels, - }) = AnimalUnknown; - - + @freezed + sealed class Animal with _$Animal { + const Animal._(); + + const factory Animal.asCat({ + required Cat catValue + }) = AnimalAsCat; + const factory Animal.asDog({ + required Dog dogValue + }) = AnimalAsDog; + const factory Animal.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + + @Default([]) + List possibleTypes, + + @Default([]) + List deserializedModels, + }) = AnimalUnknown; factory Animal.fromJson(Map json) { - switch(json['className']){ - case 'CAT': - return Animal.cat( - cat : Cat.fromJson(json), - ); - case 'DOG': - return Animal.dog( - dog : Dog.fromJson(json), - ); - } - return Animal.unknown(json: json); + switch(json['className']){ + case 'CAT': + return Animal.asCat( + catValue : Cat.fromJson(json), + ); + case 'DOG': + return Animal.asDog( + dogValue : Dog.fromJson(json), + ); + } + return Animal.unknown(json: json); } - - Map toJson() { - return when( - cat: (cat) => cat.toJson(), - dog: (dog) => dog.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } - - + Map toJson() { + return when( + asCat: (asCat) => asCat.toJson(), + asDog: (asDog) => asDog.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/api_response.dart index e8608ad60603..2316f402fe13 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/api_response.dart @@ -12,24 +12,21 @@ part of 'models.dart'; /// * [type] /// * [message] -@freezed -class ApiResponse with _$ApiResponse { -const ApiResponse._(); - - + @freezed + class ApiResponse with _$ApiResponse { + const ApiResponse._(); + const factory ApiResponse({ - @JsonKey(name: r'code') + @JsonKey(name: r'code') int? code, - @JsonKey(name: r'type') + @JsonKey(name: r'type') String? type, - @JsonKey(name: r'message') + @JsonKey(name: r'message') String? message, -}) = _ApiResponse; - - + }) = _ApiResponse; factory ApiResponse.fromJson(Map json) => _$ApiResponseFromJson(json); @@ -39,10 +36,7 @@ const ApiResponse._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart index 82381d375158..8a55642b0b5d 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart @@ -10,22 +10,19 @@ part of 'models.dart'; /// Properties: /// * [arrayArrayNumber] -@freezed -class ArrayOfArrayOfNumberOnly with _$ArrayOfArrayOfNumberOnly { -const ArrayOfArrayOfNumberOnly._(); - - + @freezed + class ArrayOfArrayOfNumberOnly with _$ArrayOfArrayOfNumberOnly { + const ArrayOfArrayOfNumberOnly._(); + const factory ArrayOfArrayOfNumberOnly({ - @JsonKey(name: r'ArrayArrayNumber') + @JsonKey(name: r'ArrayArrayNumber') List< List< num? >? >? arrayArrayNumber, -}) = _ArrayOfArrayOfNumberOnly; - - + }) = _ArrayOfArrayOfNumberOnly; factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfArrayOfNumberOnlyFromJson(json); @@ -35,10 +32,7 @@ const ArrayOfArrayOfNumberOnly._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart index 623dbe6d5d58..1a9ff7348fa3 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart @@ -10,20 +10,17 @@ part of 'models.dart'; /// Properties: /// * [arrayNumber] -@freezed -class ArrayOfNumberOnly with _$ArrayOfNumberOnly { -const ArrayOfNumberOnly._(); - - + @freezed + class ArrayOfNumberOnly with _$ArrayOfNumberOnly { + const ArrayOfNumberOnly._(); + const factory ArrayOfNumberOnly({ - @JsonKey(name: r'ArrayNumber') + @JsonKey(name: r'ArrayNumber') List< num? >? arrayNumber, -}) = _ArrayOfNumberOnly; - - + }) = _ArrayOfNumberOnly; factory ArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfNumberOnlyFromJson(json); @@ -33,10 +30,7 @@ const ArrayOfNumberOnly._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_test.dart index 1c793fc302a9..6648e6d8b607 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/array_test.dart @@ -12,34 +12,31 @@ part of 'models.dart'; /// * [arrayArrayOfInteger] /// * [arrayArrayOfModel] -@freezed -class ArrayTest with _$ArrayTest { -const ArrayTest._(); - - + @freezed + class ArrayTest with _$ArrayTest { + const ArrayTest._(); + const factory ArrayTest({ - @JsonKey(name: r'array_of_string') + @JsonKey(name: r'array_of_string') List< String? >? arrayOfString, - @JsonKey(name: r'array_array_of_integer') + @JsonKey(name: r'array_array_of_integer') List< List< int? >? >? arrayArrayOfInteger, - @JsonKey(name: r'array_array_of_model') + @JsonKey(name: r'array_array_of_model') List< List< ReadOnlyFirst? >? >? arrayArrayOfModel, -}) = _ArrayTest; - - + }) = _ArrayTest; factory ArrayTest.fromJson(Map json) => _$ArrayTestFromJson(json); @@ -49,10 +46,7 @@ const ArrayTest._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/capitalization.dart index 525d1f04e549..7446ec95c104 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/capitalization.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/capitalization.dart @@ -15,34 +15,31 @@ part of 'models.dart'; /// * [sCAETHFlowPoints] /// * [ATT_NAME] - Name of the pet -@freezed -class Capitalization with _$Capitalization { -const Capitalization._(); - - + @freezed + class Capitalization with _$Capitalization { + const Capitalization._(); + const factory Capitalization({ - @JsonKey(name: r'smallCamel') + @JsonKey(name: r'smallCamel') String? smallCamel, - @JsonKey(name: r'CapitalCamel') + @JsonKey(name: r'CapitalCamel') String? capitalCamel, - @JsonKey(name: r'small_Snake') + @JsonKey(name: r'small_Snake') String? smallSnake, - @JsonKey(name: r'Capital_Snake') + @JsonKey(name: r'Capital_Snake') String? capitalSnake, - @JsonKey(name: r'SCA_ETH_Flow_Points') + @JsonKey(name: r'SCA_ETH_Flow_Points') String? sCAETHFlowPoints, - /// Name of the pet - @JsonKey(name: r'ATT_NAME') + /// Name of the pet + @JsonKey(name: r'ATT_NAME') String? ATT_NAME, -}) = _Capitalization; - - + }) = _Capitalization; factory Capitalization.fromJson(Map json) => _$CapitalizationFromJson(json); @@ -52,10 +49,7 @@ const Capitalization._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/cat.dart index a60babcaddc1..b9fb961b58f3 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/cat.dart @@ -12,25 +12,22 @@ part of 'models.dart'; /// * [color] /// * [declawed] -@freezed -class Cat with _$Cat { -const Cat._(); - - + @freezed + class Cat with _$Cat { + const Cat._(); + const factory Cat({ - @JsonKey(name: r'className') + @JsonKey(name: r'className') required String className, - @JsonKey(name: r'color') + @JsonKey(name: r'color') String? color, - @JsonKey(name: r'declawed') + @JsonKey(name: r'declawed') bool? declawed, -}) = _Cat; - - + }) = _Cat; factory Cat.fromJson(Map json) => _$CatFromJson(json); @@ -39,10 +36,7 @@ const Cat._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/category.dart index 5f4054076196..7c1fda5de175 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/category.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/category.dart @@ -11,21 +11,18 @@ part of 'models.dart'; /// * [id] /// * [name] -@freezed -class Category with _$Category { -const Category._(); - - + @freezed + class Category with _$Category { + const Category._(); + const factory Category({ - @JsonKey(name: r'id') + @JsonKey(name: r'id') int? id, - @JsonKey(name: r'name') + @JsonKey(name: r'name') required String name, -}) = _Category; - - + }) = _Category; factory Category.fromJson(Map json) => _$CategoryFromJson(json); @@ -35,10 +32,7 @@ const Category._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/child_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/child_with_nullable.dart index 7b43ddac31c2..99ccb6be3c59 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/child_with_nullable.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/child_with_nullable.dart @@ -12,25 +12,22 @@ part of 'models.dart'; /// * [nullableProperty] /// * [otherProperty] -@freezed -class ChildWithNullable with _$ChildWithNullable { -const ChildWithNullable._(); - - + @freezed + class ChildWithNullable with _$ChildWithNullable { + const ChildWithNullable._(); + const factory ChildWithNullable({ - @JsonKey(name: r'type') + @JsonKey(name: r'type') ChildWithNullableTypeEnum? type, - @JsonKey(name: r'nullableProperty') + @JsonKey(name: r'nullableProperty') String? nullableProperty, - @JsonKey(name: r'otherProperty') + @JsonKey(name: r'otherProperty') String? otherProperty, -}) = _ChildWithNullable; - - + }) = _ChildWithNullable; factory ChildWithNullable.fromJson(Map json) => _$ChildWithNullableFromJson(json); @@ -39,18 +36,14 @@ const ChildWithNullable._(); - - } - -@JsonEnum(valueField: 'value') -enum ChildWithNullableTypeEnum { - childWithNullable(value: r'ChildWithNullable'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const ChildWithNullableTypeEnum({required this.value}); - final String value; -} - + @JsonEnum(valueField: 'value') + enum ChildWithNullableTypeEnum { + childWithNullable(value: r'ChildWithNullable'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const ChildWithNullableTypeEnum({required this.value}); + final String value; + } diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/class_model.dart index cb16c798fde3..ee248ecb7dfb 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/class_model.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [class_] -@freezed -class ClassModel with _$ClassModel { -const ClassModel._(); - - + @freezed + class ClassModel with _$ClassModel { + const ClassModel._(); + const factory ClassModel({ - @JsonKey(name: r'_class') + @JsonKey(name: r'_class') String? class_, -}) = _ClassModel; - - + }) = _ClassModel; factory ClassModel.fromJson(Map json) => _$ClassModelFromJson(json); @@ -31,10 +28,7 @@ const ClassModel._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/deprecated_object.dart index 373d5863c1dd..0b72b6a9ccc0 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/deprecated_object.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/deprecated_object.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [name] -@freezed -class DeprecatedObject with _$DeprecatedObject { -const DeprecatedObject._(); - - + @freezed + class DeprecatedObject with _$DeprecatedObject { + const DeprecatedObject._(); + const factory DeprecatedObject({ - @JsonKey(name: r'name') + @JsonKey(name: r'name') String? name, -}) = _DeprecatedObject; - - + }) = _DeprecatedObject; factory DeprecatedObject.fromJson(Map json) => _$DeprecatedObjectFromJson(json); @@ -31,10 +28,7 @@ const DeprecatedObject._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/dog.dart index 9df086abe547..2add58483508 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/dog.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/dog.dart @@ -12,25 +12,22 @@ part of 'models.dart'; /// * [color] /// * [breed] -@freezed -class Dog with _$Dog { -const Dog._(); - - + @freezed + class Dog with _$Dog { + const Dog._(); + const factory Dog({ - @JsonKey(name: r'className') + @JsonKey(name: r'className') required String className, - @JsonKey(name: r'color') + @JsonKey(name: r'color') String? color, - @JsonKey(name: r'breed') + @JsonKey(name: r'breed') String? breed, -}) = _Dog; - - + }) = _Dog; factory Dog.fromJson(Map json) => _$DogFromJson(json); @@ -39,10 +36,7 @@ const Dog._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_arrays.dart index 6fd9a450ca7b..97e7a751b331 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_arrays.dart @@ -11,23 +11,20 @@ part of 'models.dart'; /// * [justSymbol] /// * [arrayEnum] -@freezed -class EnumArrays with _$EnumArrays { -const EnumArrays._(); - - + @freezed + class EnumArrays with _$EnumArrays { + const EnumArrays._(); + const factory EnumArrays({ - @JsonKey(name: r'just_symbol') + @JsonKey(name: r'just_symbol') EnumArraysJustSymbolEnum? justSymbol, - @JsonKey(name: r'array_enum') + @JsonKey(name: r'array_enum') List< EnumArraysArrayEnumEnum? >? arrayEnum, -}) = _EnumArrays; - - + }) = _EnumArrays; factory EnumArrays.fromJson(Map json) => _$EnumArraysFromJson(json); @@ -37,29 +34,24 @@ const EnumArrays._(); - - } - -@JsonEnum(valueField: 'value') -enum EnumArraysJustSymbolEnum { - greaterThanEqual(value: r'>='), - dollar(value: r'$'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const EnumArraysJustSymbolEnum({required this.value}); - final String value; -} - + @JsonEnum(valueField: 'value') + enum EnumArraysJustSymbolEnum { + greaterThanEqual(value: r'>='), + dollar(value: r'$'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumArraysJustSymbolEnum({required this.value}); + final String value; + } -@JsonEnum(valueField: 'value') -enum EnumArraysArrayEnumEnum { - fish(value: r'fish'), - crab(value: r'crab'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const EnumArraysArrayEnumEnum({required this.value}); - final String value; -} - + @JsonEnum(valueField: 'value') + enum EnumArraysArrayEnumEnum { + fish(value: r'fish'), + crab(value: r'crab'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumArraysArrayEnumEnum({required this.value}); + final String value; + } diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_test.dart index 55b5cfe74ece..e2827b647e75 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/enum_test.dart @@ -17,39 +17,36 @@ part of 'models.dart'; /// * [outerEnumDefaultValue] /// * [outerEnumIntegerDefaultValue] -@freezed -class EnumTest with _$EnumTest { -const EnumTest._(); - - + @freezed + class EnumTest with _$EnumTest { + const EnumTest._(); + const factory EnumTest({ - @JsonKey(name: r'enum_string') + @JsonKey(name: r'enum_string') EnumTestEnumStringEnum? enumString, - @JsonKey(name: r'enum_string_required') + @JsonKey(name: r'enum_string_required') required EnumTestEnumStringRequiredEnum enumStringRequired, - @JsonKey(name: r'enum_integer') + @JsonKey(name: r'enum_integer') EnumTestEnumIntegerEnum? enumInteger, - @JsonKey(name: r'enum_number') + @JsonKey(name: r'enum_number') EnumTestEnumNumberEnum? enumNumber, - @JsonKey(name: r'outerEnum') + @JsonKey(name: r'outerEnum') OuterEnum? outerEnum, - @JsonKey(name: r'outerEnumInteger') + @JsonKey(name: r'outerEnumInteger') OuterEnumInteger? outerEnumInteger, - @JsonKey(name: r'outerEnumDefaultValue') + @JsonKey(name: r'outerEnumDefaultValue') OuterEnumDefaultValue? outerEnumDefaultValue, - @JsonKey(name: r'outerEnumIntegerDefaultValue') + @JsonKey(name: r'outerEnumIntegerDefaultValue') OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue, -}) = _EnumTest; - - + }) = _EnumTest; factory EnumTest.fromJson(Map json) => _$EnumTestFromJson(json); @@ -59,48 +56,41 @@ const EnumTest._(); - - } - -@JsonEnum(valueField: 'value') -enum EnumTestEnumStringEnum { - UPPER(value: r'UPPER'), - lower(value: r'lower'), - empty(value: r''), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const EnumTestEnumStringEnum({required this.value}); - final String value; -} - -@JsonEnum(valueField: 'value') -enum EnumTestEnumStringRequiredEnum { - UPPER(value: r'UPPER'), - lower(value: r'lower'), - empty(value: r''), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const EnumTestEnumStringRequiredEnum({required this.value}); - final String value; -} - -@JsonEnum(valueField: 'value') -enum EnumTestEnumIntegerEnum { - number1(value: 1), - numberNegative1(value: -1), - unknownDefaultOpenApi(value: 11184809); - const EnumTestEnumIntegerEnum({required this.value}); - final int value; -} - -@JsonEnum(valueField: 'value') -enum EnumTestEnumNumberEnum { - number1Period1(value: '1.1'), - numberNegative1Period2(value: '-1.2'), - unknownDefaultOpenApi(value: '11184809'); - const EnumTestEnumNumberEnum({required this.value}); - final double value; -} - + @JsonEnum(valueField: 'value') + enum EnumTestEnumStringEnum { + UPPER(value: r'UPPER'), + lower(value: r'lower'), + empty(value: r''), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumTestEnumStringEnum({required this.value}); + final String value; + } + @JsonEnum(valueField: 'value') + enum EnumTestEnumStringRequiredEnum { + UPPER(value: r'UPPER'), + lower(value: r'lower'), + empty(value: r''), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const EnumTestEnumStringRequiredEnum({required this.value}); + final String value; + } + @JsonEnum(valueField: 'value') + enum EnumTestEnumIntegerEnum { + number1(value: 1), + numberNegative1(value: -1), + unknownDefaultOpenApi(value: 11184809); + const EnumTestEnumIntegerEnum({required this.value}); + final int value; + } + @JsonEnum(valueField: 'value') + enum EnumTestEnumNumberEnum { + number1Period1(value: '1.1'), + numberNegative1Period2(value: '-1.2'), + unknownDefaultOpenApi(value: '11184809'); + const EnumTestEnumNumberEnum({required this.value}); + final double value; + } diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart index 58f1f2fb2971..22c9785245d6 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart @@ -11,23 +11,20 @@ part of 'models.dart'; /// * [someId] /// * [someMap] -@freezed -class FakeBigDecimalMap200Response with _$FakeBigDecimalMap200Response { -const FakeBigDecimalMap200Response._(); - - + @freezed + class FakeBigDecimalMap200Response with _$FakeBigDecimalMap200Response { + const FakeBigDecimalMap200Response._(); + const factory FakeBigDecimalMap200Response({ - @JsonKey(name: r'someId') + @JsonKey(name: r'someId') num? someId, - @JsonKey(name: r'someMap') + @JsonKey(name: r'someMap') Map? someMap, -}) = _FakeBigDecimalMap200Response; - - + }) = _FakeBigDecimalMap200Response; factory FakeBigDecimalMap200Response.fromJson(Map json) => _$FakeBigDecimalMap200ResponseFromJson(json); @@ -37,10 +34,7 @@ const FakeBigDecimalMap200Response._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart index 45eed25fb283..d2bef63869e6 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart @@ -11,23 +11,20 @@ part of 'models.dart'; /// * [file] /// * [files] -@freezed -class FileSchemaTestClass with _$FileSchemaTestClass { -const FileSchemaTestClass._(); - - + @freezed + class FileSchemaTestClass with _$FileSchemaTestClass { + const FileSchemaTestClass._(); + const factory FileSchemaTestClass({ - @JsonKey(name: r'file') + @JsonKey(name: r'file') ModelFile? file, - @JsonKey(name: r'files') + @JsonKey(name: r'files') List< ModelFile? >? files, -}) = _FileSchemaTestClass; - - + }) = _FileSchemaTestClass; factory FileSchemaTestClass.fromJson(Map json) => _$FileSchemaTestClassFromJson(json); @@ -37,10 +34,7 @@ const FileSchemaTestClass._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo.dart index e1d42e6f0a5a..ffa9c45cc003 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [bar] -@freezed -class Foo with _$Foo { -const Foo._(); - - + @freezed + class Foo with _$Foo { + const Foo._(); + const factory Foo({ - @JsonKey(name: r'bar') + @JsonKey(name: r'bar') String? bar, -}) = _Foo; - - + }) = _Foo; factory Foo.fromJson(Map json) => _$FooFromJson(json); @@ -31,10 +28,7 @@ const Foo._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart index 06c214baa9e2..4a0bb7e0caca 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [string] -@freezed -class FooGetDefaultResponse with _$FooGetDefaultResponse { -const FooGetDefaultResponse._(); - - + @freezed + class FooGetDefaultResponse with _$FooGetDefaultResponse { + const FooGetDefaultResponse._(); + const factory FooGetDefaultResponse({ - @JsonKey(name: r'string') + @JsonKey(name: r'string') Foo? string, -}) = _FooGetDefaultResponse; - - + }) = _FooGetDefaultResponse; factory FooGetDefaultResponse.fromJson(Map json) => _$FooGetDefaultResponseFromJson(json); @@ -31,10 +28,7 @@ const FooGetDefaultResponse._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/format_test.dart index c5a2780e3aae..e4170c523c24 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/format_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/format_test.dart @@ -25,65 +25,62 @@ part of 'models.dart'; /// * [patternWithDigits] - A string that is a 10 digit number. Can have leading zeros. /// * [patternWithDigitsAndDelimiter] - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. -@freezed -class FormatTest with _$FormatTest { -const FormatTest._(); - - + @freezed + class FormatTest with _$FormatTest { + const FormatTest._(); + const factory FormatTest({ - @JsonKey(name: r'integer') + @JsonKey(name: r'integer') int? integer, - @JsonKey(name: r'int32') + @JsonKey(name: r'int32') int? int32, - @JsonKey(name: r'int64') + @JsonKey(name: r'int64') int? int64, - @JsonKey(name: r'number') + @JsonKey(name: r'number') required num number, - @JsonKey(name: r'float') + @JsonKey(name: r'float') double? float, - @JsonKey(name: r'double') + @JsonKey(name: r'double') double? double_, - @JsonKey(name: r'decimal') + @JsonKey(name: r'decimal') double? decimal, - @JsonKey(name: r'string') + @JsonKey(name: r'string') String? string, - @JsonKey(name: r'byte') + @JsonKey(name: r'byte') required String byte, - @JsonKey(name: r'binary') + @JsonKey(name: r'binary') MultipartFile? binary, - @JsonKey(name: r'date') + @JsonKey(name: r'date') required DateTime date, - @JsonKey(name: r'dateTime') + @JsonKey(name: r'dateTime') DateTime? dateTime, - @JsonKey(name: r'uuid') + @JsonKey(name: r'uuid') String? uuid, - @JsonKey(name: r'password') + @JsonKey(name: r'password') required String password, - /// A string that is a 10 digit number. Can have leading zeros. - @JsonKey(name: r'pattern_with_digits') + /// A string that is a 10 digit number. Can have leading zeros. + @JsonKey(name: r'pattern_with_digits') 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') + /// 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') String? patternWithDigitsAndDelimiter, -}) = _FormatTest; - - + }) = _FormatTest; factory FormatTest.fromJson(Map json) => _$FormatTestFromJson(json); @@ -93,10 +90,7 @@ const FormatTest._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart index 7761a7315928..08118cf5d4da 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart @@ -11,21 +11,18 @@ part of 'models.dart'; /// * [bar] /// * [foo] -@freezed -class HasOnlyReadOnly with _$HasOnlyReadOnly { -const HasOnlyReadOnly._(); - - + @freezed + class HasOnlyReadOnly with _$HasOnlyReadOnly { + const HasOnlyReadOnly._(); + const factory HasOnlyReadOnly({ - @JsonKey(name: r'bar') + @JsonKey(name: r'bar') String? bar, - @JsonKey(name: r'foo') + @JsonKey(name: r'foo') String? foo, -}) = _HasOnlyReadOnly; - - + }) = _HasOnlyReadOnly; factory HasOnlyReadOnly.fromJson(Map json) => _$HasOnlyReadOnlyFromJson(json); @@ -35,10 +32,7 @@ const HasOnlyReadOnly._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/health_check_result.dart index 9dfdbc5c1a82..6be0435894b2 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/health_check_result.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/health_check_result.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [nullableMessage] -@freezed -class HealthCheckResult with _$HealthCheckResult { -const HealthCheckResult._(); - - + @freezed + class HealthCheckResult with _$HealthCheckResult { + const HealthCheckResult._(); + const factory HealthCheckResult({ - @JsonKey(name: r'NullableMessage') + @JsonKey(name: r'NullableMessage') String? nullableMessage, -}) = _HealthCheckResult; - - + }) = _HealthCheckResult; factory HealthCheckResult.fromJson(Map json) => _$HealthCheckResultFromJson(json); @@ -31,10 +28,7 @@ const HealthCheckResult._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/map_test.dart index edeeb9fe5649..4ae39f268d4d 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/map_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/map_test.dart @@ -13,37 +13,34 @@ part of 'models.dart'; /// * [directMap] /// * [indirectMap] -@freezed -class MapTest with _$MapTest { -const MapTest._(); - - + @freezed + class MapTest with _$MapTest { + const MapTest._(); + const factory MapTest({ - @JsonKey(name: r'map_map_of_string') + @JsonKey(name: r'map_map_of_string') Map? >? mapMapOfString, - @JsonKey(name: r'map_of_enum_string') + @JsonKey(name: r'map_of_enum_string') Map? mapOfEnumString, - @JsonKey(name: r'direct_map') + @JsonKey(name: r'direct_map') Map? directMap, - @JsonKey(name: r'indirect_map') + @JsonKey(name: r'indirect_map') Map? indirectMap, -}) = _MapTest; - - + }) = _MapTest; factory MapTest.fromJson(Map json) => _$MapTestFromJson(json); @@ -53,20 +50,16 @@ const MapTest._(); - - } - -@JsonEnum(valueField: 'value') -enum MapTestMapOfEnumStringEnum { - UPPER(value: r'UPPER'), - lower(value: r'lower'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const MapTestMapOfEnumStringEnum({required this.value}); - final String value; -} - + @JsonEnum(valueField: 'value') + enum MapTestMapOfEnumStringEnum { + UPPER(value: r'UPPER'), + lower(value: r'lower'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const MapTestMapOfEnumStringEnum({required this.value}); + final String value; + } diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart index eb12475fc3b7..b54a0a41c1fc 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -12,26 +12,23 @@ part of 'models.dart'; /// * [dateTime] /// * [map] -@freezed -class MixedPropertiesAndAdditionalPropertiesClass with _$MixedPropertiesAndAdditionalPropertiesClass { -const MixedPropertiesAndAdditionalPropertiesClass._(); - - + @freezed + class MixedPropertiesAndAdditionalPropertiesClass with _$MixedPropertiesAndAdditionalPropertiesClass { + const MixedPropertiesAndAdditionalPropertiesClass._(); + const factory MixedPropertiesAndAdditionalPropertiesClass({ - @JsonKey(name: r'uuid') + @JsonKey(name: r'uuid') String? uuid, - @JsonKey(name: r'dateTime') + @JsonKey(name: r'dateTime') DateTime? dateTime, - @JsonKey(name: r'map') + @JsonKey(name: r'map') Map? map, -}) = _MixedPropertiesAndAdditionalPropertiesClass; - - + }) = _MixedPropertiesAndAdditionalPropertiesClass; factory MixedPropertiesAndAdditionalPropertiesClass.fromJson(Map json) => _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); @@ -41,10 +38,7 @@ const MixedPropertiesAndAdditionalPropertiesClass._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model200_response.dart index cbc0c625c0e9..6fb47a0d7d18 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model200_response.dart @@ -11,21 +11,18 @@ part of 'models.dart'; /// * [name] /// * [class_] -@freezed -class Model200Response with _$Model200Response { -const Model200Response._(); - - + @freezed + class Model200Response with _$Model200Response { + const Model200Response._(); + const factory Model200Response({ - @JsonKey(name: r'name') + @JsonKey(name: r'name') int? name, - @JsonKey(name: r'class') + @JsonKey(name: r'class') String? class_, -}) = _Model200Response; - - + }) = _Model200Response; factory Model200Response.fromJson(Map json) => _$Model200ResponseFromJson(json); @@ -35,10 +32,7 @@ const Model200Response._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_client.dart index 5e7d477fc2c5..ded67be9adbf 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_client.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_client.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [client] -@freezed -class ModelClient with _$ModelClient { -const ModelClient._(); - - + @freezed + class ModelClient with _$ModelClient { + const ModelClient._(); + const factory ModelClient({ - @JsonKey(name: r'client') + @JsonKey(name: r'client') String? client, -}) = _ModelClient; - - + }) = _ModelClient; factory ModelClient.fromJson(Map json) => _$ModelClientFromJson(json); @@ -31,10 +28,7 @@ const ModelClient._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_file.dart index 7585fead5f37..590ac4d93fd2 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_file.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_file.dart @@ -10,19 +10,16 @@ part of 'models.dart'; /// Properties: /// * [sourceURI] - Test capitalization -@freezed -class ModelFile with _$ModelFile { -const ModelFile._(); - - + @freezed + class ModelFile with _$ModelFile { + const ModelFile._(); + const factory ModelFile({ - /// Test capitalization - @JsonKey(name: r'sourceURI') + /// Test capitalization + @JsonKey(name: r'sourceURI') String? sourceURI, -}) = _ModelFile; - - + }) = _ModelFile; factory ModelFile.fromJson(Map json) => _$ModelFileFromJson(json); @@ -32,10 +29,7 @@ const ModelFile._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_list.dart index 5f9e176b5ffd..47ec10080325 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_list.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_list.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [n123list] -@freezed -class ModelList with _$ModelList { -const ModelList._(); - - + @freezed + class ModelList with _$ModelList { + const ModelList._(); + const factory ModelList({ - @JsonKey(name: r'123-list') + @JsonKey(name: r'123-list') String? n123list, -}) = _ModelList; - - + }) = _ModelList; factory ModelList.fromJson(Map json) => _$ModelListFromJson(json); @@ -31,10 +28,7 @@ const ModelList._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_return.dart index 29d509a235cf..2423aeecc969 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/model_return.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [return_] -@freezed -class ModelReturn with _$ModelReturn { -const ModelReturn._(); - - + @freezed + class ModelReturn with _$ModelReturn { + const ModelReturn._(); + const factory ModelReturn({ - @JsonKey(name: r'return') + @JsonKey(name: r'return') int? return_, -}) = _ModelReturn; - - + }) = _ModelReturn; factory ModelReturn.fromJson(Map json) => _$ModelReturnFromJson(json); @@ -31,10 +28,7 @@ const ModelReturn._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/name.dart index 2cf00d19f6e6..7a676910ee89 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/name.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/name.dart @@ -13,27 +13,24 @@ part of 'models.dart'; /// * [property] /// * [n123number] -@freezed -class Name with _$Name { -const Name._(); - - + @freezed + class Name with _$Name { + const Name._(); + const factory Name({ - @JsonKey(name: r'name') + @JsonKey(name: r'name') required int name, - @JsonKey(name: r'snake_case') + @JsonKey(name: r'snake_case') int? snakeCase, - @JsonKey(name: r'property') + @JsonKey(name: r'property') String? property, - @JsonKey(name: r'123Number') + @JsonKey(name: r'123Number') int? n123number, -}) = _Name; - - + }) = _Name; factory Name.fromJson(Map json) => _$NameFromJson(json); @@ -43,10 +40,7 @@ const Name._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/nullable_class.dart index d97933988453..9ce927fb2514 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/nullable_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/nullable_class.dart @@ -21,63 +21,60 @@ part of 'models.dart'; /// * [objectAndItemsNullableProp] /// * [objectItemsNullable] -@freezed -class NullableClass with _$NullableClass { -const NullableClass._(); - - + @freezed + class NullableClass with _$NullableClass { + const NullableClass._(); + const factory NullableClass({ - @JsonKey(name: r'integer_prop') + @JsonKey(name: r'integer_prop') int? integerProp, - @JsonKey(name: r'number_prop') + @JsonKey(name: r'number_prop') num? numberProp, - @JsonKey(name: r'boolean_prop') + @JsonKey(name: r'boolean_prop') bool? booleanProp, - @JsonKey(name: r'string_prop') + @JsonKey(name: r'string_prop') String? stringProp, - @JsonKey(name: r'date_prop') + @JsonKey(name: r'date_prop') DateTime? dateProp, - @JsonKey(name: r'datetime_prop') + @JsonKey(name: r'datetime_prop') DateTime? datetimeProp, - @JsonKey(name: r'array_nullable_prop') + @JsonKey(name: r'array_nullable_prop') List< Object? >? arrayNullableProp, - @JsonKey(name: r'array_and_items_nullable_prop') + @JsonKey(name: r'array_and_items_nullable_prop') List< Object? >? arrayAndItemsNullableProp, - @JsonKey(name: r'array_items_nullable') + @JsonKey(name: r'array_items_nullable') List< Object? >? arrayItemsNullable, - @JsonKey(name: r'object_nullable_prop') + @JsonKey(name: r'object_nullable_prop') Map? objectNullableProp, - @JsonKey(name: r'object_and_items_nullable_prop') + @JsonKey(name: r'object_and_items_nullable_prop') Map? objectAndItemsNullableProp, - @JsonKey(name: r'object_items_nullable') + @JsonKey(name: r'object_items_nullable') Map? objectItemsNullable, -}) = _NullableClass; - - + }) = _NullableClass; factory NullableClass.fromJson(Map json) => _$NullableClassFromJson(json); @@ -87,10 +84,7 @@ const NullableClass._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/number_only.dart index 6e59c27d03af..c688bfb5aca8 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/number_only.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [justNumber] -@freezed -class NumberOnly with _$NumberOnly { -const NumberOnly._(); - - + @freezed + class NumberOnly with _$NumberOnly { + const NumberOnly._(); + const factory NumberOnly({ - @JsonKey(name: r'JustNumber') + @JsonKey(name: r'JustNumber') num? justNumber, -}) = _NumberOnly; - - + }) = _NumberOnly; factory NumberOnly.fromJson(Map json) => _$NumberOnlyFromJson(json); @@ -31,10 +28,7 @@ const NumberOnly._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart index 8c78bdadaf8b..501a4b4f67ce 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart @@ -13,29 +13,26 @@ part of 'models.dart'; /// * [deprecatedRef] /// * [bars] -@freezed -class ObjectWithDeprecatedFields with _$ObjectWithDeprecatedFields { -const ObjectWithDeprecatedFields._(); - - + @freezed + class ObjectWithDeprecatedFields with _$ObjectWithDeprecatedFields { + const ObjectWithDeprecatedFields._(); + const factory ObjectWithDeprecatedFields({ - @JsonKey(name: r'uuid') + @JsonKey(name: r'uuid') String? uuid, - @JsonKey(name: r'id') + @JsonKey(name: r'id') num? id, - @JsonKey(name: r'deprecatedRef') + @JsonKey(name: r'deprecatedRef') DeprecatedObject? deprecatedRef, - @JsonKey(name: r'bars') + @JsonKey(name: r'bars') List< String? >? bars, -}) = _ObjectWithDeprecatedFields; - - + }) = _ObjectWithDeprecatedFields; factory ObjectWithDeprecatedFields.fromJson(Map json) => _$ObjectWithDeprecatedFieldsFromJson(json); @@ -45,10 +42,7 @@ const ObjectWithDeprecatedFields._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/order.dart index 543d035c9fa3..0c154903884c 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/order.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/order.dart @@ -15,34 +15,31 @@ part of 'models.dart'; /// * [status] - Order Status /// * [complete] -@freezed -class Order with _$Order { -const Order._(); - - + @freezed + class Order with _$Order { + const Order._(); + const factory Order({ - @JsonKey(name: r'id') + @JsonKey(name: r'id') int? id, - @JsonKey(name: r'petId') + @JsonKey(name: r'petId') int? petId, - @JsonKey(name: r'quantity') + @JsonKey(name: r'quantity') int? quantity, - @JsonKey(name: r'shipDate') + @JsonKey(name: r'shipDate') DateTime? shipDate, - /// Order Status - @JsonKey(name: r'status') + /// Order Status + @JsonKey(name: r'status') OrderStatusEnum? status, - @JsonKey(name: r'complete') + @JsonKey(name: r'complete') bool? complete, -}) = _Order; - - + }) = _Order; factory Order.fromJson(Map json) => _$OrderFromJson(json); @@ -52,20 +49,16 @@ const Order._(); - - } - /// Order Status -@JsonEnum(valueField: 'value') -enum OrderStatusEnum { - placed(value: r'placed'), - approved(value: r'approved'), - delivered(value: r'delivered'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const OrderStatusEnum({required this.value}); - final String value; -} - + @JsonEnum(valueField: 'value') + enum OrderStatusEnum { + placed(value: r'placed'), + approved(value: r'approved'), + delivered(value: r'delivered'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const OrderStatusEnum({required this.value}); + final String value; + } diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_composite.dart index b683fc76db42..9ca4d9bafe7e 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_composite.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_composite.dart @@ -12,24 +12,21 @@ part of 'models.dart'; /// * [myString] /// * [myBoolean] -@freezed -class OuterComposite with _$OuterComposite { -const OuterComposite._(); - - + @freezed + class OuterComposite with _$OuterComposite { + const OuterComposite._(); + const factory OuterComposite({ - @JsonKey(name: r'my_number') + @JsonKey(name: r'my_number') num? myNumber, - @JsonKey(name: r'my_string') + @JsonKey(name: r'my_string') String? myString, - @JsonKey(name: r'my_boolean') + @JsonKey(name: r'my_boolean') bool? myBoolean, -}) = _OuterComposite; - - + }) = _OuterComposite; factory OuterComposite.fromJson(Map json) => _$OuterCompositeFromJson(json); @@ -39,10 +36,7 @@ const OuterComposite._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart index 9a7e946faecf..09aa8e0241fa 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [value] -@freezed -class OuterObjectWithEnumProperty with _$OuterObjectWithEnumProperty { -const OuterObjectWithEnumProperty._(); - - + @freezed + class OuterObjectWithEnumProperty with _$OuterObjectWithEnumProperty { + const OuterObjectWithEnumProperty._(); + const factory OuterObjectWithEnumProperty({ - @JsonKey(name: r'value') + @JsonKey(name: r'value') required OuterEnumInteger value, -}) = _OuterObjectWithEnumProperty; - - + }) = _OuterObjectWithEnumProperty; factory OuterObjectWithEnumProperty.fromJson(Map json) => _$OuterObjectWithEnumPropertyFromJson(json); @@ -31,10 +28,7 @@ const OuterObjectWithEnumProperty._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/parent_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/parent_with_nullable.dart index f4ebcfe43f60..1daa3ecabd9b 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/parent_with_nullable.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/parent_with_nullable.dart @@ -11,59 +11,56 @@ part of 'models.dart'; /// * [type] /// * [nullableProperty] -@freezed -class ParentWithNullable with _$ParentWithNullable { -const ParentWithNullable._(); - - - const factory ParentWithNullable.childwithnullable({ - required ChildWithNullable childWithNullable, - }) = ParentWithNullableChildwithnullable; - const factory ParentWithNullable.unknown({ - @Default('Json does not satisfy any available types') String message, - required Map json, - @Default(DeserializationErrorType.UnKnownType) - DeserializationErrorType errorType, - @Default([]) List possibleTypes, - @Default([]) List deserializedModels, - }) = ParentWithNullableUnknown; - - + @freezed + sealed class ParentWithNullable with _$ParentWithNullable { + const ParentWithNullable._(); + + const factory ParentWithNullable.asChildWithNullable({ + required ChildWithNullable childWithNullableValue + }) = ParentWithNullableAsChildWithNullable; + const factory ParentWithNullable.unknown({ + @Default('Json does not satisfy any available types') String message, + required Map json, + + @Default(DeserializationErrorType.UnKnownType) + DeserializationErrorType errorType, + + @Default([]) + List possibleTypes, + + @Default([]) + List deserializedModels, + }) = ParentWithNullableUnknown; factory ParentWithNullable.fromJson(Map json) { - switch(json['type']){ - case 'ChildWithNullable': - return ParentWithNullable.childwithnullable( - childWithNullable : ChildWithNullable.fromJson(json), - ); - } - return ParentWithNullable.unknown(json: json); + switch(json['type']){ + case 'ChildWithNullable': + return ParentWithNullable.asChildWithNullable( + childWithNullableValue : ChildWithNullable.fromJson(json), + ); + } + return ParentWithNullable.unknown(json: json); } - - Map toJson() { - return when( - childwithnullable: (childWithNullable) => childWithNullable.toJson(), - unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, - ); - } - - + Map toJson() { + return when( + asChildWithNullable: (asChildWithNullable) => asChildWithNullable.toJson(), + unknown: (message, json, errorType, possibleTypes, deserializedModels) => {}, + ); + } } - -@JsonEnum(valueField: 'value') -enum ParentWithNullableTypeEnum { - childWithNullable(value: r'ChildWithNullable'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const ParentWithNullableTypeEnum({required this.value}); - final String value; -} - + @JsonEnum(valueField: 'value') + enum ParentWithNullableTypeEnum { + childWithNullable(value: r'ChildWithNullable'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const ParentWithNullableTypeEnum({required this.value}); + final String value; + } diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/pet.dart index bf4bbab02440..422bbbfab974 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/pet.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/pet.dart @@ -15,38 +15,35 @@ part of 'models.dart'; /// * [tags] /// * [status] - pet status in the store -@freezed -class Pet with _$Pet { -const Pet._(); - - + @freezed + class Pet with _$Pet { + const Pet._(); + const factory Pet({ - @JsonKey(name: r'id') + @JsonKey(name: r'id') int? id, - @JsonKey(name: r'category') + @JsonKey(name: r'category') Category? category, - @JsonKey(name: r'name') + @JsonKey(name: r'name') required String name, - @JsonKey(name: r'photoUrls') + @JsonKey(name: r'photoUrls') required Set< String? > photoUrls, - @JsonKey(name: r'tags') + @JsonKey(name: r'tags') List< Tag? >? tags, - /// pet status in the store - @JsonKey(name: r'status') + /// pet status in the store + @JsonKey(name: r'status') PetStatusEnum? status, -}) = _Pet; - - + }) = _Pet; factory Pet.fromJson(Map json) => _$PetFromJson(json); @@ -56,20 +53,16 @@ const Pet._(); - - } - /// pet status in the store -@JsonEnum(valueField: 'value') -enum PetStatusEnum { - available(value: r'available'), - pending(value: r'pending'), - sold(value: r'sold'), - unknownDefaultOpenApi(value: r'unknown_default_open_api'); - const PetStatusEnum({required this.value}); - final String value; -} - + @JsonEnum(valueField: 'value') + enum PetStatusEnum { + available(value: r'available'), + pending(value: r'pending'), + sold(value: r'sold'), + unknownDefaultOpenApi(value: r'unknown_default_open_api'); + const PetStatusEnum({required this.value}); + final String value; + } diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/read_only_first.dart index 95486163ea5f..0cb1ccb1957f 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/read_only_first.dart @@ -11,21 +11,18 @@ part of 'models.dart'; /// * [bar] /// * [baz] -@freezed -class ReadOnlyFirst with _$ReadOnlyFirst { -const ReadOnlyFirst._(); - - + @freezed + class ReadOnlyFirst with _$ReadOnlyFirst { + const ReadOnlyFirst._(); + const factory ReadOnlyFirst({ - @JsonKey(name: r'bar') + @JsonKey(name: r'bar') String? bar, - @JsonKey(name: r'baz') + @JsonKey(name: r'baz') String? baz, -}) = _ReadOnlyFirst; - - + }) = _ReadOnlyFirst; factory ReadOnlyFirst.fromJson(Map json) => _$ReadOnlyFirstFromJson(json); @@ -35,10 +32,7 @@ const ReadOnlyFirst._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/special_model_name.dart index 6919aa67e9cb..1bc8e76e305a 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/special_model_name.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] -@freezed -class SpecialModelName with _$SpecialModelName { -const SpecialModelName._(); - - + @freezed + class SpecialModelName with _$SpecialModelName { + const SpecialModelName._(); + const factory SpecialModelName({ - @JsonKey(name: r'$special[property.name]') + @JsonKey(name: r'$special[property.name]') int? dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, -}) = _SpecialModelName; - - + }) = _SpecialModelName; factory SpecialModelName.fromJson(Map json) => _$SpecialModelNameFromJson(json); @@ -31,10 +28,7 @@ const SpecialModelName._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/tag.dart index ecf57fea0818..7271f893b90e 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/tag.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/tag.dart @@ -11,21 +11,18 @@ part of 'models.dart'; /// * [id] /// * [name] -@freezed -class Tag with _$Tag { -const Tag._(); - - + @freezed + class Tag with _$Tag { + const Tag._(); + const factory Tag({ - @JsonKey(name: r'id') + @JsonKey(name: r'id') int? id, - @JsonKey(name: r'name') + @JsonKey(name: r'name') String? name, -}) = _Tag; - - + }) = _Tag; factory Tag.fromJson(Map json) => _$TagFromJson(json); @@ -35,10 +32,7 @@ const Tag._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/test_inline_freeform_additional_properties_request.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/test_inline_freeform_additional_properties_request.dart index 931a021a8cd9..e26649fa48f1 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/test_inline_freeform_additional_properties_request.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/test_inline_freeform_additional_properties_request.dart @@ -10,18 +10,15 @@ part of 'models.dart'; /// Properties: /// * [someProperty] -@freezed -class TestInlineFreeformAdditionalPropertiesRequest with _$TestInlineFreeformAdditionalPropertiesRequest { -const TestInlineFreeformAdditionalPropertiesRequest._(); - - + @freezed + class TestInlineFreeformAdditionalPropertiesRequest with _$TestInlineFreeformAdditionalPropertiesRequest { + const TestInlineFreeformAdditionalPropertiesRequest._(); + const factory TestInlineFreeformAdditionalPropertiesRequest({ - @JsonKey(name: r'someProperty') + @JsonKey(name: r'someProperty') String? someProperty, -}) = _TestInlineFreeformAdditionalPropertiesRequest; - - + }) = _TestInlineFreeformAdditionalPropertiesRequest; factory TestInlineFreeformAdditionalPropertiesRequest.fromJson(Map json) => _$TestInlineFreeformAdditionalPropertiesRequestFromJson(json); @@ -31,10 +28,7 @@ const TestInlineFreeformAdditionalPropertiesRequest._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/user.dart index 06bc9e1c887d..4e7ed7742c3f 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/user.dart +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/lib/src/model/user.dart @@ -17,40 +17,37 @@ part of 'models.dart'; /// * [phone] /// * [userStatus] - User Status -@freezed -class User with _$User { -const User._(); - - + @freezed + class User with _$User { + const User._(); + const factory User({ - @JsonKey(name: r'id') + @JsonKey(name: r'id') int? id, - @JsonKey(name: r'username') + @JsonKey(name: r'username') String? username, - @JsonKey(name: r'firstName') + @JsonKey(name: r'firstName') String? firstName, - @JsonKey(name: r'lastName') + @JsonKey(name: r'lastName') String? lastName, - @JsonKey(name: r'email') + @JsonKey(name: r'email') String? email, - @JsonKey(name: r'password') + @JsonKey(name: r'password') String? password, - @JsonKey(name: r'phone') + @JsonKey(name: r'phone') String? phone, - /// User Status - @JsonKey(name: r'userStatus') + /// User Status + @JsonKey(name: r'userStatus') int? userStatus, -}) = _User; - - + }) = _User; factory User.fromJson(Map json) => _$UserFromJson(json); @@ -60,10 +57,7 @@ const User._(); - - } - diff --git a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/pubspec.yaml index 12925113115d..445bc9f8f04d 100644 --- a/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/freezed/petstore_client_lib_fake/pubspec.yaml @@ -3,11 +3,12 @@ version: 1.0.0 description: OpenAPI API client homepage: homepage + environment: sdk: '^3.0.0' dependencies: - dio: '^5.2.0' + dio: '^5.7.0' freezed_annotation: '^2.4.4' json_annotation: '^4.9.0' @@ -15,4 +16,4 @@ dev_dependencies: freezed: '^2.5.2' json_serializable: '^6.8.0' build_runner: any - test: ^1.16.0 + test: '^1.16.0'