From 139bcfb62ab836fe1742b42645b8eb1ac3232745 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 20 Dec 2022 05:31:57 +0200 Subject: [PATCH 01/20] override createDiscriminator --- .../languages/DartDioClientCodegen.java | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) mode change 100644 => 100755 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java 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 old mode 100644 new mode 100755 index 25e60dc0a311..65c09dd36893 --- 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 @@ -19,10 +19,13 @@ import com.google.common.collect.Sets; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; +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.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; +import org.openapitools.codegen.CodegenDiscriminator.MappedModel; import org.openapitools.codegen.api.TemplatePathLocator; import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.meta.GeneratorMetadata; @@ -44,6 +47,7 @@ import java.io.File; import java.util.*; +import java.util.Map.Entry; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -275,7 +279,7 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { imports.put("Uint8List", "dart:typed_data"); imports.put("MultipartFile", DIO_IMPORT); } - + private void configureDateLibrary(String srcFolder) { switch (dateLibrary) { case DATE_LIBRARY_TIME_MACHINE: @@ -541,6 +545,28 @@ private void adaptToDartInheritance(Map objs) { } } + @Override + protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema, OpenAPI openAPI) { + CodegenDiscriminator sub = super.createDiscriminator(schemaName, schema, openAPI); + Discriminator originalDiscriminator = schema.getDiscriminator(); + if (originalDiscriminator!=null) { + Map originalMapping = originalDiscriminator.getMapping(); + if (originalMapping != null && !originalMapping.isEmpty()) { + //we already have a discriminator mapping, remove everything else + for (MappedModel currentMappings : new HashSet<>(sub.getMappedModels())) { + if (originalMapping.containsKey(currentMappings.getMappingName())) { + //all good + } else { + sub.getMapping().remove(currentMappings.getMappingName()); + sub.getMappedModels().remove(currentMappings); + } + } + } + } + return sub; + //sub.getMappedModels(). + } + @Override public Map postProcessAllModels(Map objs) { objs = super.postProcessAllModels(objs); From a410925758bd139cbbb5286133605b78c0c84db6 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 20 Dec 2022 08:39:39 +0200 Subject: [PATCH 02/20] assign discriminator = null to remove duplicates --- .../openapitools/codegen/languages/DartDioClientCodegen.java | 4 ++++ 1 file changed, 4 insertions(+) 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 65c09dd36893..8c354b557a18 100755 --- 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 @@ -453,6 +453,10 @@ private void adaptToDartInheritance(Map objs) { cm.vendorExtensions.put(kIsChild, isChild); cm.vendorExtensions.put(kIsParent, isParent); cm.vendorExtensions.put(kIsPure, isPure); + if (!isParent && (cm.oneOf == null || cm.oneOf.isEmpty()) && (cm.anyOf == null || cm.anyOf.isEmpty())) { + //discriminator has no meaning here + cm.discriminator=null; + } // when pure: // vars = allVars = selfOnlyProperties = kSelfAndAncestorOnlyProps // ancestorOnlyProps = empty From 91acb7223d968563ea82a9ca9af6ffda3eda828a Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 20 Dec 2022 08:39:59 +0200 Subject: [PATCH 03/20] added discriminatorValue extension --- .../dio/serialization/built_value/class.mustache | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache index a8a1339c6300..ad85794656b7 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache @@ -10,7 +10,17 @@ part '{{classFilename}}.g.dart'; {{>serialization/built_value/class_header}} { {{>serialization/built_value/class_members}} } - +{{#discriminator}}{{#hasDiscriminatorWithNonEmptyMapping}} +extension {{classname}}DiscriminatorExt on {{classname}} { + String? discriminatorValue() { + {{#mappedModels}} + if (this is {{modelName}}) { + return r'{{mappingName}}'; + } + {{/mappedModels}} + return null; + } +}{{/hasDiscriminatorWithNonEmptyMapping}}{{/discriminator}} {{>serialization/built_value/class_serializer}}{{#vendorExtensions.x-is-parent}} {{>serialization/built_value/class_concrete}}{{/vendorExtensions.x-is-parent}} From db5c229409c5aa93d94129452d0d1682ea981e11 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 20 Dec 2022 09:17:37 +0200 Subject: [PATCH 04/20] added _defaults --- .../languages/DartDioClientCodegen.java | 7 ++++++- .../serialization/built_value/class.mustache | 12 ++--------- .../built_value/class_discriminator.mustache | 20 +++++++++++++++++++ .../built_value/class_members.mustache | 2 +- .../built_value/class_serializer.mustache | 19 +++++------------- 5 files changed, 34 insertions(+), 26 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.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 8c354b557a18..a9ff6426bc49 100755 --- 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 @@ -404,6 +404,7 @@ private void syncRootTypesWithInnerVars(Map objs, CodegenM private final String kHasAncestorOnlyProps = "x-has-ancestor-only-props"; private final String kSelfAndAncestorOnlyProps = "x-self-and-ancestor-only-props"; private final String kHasSelfAndAncestorOnlyProps = "x-has-self-and-ancestor-only-props"; + private final String kParentDiscriminator = "x-parent-discriminator"; // adapts codegen models and property to dart rules of inheritance private void adaptToDartInheritance(Map objs) { @@ -455,7 +456,11 @@ private void adaptToDartInheritance(Map objs) { cm.vendorExtensions.put(kIsPure, isPure); if (!isParent && (cm.oneOf == null || cm.oneOf.isEmpty()) && (cm.anyOf == null || cm.anyOf.isEmpty())) { //discriminator has no meaning here - cm.discriminator=null; + if (cm.discriminator!=null) { + cm.vendorExtensions.put(kParentDiscriminator, cm.discriminator); + cm.discriminator=null; + } + } // when pure: // vars = allVars = selfOnlyProperties = kSelfAndAncestorOnlyProps diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache index ad85794656b7..9acd5ba70a08 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache @@ -11,16 +11,8 @@ part '{{classFilename}}.g.dart'; {{>serialization/built_value/class_members}} } {{#discriminator}}{{#hasDiscriminatorWithNonEmptyMapping}} -extension {{classname}}DiscriminatorExt on {{classname}} { - String? discriminatorValue() { - {{#mappedModels}} - if (this is {{modelName}}) { - return r'{{mappingName}}'; - } - {{/mappedModels}} - return null; - } -}{{/hasDiscriminatorWithNonEmptyMapping}}{{/discriminator}} +{{>serialization/built_value/class_discriminator}} +{{/hasDiscriminatorWithNonEmptyMapping}}{{/discriminator}} {{>serialization/built_value/class_serializer}}{{#vendorExtensions.x-is-parent}} {{>serialization/built_value/class_concrete}}{{/vendorExtensions.x-is-parent}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache new file mode 100644 index 000000000000..ea52580b2104 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache @@ -0,0 +1,20 @@ +extension {{classname}}DiscriminatorExt on {{classname}} { + String? discriminatorValue() { + {{#mappedModels}} + if (this is {{modelName}}) { + return r'{{mappingName}}'; + } + {{/mappedModels}} + return null; + } +} +extension {{classname}}BuilderDiscriminatorExt on {{classname}}Builder { + String? discriminatorValue() { + {{#mappedModels}} + if (this is {{modelName}}Builder) { + return r'{{mappingName}}'; + } + {{/mappedModels}} + return null; + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache index d814b9ee9d02..261c72458ab4 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache @@ -28,7 +28,7 @@ factory {{classname}}([void updates({{classname}}Builder b)]) = _${{classname}}; @BuiltValueHook(initializeBuilder: true) - static void _defaults({{{classname}}}Builder b) => b{{#vendorExtensions.x-self-and-ancestor-only-props}}{{#defaultValue}} + static void _defaults({{{classname}}}Builder b) => b{{#vendorExtensions.x-parent-discriminator}}..{{propertyName}}=b.discriminatorValue(){{/vendorExtensions.x-parent-discriminator}}{{#vendorExtensions.x-self-and-ancestor-only-props}}{{#defaultValue}} ..{{{name}}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}{{/vendorExtensions.x-self-and-ancestor-only-props}}; {{/vendorExtensions.x-is-parent}} @BuiltValueSerializer(custom: true) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache index 6edb8a019de0..413d184ee4cd 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache @@ -10,26 +10,17 @@ class _${{classname}}Serializer implements PrimitiveSerializer<{{classname}}> { {{{classname}}} object, { FullType specifiedType = FullType.unspecified, }) sync* { - {{#vendorExtensions.x-self-and-ancestor-only-props}} - {{#required}} - {{! - A required property need to always be part of the serialized output. - When it is nullable, null is serialized, otherwise it is an error if it is null. - }} - yield r'{{baseName}}'; - yield {{#isNullable}}object.{{{name}}} == null ? null : {{/isNullable}}serializers.serialize( - object.{{{name}}}, - specifiedType: const {{>serialization/built_value/variable_serializer_type}}, - ); - {{/required}} + {{#vendorExtensions.x-self-and-ancestor-only-props}} + {{! Non-required properties are only serialized if not null. }} {{^required}} if (object.{{{name}}} != null) { - {{! Non-required properties are only serialized if not null. }} + {{/required}} yield r'{{baseName}}'; - yield serializers.serialize( + yield {{#required}}{{#isNullable}}object.{{{name}}} == null ? null : {{/isNullable}}{{/required}}serializers.serialize( object.{{{name}}}, specifiedType: const {{>serialization/built_value/variable_serializer_type}}, ); + {{^required}} } {{/required}} {{/vendorExtensions.x-self-and-ancestor-only-props}} From 0d008610e9d59fb766aeb35268cebb6d680ae17e Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 20 Dec 2022 09:32:48 +0200 Subject: [PATCH 05/20] formatting --- .../built_value/class_serializer.mustache | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache index 413d184ee4cd..ffda1ab99393 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache @@ -15,11 +15,11 @@ class _${{classname}}Serializer implements PrimitiveSerializer<{{classname}}> { {{^required}} if (object.{{{name}}} != null) { {{/required}} - yield r'{{baseName}}'; - yield {{#required}}{{#isNullable}}object.{{{name}}} == null ? null : {{/isNullable}}{{/required}}serializers.serialize( - object.{{{name}}}, - specifiedType: const {{>serialization/built_value/variable_serializer_type}}, - ); + yield r'{{baseName}}'; + yield {{#required}}{{#isNullable}}object.{{{name}}} == null ? null : {{/isNullable}}{{/required}}serializers.serialize( + object.{{{name}}}, + specifiedType: const {{>serialization/built_value/variable_serializer_type}}, + ); {{^required}} } {{/required}} From d2bf302f70ecfd313fcfdfd904752abad4cfb36c Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 20 Dec 2022 09:33:23 +0200 Subject: [PATCH 06/20] samples --- .../dart-dio/oneof/lib/src/model/apple.dart | 10 +- .../dart-dio/oneof/lib/src/model/banana.dart | 10 +- .../dart-dio/oneof/lib/src/model/fruit.dart | 10 +- .../lib/src/model/addressable.dart | 20 +-- .../lib/src/model/bar.dart | 74 ++++++----- .../lib/src/model/bar_create.dart | 74 ++++++----- .../lib/src/model/bar_ref.dart | 64 +++++----- .../lib/src/model/bar_ref_or_value.dart | 23 ++++ .../lib/src/model/entity.dart | 87 ++++++++++--- .../lib/src/model/entity_ref.dart | 83 +++++++----- .../lib/src/model/extensible.dart | 20 +-- .../lib/src/model/foo.dart | 64 +++++----- .../lib/src/model/foo_ref.dart | 74 ++++++----- .../lib/src/model/foo_ref_or_value.dart | 23 ++++ .../lib/src/model/pasta.dart | 54 ++++---- .../lib/src/model/pizza.dart | 67 ++++++---- .../lib/src/model/pizza_speziale.dart | 64 +++++----- .../oneof_primitive/lib/src/model/child.dart | 10 +- .../model/additional_properties_class.dart | 20 +-- .../lib/src/model/all_of_with_single_ref.dart | 20 +-- .../lib/src/model/animal.dart | 33 ++++- .../lib/src/model/api_response.dart | 30 ++--- .../model/array_of_array_of_number_only.dart | 10 +- .../lib/src/model/array_of_number_only.dart | 10 +- .../lib/src/model/array_test.dart | 30 ++--- .../lib/src/model/capitalization.dart | 60 ++++----- .../lib/src/model/cat.dart | 24 ++-- .../lib/src/model/cat_all_of.dart | 10 +- .../lib/src/model/category.dart | 10 +- .../lib/src/model/class_model.dart | 10 +- .../lib/src/model/deprecated_object.dart | 10 +- .../lib/src/model/dog.dart | 24 ++-- .../lib/src/model/dog_all_of.dart | 10 +- .../lib/src/model/enum_arrays.dart | 20 +-- .../lib/src/model/enum_test.dart | 70 +++++----- .../lib/src/model/file_schema_test_class.dart | 20 +-- .../lib/src/model/foo.dart | 10 +- .../src/model/foo_get_default_response.dart | 10 +- .../lib/src/model/format_test.dart | 120 +++++++++--------- .../lib/src/model/has_only_read_only.dart | 20 +-- .../lib/src/model/health_check_result.dart | 10 +- .../lib/src/model/map_test.dart | 40 +++--- ...rties_and_additional_properties_class.dart | 30 ++--- .../lib/src/model/model200_response.dart | 20 +-- .../lib/src/model/model_client.dart | 10 +- .../lib/src/model/model_file.dart | 10 +- .../lib/src/model/model_list.dart | 10 +- .../lib/src/model/model_return.dart | 10 +- .../lib/src/model/name.dart | 30 ++--- .../lib/src/model/nullable_class.dart | 120 +++++++++--------- .../lib/src/model/number_only.dart | 10 +- .../model/object_with_deprecated_fields.dart | 40 +++--- .../lib/src/model/order.dart | 60 ++++----- .../lib/src/model/outer_composite.dart | 30 ++--- .../lib/src/model/pet.dart | 40 +++--- .../lib/src/model/read_only_first.dart | 20 +-- .../lib/src/model/special_model_name.dart | 10 +- .../lib/src/model/tag.dart | 20 +-- .../lib/src/model/user.dart | 80 ++++++------ 59 files changed, 1075 insertions(+), 937 deletions(-) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart index 02ca94190b96..e4021d1ff1dc 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart @@ -41,11 +41,11 @@ class _$AppleSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.kind != null) { - yield r'kind'; - yield serializers.serialize( - object.kind, - specifiedType: const FullType(String), - ); + yield r'kind'; + yield serializers.serialize( + object.kind, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart index bf2d632ee114..709d550d9d09 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart @@ -41,11 +41,11 @@ class _$BananaSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.count != null) { - yield r'count'; - yield serializers.serialize( - object.count, - specifiedType: const FullType(num), - ); + yield r'count'; + yield serializers.serialize( + object.count, + specifiedType: const FullType(num), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart index 11f8cfa70501..55d16a92814a 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart @@ -49,11 +49,11 @@ class _$FruitSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.color != null) { - yield r'color'; - yield serializers.serialize( - object.color, - specifiedType: const FullType(String), - ); + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart index 0ab0936d5673..8f11cb9137ac 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart @@ -40,18 +40,18 @@ class _$AddressableSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart index ee5c3ec5be1d..7bb2a8bd4472 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart @@ -32,14 +32,12 @@ abstract class Bar implements Entity, Built { @BuiltValueField(wireName: r'barPropA') String? get barPropA; - static const String discriminatorFieldName = r'@type'; - Bar._(); factory Bar([void updates(BarBuilder b)]) = _$Bar; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarBuilder b) => b; + static void _defaults(BarBuilder b) => b..atType=b.discriminatorValue(); @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarSerializer(); @@ -58,46 +56,46 @@ class _$BarSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.foo != null) { - yield r'foo'; - yield serializers.serialize( - object.foo, - specifiedType: const FullType(FooRefOrValue), - ); + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(FooRefOrValue), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.fooPropB != null) { - yield r'fooPropB'; - yield serializers.serialize( - object.fooPropB, - specifiedType: const FullType(String), - ); + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( @@ -105,11 +103,11 @@ class _$BarSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.barPropA != null) { - yield r'barPropA'; - yield serializers.serialize( - object.barPropA, - specifiedType: const FullType(String), - ); + yield r'barPropA'; + yield serializers.serialize( + object.barPropA, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart index 2cd7603faa33..9f4dddd7fe08 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart @@ -32,14 +32,12 @@ abstract class BarCreate implements Entity, Built { @BuiltValueField(wireName: r'barPropA') String? get barPropA; - static const String discriminatorFieldName = r'@type'; - BarCreate._(); factory BarCreate([void updates(BarCreateBuilder b)]) = _$BarCreate; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarCreateBuilder b) => b; + static void _defaults(BarCreateBuilder b) => b..atType=b.discriminatorValue(); @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarCreateSerializer(); @@ -58,46 +56,46 @@ class _$BarCreateSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.foo != null) { - yield r'foo'; - yield serializers.serialize( - object.foo, - specifiedType: const FullType(FooRefOrValue), - ); + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(FooRefOrValue), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.fooPropB != null) { - yield r'fooPropB'; - yield serializers.serialize( - object.fooPropB, - specifiedType: const FullType(String), - ); + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( @@ -105,11 +103,11 @@ class _$BarCreateSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.barPropA != null) { - yield r'barPropA'; - yield serializers.serialize( - object.barPropA, - specifiedType: const FullType(String), - ); + yield r'barPropA'; + yield serializers.serialize( + object.barPropA, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart index eec9b1ce5107..de547823706c 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart @@ -19,14 +19,12 @@ part 'bar_ref.g.dart'; /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue() abstract class BarRef implements EntityRef, Built { - static const String discriminatorFieldName = r'@type'; - BarRef._(); factory BarRef([void updates(BarRefBuilder b)]) = _$BarRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarRefBuilder b) => b; + static void _defaults(BarRefBuilder b) => b..atType=b.discriminatorValue(); @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarRefSerializer(); @@ -45,46 +43,46 @@ class _$BarRefSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atReferredType != null) { - yield r'@referredType'; - yield serializers.serialize( - object.atReferredType, - specifiedType: const FullType(String), - ); + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); } if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart index 9f73e2131d5b..6a74610e4a13 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart @@ -42,6 +42,29 @@ abstract class BarRefOrValue implements Built get serializer => _$BarRefOrValueSerializer(); } +extension BarRefOrValueDiscriminatorExt on BarRefOrValue { + String? discriminatorValue() { + if (this is Bar) { + return r'Bar'; + } + if (this is BarRef) { + return r'BarRef'; + } + return null; + } +} +extension BarRefOrValueBuilderDiscriminatorExt on BarRefOrValueBuilder { + String? discriminatorValue() { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarRefBuilder) { + return r'BarRef'; + } + return null; + } +} + class _$BarRefOrValueSerializer implements PrimitiveSerializer { @override final Iterable types = const [BarRefOrValue, _$BarRefOrValue]; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart index 040a825e092a..da455e46e9a2 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart @@ -41,6 +41,53 @@ abstract class Entity implements Addressable, Extensible { static Serializer get serializer => _$EntitySerializer(); } +extension EntityDiscriminatorExt on Entity { + String? discriminatorValue() { + if (this is Bar) { + return r'Bar'; + } + if (this is BarCreate) { + return r'Bar_Create'; + } + if (this is Foo) { + return r'Foo'; + } + if (this is Pasta) { + return r'Pasta'; + } + if (this is Pizza) { + return r'Pizza'; + } + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; + } +} +extension EntityBuilderDiscriminatorExt on EntityBuilder { + String? discriminatorValue() { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarCreateBuilder) { + return r'Bar_Create'; + } + if (this is FooBuilder) { + return r'Foo'; + } + if (this is PastaBuilder) { + return r'Pasta'; + } + if (this is PizzaBuilder) { + return r'Pizza'; + } + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; + } +} + class _$EntitySerializer implements PrimitiveSerializer { @override final Iterable types = const [Entity]; @@ -54,32 +101,32 @@ class _$EntitySerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart index 872209eab5d5..faf648789144 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart @@ -43,6 +43,29 @@ abstract class EntityRef implements Addressable, Extensible { static Serializer get serializer => _$EntityRefSerializer(); } +extension EntityRefDiscriminatorExt on EntityRef { + String? discriminatorValue() { + if (this is BarRef) { + return r'BarRef'; + } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } +} +extension EntityRefBuilderDiscriminatorExt on EntityRefBuilder { + String? discriminatorValue() { + if (this is BarRefBuilder) { + return r'BarRef'; + } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; + } +} + class _$EntityRefSerializer implements PrimitiveSerializer { @override final Iterable types = const [EntityRef]; @@ -56,46 +79,46 @@ class _$EntityRefSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atReferredType != null) { - yield r'@referredType'; - yield serializers.serialize( - object.atReferredType, - specifiedType: const FullType(String), - ); + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); } if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart index 2423fb276412..dab6756ac23c 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart @@ -45,18 +45,18 @@ class _$ExtensibleSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart index bd5e339c469e..c8b4680a9801 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart @@ -27,14 +27,12 @@ abstract class Foo implements Entity, Built { @BuiltValueField(wireName: r'fooPropB') String? get fooPropB; - static const String discriminatorFieldName = r'@type'; - Foo._(); factory Foo([void updates(FooBuilder b)]) = _$Foo; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooBuilder b) => b; + static void _defaults(FooBuilder b) => b..atType=b.discriminatorValue(); @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooSerializer(); @@ -53,46 +51,46 @@ class _$FooSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.fooPropA != null) { - yield r'fooPropA'; - yield serializers.serialize( - object.fooPropA, - specifiedType: const FullType(String), - ); + yield r'fooPropA'; + yield serializers.serialize( + object.fooPropA, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.fooPropB != null) { - yield r'fooPropB'; - yield serializers.serialize( - object.fooPropB, - specifiedType: const FullType(String), - ); + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart index 7e92a709f675..99aec53c25d8 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart @@ -23,14 +23,12 @@ abstract class FooRef implements EntityRef, Built { @BuiltValueField(wireName: r'foorefPropA') String? get foorefPropA; - static const String discriminatorFieldName = r'@type'; - FooRef._(); factory FooRef([void updates(FooRefBuilder b)]) = _$FooRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooRefBuilder b) => b; + static void _defaults(FooRefBuilder b) => b..atType=b.discriminatorValue(); @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooRefSerializer(); @@ -49,53 +47,53 @@ class _$FooRefSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atReferredType != null) { - yield r'@referredType'; - yield serializers.serialize( - object.atReferredType, - specifiedType: const FullType(String), - ); + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); } if (object.foorefPropA != null) { - yield r'foorefPropA'; - yield serializers.serialize( - object.foorefPropA, - specifiedType: const FullType(String), - ); + yield r'foorefPropA'; + yield serializers.serialize( + object.foorefPropA, + specifiedType: const FullType(String), + ); } if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart index 115d11d8f689..5d91ed60a646 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart @@ -42,6 +42,29 @@ abstract class FooRefOrValue implements Built get serializer => _$FooRefOrValueSerializer(); } +extension FooRefOrValueDiscriminatorExt on FooRefOrValue { + String? discriminatorValue() { + if (this is Foo) { + return r'Foo'; + } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } +} +extension FooRefOrValueBuilderDiscriminatorExt on FooRefOrValueBuilder { + String? discriminatorValue() { + if (this is FooBuilder) { + return r'Foo'; + } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; + } +} + class _$FooRefOrValueSerializer implements PrimitiveSerializer { @override final Iterable types = const [FooRefOrValue, _$FooRefOrValue]; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart index 5af34ea17681..1eba5a5bf148 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart @@ -23,14 +23,12 @@ abstract class Pasta implements Entity, Built { @BuiltValueField(wireName: r'vendor') String? get vendor; - static const String discriminatorFieldName = r'@type'; - Pasta._(); factory Pasta([void updates(PastaBuilder b)]) = _$Pasta; @BuiltValueHook(initializeBuilder: true) - static void _defaults(PastaBuilder b) => b; + static void _defaults(PastaBuilder b) => b..atType=b.discriminatorValue(); @BuiltValueSerializer(custom: true) static Serializer get serializer => _$PastaSerializer(); @@ -49,32 +47,32 @@ class _$PastaSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( @@ -82,11 +80,11 @@ class _$PastaSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.vendor != null) { - yield r'vendor'; - yield serializers.serialize( - object.vendor, - specifiedType: const FullType(String), - ); + yield r'vendor'; + yield serializers.serialize( + object.vendor, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart index 2948323c9e44..ad9dd50f477f 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart @@ -34,6 +34,23 @@ abstract class Pizza implements Entity { static Serializer get serializer => _$PizzaSerializer(); } +extension PizzaDiscriminatorExt on Pizza { + String? discriminatorValue() { + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; + } +} +extension PizzaBuilderDiscriminatorExt on PizzaBuilder { + String? discriminatorValue() { + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; + } +} + class _$PizzaSerializer implements PrimitiveSerializer { @override final Iterable types = const [Pizza]; @@ -47,39 +64,39 @@ class _$PizzaSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.pizzaSize != null) { - yield r'pizzaSize'; - yield serializers.serialize( - object.pizzaSize, - specifiedType: const FullType(num), - ); + yield r'pizzaSize'; + yield serializers.serialize( + object.pizzaSize, + specifiedType: const FullType(num), + ); } if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart index dd911e1a1197..df0df5c1a1f6 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart @@ -23,14 +23,12 @@ abstract class PizzaSpeziale implements Pizza, Built b; + static void _defaults(PizzaSpezialeBuilder b) => b..atType=b.discriminatorValue(); @BuiltValueSerializer(custom: true) static Serializer get serializer => _$PizzaSpezialeSerializer(); @@ -49,46 +47,46 @@ class _$PizzaSpezialeSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.pizzaSize != null) { - yield r'pizzaSize'; - yield serializers.serialize( - object.pizzaSize, - specifiedType: const FullType(num), - ); + yield r'pizzaSize'; + yield serializers.serialize( + object.pizzaSize, + specifiedType: const FullType(num), + ); } if (object.toppings != null) { - yield r'toppings'; - yield serializers.serialize( - object.toppings, - specifiedType: const FullType(String), - ); + yield r'toppings'; + yield serializers.serialize( + object.toppings, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart index 987b52ca7240..8c9bfa85f3ec 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart @@ -41,11 +41,11 @@ class _$ChildSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart index 3fdac6d5a44f..b152edcdb583 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart @@ -46,18 +46,18 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer get serializer => _$AnimalSerializer(); } +extension AnimalDiscriminatorExt on Animal { + String? discriminatorValue() { + if (this is Cat) { + return r'Cat'; + } + if (this is Dog) { + return r'Dog'; + } + return null; + } +} +extension AnimalBuilderDiscriminatorExt on AnimalBuilder { + String? discriminatorValue() { + if (this is CatBuilder) { + return r'Cat'; + } + if (this is DogBuilder) { + return r'Dog'; + } + return null; + } +} + class _$AnimalSerializer implements PrimitiveSerializer { @override final Iterable types = const [Animal]; @@ -52,11 +75,11 @@ class _$AnimalSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.color != null) { - yield r'color'; - yield serializers.serialize( - object.color, - specifiedType: const FullType(String), - ); + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart index aadcd792e2bf..f167cf495fa4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart @@ -49,25 +49,25 @@ class _$ApiResponseSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.code != null) { - yield r'code'; - yield serializers.serialize( - object.code, - specifiedType: const FullType(int), - ); + yield r'code'; + yield serializers.serialize( + object.code, + specifiedType: const FullType(int), + ); } if (object.type != null) { - yield r'type'; - yield serializers.serialize( - object.type, - specifiedType: const FullType(String), - ); + yield r'type'; + yield serializers.serialize( + object.type, + specifiedType: const FullType(String), + ); } if (object.message != null) { - yield r'message'; - yield serializers.serialize( - object.message, - specifiedType: const FullType(String), - ); + yield r'message'; + yield serializers.serialize( + object.message, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart index 5bc0982b8ab0..d8698018afca 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart @@ -42,11 +42,11 @@ class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.arrayOfString != null) { - yield r'array_of_string'; - yield serializers.serialize( - object.arrayOfString, - specifiedType: const FullType(BuiltList, [FullType(String)]), - ); + yield r'array_of_string'; + yield serializers.serialize( + object.arrayOfString, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); } if (object.arrayArrayOfInteger != null) { - yield r'array_array_of_integer'; - yield serializers.serialize( - object.arrayArrayOfInteger, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), - ); + yield r'array_array_of_integer'; + yield serializers.serialize( + object.arrayArrayOfInteger, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + ); } if (object.arrayArrayOfModel != null) { - yield r'array_array_of_model'; - yield serializers.serialize( - object.arrayArrayOfModel, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), - ); + yield r'array_array_of_model'; + yield serializers.serialize( + object.arrayArrayOfModel, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart index 75827b9a429e..23b9a888625f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart @@ -62,46 +62,46 @@ class _$CapitalizationSerializer implements PrimitiveSerializer FullType specifiedType = FullType.unspecified, }) sync* { if (object.smallCamel != null) { - yield r'smallCamel'; - yield serializers.serialize( - object.smallCamel, - specifiedType: const FullType(String), - ); + yield r'smallCamel'; + yield serializers.serialize( + object.smallCamel, + specifiedType: const FullType(String), + ); } if (object.capitalCamel != null) { - yield r'CapitalCamel'; - yield serializers.serialize( - object.capitalCamel, - specifiedType: const FullType(String), - ); + yield r'CapitalCamel'; + yield serializers.serialize( + object.capitalCamel, + specifiedType: const FullType(String), + ); } if (object.smallSnake != null) { - yield r'small_Snake'; - yield serializers.serialize( - object.smallSnake, - specifiedType: const FullType(String), - ); + yield r'small_Snake'; + yield serializers.serialize( + object.smallSnake, + specifiedType: const FullType(String), + ); } if (object.capitalSnake != null) { - yield r'Capital_Snake'; - yield serializers.serialize( - object.capitalSnake, - specifiedType: const FullType(String), - ); + yield r'Capital_Snake'; + yield serializers.serialize( + object.capitalSnake, + specifiedType: const FullType(String), + ); } if (object.sCAETHFlowPoints != null) { - yield r'SCA_ETH_Flow_Points'; - yield serializers.serialize( - object.sCAETHFlowPoints, - specifiedType: const FullType(String), - ); + yield r'SCA_ETH_Flow_Points'; + yield serializers.serialize( + object.sCAETHFlowPoints, + specifiedType: const FullType(String), + ); } if (object.ATT_NAME != null) { - yield r'ATT_NAME'; - yield serializers.serialize( - object.ATT_NAME, - specifiedType: const FullType(String), - ); + yield r'ATT_NAME'; + yield serializers.serialize( + object.ATT_NAME, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart index 31a2b14769c3..6821fc37138a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart @@ -18,14 +18,12 @@ part 'cat.g.dart'; /// * [declawed] @BuiltValue() abstract class Cat implements Animal, CatAllOf, Built { - static const String discriminatorFieldName = r'className'; - Cat._(); factory Cat([void updates(CatBuilder b)]) = _$Cat; @BuiltValueHook(initializeBuilder: true) - static void _defaults(CatBuilder b) => b + static void _defaults(CatBuilder b) => b..className=b.discriminatorValue() ..color = 'red'; @BuiltValueSerializer(custom: true) @@ -50,18 +48,18 @@ class _$CatSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.color != null) { - yield r'color'; - yield serializers.serialize( - object.color, - specifiedType: const FullType(String), - ); + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); } if (object.declawed != null) { - yield r'declawed'; - yield serializers.serialize( - object.declawed, - specifiedType: const FullType(bool), - ); + yield r'declawed'; + yield serializers.serialize( + object.declawed, + specifiedType: const FullType(bool), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart index 02d9cce0cae1..ce2ee3e49997 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart @@ -34,11 +34,11 @@ class _$CatAllOfSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.declawed != null) { - yield r'declawed'; - yield serializers.serialize( - object.declawed, - specifiedType: const FullType(bool), - ); + yield r'declawed'; + yield serializers.serialize( + object.declawed, + specifiedType: const FullType(bool), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart index 3a541dd1fa92..5e8cf7ac9045 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart @@ -46,11 +46,11 @@ class _$CategorySerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(int), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); } yield r'name'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart index 51166943c6cd..e2c0a9f04b8c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart @@ -41,11 +41,11 @@ class _$ClassModelSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.classField != null) { - yield r'_class'; - yield serializers.serialize( - object.classField, - specifiedType: const FullType(String), - ); + yield r'_class'; + yield serializers.serialize( + object.classField, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart index 91d0b428e9bb..13133f48ea66 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart @@ -41,11 +41,11 @@ class _$DeprecatedObjectSerializer implements PrimitiveSerializer { - static const String discriminatorFieldName = r'className'; - Dog._(); factory Dog([void updates(DogBuilder b)]) = _$Dog; @BuiltValueHook(initializeBuilder: true) - static void _defaults(DogBuilder b) => b + static void _defaults(DogBuilder b) => b..className=b.discriminatorValue() ..color = 'red'; @BuiltValueSerializer(custom: true) @@ -50,18 +48,18 @@ class _$DogSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.color != null) { - yield r'color'; - yield serializers.serialize( - object.color, - specifiedType: const FullType(String), - ); + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); } if (object.breed != null) { - yield r'breed'; - yield serializers.serialize( - object.breed, - specifiedType: const FullType(String), - ); + yield r'breed'; + yield serializers.serialize( + object.breed, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart index bd52567fa60a..5fbd3e253804 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart @@ -34,11 +34,11 @@ class _$DogAllOfSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.breed != null) { - yield r'breed'; - yield serializers.serialize( - object.breed, - specifiedType: const FullType(String), - ); + yield r'breed'; + yield serializers.serialize( + object.breed, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart index b79a175e833c..628b05cde312 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart @@ -48,18 +48,18 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.justSymbol != null) { - yield r'just_symbol'; - yield serializers.serialize( - object.justSymbol, - specifiedType: const FullType(EnumArraysJustSymbolEnum), - ); + yield r'just_symbol'; + yield serializers.serialize( + object.justSymbol, + specifiedType: const FullType(EnumArraysJustSymbolEnum), + ); } if (object.arrayEnum != null) { - yield r'array_enum'; - yield serializers.serialize( - object.arrayEnum, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), - ); + yield r'array_enum'; + yield serializers.serialize( + object.arrayEnum, + specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart index 831f5b9d6d2d..3bda1ae5135f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart @@ -82,11 +82,11 @@ class _$EnumTestSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.enumString != null) { - yield r'enum_string'; - yield serializers.serialize( - object.enumString, - specifiedType: const FullType(EnumTestEnumStringEnum), - ); + yield r'enum_string'; + yield serializers.serialize( + object.enumString, + specifiedType: const FullType(EnumTestEnumStringEnum), + ); } yield r'enum_string_required'; yield serializers.serialize( @@ -94,46 +94,46 @@ class _$EnumTestSerializer implements PrimitiveSerializer { specifiedType: const FullType(EnumTestEnumStringRequiredEnum), ); if (object.enumInteger != null) { - yield r'enum_integer'; - yield serializers.serialize( - object.enumInteger, - specifiedType: const FullType(EnumTestEnumIntegerEnum), - ); + yield r'enum_integer'; + yield serializers.serialize( + object.enumInteger, + specifiedType: const FullType(EnumTestEnumIntegerEnum), + ); } if (object.enumNumber != null) { - yield r'enum_number'; - yield serializers.serialize( - object.enumNumber, - specifiedType: const FullType(EnumTestEnumNumberEnum), - ); + yield r'enum_number'; + yield serializers.serialize( + object.enumNumber, + specifiedType: const FullType(EnumTestEnumNumberEnum), + ); } if (object.outerEnum != null) { - yield r'outerEnum'; - yield serializers.serialize( - object.outerEnum, - specifiedType: const FullType.nullable(OuterEnum), - ); + yield r'outerEnum'; + yield serializers.serialize( + object.outerEnum, + specifiedType: const FullType.nullable(OuterEnum), + ); } if (object.outerEnumInteger != null) { - yield r'outerEnumInteger'; - yield serializers.serialize( - object.outerEnumInteger, - specifiedType: const FullType(OuterEnumInteger), - ); + yield r'outerEnumInteger'; + yield serializers.serialize( + object.outerEnumInteger, + specifiedType: const FullType(OuterEnumInteger), + ); } if (object.outerEnumDefaultValue != null) { - yield r'outerEnumDefaultValue'; - yield serializers.serialize( - object.outerEnumDefaultValue, - specifiedType: const FullType(OuterEnumDefaultValue), - ); + yield r'outerEnumDefaultValue'; + yield serializers.serialize( + object.outerEnumDefaultValue, + specifiedType: const FullType(OuterEnumDefaultValue), + ); } if (object.outerEnumIntegerDefaultValue != null) { - yield r'outerEnumIntegerDefaultValue'; - yield serializers.serialize( - object.outerEnumIntegerDefaultValue, - specifiedType: const FullType(OuterEnumIntegerDefaultValue), - ); + yield r'outerEnumIntegerDefaultValue'; + yield serializers.serialize( + object.outerEnumIntegerDefaultValue, + specifiedType: const FullType(OuterEnumIntegerDefaultValue), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart index 5ab41d14f437..83292d63934b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart @@ -47,18 +47,18 @@ class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.bar != null) { - yield r'bar'; - yield serializers.serialize( - object.bar, - specifiedType: const FullType(String), - ); + yield r'bar'; + yield serializers.serialize( + object.bar, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart index b5903ebd5dbf..24ab0718f3a7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart @@ -42,11 +42,11 @@ class _$FooGetDefaultResponseSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.integer != null) { - yield r'integer'; - yield serializers.serialize( - object.integer, - specifiedType: const FullType(int), - ); + yield r'integer'; + yield serializers.serialize( + object.integer, + specifiedType: const FullType(int), + ); } if (object.int32 != null) { - yield r'int32'; - yield serializers.serialize( - object.int32, - specifiedType: const FullType(int), - ); + yield r'int32'; + yield serializers.serialize( + object.int32, + specifiedType: const FullType(int), + ); } if (object.int64 != null) { - yield r'int64'; - yield serializers.serialize( - object.int64, - specifiedType: const FullType(int), - ); + yield r'int64'; + yield serializers.serialize( + object.int64, + specifiedType: const FullType(int), + ); } yield r'number'; yield serializers.serialize( @@ -131,32 +131,32 @@ class _$FormatTestSerializer implements PrimitiveSerializer { specifiedType: const FullType(num), ); if (object.float != null) { - yield r'float'; - yield serializers.serialize( - object.float, - specifiedType: const FullType(double), - ); + yield r'float'; + yield serializers.serialize( + object.float, + specifiedType: const FullType(double), + ); } if (object.double_ != null) { - yield r'double'; - yield serializers.serialize( - object.double_, - specifiedType: const FullType(double), - ); + yield r'double'; + yield serializers.serialize( + object.double_, + specifiedType: const FullType(double), + ); } if (object.decimal != null) { - yield r'decimal'; - yield serializers.serialize( - object.decimal, - specifiedType: const FullType(double), - ); + yield r'decimal'; + yield serializers.serialize( + object.decimal, + specifiedType: const FullType(double), + ); } if (object.string != null) { - yield r'string'; - yield serializers.serialize( - object.string, - specifiedType: const FullType(String), - ); + yield r'string'; + yield serializers.serialize( + object.string, + specifiedType: const FullType(String), + ); } yield r'byte'; yield serializers.serialize( @@ -164,11 +164,11 @@ class _$FormatTestSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.binary != null) { - yield r'binary'; - yield serializers.serialize( - object.binary, - specifiedType: const FullType(Uint8List), - ); + yield r'binary'; + yield serializers.serialize( + object.binary, + specifiedType: const FullType(Uint8List), + ); } yield r'date'; yield serializers.serialize( @@ -176,18 +176,18 @@ class _$FormatTestSerializer implements PrimitiveSerializer { specifiedType: const FullType(Date), ); if (object.dateTime != null) { - yield r'dateTime'; - yield serializers.serialize( - object.dateTime, - specifiedType: const FullType(DateTime), - ); + yield r'dateTime'; + yield serializers.serialize( + object.dateTime, + specifiedType: const FullType(DateTime), + ); } if (object.uuid != null) { - yield r'uuid'; - yield serializers.serialize( - object.uuid, - specifiedType: const FullType(String), - ); + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); } yield r'password'; yield serializers.serialize( @@ -195,18 +195,18 @@ class _$FormatTestSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.patternWithDigits != null) { - yield r'pattern_with_digits'; - yield serializers.serialize( - object.patternWithDigits, - specifiedType: const FullType(String), - ); + yield r'pattern_with_digits'; + yield serializers.serialize( + object.patternWithDigits, + specifiedType: const FullType(String), + ); } if (object.patternWithDigitsAndDelimiter != null) { - yield r'pattern_with_digits_and_delimiter'; - yield serializers.serialize( - object.patternWithDigitsAndDelimiter, - specifiedType: const FullType(String), - ); + yield r'pattern_with_digits_and_delimiter'; + yield serializers.serialize( + object.patternWithDigitsAndDelimiter, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart index 9683985cf198..cd3984c047f9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart @@ -45,18 +45,18 @@ class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.mapMapOfString != null) { - yield r'map_map_of_string'; - yield serializers.serialize( - object.mapMapOfString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), - ); + yield r'map_map_of_string'; + yield serializers.serialize( + object.mapMapOfString, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ); } if (object.mapOfEnumString != null) { - yield r'map_of_enum_string'; - yield serializers.serialize( - object.mapOfEnumString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), - ); + yield r'map_of_enum_string'; + yield serializers.serialize( + object.mapOfEnumString, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + ); } if (object.directMap != null) { - yield r'direct_map'; - yield serializers.serialize( - object.directMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), - ); + yield r'direct_map'; + yield serializers.serialize( + object.directMap, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ); } if (object.indirectMap != null) { - yield r'indirect_map'; - yield serializers.serialize( - object.indirectMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), - ); + yield r'indirect_map'; + yield serializers.serialize( + object.indirectMap, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart index 76b5933ae5a7..1186750e994a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -51,25 +51,25 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti FullType specifiedType = FullType.unspecified, }) sync* { if (object.uuid != null) { - yield r'uuid'; - yield serializers.serialize( - object.uuid, - specifiedType: const FullType(String), - ); + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); } if (object.dateTime != null) { - yield r'dateTime'; - yield serializers.serialize( - object.dateTime, - specifiedType: const FullType(DateTime), - ); + yield r'dateTime'; + yield serializers.serialize( + object.dateTime, + specifiedType: const FullType(DateTime), + ); } if (object.map != null) { - yield r'map'; - yield serializers.serialize( - object.map, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), - ); + yield r'map'; + yield serializers.serialize( + object.map, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart index 0a2cfb4411ac..d021c2fa67dd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart @@ -45,18 +45,18 @@ class _$Model200ResponseSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.client != null) { - yield r'client'; - yield serializers.serialize( - object.client, - specifiedType: const FullType(String), - ); + yield r'client'; + yield serializers.serialize( + object.client, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart index 2702c21d36f2..b7d05bcb3c3b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart @@ -42,11 +42,11 @@ class _$ModelFileSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.sourceURI != null) { - yield r'sourceURI'; - yield serializers.serialize( - object.sourceURI, - specifiedType: const FullType(String), - ); + yield r'sourceURI'; + yield serializers.serialize( + object.sourceURI, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart index 579853258f8e..2617f178dc82 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart @@ -41,11 +41,11 @@ class _$ModelListSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.n123list != null) { - yield r'123-list'; - yield serializers.serialize( - object.n123list, - specifiedType: const FullType(String), - ); + yield r'123-list'; + yield serializers.serialize( + object.n123list, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart index 45a2f67f8a40..4882cedf34ed 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart @@ -41,11 +41,11 @@ class _$ModelReturnSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.return_ != null) { - yield r'return'; - yield serializers.serialize( - object.return_, - specifiedType: const FullType(int), - ); + yield r'return'; + yield serializers.serialize( + object.return_, + specifiedType: const FullType(int), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart index 10fa99e6a5f7..53e43b95c21e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart @@ -58,25 +58,25 @@ class _$NameSerializer implements PrimitiveSerializer { specifiedType: const FullType(int), ); if (object.snakeCase != null) { - yield r'snake_case'; - yield serializers.serialize( - object.snakeCase, - specifiedType: const FullType(int), - ); + yield r'snake_case'; + yield serializers.serialize( + object.snakeCase, + specifiedType: const FullType(int), + ); } if (object.property != null) { - yield r'property'; - yield serializers.serialize( - object.property, - specifiedType: const FullType(String), - ); + yield r'property'; + yield serializers.serialize( + object.property, + specifiedType: const FullType(String), + ); } if (object.n123number != null) { - yield r'123Number'; - yield serializers.serialize( - object.n123number, - specifiedType: const FullType(int), - ); + yield r'123Number'; + yield serializers.serialize( + object.n123number, + specifiedType: const FullType(int), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart index c993a41303f0..6a1082dc3983 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart @@ -88,88 +88,88 @@ class _$NullableClassSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.integerProp != null) { - yield r'integer_prop'; - yield serializers.serialize( - object.integerProp, - specifiedType: const FullType.nullable(int), - ); + yield r'integer_prop'; + yield serializers.serialize( + object.integerProp, + specifiedType: const FullType.nullable(int), + ); } if (object.numberProp != null) { - yield r'number_prop'; - yield serializers.serialize( - object.numberProp, - specifiedType: const FullType.nullable(num), - ); + yield r'number_prop'; + yield serializers.serialize( + object.numberProp, + specifiedType: const FullType.nullable(num), + ); } if (object.booleanProp != null) { - yield r'boolean_prop'; - yield serializers.serialize( - object.booleanProp, - specifiedType: const FullType.nullable(bool), - ); + yield r'boolean_prop'; + yield serializers.serialize( + object.booleanProp, + specifiedType: const FullType.nullable(bool), + ); } if (object.stringProp != null) { - yield r'string_prop'; - yield serializers.serialize( - object.stringProp, - specifiedType: const FullType.nullable(String), - ); + yield r'string_prop'; + yield serializers.serialize( + object.stringProp, + specifiedType: const FullType.nullable(String), + ); } if (object.dateProp != null) { - yield r'date_prop'; - yield serializers.serialize( - object.dateProp, - specifiedType: const FullType.nullable(Date), - ); + yield r'date_prop'; + yield serializers.serialize( + object.dateProp, + specifiedType: const FullType.nullable(Date), + ); } if (object.datetimeProp != null) { - yield r'datetime_prop'; - yield serializers.serialize( - object.datetimeProp, - specifiedType: const FullType.nullable(DateTime), - ); + yield r'datetime_prop'; + yield serializers.serialize( + object.datetimeProp, + specifiedType: const FullType.nullable(DateTime), + ); } if (object.arrayNullableProp != null) { - yield r'array_nullable_prop'; - yield serializers.serialize( - object.arrayNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), - ); + yield r'array_nullable_prop'; + yield serializers.serialize( + object.arrayNullableProp, + specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + ); } if (object.arrayAndItemsNullableProp != null) { - yield r'array_and_items_nullable_prop'; - yield serializers.serialize( - object.arrayAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), - ); + yield r'array_and_items_nullable_prop'; + yield serializers.serialize( + object.arrayAndItemsNullableProp, + specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + ); } if (object.arrayItemsNullable != null) { - yield r'array_items_nullable'; - yield serializers.serialize( - object.arrayItemsNullable, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), - ); + yield r'array_items_nullable'; + yield serializers.serialize( + object.arrayItemsNullable, + specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + ); } if (object.objectNullableProp != null) { - yield r'object_nullable_prop'; - yield serializers.serialize( - object.objectNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), - ); + yield r'object_nullable_prop'; + yield serializers.serialize( + object.objectNullableProp, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + ); } if (object.objectAndItemsNullableProp != null) { - yield r'object_and_items_nullable_prop'; - yield serializers.serialize( - object.objectAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), - ); + yield r'object_and_items_nullable_prop'; + yield serializers.serialize( + object.objectAndItemsNullableProp, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); } if (object.objectItemsNullable != null) { - yield r'object_items_nullable'; - yield serializers.serialize( - object.objectItemsNullable, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), - ); + yield r'object_items_nullable'; + yield serializers.serialize( + object.objectItemsNullable, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart index 482a95f3e521..20c45fab22e2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart @@ -41,11 +41,11 @@ class _$NumberOnlySerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.justNumber != null) { - yield r'JustNumber'; - yield serializers.serialize( - object.justNumber, - specifiedType: const FullType(num), - ); + yield r'JustNumber'; + yield serializers.serialize( + object.justNumber, + specifiedType: const FullType(num), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart index f59131ea6fbf..26780b70b11f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart @@ -55,32 +55,32 @@ class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(int), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); } if (object.petId != null) { - yield r'petId'; - yield serializers.serialize( - object.petId, - specifiedType: const FullType(int), - ); + yield r'petId'; + yield serializers.serialize( + object.petId, + specifiedType: const FullType(int), + ); } if (object.quantity != null) { - yield r'quantity'; - yield serializers.serialize( - object.quantity, - specifiedType: const FullType(int), - ); + yield r'quantity'; + yield serializers.serialize( + object.quantity, + specifiedType: const FullType(int), + ); } if (object.shipDate != null) { - yield r'shipDate'; - yield serializers.serialize( - object.shipDate, - specifiedType: const FullType(DateTime), - ); + yield r'shipDate'; + yield serializers.serialize( + object.shipDate, + specifiedType: const FullType(DateTime), + ); } if (object.status != null) { - yield r'status'; - yield serializers.serialize( - object.status, - specifiedType: const FullType(OrderStatusEnum), - ); + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(OrderStatusEnum), + ); } if (object.complete != null) { - yield r'complete'; - yield serializers.serialize( - object.complete, - specifiedType: const FullType(bool), - ); + yield r'complete'; + yield serializers.serialize( + object.complete, + specifiedType: const FullType(bool), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart index 0d6341cc1299..5ea2562cfd9d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart @@ -49,25 +49,25 @@ class _$OuterCompositeSerializer implements PrimitiveSerializer FullType specifiedType = FullType.unspecified, }) sync* { if (object.myNumber != null) { - yield r'my_number'; - yield serializers.serialize( - object.myNumber, - specifiedType: const FullType(num), - ); + yield r'my_number'; + yield serializers.serialize( + object.myNumber, + specifiedType: const FullType(num), + ); } if (object.myString != null) { - yield r'my_string'; - yield serializers.serialize( - object.myString, - specifiedType: const FullType(String), - ); + yield r'my_string'; + yield serializers.serialize( + object.myString, + specifiedType: const FullType(String), + ); } if (object.myBoolean != null) { - yield r'my_boolean'; - yield serializers.serialize( - object.myBoolean, - specifiedType: const FullType(bool), - ); + yield r'my_boolean'; + yield serializers.serialize( + object.myBoolean, + specifiedType: const FullType(bool), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart index 4d6358bef27d..d6e51674f194 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart @@ -66,18 +66,18 @@ class _$PetSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(int), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); } if (object.category != null) { - yield r'category'; - yield serializers.serialize( - object.category, - specifiedType: const FullType(Category), - ); + yield r'category'; + yield serializers.serialize( + object.category, + specifiedType: const FullType(Category), + ); } yield r'name'; yield serializers.serialize( @@ -90,18 +90,18 @@ class _$PetSerializer implements PrimitiveSerializer { specifiedType: const FullType(BuiltSet, [FullType(String)]), ); if (object.tags != null) { - yield r'tags'; - yield serializers.serialize( - object.tags, - specifiedType: const FullType(BuiltList, [FullType(Tag)]), - ); + yield r'tags'; + yield serializers.serialize( + object.tags, + specifiedType: const FullType(BuiltList, [FullType(Tag)]), + ); } if (object.status != null) { - yield r'status'; - yield serializers.serialize( - object.status, - specifiedType: const FullType(PetStatusEnum), - ); + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(PetStatusEnum), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart index b619217ab3cb..9739971d9d73 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart @@ -45,18 +45,18 @@ class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.bar != null) { - yield r'bar'; - yield serializers.serialize( - object.bar, - specifiedType: const FullType(String), - ); + yield r'bar'; + yield serializers.serialize( + object.bar, + specifiedType: const FullType(String), + ); } if (object.baz != null) { - yield r'baz'; - yield serializers.serialize( - object.baz, - specifiedType: const FullType(String), - ); + yield r'baz'; + yield serializers.serialize( + object.baz, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart index fa860056b45d..7397aafd045b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart @@ -41,11 +41,11 @@ class _$SpecialModelNameSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(int), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); } if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart index f7577d7e1ee9..438f84425970 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart @@ -70,60 +70,60 @@ class _$UserSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(int), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); } if (object.username != null) { - yield r'username'; - yield serializers.serialize( - object.username, - specifiedType: const FullType(String), - ); + yield r'username'; + yield serializers.serialize( + object.username, + specifiedType: const FullType(String), + ); } if (object.firstName != null) { - yield r'firstName'; - yield serializers.serialize( - object.firstName, - specifiedType: const FullType(String), - ); + yield r'firstName'; + yield serializers.serialize( + object.firstName, + specifiedType: const FullType(String), + ); } if (object.lastName != null) { - yield r'lastName'; - yield serializers.serialize( - object.lastName, - specifiedType: const FullType(String), - ); + yield r'lastName'; + yield serializers.serialize( + object.lastName, + specifiedType: const FullType(String), + ); } if (object.email != null) { - yield r'email'; - yield serializers.serialize( - object.email, - specifiedType: const FullType(String), - ); + yield r'email'; + yield serializers.serialize( + object.email, + specifiedType: const FullType(String), + ); } if (object.password != null) { - yield r'password'; - yield serializers.serialize( - object.password, - specifiedType: const FullType(String), - ); + yield r'password'; + yield serializers.serialize( + object.password, + specifiedType: const FullType(String), + ); } if (object.phone != null) { - yield r'phone'; - yield serializers.serialize( - object.phone, - specifiedType: const FullType(String), - ); + yield r'phone'; + yield serializers.serialize( + object.phone, + specifiedType: const FullType(String), + ); } if (object.userStatus != null) { - yield r'userStatus'; - yield serializers.serialize( - object.userStatus, - specifiedType: const FullType(int), - ); + yield r'userStatus'; + yield serializers.serialize( + object.userStatus, + specifiedType: const FullType(int), + ); } } From 8f3b24b9946ed93385806f3a52579e56f4668b36 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 20 Dec 2022 17:20:33 +0200 Subject: [PATCH 07/20] use gitter instead --- .../serialization/built_value/class_discriminator.mustache | 4 ++-- .../dio/serialization/built_value/class_members.mustache | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache index ea52580b2104..f867345883b1 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache @@ -1,5 +1,5 @@ extension {{classname}}DiscriminatorExt on {{classname}} { - String? discriminatorValue() { + String? get discriminatorValue { {{#mappedModels}} if (this is {{modelName}}) { return r'{{mappingName}}'; @@ -9,7 +9,7 @@ extension {{classname}}DiscriminatorExt on {{classname}} { } } extension {{classname}}BuilderDiscriminatorExt on {{classname}}Builder { - String? discriminatorValue() { + String? get discriminatorValue { {{#mappedModels}} if (this is {{modelName}}Builder) { return r'{{mappingName}}'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache index 261c72458ab4..7fb4c4d74be0 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache @@ -28,7 +28,7 @@ factory {{classname}}([void updates({{classname}}Builder b)]) = _${{classname}}; @BuiltValueHook(initializeBuilder: true) - static void _defaults({{{classname}}}Builder b) => b{{#vendorExtensions.x-parent-discriminator}}..{{propertyName}}=b.discriminatorValue(){{/vendorExtensions.x-parent-discriminator}}{{#vendorExtensions.x-self-and-ancestor-only-props}}{{#defaultValue}} + static void _defaults({{{classname}}}Builder b) => b{{#vendorExtensions.x-parent-discriminator}}..{{propertyName}}=b.discriminatorValue{{/vendorExtensions.x-parent-discriminator}}{{#vendorExtensions.x-self-and-ancestor-only-props}}{{#defaultValue}} ..{{{name}}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}{{/vendorExtensions.x-self-and-ancestor-only-props}}; {{/vendorExtensions.x-is-parent}} @BuiltValueSerializer(custom: true) From f471c1bfbdb7db6ba190fa5b624cf290281356ea Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 20 Dec 2022 17:20:41 +0200 Subject: [PATCH 08/20] remove comment --- .../org/openapitools/codegen/languages/DartDioClientCodegen.java | 1 - 1 file changed, 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 a9ff6426bc49..8ad35c7d1ba5 100755 --- 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 @@ -573,7 +573,6 @@ protected CodegenDiscriminator createDiscriminator(String schemaName, Schema sch } } return sub; - //sub.getMappedModels(). } @Override From b40118224f542f17cb8d66480954370ba3d7f2ec Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 20 Dec 2022 17:28:21 +0200 Subject: [PATCH 09/20] updated samples --- .../oneof_polymorphism_and_inheritance/lib/src/model/bar.dart | 2 +- .../lib/src/model/bar_create.dart | 2 +- .../lib/src/model/bar_ref.dart | 2 +- .../lib/src/model/bar_ref_or_value.dart | 4 ++-- .../lib/src/model/entity.dart | 4 ++-- .../lib/src/model/entity_ref.dart | 4 ++-- .../oneof_polymorphism_and_inheritance/lib/src/model/foo.dart | 2 +- .../lib/src/model/foo_ref.dart | 2 +- .../lib/src/model/foo_ref_or_value.dart | 4 ++-- .../lib/src/model/pasta.dart | 2 +- .../lib/src/model/pizza.dart | 4 ++-- .../lib/src/model/pizza_speziale.dart | 2 +- .../petstore_client_lib_fake/lib/src/model/animal.dart | 4 ++-- .../dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart | 2 +- .../dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart | 2 +- 15 files changed, 21 insertions(+), 21 deletions(-) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart index 7bb2a8bd4472..604fe29b14a4 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart @@ -37,7 +37,7 @@ abstract class Bar implements Entity, Built { factory Bar([void updates(BarBuilder b)]) = _$Bar; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarBuilder b) => b..atType=b.discriminatorValue(); + static void _defaults(BarBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarSerializer(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart index 9f4dddd7fe08..0e6d7ea6fd17 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart @@ -37,7 +37,7 @@ abstract class BarCreate implements Entity, Built { factory BarCreate([void updates(BarCreateBuilder b)]) = _$BarCreate; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarCreateBuilder b) => b..atType=b.discriminatorValue(); + static void _defaults(BarCreateBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarCreateSerializer(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart index de547823706c..f86c99c3905c 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart @@ -24,7 +24,7 @@ abstract class BarRef implements EntityRef, Built { factory BarRef([void updates(BarRefBuilder b)]) = _$BarRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarRefBuilder b) => b..atType=b.discriminatorValue(); + static void _defaults(BarRefBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarRefSerializer(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart index 6a74610e4a13..4af61384ab76 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart @@ -43,7 +43,7 @@ abstract class BarRefOrValue implements Built { factory Foo([void updates(FooBuilder b)]) = _$Foo; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooBuilder b) => b..atType=b.discriminatorValue(); + static void _defaults(FooBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooSerializer(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart index 99aec53c25d8..e2239fcb2575 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart @@ -28,7 +28,7 @@ abstract class FooRef implements EntityRef, Built { factory FooRef([void updates(FooRefBuilder b)]) = _$FooRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooRefBuilder b) => b..atType=b.discriminatorValue(); + static void _defaults(FooRefBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooRefSerializer(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart index 5d91ed60a646..af3e4875d9d6 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart @@ -43,7 +43,7 @@ abstract class FooRefOrValue implements Built { factory Pasta([void updates(PastaBuilder b)]) = _$Pasta; @BuiltValueHook(initializeBuilder: true) - static void _defaults(PastaBuilder b) => b..atType=b.discriminatorValue(); + static void _defaults(PastaBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$PastaSerializer(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart index ad9dd50f477f..11efe9a2807d 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart @@ -35,7 +35,7 @@ abstract class Pizza implements Entity { } extension PizzaDiscriminatorExt on Pizza { - String? discriminatorValue() { + String? get discriminatorValue { if (this is PizzaSpeziale) { return r'PizzaSpeziale'; } @@ -43,7 +43,7 @@ extension PizzaDiscriminatorExt on Pizza { } } extension PizzaBuilderDiscriminatorExt on PizzaBuilder { - String? discriminatorValue() { + String? get discriminatorValue { if (this is PizzaSpezialeBuilder) { return r'PizzaSpeziale'; } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart index df0df5c1a1f6..b023093de766 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart @@ -28,7 +28,7 @@ abstract class PizzaSpeziale implements Pizza, Built b..atType=b.discriminatorValue(); + static void _defaults(PizzaSpezialeBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$PizzaSpezialeSerializer(); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart index e3b75283c834..bd786b68a4ed 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart @@ -35,7 +35,7 @@ abstract class Animal { } extension AnimalDiscriminatorExt on Animal { - String? discriminatorValue() { + String? get discriminatorValue { if (this is Cat) { return r'Cat'; } @@ -46,7 +46,7 @@ extension AnimalDiscriminatorExt on Animal { } } extension AnimalBuilderDiscriminatorExt on AnimalBuilder { - String? discriminatorValue() { + String? get discriminatorValue { if (this is CatBuilder) { return r'Cat'; } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart index 6821fc37138a..713cad8fabd7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart @@ -23,7 +23,7 @@ abstract class Cat implements Animal, CatAllOf, Built { factory Cat([void updates(CatBuilder b)]) = _$Cat; @BuiltValueHook(initializeBuilder: true) - static void _defaults(CatBuilder b) => b..className=b.discriminatorValue() + static void _defaults(CatBuilder b) => b..className=b.discriminatorValue ..color = 'red'; @BuiltValueSerializer(custom: true) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart index 5c067fa04c66..dee46d188e4d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart @@ -23,7 +23,7 @@ abstract class Dog implements Animal, DogAllOf, Built { factory Dog([void updates(DogBuilder b)]) = _$Dog; @BuiltValueHook(initializeBuilder: true) - static void _defaults(DogBuilder b) => b..className=b.discriminatorValue() + static void _defaults(DogBuilder b) => b..className=b.discriminatorValue ..color = 'red'; @BuiltValueSerializer(custom: true) From 7b6d2350a4b19c68c301b122575789ae96a50677 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 20 Dec 2022 17:40:21 +0200 Subject: [PATCH 10/20] revert formatting changes --- .../built_value/class_serializer.mustache | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache index ffda1ab99393..6edb8a019de0 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache @@ -10,17 +10,26 @@ class _${{classname}}Serializer implements PrimitiveSerializer<{{classname}}> { {{{classname}}} object, { FullType specifiedType = FullType.unspecified, }) sync* { - {{#vendorExtensions.x-self-and-ancestor-only-props}} - {{! Non-required properties are only serialized if not null. }} - {{^required}} - if (object.{{{name}}} != null) { - {{/required}} + {{#vendorExtensions.x-self-and-ancestor-only-props}} + {{#required}} + {{! + A required property need to always be part of the serialized output. + When it is nullable, null is serialized, otherwise it is an error if it is null. + }} yield r'{{baseName}}'; - yield {{#required}}{{#isNullable}}object.{{{name}}} == null ? null : {{/isNullable}}{{/required}}serializers.serialize( + yield {{#isNullable}}object.{{{name}}} == null ? null : {{/isNullable}}serializers.serialize( object.{{{name}}}, specifiedType: const {{>serialization/built_value/variable_serializer_type}}, ); + {{/required}} {{^required}} + if (object.{{{name}}} != null) { + {{! Non-required properties are only serialized if not null. }} + yield r'{{baseName}}'; + yield serializers.serialize( + object.{{{name}}}, + specifiedType: const {{>serialization/built_value/variable_serializer_type}}, + ); } {{/required}} {{/vendorExtensions.x-self-and-ancestor-only-props}} From 51ca2946eabf24446b96ca4cc58da3fa6ac0fda8 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 20 Dec 2022 17:40:38 +0200 Subject: [PATCH 11/20] update samples --- .../dart-dio/oneof/lib/src/model/apple.dart | 10 +- .../dart-dio/oneof/lib/src/model/banana.dart | 10 +- .../dart-dio/oneof/lib/src/model/fruit.dart | 10 +- .../lib/src/model/addressable.dart | 20 +-- .../lib/src/model/bar.dart | 70 +++++----- .../lib/src/model/bar_create.dart | 70 +++++----- .../lib/src/model/bar_ref.dart | 60 ++++----- .../lib/src/model/entity.dart | 40 +++--- .../lib/src/model/entity_ref.dart | 60 ++++----- .../lib/src/model/extensible.dart | 20 +-- .../lib/src/model/foo.dart | 60 ++++----- .../lib/src/model/foo_ref.dart | 70 +++++----- .../lib/src/model/pasta.dart | 50 ++++---- .../lib/src/model/pizza.dart | 50 ++++---- .../lib/src/model/pizza_speziale.dart | 60 ++++----- .../oneof_primitive/lib/src/model/child.dart | 10 +- .../model/additional_properties_class.dart | 20 +-- .../lib/src/model/all_of_with_single_ref.dart | 20 +-- .../lib/src/model/animal.dart | 10 +- .../lib/src/model/api_response.dart | 30 ++--- .../model/array_of_array_of_number_only.dart | 10 +- .../lib/src/model/array_of_number_only.dart | 10 +- .../lib/src/model/array_test.dart | 30 ++--- .../lib/src/model/capitalization.dart | 60 ++++----- .../lib/src/model/cat.dart | 20 +-- .../lib/src/model/cat_all_of.dart | 10 +- .../lib/src/model/category.dart | 10 +- .../lib/src/model/class_model.dart | 10 +- .../lib/src/model/deprecated_object.dart | 10 +- .../lib/src/model/dog.dart | 20 +-- .../lib/src/model/dog_all_of.dart | 10 +- .../lib/src/model/enum_arrays.dart | 20 +-- .../lib/src/model/enum_test.dart | 70 +++++----- .../lib/src/model/file_schema_test_class.dart | 20 +-- .../lib/src/model/foo.dart | 10 +- .../src/model/foo_get_default_response.dart | 10 +- .../lib/src/model/format_test.dart | 120 +++++++++--------- .../lib/src/model/has_only_read_only.dart | 20 +-- .../lib/src/model/health_check_result.dart | 10 +- .../lib/src/model/map_test.dart | 40 +++--- ...rties_and_additional_properties_class.dart | 30 ++--- .../lib/src/model/model200_response.dart | 20 +-- .../lib/src/model/model_client.dart | 10 +- .../lib/src/model/model_file.dart | 10 +- .../lib/src/model/model_list.dart | 10 +- .../lib/src/model/model_return.dart | 10 +- .../lib/src/model/name.dart | 30 ++--- .../lib/src/model/nullable_class.dart | 120 +++++++++--------- .../lib/src/model/number_only.dart | 10 +- .../model/object_with_deprecated_fields.dart | 40 +++--- .../lib/src/model/order.dart | 60 ++++----- .../lib/src/model/outer_composite.dart | 30 ++--- .../lib/src/model/pet.dart | 40 +++--- .../lib/src/model/read_only_first.dart | 20 +-- .../lib/src/model/special_model_name.dart | 10 +- .../lib/src/model/tag.dart | 20 +-- .../lib/src/model/user.dart | 80 ++++++------ 57 files changed, 910 insertions(+), 910 deletions(-) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart index e4021d1ff1dc..02ca94190b96 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart @@ -41,11 +41,11 @@ class _$AppleSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.kind != null) { - yield r'kind'; - yield serializers.serialize( - object.kind, - specifiedType: const FullType(String), - ); + yield r'kind'; + yield serializers.serialize( + object.kind, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart index 709d550d9d09..bf2d632ee114 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart @@ -41,11 +41,11 @@ class _$BananaSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.count != null) { - yield r'count'; - yield serializers.serialize( - object.count, - specifiedType: const FullType(num), - ); + yield r'count'; + yield serializers.serialize( + object.count, + specifiedType: const FullType(num), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart index 55d16a92814a..11f8cfa70501 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart @@ -49,11 +49,11 @@ class _$FruitSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.color != null) { - yield r'color'; - yield serializers.serialize( - object.color, - specifiedType: const FullType(String), - ); + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart index 8f11cb9137ac..0ab0936d5673 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart @@ -40,18 +40,18 @@ class _$AddressableSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart index 604fe29b14a4..cb769550b4f2 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart @@ -56,46 +56,46 @@ class _$BarSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.foo != null) { - yield r'foo'; - yield serializers.serialize( - object.foo, - specifiedType: const FullType(FooRefOrValue), - ); + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(FooRefOrValue), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.fooPropB != null) { - yield r'fooPropB'; - yield serializers.serialize( - object.fooPropB, - specifiedType: const FullType(String), - ); + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( @@ -103,11 +103,11 @@ class _$BarSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.barPropA != null) { - yield r'barPropA'; - yield serializers.serialize( - object.barPropA, - specifiedType: const FullType(String), - ); + yield r'barPropA'; + yield serializers.serialize( + object.barPropA, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart index 0e6d7ea6fd17..8942b6433f5e 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart @@ -56,46 +56,46 @@ class _$BarCreateSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.foo != null) { - yield r'foo'; - yield serializers.serialize( - object.foo, - specifiedType: const FullType(FooRefOrValue), - ); + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(FooRefOrValue), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.fooPropB != null) { - yield r'fooPropB'; - yield serializers.serialize( - object.fooPropB, - specifiedType: const FullType(String), - ); + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( @@ -103,11 +103,11 @@ class _$BarCreateSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.barPropA != null) { - yield r'barPropA'; - yield serializers.serialize( - object.barPropA, - specifiedType: const FullType(String), - ); + yield r'barPropA'; + yield serializers.serialize( + object.barPropA, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart index f86c99c3905c..2b9d2727a448 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart @@ -43,46 +43,46 @@ class _$BarRefSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atReferredType != null) { - yield r'@referredType'; - yield serializers.serialize( - object.atReferredType, - specifiedType: const FullType(String), - ); + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); } if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart index 4e6659a93130..7e27fab47387 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart @@ -101,32 +101,32 @@ class _$EntitySerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart index 8afcc22d0004..7502c94dd7f3 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart @@ -79,46 +79,46 @@ class _$EntityRefSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atReferredType != null) { - yield r'@referredType'; - yield serializers.serialize( - object.atReferredType, - specifiedType: const FullType(String), - ); + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); } if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart index dab6756ac23c..2423fb276412 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart @@ -45,18 +45,18 @@ class _$ExtensibleSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart index 078c2056bea9..d2e1f5817f20 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart @@ -51,46 +51,46 @@ class _$FooSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.fooPropA != null) { - yield r'fooPropA'; - yield serializers.serialize( - object.fooPropA, - specifiedType: const FullType(String), - ); + yield r'fooPropA'; + yield serializers.serialize( + object.fooPropA, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.fooPropB != null) { - yield r'fooPropB'; - yield serializers.serialize( - object.fooPropB, - specifiedType: const FullType(String), - ); + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart index e2239fcb2575..1f77d990f0e8 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart @@ -47,53 +47,53 @@ class _$FooRefSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atReferredType != null) { - yield r'@referredType'; - yield serializers.serialize( - object.atReferredType, - specifiedType: const FullType(String), - ); + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); } if (object.foorefPropA != null) { - yield r'foorefPropA'; - yield serializers.serialize( - object.foorefPropA, - specifiedType: const FullType(String), - ); + yield r'foorefPropA'; + yield serializers.serialize( + object.foorefPropA, + specifiedType: const FullType(String), + ); } if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart index 338f5d1e2055..e8b1ebdf31ea 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart @@ -47,32 +47,32 @@ class _$PastaSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( @@ -80,11 +80,11 @@ class _$PastaSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.vendor != null) { - yield r'vendor'; - yield serializers.serialize( - object.vendor, - specifiedType: const FullType(String), - ); + yield r'vendor'; + yield serializers.serialize( + object.vendor, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart index 11efe9a2807d..14c06db06d7e 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart @@ -64,39 +64,39 @@ class _$PizzaSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.pizzaSize != null) { - yield r'pizzaSize'; - yield serializers.serialize( - object.pizzaSize, - specifiedType: const FullType(num), - ); + yield r'pizzaSize'; + yield serializers.serialize( + object.pizzaSize, + specifiedType: const FullType(num), + ); } if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart index b023093de766..673052cc8fcf 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart @@ -47,46 +47,46 @@ class _$PizzaSpezialeSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); } if (object.pizzaSize != null) { - yield r'pizzaSize'; - yield serializers.serialize( - object.pizzaSize, - specifiedType: const FullType(num), - ); + yield r'pizzaSize'; + yield serializers.serialize( + object.pizzaSize, + specifiedType: const FullType(num), + ); } if (object.toppings != null) { - yield r'toppings'; - yield serializers.serialize( - object.toppings, - specifiedType: const FullType(String), - ); + yield r'toppings'; + yield serializers.serialize( + object.toppings, + specifiedType: const FullType(String), + ); } if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); } if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); } if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); } yield r'@type'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart index 8c9bfa85f3ec..987b52ca7240 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart @@ -41,11 +41,11 @@ class _$ChildSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart index b152edcdb583..3fdac6d5a44f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart @@ -46,18 +46,18 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.color != null) { - yield r'color'; - yield serializers.serialize( - object.color, - specifiedType: const FullType(String), - ); + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart index f167cf495fa4..aadcd792e2bf 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart @@ -49,25 +49,25 @@ class _$ApiResponseSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.code != null) { - yield r'code'; - yield serializers.serialize( - object.code, - specifiedType: const FullType(int), - ); + yield r'code'; + yield serializers.serialize( + object.code, + specifiedType: const FullType(int), + ); } if (object.type != null) { - yield r'type'; - yield serializers.serialize( - object.type, - specifiedType: const FullType(String), - ); + yield r'type'; + yield serializers.serialize( + object.type, + specifiedType: const FullType(String), + ); } if (object.message != null) { - yield r'message'; - yield serializers.serialize( - object.message, - specifiedType: const FullType(String), - ); + yield r'message'; + yield serializers.serialize( + object.message, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart index d8698018afca..5bc0982b8ab0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart @@ -42,11 +42,11 @@ class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.arrayOfString != null) { - yield r'array_of_string'; - yield serializers.serialize( - object.arrayOfString, - specifiedType: const FullType(BuiltList, [FullType(String)]), - ); + yield r'array_of_string'; + yield serializers.serialize( + object.arrayOfString, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); } if (object.arrayArrayOfInteger != null) { - yield r'array_array_of_integer'; - yield serializers.serialize( - object.arrayArrayOfInteger, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), - ); + yield r'array_array_of_integer'; + yield serializers.serialize( + object.arrayArrayOfInteger, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + ); } if (object.arrayArrayOfModel != null) { - yield r'array_array_of_model'; - yield serializers.serialize( - object.arrayArrayOfModel, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), - ); + yield r'array_array_of_model'; + yield serializers.serialize( + object.arrayArrayOfModel, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart index 23b9a888625f..75827b9a429e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart @@ -62,46 +62,46 @@ class _$CapitalizationSerializer implements PrimitiveSerializer FullType specifiedType = FullType.unspecified, }) sync* { if (object.smallCamel != null) { - yield r'smallCamel'; - yield serializers.serialize( - object.smallCamel, - specifiedType: const FullType(String), - ); + yield r'smallCamel'; + yield serializers.serialize( + object.smallCamel, + specifiedType: const FullType(String), + ); } if (object.capitalCamel != null) { - yield r'CapitalCamel'; - yield serializers.serialize( - object.capitalCamel, - specifiedType: const FullType(String), - ); + yield r'CapitalCamel'; + yield serializers.serialize( + object.capitalCamel, + specifiedType: const FullType(String), + ); } if (object.smallSnake != null) { - yield r'small_Snake'; - yield serializers.serialize( - object.smallSnake, - specifiedType: const FullType(String), - ); + yield r'small_Snake'; + yield serializers.serialize( + object.smallSnake, + specifiedType: const FullType(String), + ); } if (object.capitalSnake != null) { - yield r'Capital_Snake'; - yield serializers.serialize( - object.capitalSnake, - specifiedType: const FullType(String), - ); + yield r'Capital_Snake'; + yield serializers.serialize( + object.capitalSnake, + specifiedType: const FullType(String), + ); } if (object.sCAETHFlowPoints != null) { - yield r'SCA_ETH_Flow_Points'; - yield serializers.serialize( - object.sCAETHFlowPoints, - specifiedType: const FullType(String), - ); + yield r'SCA_ETH_Flow_Points'; + yield serializers.serialize( + object.sCAETHFlowPoints, + specifiedType: const FullType(String), + ); } if (object.ATT_NAME != null) { - yield r'ATT_NAME'; - yield serializers.serialize( - object.ATT_NAME, - specifiedType: const FullType(String), - ); + yield r'ATT_NAME'; + yield serializers.serialize( + object.ATT_NAME, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart index 713cad8fabd7..23d19b38b05a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart @@ -48,18 +48,18 @@ class _$CatSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.color != null) { - yield r'color'; - yield serializers.serialize( - object.color, - specifiedType: const FullType(String), - ); + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); } if (object.declawed != null) { - yield r'declawed'; - yield serializers.serialize( - object.declawed, - specifiedType: const FullType(bool), - ); + yield r'declawed'; + yield serializers.serialize( + object.declawed, + specifiedType: const FullType(bool), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart index ce2ee3e49997..02d9cce0cae1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart @@ -34,11 +34,11 @@ class _$CatAllOfSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.declawed != null) { - yield r'declawed'; - yield serializers.serialize( - object.declawed, - specifiedType: const FullType(bool), - ); + yield r'declawed'; + yield serializers.serialize( + object.declawed, + specifiedType: const FullType(bool), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart index 5e8cf7ac9045..3a541dd1fa92 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart @@ -46,11 +46,11 @@ class _$CategorySerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(int), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); } yield r'name'; yield serializers.serialize( diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart index e2c0a9f04b8c..51166943c6cd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart @@ -41,11 +41,11 @@ class _$ClassModelSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.classField != null) { - yield r'_class'; - yield serializers.serialize( - object.classField, - specifiedType: const FullType(String), - ); + yield r'_class'; + yield serializers.serialize( + object.classField, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart index 13133f48ea66..91d0b428e9bb 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart @@ -41,11 +41,11 @@ class _$DeprecatedObjectSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.color != null) { - yield r'color'; - yield serializers.serialize( - object.color, - specifiedType: const FullType(String), - ); + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); } if (object.breed != null) { - yield r'breed'; - yield serializers.serialize( - object.breed, - specifiedType: const FullType(String), - ); + yield r'breed'; + yield serializers.serialize( + object.breed, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart index 5fbd3e253804..bd52567fa60a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart @@ -34,11 +34,11 @@ class _$DogAllOfSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.breed != null) { - yield r'breed'; - yield serializers.serialize( - object.breed, - specifiedType: const FullType(String), - ); + yield r'breed'; + yield serializers.serialize( + object.breed, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart index 628b05cde312..b79a175e833c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart @@ -48,18 +48,18 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.justSymbol != null) { - yield r'just_symbol'; - yield serializers.serialize( - object.justSymbol, - specifiedType: const FullType(EnumArraysJustSymbolEnum), - ); + yield r'just_symbol'; + yield serializers.serialize( + object.justSymbol, + specifiedType: const FullType(EnumArraysJustSymbolEnum), + ); } if (object.arrayEnum != null) { - yield r'array_enum'; - yield serializers.serialize( - object.arrayEnum, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), - ); + yield r'array_enum'; + yield serializers.serialize( + object.arrayEnum, + specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart index 3bda1ae5135f..831f5b9d6d2d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart @@ -82,11 +82,11 @@ class _$EnumTestSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.enumString != null) { - yield r'enum_string'; - yield serializers.serialize( - object.enumString, - specifiedType: const FullType(EnumTestEnumStringEnum), - ); + yield r'enum_string'; + yield serializers.serialize( + object.enumString, + specifiedType: const FullType(EnumTestEnumStringEnum), + ); } yield r'enum_string_required'; yield serializers.serialize( @@ -94,46 +94,46 @@ class _$EnumTestSerializer implements PrimitiveSerializer { specifiedType: const FullType(EnumTestEnumStringRequiredEnum), ); if (object.enumInteger != null) { - yield r'enum_integer'; - yield serializers.serialize( - object.enumInteger, - specifiedType: const FullType(EnumTestEnumIntegerEnum), - ); + yield r'enum_integer'; + yield serializers.serialize( + object.enumInteger, + specifiedType: const FullType(EnumTestEnumIntegerEnum), + ); } if (object.enumNumber != null) { - yield r'enum_number'; - yield serializers.serialize( - object.enumNumber, - specifiedType: const FullType(EnumTestEnumNumberEnum), - ); + yield r'enum_number'; + yield serializers.serialize( + object.enumNumber, + specifiedType: const FullType(EnumTestEnumNumberEnum), + ); } if (object.outerEnum != null) { - yield r'outerEnum'; - yield serializers.serialize( - object.outerEnum, - specifiedType: const FullType.nullable(OuterEnum), - ); + yield r'outerEnum'; + yield serializers.serialize( + object.outerEnum, + specifiedType: const FullType.nullable(OuterEnum), + ); } if (object.outerEnumInteger != null) { - yield r'outerEnumInteger'; - yield serializers.serialize( - object.outerEnumInteger, - specifiedType: const FullType(OuterEnumInteger), - ); + yield r'outerEnumInteger'; + yield serializers.serialize( + object.outerEnumInteger, + specifiedType: const FullType(OuterEnumInteger), + ); } if (object.outerEnumDefaultValue != null) { - yield r'outerEnumDefaultValue'; - yield serializers.serialize( - object.outerEnumDefaultValue, - specifiedType: const FullType(OuterEnumDefaultValue), - ); + yield r'outerEnumDefaultValue'; + yield serializers.serialize( + object.outerEnumDefaultValue, + specifiedType: const FullType(OuterEnumDefaultValue), + ); } if (object.outerEnumIntegerDefaultValue != null) { - yield r'outerEnumIntegerDefaultValue'; - yield serializers.serialize( - object.outerEnumIntegerDefaultValue, - specifiedType: const FullType(OuterEnumIntegerDefaultValue), - ); + yield r'outerEnumIntegerDefaultValue'; + yield serializers.serialize( + object.outerEnumIntegerDefaultValue, + specifiedType: const FullType(OuterEnumIntegerDefaultValue), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart index 83292d63934b..5ab41d14f437 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart @@ -47,18 +47,18 @@ class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.bar != null) { - yield r'bar'; - yield serializers.serialize( - object.bar, - specifiedType: const FullType(String), - ); + yield r'bar'; + yield serializers.serialize( + object.bar, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart index 24ab0718f3a7..b5903ebd5dbf 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart @@ -42,11 +42,11 @@ class _$FooGetDefaultResponseSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.integer != null) { - yield r'integer'; - yield serializers.serialize( - object.integer, - specifiedType: const FullType(int), - ); + yield r'integer'; + yield serializers.serialize( + object.integer, + specifiedType: const FullType(int), + ); } if (object.int32 != null) { - yield r'int32'; - yield serializers.serialize( - object.int32, - specifiedType: const FullType(int), - ); + yield r'int32'; + yield serializers.serialize( + object.int32, + specifiedType: const FullType(int), + ); } if (object.int64 != null) { - yield r'int64'; - yield serializers.serialize( - object.int64, - specifiedType: const FullType(int), - ); + yield r'int64'; + yield serializers.serialize( + object.int64, + specifiedType: const FullType(int), + ); } yield r'number'; yield serializers.serialize( @@ -131,32 +131,32 @@ class _$FormatTestSerializer implements PrimitiveSerializer { specifiedType: const FullType(num), ); if (object.float != null) { - yield r'float'; - yield serializers.serialize( - object.float, - specifiedType: const FullType(double), - ); + yield r'float'; + yield serializers.serialize( + object.float, + specifiedType: const FullType(double), + ); } if (object.double_ != null) { - yield r'double'; - yield serializers.serialize( - object.double_, - specifiedType: const FullType(double), - ); + yield r'double'; + yield serializers.serialize( + object.double_, + specifiedType: const FullType(double), + ); } if (object.decimal != null) { - yield r'decimal'; - yield serializers.serialize( - object.decimal, - specifiedType: const FullType(double), - ); + yield r'decimal'; + yield serializers.serialize( + object.decimal, + specifiedType: const FullType(double), + ); } if (object.string != null) { - yield r'string'; - yield serializers.serialize( - object.string, - specifiedType: const FullType(String), - ); + yield r'string'; + yield serializers.serialize( + object.string, + specifiedType: const FullType(String), + ); } yield r'byte'; yield serializers.serialize( @@ -164,11 +164,11 @@ class _$FormatTestSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.binary != null) { - yield r'binary'; - yield serializers.serialize( - object.binary, - specifiedType: const FullType(Uint8List), - ); + yield r'binary'; + yield serializers.serialize( + object.binary, + specifiedType: const FullType(Uint8List), + ); } yield r'date'; yield serializers.serialize( @@ -176,18 +176,18 @@ class _$FormatTestSerializer implements PrimitiveSerializer { specifiedType: const FullType(Date), ); if (object.dateTime != null) { - yield r'dateTime'; - yield serializers.serialize( - object.dateTime, - specifiedType: const FullType(DateTime), - ); + yield r'dateTime'; + yield serializers.serialize( + object.dateTime, + specifiedType: const FullType(DateTime), + ); } if (object.uuid != null) { - yield r'uuid'; - yield serializers.serialize( - object.uuid, - specifiedType: const FullType(String), - ); + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); } yield r'password'; yield serializers.serialize( @@ -195,18 +195,18 @@ class _$FormatTestSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); if (object.patternWithDigits != null) { - yield r'pattern_with_digits'; - yield serializers.serialize( - object.patternWithDigits, - specifiedType: const FullType(String), - ); + yield r'pattern_with_digits'; + yield serializers.serialize( + object.patternWithDigits, + specifiedType: const FullType(String), + ); } if (object.patternWithDigitsAndDelimiter != null) { - yield r'pattern_with_digits_and_delimiter'; - yield serializers.serialize( - object.patternWithDigitsAndDelimiter, - specifiedType: const FullType(String), - ); + yield r'pattern_with_digits_and_delimiter'; + yield serializers.serialize( + object.patternWithDigitsAndDelimiter, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart index cd3984c047f9..9683985cf198 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart @@ -45,18 +45,18 @@ class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.mapMapOfString != null) { - yield r'map_map_of_string'; - yield serializers.serialize( - object.mapMapOfString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), - ); + yield r'map_map_of_string'; + yield serializers.serialize( + object.mapMapOfString, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ); } if (object.mapOfEnumString != null) { - yield r'map_of_enum_string'; - yield serializers.serialize( - object.mapOfEnumString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), - ); + yield r'map_of_enum_string'; + yield serializers.serialize( + object.mapOfEnumString, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + ); } if (object.directMap != null) { - yield r'direct_map'; - yield serializers.serialize( - object.directMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), - ); + yield r'direct_map'; + yield serializers.serialize( + object.directMap, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ); } if (object.indirectMap != null) { - yield r'indirect_map'; - yield serializers.serialize( - object.indirectMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), - ); + yield r'indirect_map'; + yield serializers.serialize( + object.indirectMap, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart index 1186750e994a..76b5933ae5a7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -51,25 +51,25 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti FullType specifiedType = FullType.unspecified, }) sync* { if (object.uuid != null) { - yield r'uuid'; - yield serializers.serialize( - object.uuid, - specifiedType: const FullType(String), - ); + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); } if (object.dateTime != null) { - yield r'dateTime'; - yield serializers.serialize( - object.dateTime, - specifiedType: const FullType(DateTime), - ); + yield r'dateTime'; + yield serializers.serialize( + object.dateTime, + specifiedType: const FullType(DateTime), + ); } if (object.map != null) { - yield r'map'; - yield serializers.serialize( - object.map, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), - ); + yield r'map'; + yield serializers.serialize( + object.map, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart index d021c2fa67dd..0a2cfb4411ac 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart @@ -45,18 +45,18 @@ class _$Model200ResponseSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.client != null) { - yield r'client'; - yield serializers.serialize( - object.client, - specifiedType: const FullType(String), - ); + yield r'client'; + yield serializers.serialize( + object.client, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart index b7d05bcb3c3b..2702c21d36f2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart @@ -42,11 +42,11 @@ class _$ModelFileSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.sourceURI != null) { - yield r'sourceURI'; - yield serializers.serialize( - object.sourceURI, - specifiedType: const FullType(String), - ); + yield r'sourceURI'; + yield serializers.serialize( + object.sourceURI, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart index 2617f178dc82..579853258f8e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart @@ -41,11 +41,11 @@ class _$ModelListSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.n123list != null) { - yield r'123-list'; - yield serializers.serialize( - object.n123list, - specifiedType: const FullType(String), - ); + yield r'123-list'; + yield serializers.serialize( + object.n123list, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart index 4882cedf34ed..45a2f67f8a40 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart @@ -41,11 +41,11 @@ class _$ModelReturnSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.return_ != null) { - yield r'return'; - yield serializers.serialize( - object.return_, - specifiedType: const FullType(int), - ); + yield r'return'; + yield serializers.serialize( + object.return_, + specifiedType: const FullType(int), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart index 53e43b95c21e..10fa99e6a5f7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart @@ -58,25 +58,25 @@ class _$NameSerializer implements PrimitiveSerializer { specifiedType: const FullType(int), ); if (object.snakeCase != null) { - yield r'snake_case'; - yield serializers.serialize( - object.snakeCase, - specifiedType: const FullType(int), - ); + yield r'snake_case'; + yield serializers.serialize( + object.snakeCase, + specifiedType: const FullType(int), + ); } if (object.property != null) { - yield r'property'; - yield serializers.serialize( - object.property, - specifiedType: const FullType(String), - ); + yield r'property'; + yield serializers.serialize( + object.property, + specifiedType: const FullType(String), + ); } if (object.n123number != null) { - yield r'123Number'; - yield serializers.serialize( - object.n123number, - specifiedType: const FullType(int), - ); + yield r'123Number'; + yield serializers.serialize( + object.n123number, + specifiedType: const FullType(int), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart index 6a1082dc3983..c993a41303f0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart @@ -88,88 +88,88 @@ class _$NullableClassSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.integerProp != null) { - yield r'integer_prop'; - yield serializers.serialize( - object.integerProp, - specifiedType: const FullType.nullable(int), - ); + yield r'integer_prop'; + yield serializers.serialize( + object.integerProp, + specifiedType: const FullType.nullable(int), + ); } if (object.numberProp != null) { - yield r'number_prop'; - yield serializers.serialize( - object.numberProp, - specifiedType: const FullType.nullable(num), - ); + yield r'number_prop'; + yield serializers.serialize( + object.numberProp, + specifiedType: const FullType.nullable(num), + ); } if (object.booleanProp != null) { - yield r'boolean_prop'; - yield serializers.serialize( - object.booleanProp, - specifiedType: const FullType.nullable(bool), - ); + yield r'boolean_prop'; + yield serializers.serialize( + object.booleanProp, + specifiedType: const FullType.nullable(bool), + ); } if (object.stringProp != null) { - yield r'string_prop'; - yield serializers.serialize( - object.stringProp, - specifiedType: const FullType.nullable(String), - ); + yield r'string_prop'; + yield serializers.serialize( + object.stringProp, + specifiedType: const FullType.nullable(String), + ); } if (object.dateProp != null) { - yield r'date_prop'; - yield serializers.serialize( - object.dateProp, - specifiedType: const FullType.nullable(Date), - ); + yield r'date_prop'; + yield serializers.serialize( + object.dateProp, + specifiedType: const FullType.nullable(Date), + ); } if (object.datetimeProp != null) { - yield r'datetime_prop'; - yield serializers.serialize( - object.datetimeProp, - specifiedType: const FullType.nullable(DateTime), - ); + yield r'datetime_prop'; + yield serializers.serialize( + object.datetimeProp, + specifiedType: const FullType.nullable(DateTime), + ); } if (object.arrayNullableProp != null) { - yield r'array_nullable_prop'; - yield serializers.serialize( - object.arrayNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), - ); + yield r'array_nullable_prop'; + yield serializers.serialize( + object.arrayNullableProp, + specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + ); } if (object.arrayAndItemsNullableProp != null) { - yield r'array_and_items_nullable_prop'; - yield serializers.serialize( - object.arrayAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), - ); + yield r'array_and_items_nullable_prop'; + yield serializers.serialize( + object.arrayAndItemsNullableProp, + specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + ); } if (object.arrayItemsNullable != null) { - yield r'array_items_nullable'; - yield serializers.serialize( - object.arrayItemsNullable, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), - ); + yield r'array_items_nullable'; + yield serializers.serialize( + object.arrayItemsNullable, + specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + ); } if (object.objectNullableProp != null) { - yield r'object_nullable_prop'; - yield serializers.serialize( - object.objectNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), - ); + yield r'object_nullable_prop'; + yield serializers.serialize( + object.objectNullableProp, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + ); } if (object.objectAndItemsNullableProp != null) { - yield r'object_and_items_nullable_prop'; - yield serializers.serialize( - object.objectAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), - ); + yield r'object_and_items_nullable_prop'; + yield serializers.serialize( + object.objectAndItemsNullableProp, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); } if (object.objectItemsNullable != null) { - yield r'object_items_nullable'; - yield serializers.serialize( - object.objectItemsNullable, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), - ); + yield r'object_items_nullable'; + yield serializers.serialize( + object.objectItemsNullable, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart index 20c45fab22e2..482a95f3e521 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart @@ -41,11 +41,11 @@ class _$NumberOnlySerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.justNumber != null) { - yield r'JustNumber'; - yield serializers.serialize( - object.justNumber, - specifiedType: const FullType(num), - ); + yield r'JustNumber'; + yield serializers.serialize( + object.justNumber, + specifiedType: const FullType(num), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart index 26780b70b11f..f59131ea6fbf 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart @@ -55,32 +55,32 @@ class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(int), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); } if (object.petId != null) { - yield r'petId'; - yield serializers.serialize( - object.petId, - specifiedType: const FullType(int), - ); + yield r'petId'; + yield serializers.serialize( + object.petId, + specifiedType: const FullType(int), + ); } if (object.quantity != null) { - yield r'quantity'; - yield serializers.serialize( - object.quantity, - specifiedType: const FullType(int), - ); + yield r'quantity'; + yield serializers.serialize( + object.quantity, + specifiedType: const FullType(int), + ); } if (object.shipDate != null) { - yield r'shipDate'; - yield serializers.serialize( - object.shipDate, - specifiedType: const FullType(DateTime), - ); + yield r'shipDate'; + yield serializers.serialize( + object.shipDate, + specifiedType: const FullType(DateTime), + ); } if (object.status != null) { - yield r'status'; - yield serializers.serialize( - object.status, - specifiedType: const FullType(OrderStatusEnum), - ); + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(OrderStatusEnum), + ); } if (object.complete != null) { - yield r'complete'; - yield serializers.serialize( - object.complete, - specifiedType: const FullType(bool), - ); + yield r'complete'; + yield serializers.serialize( + object.complete, + specifiedType: const FullType(bool), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart index 5ea2562cfd9d..0d6341cc1299 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart @@ -49,25 +49,25 @@ class _$OuterCompositeSerializer implements PrimitiveSerializer FullType specifiedType = FullType.unspecified, }) sync* { if (object.myNumber != null) { - yield r'my_number'; - yield serializers.serialize( - object.myNumber, - specifiedType: const FullType(num), - ); + yield r'my_number'; + yield serializers.serialize( + object.myNumber, + specifiedType: const FullType(num), + ); } if (object.myString != null) { - yield r'my_string'; - yield serializers.serialize( - object.myString, - specifiedType: const FullType(String), - ); + yield r'my_string'; + yield serializers.serialize( + object.myString, + specifiedType: const FullType(String), + ); } if (object.myBoolean != null) { - yield r'my_boolean'; - yield serializers.serialize( - object.myBoolean, - specifiedType: const FullType(bool), - ); + yield r'my_boolean'; + yield serializers.serialize( + object.myBoolean, + specifiedType: const FullType(bool), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart index d6e51674f194..4d6358bef27d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart @@ -66,18 +66,18 @@ class _$PetSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(int), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); } if (object.category != null) { - yield r'category'; - yield serializers.serialize( - object.category, - specifiedType: const FullType(Category), - ); + yield r'category'; + yield serializers.serialize( + object.category, + specifiedType: const FullType(Category), + ); } yield r'name'; yield serializers.serialize( @@ -90,18 +90,18 @@ class _$PetSerializer implements PrimitiveSerializer { specifiedType: const FullType(BuiltSet, [FullType(String)]), ); if (object.tags != null) { - yield r'tags'; - yield serializers.serialize( - object.tags, - specifiedType: const FullType(BuiltList, [FullType(Tag)]), - ); + yield r'tags'; + yield serializers.serialize( + object.tags, + specifiedType: const FullType(BuiltList, [FullType(Tag)]), + ); } if (object.status != null) { - yield r'status'; - yield serializers.serialize( - object.status, - specifiedType: const FullType(PetStatusEnum), - ); + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(PetStatusEnum), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart index 9739971d9d73..b619217ab3cb 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart @@ -45,18 +45,18 @@ class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.bar != null) { - yield r'bar'; - yield serializers.serialize( - object.bar, - specifiedType: const FullType(String), - ); + yield r'bar'; + yield serializers.serialize( + object.bar, + specifiedType: const FullType(String), + ); } if (object.baz != null) { - yield r'baz'; - yield serializers.serialize( - object.baz, - specifiedType: const FullType(String), - ); + yield r'baz'; + yield serializers.serialize( + object.baz, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart index 7397aafd045b..fa860056b45d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart @@ -41,11 +41,11 @@ class _$SpecialModelNameSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(int), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); } if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart index 438f84425970..f7577d7e1ee9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart @@ -70,60 +70,60 @@ class _$UserSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) sync* { if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(int), - ); + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); } if (object.username != null) { - yield r'username'; - yield serializers.serialize( - object.username, - specifiedType: const FullType(String), - ); + yield r'username'; + yield serializers.serialize( + object.username, + specifiedType: const FullType(String), + ); } if (object.firstName != null) { - yield r'firstName'; - yield serializers.serialize( - object.firstName, - specifiedType: const FullType(String), - ); + yield r'firstName'; + yield serializers.serialize( + object.firstName, + specifiedType: const FullType(String), + ); } if (object.lastName != null) { - yield r'lastName'; - yield serializers.serialize( - object.lastName, - specifiedType: const FullType(String), - ); + yield r'lastName'; + yield serializers.serialize( + object.lastName, + specifiedType: const FullType(String), + ); } if (object.email != null) { - yield r'email'; - yield serializers.serialize( - object.email, - specifiedType: const FullType(String), - ); + yield r'email'; + yield serializers.serialize( + object.email, + specifiedType: const FullType(String), + ); } if (object.password != null) { - yield r'password'; - yield serializers.serialize( - object.password, - specifiedType: const FullType(String), - ); + yield r'password'; + yield serializers.serialize( + object.password, + specifiedType: const FullType(String), + ); } if (object.phone != null) { - yield r'phone'; - yield serializers.serialize( - object.phone, - specifiedType: const FullType(String), - ); + yield r'phone'; + yield serializers.serialize( + object.phone, + specifiedType: const FullType(String), + ); } if (object.userStatus != null) { - yield r'userStatus'; - yield serializers.serialize( - object.userStatus, - specifiedType: const FullType(int), - ); + yield r'userStatus'; + yield serializers.serialize( + object.userStatus, + specifiedType: const FullType(int), + ); } } From 7b74fc90b9ac0fae3245f862fee2df1c36c5f833 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Thu, 29 Dec 2022 06:44:46 +0200 Subject: [PATCH 12/20] change file permissions --- .../org/openapitools/codegen/languages/DartDioClientCodegen.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java 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 old mode 100755 new mode 100644 From ffeed66b5433bcaccad7c1d66eaa6da921785272 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 1 Jan 2023 08:49:40 +0200 Subject: [PATCH 13/20] WIP initial commit --- .../languages/DartDioClientCodegen.java | 82 +++++++++- .../dart/libraries/dio/README.mustache | 7 +- .../resources/dart/libraries/dio/api.mustache | 147 +----------------- .../dart/libraries/dio/api_client.mustache | 73 +-------- .../libraries/dio/networking/dio/api.mustache | 146 +++++++++++++++++ .../dio/networking/dio/api_client.mustache | 72 +++++++++ .../dio/networking/http/api.mustache | 146 +++++++++++++++++ .../dio/networking/http/api_client.mustache | 33 ++++ .../dart/libraries/dio/pubspec.mustache | 5 + .../dart/dio/DartDioClientOptionsTest.java | 1 + 10 files changed, 490 insertions(+), 222 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.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 8ad35c7d1ba5..f92fb4818e3e 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 @@ -58,6 +58,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen { private final Logger LOGGER = LoggerFactory.getLogger(DartDioClientCodegen.class); public static final String DATE_LIBRARY = "dateLibrary"; + public static final String NETWORKING_LIBRARY = "networkingLibrary"; public static final String DATE_LIBRARY_CORE = "core"; public static final String DATE_LIBRARY_TIME_MACHINE = "timemachine"; public static final String DATE_LIBRARY_DEFAULT = DATE_LIBRARY_CORE; @@ -66,7 +67,12 @@ public class DartDioClientCodegen extends AbstractDartCodegen { public static final String SERIALIZATION_LIBRARY_JSON_SERIALIZABLE = "json_serializable"; public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE; + public static final String NETWORKING_LIBRARY_DIO = "dio"; + public static final String NETWORKING_LIBRARY_HTTP = "http"; + public static final String NETWORKING_LIBRARY_DEFAULT = NETWORKING_LIBRARY_DIO; + private static final String DIO_IMPORT = "package:dio/dio.dart"; + private static final String HTTP_IMPORT = "package:http/http.dart"; public static final String FINAL_PROPERTIES = "finalProperties"; public static final String FINAL_PROPERTIES_DEFAULT_VALUE = "true"; @@ -74,6 +80,8 @@ public class DartDioClientCodegen extends AbstractDartCodegen { private String dateLibrary; + private String networkingLibrary; + private String clientName; private TemplateManager templateManager; @@ -102,6 +110,7 @@ public DartDioClientCodegen() { embeddedTemplateDir = "dart/libraries/dio"; this.setTemplateDir(embeddedTemplateDir); + //SERIALIZATION_LIBRARY options supportedLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); supportedLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable"); final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); @@ -109,6 +118,17 @@ public DartDioClientCodegen() { serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); cliOptions.add(serializationLibrary); + //NETWORKING_LIBRARY options + final CliOption networkingOption = CliOption.newString(NETWORKING_LIBRARY, "Specify networking library"); + networkingOption.setDefault(NETWORKING_LIBRARY_DEFAULT); + + final Map networkingOptions = new HashMap<>(); + networkingOptions.put(NETWORKING_LIBRARY_DIO, "[DEFAULT] Dio"); + networkingOptions.put(NETWORKING_LIBRARY_HTTP, "[BETA] http"); + networkingOption.setEnum(networkingOptions); + cliOptions.add(networkingOption); + + //FINAL_PROPERTIES option final CliOption finalProperties = CliOption.newBoolean(FINAL_PROPERTIES, "Whether properties are marked as final when using Json Serializable for serialization"); finalProperties.setDefault("true"); cliOptions.add(finalProperties); @@ -132,6 +152,14 @@ public void setDateLibrary(String library) { this.dateLibrary = library; } + public String getNetworkingLibrary() { + return networkingLibrary; + } + + public void setNetworkingLibrary(String networkingLibrary) { + this.networkingLibrary = networkingLibrary; + } + public String getClientName() { return clientName; } @@ -147,7 +175,7 @@ public String getName() { @Override public String getHelp() { - return "Generates a Dart Dio client library with null-safety."; + return "Generates a Dart client library with null-safety."; } @Override @@ -174,6 +202,12 @@ public void processOpts() { } setDateLibrary(additionalProperties.get(DATE_LIBRARY).toString()); + if (!additionalProperties.containsKey(NETWORKING_LIBRARY)) { + additionalProperties.put(NETWORKING_LIBRARY, NETWORKING_LIBRARY_DEFAULT); + LOGGER.debug("Networking library not set, using default {}", NETWORKING_LIBRARY_DEFAULT); + } + setNetworkingLibrary(additionalProperties.get(NETWORKING_LIBRARY).toString()); + if (!additionalProperties.containsKey(FINAL_PROPERTIES)) { additionalProperties.put(FINAL_PROPERTIES, Boolean.parseBoolean(FINAL_PROPERTIES_DEFAULT_VALUE)); LOGGER.debug("finalProperties not set, using default {}", FINAL_PROPERTIES_DEFAULT_VALUE); @@ -208,6 +242,50 @@ public void processOpts() { configureSerializationLibrary(srcFolder); configureDateLibrary(srcFolder); + configureNetworkingLibrary(srcFolder); + } + + private void configureNetworkingLibrary(String srcFolder) { + switch (networkingLibrary) { + case NETWORKING_LIBRARY_DIO: + additionalProperties.put("useDio", "true"); + configureNetworkingLibraryDio(srcFolder); + break; + case NETWORKING_LIBRARY_HTTP: + additionalProperties.put("useHttp", "true"); + configureNetworkingLibraryHttp(srcFolder); + break; + default: + break; + } + + TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(), isSkipOverwrite()); + TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); + TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); + templateManager = new TemplateManager( + templateManagerOptions, + getTemplatingEngine(), + new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} + ); + // A lambda which allows for easy includes of networking library specific + // templates without having to change the main template files. + additionalProperties.put("includeNetworkingLibraryTemplate", (Mustache.Lambda) (fragment, writer) -> { + MustacheEngineAdapter engine = ((MustacheEngineAdapter) getTemplatingEngine()); + String templateFile = "networking/" + library + "/" + fragment.execute() + ".mustache"; + Template tmpl = engine.getCompiler() + .withLoader(name -> engine.findTemplate(templateManager, name)) + .defaultValue("") + .compile(templateManager.getFullTemplateContents(templateFile)); + + fragment.executeTemplate(tmpl, writer); + }); + } + + private void configureNetworkingLibraryDio(String srcFolder) { + imports.put("MultipartFile", DIO_IMPORT); + } + private void configureNetworkingLibraryHttp(String srcFolder) { + imports.put("MultipartFile", HTTP_IMPORT); } private void configureSerializationLibrary(String srcFolder) { @@ -265,7 +343,6 @@ private void configureSerializationLibraryBuiltValue(String srcFolder) { imports.put("BuiltMap", "package:built_collection/built_collection.dart"); imports.put("JsonObject", "package:built_value/json_object.dart"); imports.put("Uint8List", "dart:typed_data"); - imports.put("MultipartFile", DIO_IMPORT); } private void configureSerializationLibraryJsonSerializable(String srcFolder) { @@ -277,7 +354,6 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { // just the binary / file handling languageSpecificPrimitives.add("Object"); imports.put("Uint8List", "dart:typed_data"); - imports.put("MultipartFile", DIO_IMPORT); } private void configureDateLibrary(String srcFolder) { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache index 3efaca1cb660..e5356c38ceac 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache @@ -1,4 +1,4 @@ -# {{pubName}} (EXPERIMENTAL) +# {{pubName}} {{#appDescriptionWithNewLines}} {{{.}}} {{/appDescriptionWithNewLines}} @@ -20,7 +20,12 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements * Dart 2.12.0 or later OR Flutter 1.26.0 or later +{{#useDio}} * Dio 4.0.0+ +{{/useDio}} +{{#useHttp}} +* http 0.13.5+ +{{/useHttp}} {{#useDateLibTimeMachine}} * timemachine option currently **DOES NOT** support sound null-safety and may not work {{/useDateLibTimeMachine}} 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..550692321374 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 @@ -1,146 +1 @@ -{{>header}} -import 'dart:async'; - -{{#includeLibraryTemplate}}api/imports{{/includeLibraryTemplate}} -import 'package:dio/dio.dart'; - -{{#operations}} -{{#imports}}import '{{.}}'; -{{/imports}} - -class {{classname}} { - - final Dio _dio; - -{{#includeLibraryTemplate}}api/constructor{{/includeLibraryTemplate}} - - {{#operation}} - /// {{summary}}{{^summary}}{{nickname}}{{/summary}} - /// {{notes}} - /// - /// Parameters: - {{#allParams}} - /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} - {{/allParams}} - /// * [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]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} - /// Throws [DioError] if API call or serialization fails - {{#externalDocs}} - /// {{description}} - /// Also see [{{summary}} Documentation]({{url}}) - {{/externalDocs}} - {{#isDeprecated}} - @Deprecated('This operation has been deprecated') - {{/isDeprecated}} - Future> {{nickname}}({ {{#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}} - {{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{{paramName}}}.toString()){{/pathParams}}; - final _options = Options( - method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', - {{#isResponseFile}} - responseType: ResponseType.bytes, - {{/isResponseFile}} - headers: { - {{#httpUserAgent}} - r'User-Agent': r'{{{.}}}', - {{/httpUserAgent}} - {{#headerParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, - {{/headerParams}} - ...?headers, - }, - extra: { - 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} - {{#authMethods}}{ - 'type': '{{type}}',{{#scheme}} - 'scheme': '{{.}}',{{/scheme}} - 'name': '{{name}}',{{#isApiKey}} - 'keyName': '{{keyParamName}}', - 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} - },{{/authMethods}} - ],{{/hasAuthMethods}} - ...?extra, - },{{#hasConsumes}} - contentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} - validateStatus: validateStatus, - );{{#hasQueryParams}} - - final _queryParameters = { - {{#queryParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{#includeLibraryTemplate}}api/query_param{{/includeLibraryTemplate}}, - {{/queryParams}} - };{{/hasQueryParams}}{{#hasBodyOrFormParams}} - - dynamic _bodyData; - - try { -{{#includeLibraryTemplate}}api/serialize{{/includeLibraryTemplate}} - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path,{{#hasQueryParams}} - queryParameters: _queryParameters,{{/hasQueryParams}} - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - }{{/hasBodyOrFormParams}} - - final _response = await _dio.request( - _path,{{#hasBodyOrFormParams}} - data: _bodyData,{{/hasBodyOrFormParams}} - options: _options,{{#hasQueryParams}} - queryParameters: _queryParameters,{{/hasQueryParams}} - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - {{#returnType}} - - {{{returnType}}} _responseData; - - try { -{{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response<{{{returnType}}}>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - );{{/returnType}}{{^returnType}} - return _response;{{/returnType}} - } - - {{/operation}} -} -{{/operations}} +{{#includeNetworkingLibraryTemplate}}api{{/includeNetworkingLibraryTemplate}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache index 0903a48759e1..37a5eef0a9c3 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache @@ -1,72 +1 @@ -{{>header}} -import 'package:dio/dio.dart';{{#useBuiltValue}} -import 'package:built_value/serializer.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/serializers.dart';{{/useBuiltValue}} -import 'package:{{pubName}}/{{sourceFolder}}/auth/api_key_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/basic_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/bearer_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; -{{#apiInfo}}{{#apis}}import 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; -{{/apis}}{{/apiInfo}} -class {{clientName}} { - static const String basePath = r'{{{basePath}}}'; - - final Dio dio; -{{#useBuiltValue}} - final Serializers serializers; - -{{/useBuiltValue}} - {{clientName}}({ - Dio? dio,{{#useBuiltValue}} - Serializers? serializers,{{/useBuiltValue}} - String? basePathOverride, - List? interceptors, - }) : {{#useBuiltValue}}this.serializers = serializers ?? standardSerializers,{{/useBuiltValue}} - this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: 5000, - receiveTimeout: 3000, - )) { - if (interceptors == null) { - this.dio.interceptors.addAll([ - OAuthInterceptor(), - BasicAuthInterceptor(), - BearerAuthInterceptor(), - ApiKeyAuthInterceptor(), - ]); - } else { - this.dio.interceptors.addAll(interceptors); - } - } - - void setOAuthToken(String name, String token) { - if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; - } - } - - void setBearerAuth(String name, String token) { - if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; - } - } - - void setBasicAuth(String name, String username, String password) { - if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - } - - void setApiKey(String name, String apiKey) { - if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - }{{#apiInfo}}{{#apis}} - - /// Get {{classname}} instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - {{classname}} get{{classname}}() { - return {{classname}}(dio{{#useBuiltValue}}, serializers{{/useBuiltValue}}); - }{{/apis}}{{/apiInfo}} -} +{{#includeNetworkingLibraryTemplate}}api_client{{/includeNetworkingLibraryTemplate}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api.mustache new file mode 100644 index 000000000000..892cbafd4694 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api.mustache @@ -0,0 +1,146 @@ +{{>header}} +import 'dart:async'; + +{{#includeLibraryTemplate}}api/imports{{/includeLibraryTemplate}} +import 'package:dio/dio.dart'; + +{{#operations}} +{{#imports}}import '{{.}}'; +{{/imports}} + +class {{classname}} { + + final Dio _dio; + +{{#includeLibraryTemplate}}api/constructor{{/includeLibraryTemplate}} + + {{#operation}} + /// {{summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{notes}} + /// + /// Parameters: + {{#allParams}} + /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} + {{/allParams}} + /// * [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]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} + /// Throws [DioError] if API call or serialization fails + {{#externalDocs}} + /// {{description}} + /// Also see [{{summary}} Documentation]({{url}}) + {{/externalDocs}} + {{#isDeprecated}} + @Deprecated('This operation has been deprecated') + {{/isDeprecated}} + Future> {{nickname}}({ {{#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}} + {{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{{paramName}}}.toString()){{/pathParams}}; + final _options = Options( + method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', + {{#isResponseFile}} + responseType: ResponseType.bytes, + {{/isResponseFile}} + headers: { + {{#httpUserAgent}} + r'User-Agent': r'{{{.}}}', + {{/httpUserAgent}} + {{#headerParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, + {{/headerParams}} + ...?headers, + }, + extra: { + 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} + {{#authMethods}}{ + 'type': '{{type}}',{{#scheme}} + 'scheme': '{{.}}',{{/scheme}} + 'name': '{{name}}',{{#isApiKey}} + 'keyName': '{{keyParamName}}', + 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} + },{{/authMethods}} + ],{{/hasAuthMethods}} + ...?extra, + },{{#hasConsumes}} + contentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} + validateStatus: validateStatus, + );{{#hasQueryParams}} + + final _queryParameters = { + {{#queryParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{#includeLibraryTemplate}}api/query_param{{/includeLibraryTemplate}}, + {{/queryParams}} + };{{/hasQueryParams}}{{#hasBodyOrFormParams}} + + dynamic _bodyData; + + try { +{{#includeLibraryTemplate}}api/serialize{{/includeLibraryTemplate}} + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path,{{#hasQueryParams}} + queryParameters: _queryParameters,{{/hasQueryParams}} + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + }{{/hasBodyOrFormParams}} + + final _response = await _dio.request( + _path,{{#hasBodyOrFormParams}} + data: _bodyData,{{/hasBodyOrFormParams}} + options: _options,{{#hasQueryParams}} + queryParameters: _queryParameters,{{/hasQueryParams}} + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + {{#returnType}} + + {{{returnType}}} _responseData; + + try { +{{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response<{{{returnType}}}>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + );{{/returnType}}{{^returnType}} + return _response;{{/returnType}} + } + + {{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache new file mode 100644 index 000000000000..0903a48759e1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache @@ -0,0 +1,72 @@ +{{>header}} +import 'package:dio/dio.dart';{{#useBuiltValue}} +import 'package:built_value/serializer.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/serializers.dart';{{/useBuiltValue}} +import 'package:{{pubName}}/{{sourceFolder}}/auth/api_key_auth.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/basic_auth.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/bearer_auth.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; +{{#apiInfo}}{{#apis}}import 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; +{{/apis}}{{/apiInfo}} +class {{clientName}} { + static const String basePath = r'{{{basePath}}}'; + + final Dio dio; +{{#useBuiltValue}} + final Serializers serializers; + +{{/useBuiltValue}} + {{clientName}}({ + Dio? dio,{{#useBuiltValue}} + Serializers? serializers,{{/useBuiltValue}} + String? basePathOverride, + List? interceptors, + }) : {{#useBuiltValue}}this.serializers = serializers ?? standardSerializers,{{/useBuiltValue}} + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: 5000, + receiveTimeout: 3000, + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + } + }{{#apiInfo}}{{#apis}} + + /// Get {{classname}} instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + {{classname}} get{{classname}}() { + return {{classname}}(dio{{#useBuiltValue}}, serializers{{/useBuiltValue}}); + }{{/apis}}{{/apiInfo}} +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache new file mode 100644 index 000000000000..229d798c04a5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache @@ -0,0 +1,146 @@ +{{>header}} +import 'dart:async'; + +{{#includeLibraryTemplate}}api/imports{{/includeLibraryTemplate}} +import 'package:http/http.dart' as http; + +{{#operations}} +{{#imports}}import '{{.}}'; +{{/imports}} + +class {{classname}} { + + final http.Client? _client; + +{{#includeLibraryTemplate}}api/constructor{{/includeLibraryTemplate}} + + {{#operation}} + /// {{summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{notes}} + /// + /// Parameters: + {{#allParams}} + /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} + {{/allParams}} + /// * [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]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} + /// Throws [DioError] if API call or serialization fails + {{#externalDocs}} + /// {{description}} + /// Also see [{{summary}} Documentation]({{url}}) + {{/externalDocs}} + {{#isDeprecated}} + @Deprecated('This operation has been deprecated') + {{/isDeprecated}} + Future> {{nickname}}({ {{#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}} + {{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{{paramName}}}.toString()){{/pathParams}}; + final _options = Options( + method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', + {{#isResponseFile}} + responseType: ResponseType.bytes, + {{/isResponseFile}} + headers: { + {{#httpUserAgent}} + r'User-Agent': r'{{{.}}}', + {{/httpUserAgent}} + {{#headerParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, + {{/headerParams}} + ...?headers, + }, + extra: { + 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} + {{#authMethods}}{ + 'type': '{{type}}',{{#scheme}} + 'scheme': '{{.}}',{{/scheme}} + 'name': '{{name}}',{{#isApiKey}} + 'keyName': '{{keyParamName}}', + 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} + },{{/authMethods}} + ],{{/hasAuthMethods}} + ...?extra, + },{{#hasConsumes}} + contentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} + validateStatus: validateStatus, + );{{#hasQueryParams}} + + final _queryParameters = { + {{#queryParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{#includeLibraryTemplate}}api/query_param{{/includeLibraryTemplate}}, + {{/queryParams}} + };{{/hasQueryParams}}{{#hasBodyOrFormParams}} + + dynamic _bodyData; + + try { +{{#includeLibraryTemplate}}api/serialize{{/includeLibraryTemplate}} + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path,{{#hasQueryParams}} + queryParameters: _queryParameters,{{/hasQueryParams}} + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + }{{/hasBodyOrFormParams}} + + final _response = await _dio.request( + _path,{{#hasBodyOrFormParams}} + data: _bodyData,{{/hasBodyOrFormParams}} + options: _options,{{#hasQueryParams}} + queryParameters: _queryParameters,{{/hasQueryParams}} + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + {{#returnType}} + + {{{returnType}}} _responseData; + + try { +{{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response<{{{returnType}}}>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + );{{/returnType}}{{^returnType}} + return _response;{{/returnType}} + } + + {{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.mustache new file mode 100644 index 000000000000..6c164d95415a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.mustache @@ -0,0 +1,33 @@ +{{>header}} +import 'package:http/http.dart' as http;{{#useBuiltValue}} +import 'package:built_value/serializer.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/serializers.dart';{{/useBuiltValue}} +import 'package:{{pubName}}/{{sourceFolder}}/auth/api_key_auth.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/basic_auth.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/bearer_auth.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; +{{#apiInfo}}{{#apis}}import 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; +{{/apis}}{{/apiInfo}} +class {{clientName}} { + static const String basePath = r'{{{basePath}}}'; + + final http.Client client; +{{#useBuiltValue}} + final Serializers serializers; + +{{/useBuiltValue}} + {{clientName}}({ + http.Client? client,{{#useBuiltValue}} + Serializers? serializers,{{/useBuiltValue}} + String? basePathOverride, + }) : {{#useBuiltValue}}this.serializers = serializers ?? standardSerializers,{{/useBuiltValue}} + this.client = client ?? http.Client() { + } + {{#apiInfo}}{{#apis}} + + /// Get {{classname}} instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + {{classname}} get{{classname}}() { + return {{classname}}(client{{#useBuiltValue}}, serializers{{/useBuiltValue}}); + }{{/apis}}{{/apiInfo}} +} 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..7a772156ed6e 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache @@ -12,7 +12,12 @@ environment: {{/useJsonSerializable}} dependencies: +{{#useDio}} dio: '>=4.0.1 <5.0.0' +{{#useDio}} +{{#useHttp}} + http: '>=0.13.5 <2.0.0' +{{/useHttp}} {{#useBuiltValue}} one_of: '>=1.5.0 <2.0.0' one_of_serializer: '>=1.5.0 <2.0.0' diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java index 2292d1109898..812dd1ff7644 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java @@ -50,6 +50,7 @@ protected void verifyOptions() { verify(clientCodegen).setSourceFolder(DartDioClientOptionsProvider.SOURCE_FOLDER_VALUE); verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setDateLibrary(DartDioClientCodegen.DATE_LIBRARY_DEFAULT); + verify(clientCodegen).setNetworkingLibrary(DartDioClientCodegen.NETWORKING_LIBRARY_DEFAULT); verify(clientCodegen).setLibrary(DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartDioClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } From 35d234a2b52b2e512f1ee92cf77caf89a385c79d Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 1 Jan 2023 13:18:00 +0200 Subject: [PATCH 14/20] remove EXPERIMENTAL from readme --- samples/openapi3/client/petstore/dart-dio/oneof/README.md | 2 +- .../dart-dio/oneof_polymorphism_and_inheritance/README.md | 2 +- .../openapi3/client/petstore/dart-dio/oneof_primitive/README.md | 2 +- .../petstore_client_lib_fake-json_serializable/README.md | 2 +- .../client/petstore/dart-dio/petstore_client_lib_fake/README.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/README.md b/samples/openapi3/client/petstore/dart-dio/oneof/README.md index 53bfd08fec43..1e6c2165dc0c 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/README.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof/README.md @@ -1,4 +1,4 @@ -# openapi (EXPERIMENTAL) +# openapi 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: diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md index 6a3fea771a12..45b3ba7a9516 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md @@ -1,4 +1,4 @@ -# openapi (EXPERIMENTAL) +# openapi This tests for a oneOf interface representation diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md index d73bafd4c64f..a2993a23a019 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md @@ -1,4 +1,4 @@ -# openapi (EXPERIMENTAL) +# openapi 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: diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md index 0f37d1167220..d157f07330a4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md @@ -1,4 +1,4 @@ -# openapi (EXPERIMENTAL) +# openapi 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: diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md index 0f37d1167220..d157f07330a4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md @@ -1,4 +1,4 @@ -# openapi (EXPERIMENTAL) +# openapi 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: From 717127f1d7717f08a6f117af31f0fa514970d208 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 1 Jan 2023 22:42:36 +0200 Subject: [PATCH 15/20] remove old samples --- .../client/petstore/dart-dio/oneof/.gitignore | 41 --- .../dart-dio/oneof/.openapi-generator-ignore | 23 -- .../dart-dio/oneof/.openapi-generator/FILES | 23 -- .../dart-dio/oneof/.openapi-generator/VERSION | 1 - .../client/petstore/dart-dio/oneof/README.md | 84 ----- .../dart-dio/oneof/analysis_options.yaml | 9 - .../petstore/dart-dio/oneof/doc/Apple.md | 15 - .../petstore/dart-dio/oneof/doc/Banana.md | 15 - .../petstore/dart-dio/oneof/doc/DefaultApi.md | 51 --- .../petstore/dart-dio/oneof/doc/Fruit.md | 17 - .../petstore/dart-dio/oneof/lib/openapi.dart | 16 - .../petstore/dart-dio/oneof/lib/src/api.dart | 73 ----- .../oneof/lib/src/api/default_api.dart | 92 ------ .../dart-dio/oneof/lib/src/api_util.dart | 77 ----- .../oneof/lib/src/auth/api_key_auth.dart | 30 -- .../dart-dio/oneof/lib/src/auth/auth.dart | 18 -- .../oneof/lib/src/auth/basic_auth.dart | 37 --- .../oneof/lib/src/auth/bearer_auth.dart | 26 -- .../dart-dio/oneof/lib/src/auth/oauth.dart | 26 -- .../oneof/lib/src/date_serializer.dart | 31 -- .../dart-dio/oneof/lib/src/model/apple.dart | 108 ------- .../dart-dio/oneof/lib/src/model/banana.dart | 108 ------- .../dart-dio/oneof/lib/src/model/date.dart | 70 ---- .../dart-dio/oneof/lib/src/model/fruit.dart | 123 -------- .../dart-dio/oneof/lib/src/serializers.dart | 36 --- .../client/petstore/dart-dio/oneof/pom.xml | 88 ------ .../petstore/dart-dio/oneof/pubspec.yaml | 19 -- .../dart-dio/oneof/test/apple_test.dart | 16 - .../dart-dio/oneof/test/banana_test.dart | 16 - .../dart-dio/oneof/test/default_api_test.dart | 16 - .../dart-dio/oneof/test/fruit_test.dart | 26 -- .../.gitignore | 41 --- .../.openapi-generator-ignore | 23 -- .../.openapi-generator/FILES | 47 --- .../.openapi-generator/VERSION | 1 - .../README.md | 99 ------ .../analysis_options.yaml | 9 - .../doc/Addressable.md | 16 - .../doc/Bar.md | 22 -- .../doc/BarApi.md | 55 ---- .../doc/BarCreate.md | 22 -- .../doc/BarRef.md | 19 -- .../doc/BarRefOrValue.md | 19 -- .../doc/Entity.md | 19 -- .../doc/EntityRef.md | 21 -- .../doc/Extensible.md | 17 - .../doc/Foo.md | 21 -- .../doc/FooApi.md | 93 ------ .../doc/FooRef.md | 20 -- .../doc/FooRefOrValue.md | 19 -- .../doc/FooRefOrValueWithProperties.md | 19 -- .../doc/Pasta.md | 20 -- .../doc/Pizza.md | 20 -- .../doc/PizzaSpeziale.md | 20 -- .../lib/openapi.dart | 28 -- .../lib/src/api.dart | 80 ----- .../lib/src/api/bar_api.dart | 114 ------- .../lib/src/api/foo_api.dart | 187 ----------- .../lib/src/api_util.dart | 77 ----- .../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/date_serializer.dart | 31 -- .../lib/src/model/addressable.dart | 161 ---------- .../lib/src/model/bar.dart | 219 ------------- .../lib/src/model/bar_create.dart | 219 ------------- .../lib/src/model/bar_ref.dart | 192 ----------- .../lib/src/model/bar_ref_or_value.dart | 129 -------- .../lib/src/model/date.dart | 70 ---- .../lib/src/model/entity.dart | 298 ------------------ .../lib/src/model/entity_ref.dart | 284 ----------------- .../lib/src/model/extensible.dart | 178 ----------- .../lib/src/model/foo.dart | 200 ------------ .../lib/src/model/foo_ref.dart | 210 ------------ .../lib/src/model/foo_ref_or_value.dart | 129 -------- .../lib/src/model/pasta.dart | 182 ----------- .../lib/src/model/pizza.dart | 250 --------------- .../lib/src/model/pizza_speziale.dart | 196 ------------ .../lib/src/serializers.dart | 67 ---- .../pom.xml | 88 ------ .../pubspec.yaml | 19 -- .../test/addressable_test.dart | 23 -- .../test/bar_api_test.dart | 18 -- .../test/bar_create_test.dart | 56 ---- .../test/bar_ref_or_value_test.dart | 41 --- .../test/bar_ref_test.dart | 41 --- .../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 | 41 --- .../test/foo_ref_test.dart | 46 --- .../test/foo_test.dart | 51 --- .../test/pasta_test.dart | 46 --- .../test/pizza_speziale_test.dart | 46 --- .../test/pizza_test.dart | 46 --- .../dart-dio/oneof_primitive/.gitignore | 41 --- .../oneof_primitive/.openapi-generator-ignore | 23 -- .../oneof_primitive/.openapi-generator/FILES | 21 -- .../.openapi-generator/VERSION | 1 - .../dart-dio/oneof_primitive/README.md | 83 ----- .../oneof_primitive/analysis_options.yaml | 9 - .../dart-dio/oneof_primitive/doc/Child.md | 15 - .../oneof_primitive/doc/DefaultApi.md | 51 --- .../dart-dio/oneof_primitive/doc/Example.md | 15 - .../dart-dio/oneof_primitive/lib/openapi.dart | 15 - .../dart-dio/oneof_primitive/lib/src/api.dart | 73 ----- .../lib/src/api/default_api.dart | 92 ------ .../oneof_primitive/lib/src/api_util.dart | 77 ----- .../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 -- .../lib/src/date_serializer.dart | 31 -- .../oneof_primitive/lib/src/model/child.dart | 108 ------- .../oneof_primitive/lib/src/model/date.dart | 70 ---- .../lib/src/model/example.dart | 72 ----- .../oneof_primitive/lib/src/serializers.dart | 34 -- .../petstore/dart-dio/oneof_primitive/pom.xml | 88 ------ .../dart-dio/oneof_primitive/pubspec.yaml | 19 -- .../oneof_primitive/test/child_test.dart | 16 - .../test/default_api_test.dart | 16 - .../oneof_primitive/test/example_test.dart | 16 - 127 files changed, 7519 deletions(-) delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/date.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/pom.xml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/test/apple_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/test/banana_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/test/fruit_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/addressable_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_create_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/extensible_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pasta_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/child_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/example_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/.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/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/.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/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES deleted file mode 100644 index f1ab7b5540a3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES +++ /dev/null @@ -1,23 +0,0 @@ -.gitignore -README.md -analysis_options.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/api_util.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/date_serializer.dart -lib/src/model/apple.dart -lib/src/model/banana.dart -lib/src/model/date.dart -lib/src/model/fruit.dart -lib/src/serializers.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/VERSION deleted file mode 100644 index d6b4ec4aa783..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/README.md b/samples/openapi3/client/petstore/dart-dio/oneof/README.md deleted file mode 100644 index 1e6c2165dc0c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# openapi -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 -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.12.0 or later OR Flutter 1.26.0 or later -* Dio 4.0.0+ - -## Installation & Usage - -### pub.dev -To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml -```yaml -dependencies: - openapi: 1.0.0 -``` - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - git: - url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - #ref: main -``` - -### Local development -To use the package from your local drive, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - path: /path/to/openapi -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:openapi/openapi.dart'; - - -final api = Openapi().getDefaultApi(); - -try { - final response = await api.rootGet(); - print(response); -} catch on DioError (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 - - All endpoints do not require authorization. - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof/analysis_options.yaml deleted file mode 100644 index a611887d3acf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/analysis_options.yaml +++ /dev/null @@ -1,9 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md deleted file mode 100644 index c7f711b87cef..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md deleted file mode 100644 index bef8a58a4276..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md deleted file mode 100644 index 41c9b6f94116..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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 DioError (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/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md deleted file mode 100644 index 5d48cc6e6d38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart deleted file mode 100644 index d85a16fc6ad9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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/oauth.dart'; -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; - -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/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api.dart deleted file mode 100644 index ba9424a2d2a1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api.dart +++ /dev/null @@ -1,73 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/serializers.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; - final Serializers serializers; - - Openapi({ - Dio? dio, - Serializers? serializers, - String? basePathOverride, - List? interceptors, - }) : this.serializers = serializers ?? standardSerializers, - this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: 5000, - receiveTimeout: 3000, - )) { - if (interceptors == null) { - this.dio.interceptors.addAll([ - OAuthInterceptor(), - BasicAuthInterceptor(), - BearerAuthInterceptor(), - ApiKeyAuthInterceptor(), - ]); - } else { - this.dio.interceptors.addAll(interceptors); - } - } - - void setOAuthToken(String name, String token) { - if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; - } - } - - void setBearerAuth(String name, String token) { - if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; - } - } - - void setBasicAuth(String name, String username, String password) { - if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - } - - void setApiKey(String name, String apiKey) { - if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - } - - /// Get 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, serializers); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart deleted file mode 100644 index e98b7ae9cae4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart +++ /dev/null @@ -1,92 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/fruit.dart'; - -class DefaultApi { - - final Dio _dio; - - final Serializers _serializers; - - const DefaultApi(this._dio, this._serializers); - - /// 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 [DioError] 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 { - const _responseType = FullType(Fruit); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as Fruit; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart deleted file mode 100644 index ed3bb12f25b8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart +++ /dev/null @@ -1,77 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/api_key_auth.dart deleted file mode 100644 index ee16e3f0f92f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/auth.dart deleted file mode 100644 index f7ae9bf3f11e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/basic_auth.dart deleted file mode 100644 index b6e6dce04f9c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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'] == '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/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 1d4402b376c0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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'] == '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/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/oauth.dart deleted file mode 100644 index 337cf762b0ce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart deleted file mode 100644 index db3c5c437db1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart +++ /dev/null @@ -1,31 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -class DateSerializer implements PrimitiveSerializer { - - const DateSerializer(); - - @override - Iterable get types => BuiltList.of([Date]); - - @override - String get wireName => 'Date'; - - @override - Date deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - final parsed = DateTime.parse(serialized as String); - return Date(parsed.year, parsed.month, parsed.day); - } - - @override - Object serialize(Serializers serializers, Date date, - {FullType specifiedType = FullType.unspecified}) { - return date.toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart deleted file mode 100644 index 02ca94190b96..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart +++ /dev/null @@ -1,108 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'apple.g.dart'; - -/// Apple -/// -/// Properties: -/// * [kind] -@BuiltValue() -abstract class Apple implements Built { - @BuiltValueField(wireName: r'kind') - String? get kind; - - Apple._(); - - factory Apple([void updates(AppleBuilder b)]) = _$Apple; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(AppleBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AppleSerializer(); -} - -class _$AppleSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Apple, _$Apple]; - - @override - final String wireName = r'Apple'; - - Iterable _serializeProperties( - Serializers serializers, - Apple object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.kind != null) { - yield r'kind'; - yield serializers.serialize( - object.kind, - specifiedType: const FullType(String), - ); - } - } - - @override - Object serialize( - Serializers serializers, - Apple object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required AppleBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'kind': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.kind = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - Apple deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = AppleBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart deleted file mode 100644 index bf2d632ee114..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart +++ /dev/null @@ -1,108 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'banana.g.dart'; - -/// Banana -/// -/// Properties: -/// * [count] -@BuiltValue() -abstract class Banana implements Built { - @BuiltValueField(wireName: r'count') - num? get count; - - Banana._(); - - factory Banana([void updates(BananaBuilder b)]) = _$Banana; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(BananaBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$BananaSerializer(); -} - -class _$BananaSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Banana, _$Banana]; - - @override - final String wireName = r'Banana'; - - Iterable _serializeProperties( - Serializers serializers, - Banana object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.count != null) { - yield r'count'; - yield serializers.serialize( - object.count, - specifiedType: const FullType(num), - ); - } - } - - @override - Object serialize( - Serializers serializers, - Banana object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required BananaBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'count': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(num), - ) as num; - result.count = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - Banana deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = BananaBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/date.dart deleted file mode 100644 index b21c7f544bee..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/date.dart +++ /dev/null @@ -1,70 +0,0 @@ -/// A gregorian calendar date generated by -/// OpenAPI generator to differentiate -/// between [DateTime] and [Date] formats. -class Date implements Comparable { - final int year; - - /// January is 1. - final int month; - - /// First day is 1. - final int day; - - Date(this.year, this.month, this.day); - - /// The current date - static Date now({bool utc = false}) { - var now = DateTime.now(); - if (utc) { - now = now.toUtc(); - } - return now.toDate(); - } - - /// Convert to a [DateTime]. - DateTime toDateTime({bool utc = false}) { - if (utc) { - return DateTime.utc(year, month, day); - } else { - return DateTime(year, month, day); - } - } - - @override - int compareTo(Date other) { - int d = year.compareTo(other.year); - if (d != 0) { - return d; - } - d = month.compareTo(other.month); - if (d != 0) { - return d; - } - return day.compareTo(other.day); - } - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Date && - runtimeType == other.runtimeType && - year == other.year && - month == other.month && - day == other.day; - - @override - int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; - - @override - String toString() { - final yyyy = year.toString(); - final mm = month.toString().padLeft(2, '0'); - final dd = day.toString().padLeft(2, '0'); - - return '$yyyy-$mm-$dd'; - } -} - -extension DateTimeToDate on DateTime { - Date toDate() => Date(year, month, day); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart deleted file mode 100644 index 11f8cfa70501..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart +++ /dev/null @@ -1,123 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/apple.dart'; -import 'package:openapi/src/model/banana.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:one_of/one_of.dart'; - -part 'fruit.g.dart'; - -/// Fruit -/// -/// Properties: -/// * [color] -/// * [kind] -/// * [count] -@BuiltValue() -abstract class Fruit implements Built { - @BuiltValueField(wireName: r'color') - String? get color; - - /// One Of [Apple], [Banana] - OneOf get oneOf; - - Fruit._(); - - factory Fruit([void updates(FruitBuilder b)]) = _$Fruit; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FruitBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FruitSerializer(); -} - -class _$FruitSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Fruit, _$Fruit]; - - @override - final String wireName = r'Fruit'; - - Iterable _serializeProperties( - Serializers serializers, - Fruit object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.color != null) { - yield r'color'; - yield serializers.serialize( - object.color, - specifiedType: const FullType(String), - ); - } - } - - @override - Object serialize( - Serializers serializers, - Fruit object, { - FullType specifiedType = FullType.unspecified, - }) { - final oneOf = object.oneOf; - final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); - return result; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required FruitBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'color': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.color = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - Fruit deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = FruitBuilder(); - Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [FullType(Apple), FullType(Banana), ]); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - oneOfDataSrc = unhandled; - result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart deleted file mode 100644 index ddb1d66a1f5e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart +++ /dev/null @@ -1,36 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_import - -import 'package:one_of_serializer/any_of_serializer.dart'; -import 'package:one_of_serializer/one_of_serializer.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/json_object.dart'; -import 'package:built_value/serializer.dart'; -import 'package:built_value/standard_json_plugin.dart'; -import 'package:built_value/iso_8601_date_time_serializer.dart'; -import 'package:openapi/src/date_serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -import 'package:openapi/src/model/apple.dart'; -import 'package:openapi/src/model/banana.dart'; -import 'package:openapi/src/model/fruit.dart'; - -part 'serializers.g.dart'; - -@SerializersFor([ - Apple, - Banana, - Fruit, -]) -Serializers serializers = (_$serializers.toBuilder() - ..add(const OneOfSerializer()) - ..add(const AnyOfSerializer()) - ..add(const DateSerializer()) - ..add(Iso8601DateTimeSerializer())) - .build(); - -Serializers standardSerializers = - (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/pom.xml b/samples/openapi3/client/petstore/dart-dio/oneof/pom.xml deleted file mode 100644 index 810c7d48d77f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - 4.0.0 - org.openapitools - DartDioOneOf - pom - 1.0.0-SNAPSHOT - DartDio OneOf - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - pub-get - pre-integration-test - - exec - - - pub - - get - - - - - pub-run-build-runner - pre-integration-test - - exec - - - pub - - run - build_runner - build - - - - - dart-analyze - integration-test - - exec - - - dart - - analyze - --fatal-infos - - - - - dart-test - integration-test - - exec - - - dart - - test - - - - - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml deleted file mode 100644 index fb676f65c393..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '>=2.12.0 <3.0.0' - -dependencies: - dio: '>=4.0.1 <5.0.0' - one_of: '>=1.5.0 <2.0.0' - one_of_serializer: '>=1.5.0 <2.0.0' - built_value: '>=8.4.0 <9.0.0' - built_collection: '>=5.1.1 <6.0.0' - -dev_dependencies: - built_value_generator: '>=8.4.0 <9.0.0' - build_runner: any - test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof/test/apple_test.dart deleted file mode 100644 index 1d542169550d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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 instance = AppleBuilder(); - // TODO add properties to the builder and call build() - - group(Apple, () { - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof/test/banana_test.dart deleted file mode 100644 index a883acc0a9e8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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 instance = BananaBuilder(); - // TODO add properties to the builder and call build() - - group(Banana, () { - // num count - test('to test the property `count`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof/test/default_api_test.dart deleted file mode 100644 index 07d256d2e554..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof/test/fruit_test.dart deleted file mode 100644 index c18790ae9566..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/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 instance = FruitBuilder(); - // TODO add properties to the builder and call build() - - 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/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.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/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.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/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES deleted file mode 100644 index 52a900a19623..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES +++ /dev/null @@ -1,47 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -doc/Addressable.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/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/api_util.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/date_serializer.dart -lib/src/model/addressable.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/date.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/pasta.dart -lib/src/model/pizza.dart -lib/src/model/pizza_speziale.dart -lib/src/serializers.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION deleted file mode 100644 index d6b4ec4aa783..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md deleted file mode 100644 index 45b3ba7a9516..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md +++ /dev/null @@ -1,99 +0,0 @@ -# openapi -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 -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.12.0 or later OR Flutter 1.26.0 or later -* Dio 4.0.0+ - -## Installation & Usage - -### pub.dev -To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml -```yaml -dependencies: - openapi: 1.0.0 -``` - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - git: - url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - #ref: main -``` - -### Local development -To use the package from your local drive, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - path: /path/to/openapi -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:openapi/openapi.dart'; - - -final api = Openapi().getBarApi(); -final BarCreate barCreate = ; // BarCreate | - -try { - final response = await api.createBar(barCreate); - print(response); -} catch on DioError (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) - - [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) - - [Pasta](doc/Pasta.md) - - [Pizza](doc/Pizza.md) - - [PizzaSpeziale](doc/PizzaSpeziale.md) - - -## Documentation For Authorization - - All endpoints do not require authorization. - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml deleted file mode 100644 index a611887d3acf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml +++ /dev/null @@ -1,9 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md deleted file mode 100644 index 0fcd81b80382..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/doc/Bar.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md deleted file mode 100644 index 4cccc863a489..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/doc/BarApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md deleted file mode 100644 index 3ef168ecf34b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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 DioError (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/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md deleted file mode 100644 index c0b4ba6edc9a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/doc/BarRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md deleted file mode 100644 index 949695f4d36f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md +++ /dev/null @@ -1,19 +0,0 @@ -# openapi.model.BarRef - -## 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/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md deleted file mode 100644 index 9dafa2d6b220..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md +++ /dev/null @@ -1,19 +0,0 @@ -# openapi.model.BarRefOrValue - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | -**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/doc/Entity.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md deleted file mode 100644 index 5ba2144b44fe..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md deleted file mode 100644 index 80eae55f4145..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/doc/Extensible.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md deleted file mode 100644 index 7a781e578ea4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md deleted file mode 100644 index 2627691fefe5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/doc/FooApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md deleted file mode 100644 index 9e8990ebb8b3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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 DioError (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** -> BuiltList getAllFoos() - -GET all Foos - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFooApi(); - -try { - final response = api.getAllFoos(); - print(response); -} catch on DioError (e) { - print('Exception when calling FooApi->getAllFoos: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**BuiltList<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/doc/FooRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md deleted file mode 100644 index 68104b227292..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.FooRef - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**foorefPropA** | **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/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md deleted file mode 100644 index 35e9fd114e1d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md +++ /dev/null @@ -1,19 +0,0 @@ -# openapi.model.FooRefOrValue - -## 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/doc/FooRefOrValueWithProperties.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md deleted file mode 100644 index 05aa2b0bbc1c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md +++ /dev/null @@ -1,19 +0,0 @@ -# openapi.model.FooRefOrValueWithProperties - -## 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/doc/Pasta.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md deleted file mode 100644 index 034ff420d323..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/doc/Pizza.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md deleted file mode 100644 index e4b040a6a79c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md deleted file mode 100644 index e1d8434c077d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.PizzaSpeziale - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**toppings** | **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/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart deleted file mode 100644 index ea87a7cb4761..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart +++ /dev/null @@ -1,28 +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/oauth.dart'; -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; - -export 'package:openapi/src/api/bar_api.dart'; -export 'package:openapi/src/api/foo_api.dart'; - -export 'package:openapi/src/model/addressable.dart'; -export 'package:openapi/src/model/bar.dart'; -export 'package:openapi/src/model/bar_create.dart'; -export 'package:openapi/src/model/bar_ref.dart'; -export 'package:openapi/src/model/bar_ref_or_value.dart'; -export 'package:openapi/src/model/entity.dart'; -export 'package:openapi/src/model/entity_ref.dart'; -export 'package:openapi/src/model/extensible.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_ref.dart'; -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_polymorphism_and_inheritance/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api.dart deleted file mode 100644 index 0bb368eace08..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api.dart +++ /dev/null @@ -1,80 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/serializers.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; - final Serializers serializers; - - Openapi({ - Dio? dio, - Serializers? serializers, - String? basePathOverride, - List? interceptors, - }) : this.serializers = serializers ?? standardSerializers, - this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: 5000, - receiveTimeout: 3000, - )) { - if (interceptors == null) { - this.dio.interceptors.addAll([ - OAuthInterceptor(), - BasicAuthInterceptor(), - BearerAuthInterceptor(), - ApiKeyAuthInterceptor(), - ]); - } else { - this.dio.interceptors.addAll(interceptors); - } - } - - void setOAuthToken(String name, String token) { - if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; - } - } - - void setBearerAuth(String name, String token) { - if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; - } - } - - void setBasicAuth(String name, String username, String password) { - if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - } - - void setApiKey(String name, String apiKey) { - if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - } - - /// Get 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, serializers); - } - - /// 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, serializers); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart deleted file mode 100644 index 4afe604a5578..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart +++ /dev/null @@ -1,114 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/bar.dart'; -import 'package:openapi/src/model/bar_create.dart'; - -class BarApi { - - final Dio _dio; - - final Serializers _serializers; - - const BarApi(this._dio, this._serializers); - - /// 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 [DioError] 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 { - const _type = FullType(BarCreate); - _bodyData = _serializers.serialize(barCreate, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Bar _responseData; - - try { - const _responseType = FullType(Bar); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as Bar; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart deleted file mode 100644 index 232392c76a70..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart +++ /dev/null @@ -1,187 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/foo.dart'; -import 'package:openapi/src/model/foo_ref_or_value.dart'; - -class FooApi { - - final Dio _dio; - - final Serializers _serializers; - - const FooApi(this._dio, this._serializers); - - /// 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 [DioError] 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 { - const _type = FullType(Foo); - _bodyData = foo == null ? null : _serializers.serialize(foo, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - FooRefOrValue _responseData; - - try { - const _responseType = FullType(FooRefOrValue); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as FooRefOrValue; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// 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 [BuiltList] as data - /// Throws [DioError] 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, - ); - - BuiltList _responseData; - - try { - const _responseType = FullType(BuiltList, [FullType(FooRefOrValue)]); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as BuiltList; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart deleted file mode 100644 index ed3bb12f25b8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart +++ /dev/null @@ -1,77 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/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/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart deleted file mode 100644 index f7ae9bf3f11e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart deleted file mode 100644 index b6e6dce04f9c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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'] == '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/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 1d4402b376c0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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'] == '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/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart deleted file mode 100644 index 337cf762b0ce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart deleted file mode 100644 index db3c5c437db1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart +++ /dev/null @@ -1,31 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -class DateSerializer implements PrimitiveSerializer { - - const DateSerializer(); - - @override - Iterable get types => BuiltList.of([Date]); - - @override - String get wireName => 'Date'; - - @override - Date deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - final parsed = DateTime.parse(serialized as String); - return Date(parsed.year, parsed.month, parsed.day); - } - - @override - Object serialize(Serializers serializers, Date date, - {FullType specifiedType = FullType.unspecified}) { - return date.toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart deleted file mode 100644 index 0ab0936d5673..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart +++ /dev/null @@ -1,161 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'addressable.g.dart'; - -/// Base schema for addressable entities -/// -/// Properties: -/// * [href] - Hyperlink reference -/// * [id] - unique identifier -@BuiltValue(instantiable: false) -abstract class Addressable { - /// Hyperlink reference - @BuiltValueField(wireName: r'href') - String? get href; - - /// unique identifier - @BuiltValueField(wireName: r'id') - String? get id; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AddressableSerializer(); -} - -class _$AddressableSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Addressable]; - - @override - final String wireName = r'Addressable'; - - Iterable _serializeProperties( - Serializers serializers, - Addressable object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); - } - if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); - } - } - - @override - Object serialize( - Serializers serializers, - Addressable object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - @override - Addressable deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.deserialize(serialized, specifiedType: FullType($Addressable)) as $Addressable; - } -} - -/// a concrete implementation of [Addressable], since [Addressable] is not instantiable -@BuiltValue(instantiable: true) -abstract class $Addressable implements Addressable, Built<$Addressable, $AddressableBuilder> { - $Addressable._(); - - factory $Addressable([void Function($AddressableBuilder)? updates]) = _$$Addressable; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults($AddressableBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer<$Addressable> get serializer => _$$AddressableSerializer(); -} - -class _$$AddressableSerializer implements PrimitiveSerializer<$Addressable> { - @override - final Iterable types = const [$Addressable, _$$Addressable]; - - @override - final String wireName = r'$Addressable'; - - @override - Object serialize( - Serializers serializers, - $Addressable object, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.serialize(object, specifiedType: FullType(Addressable))!; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required AddressableBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'href': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.href = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.id = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - $Addressable deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = $AddressableBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart deleted file mode 100644 index cb769550b4f2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart +++ /dev/null @@ -1,219 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/foo_ref_or_value.dart'; -import 'package:openapi/src/model/entity.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'bar.g.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 -@BuiltValue() -abstract class Bar implements Entity, Built { - @BuiltValueField(wireName: r'foo') - FooRefOrValue? get foo; - - @BuiltValueField(wireName: r'fooPropB') - String? get fooPropB; - - @BuiltValueField(wireName: r'barPropA') - String? get barPropA; - - Bar._(); - - factory Bar([void updates(BarBuilder b)]) = _$Bar; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarBuilder b) => b..atType=b.discriminatorValue; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$BarSerializer(); -} - -class _$BarSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Bar, _$Bar]; - - @override - final String wireName = r'Bar'; - - Iterable _serializeProperties( - Serializers serializers, - Bar object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); - } - if (object.foo != null) { - yield r'foo'; - yield serializers.serialize( - object.foo, - specifiedType: const FullType(FooRefOrValue), - ); - } - if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); - } - if (object.fooPropB != null) { - yield r'fooPropB'; - yield serializers.serialize( - object.fooPropB, - specifiedType: const FullType(String), - ); - } - if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); - } - if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); - } - yield r'@type'; - yield serializers.serialize( - object.atType, - specifiedType: const FullType(String), - ); - if (object.barPropA != null) { - yield r'barPropA'; - yield serializers.serialize( - object.barPropA, - specifiedType: const FullType(String), - ); - } - } - - @override - Object serialize( - Serializers serializers, - Bar object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required BarBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'@schemaLocation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atSchemaLocation = valueDes; - break; - case r'foo': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(FooRefOrValue), - ) as FooRefOrValue; - result.foo.replace(valueDes); - break; - case r'@baseType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atBaseType = valueDes; - break; - case r'fooPropB': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.fooPropB = valueDes; - break; - case r'href': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.href = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.id = valueDes; - break; - case r'@type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atType = valueDes; - break; - case r'barPropA': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.barPropA = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - Bar deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = BarBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart deleted file mode 100644 index 8942b6433f5e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart +++ /dev/null @@ -1,219 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/foo_ref_or_value.dart'; -import 'package:openapi/src/model/entity.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'bar_create.g.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 -@BuiltValue() -abstract class BarCreate implements Entity, Built { - @BuiltValueField(wireName: r'foo') - FooRefOrValue? get foo; - - @BuiltValueField(wireName: r'fooPropB') - String? get fooPropB; - - @BuiltValueField(wireName: r'barPropA') - String? get barPropA; - - BarCreate._(); - - factory BarCreate([void updates(BarCreateBuilder b)]) = _$BarCreate; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarCreateBuilder b) => b..atType=b.discriminatorValue; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$BarCreateSerializer(); -} - -class _$BarCreateSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [BarCreate, _$BarCreate]; - - @override - final String wireName = r'BarCreate'; - - Iterable _serializeProperties( - Serializers serializers, - BarCreate object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); - } - if (object.foo != null) { - yield r'foo'; - yield serializers.serialize( - object.foo, - specifiedType: const FullType(FooRefOrValue), - ); - } - if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); - } - if (object.fooPropB != null) { - yield r'fooPropB'; - yield serializers.serialize( - object.fooPropB, - specifiedType: const FullType(String), - ); - } - if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); - } - if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); - } - yield r'@type'; - yield serializers.serialize( - object.atType, - specifiedType: const FullType(String), - ); - if (object.barPropA != null) { - yield r'barPropA'; - yield serializers.serialize( - object.barPropA, - specifiedType: const FullType(String), - ); - } - } - - @override - Object serialize( - Serializers serializers, - BarCreate object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required BarCreateBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'@schemaLocation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atSchemaLocation = valueDes; - break; - case r'foo': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(FooRefOrValue), - ) as FooRefOrValue; - result.foo.replace(valueDes); - break; - case r'@baseType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atBaseType = valueDes; - break; - case r'fooPropB': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.fooPropB = valueDes; - break; - case r'href': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.href = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.id = valueDes; - break; - case r'@type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atType = valueDes; - break; - case r'barPropA': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.barPropA = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - BarCreate deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = BarCreateBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart deleted file mode 100644 index 2b9d2727a448..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart +++ /dev/null @@ -1,192 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/entity_ref.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'bar_ref.g.dart'; - -/// BarRef -/// -/// 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 -@BuiltValue() -abstract class BarRef implements EntityRef, Built { - BarRef._(); - - factory BarRef([void updates(BarRefBuilder b)]) = _$BarRef; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarRefBuilder b) => b..atType=b.discriminatorValue; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$BarRefSerializer(); -} - -class _$BarRefSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [BarRef, _$BarRef]; - - @override - final String wireName = r'BarRef'; - - Iterable _serializeProperties( - Serializers serializers, - BarRef object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); - } - if (object.atReferredType != null) { - yield r'@referredType'; - yield serializers.serialize( - object.atReferredType, - specifiedType: const FullType(String), - ); - } - if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); - } - if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); - } - if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); - } - if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); - } - yield r'@type'; - yield serializers.serialize( - object.atType, - specifiedType: const FullType(String), - ); - } - - @override - Object serialize( - Serializers serializers, - BarRef object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required BarRefBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'@schemaLocation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atSchemaLocation = valueDes; - break; - case r'@referredType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atReferredType = valueDes; - break; - case r'name': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.name = valueDes; - break; - case r'@baseType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atBaseType = valueDes; - break; - case r'href': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.href = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.id = valueDes; - break; - case r'@type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atType = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - BarRef deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = BarRefBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart deleted file mode 100644 index 4af61384ab76..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart +++ /dev/null @@ -1,129 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/bar_ref.dart'; -import 'package:openapi/src/model/bar.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:one_of/one_of.dart'; - -part 'bar_ref_or_value.g.dart'; - -/// BarRefOrValue -/// -/// 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 -@BuiltValue() -abstract class BarRefOrValue implements Built { - /// One Of [Bar], [BarRef] - OneOf get oneOf; - - static const String discriminatorFieldName = r'@type'; - - static const Map discriminatorMapping = { - r'Bar': Bar, - r'BarRef': BarRef, - }; - - BarRefOrValue._(); - - factory BarRefOrValue([void updates(BarRefOrValueBuilder b)]) = _$BarRefOrValue; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarRefOrValueBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$BarRefOrValueSerializer(); -} - -extension BarRefOrValueDiscriminatorExt on BarRefOrValue { - String? get discriminatorValue { - if (this is Bar) { - return r'Bar'; - } - if (this is BarRef) { - return r'BarRef'; - } - return null; - } -} -extension BarRefOrValueBuilderDiscriminatorExt on BarRefOrValueBuilder { - String? get discriminatorValue { - if (this is BarBuilder) { - return r'Bar'; - } - if (this is BarRefBuilder) { - return r'BarRef'; - } - return null; - } -} - -class _$BarRefOrValueSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [BarRefOrValue, _$BarRefOrValue]; - - @override - final String wireName = r'BarRefOrValue'; - - Iterable _serializeProperties( - Serializers serializers, - BarRefOrValue object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - } - - @override - Object serialize( - Serializers serializers, - BarRefOrValue object, { - FullType specifiedType = FullType.unspecified, - }) { - final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; - } - - @override - BarRefOrValue deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = BarRefOrValueBuilder(); - Object? oneOfDataSrc; - final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; - oneOfDataSrc = serialized; - final oneOfTypes = [Bar, BarRef, ]; - Object oneOfResult; - Type oneOfType; - switch (discValue) { - case r'Bar': - oneOfResult = serializers.deserialize( - oneOfDataSrc, - specifiedType: FullType(Bar), - ) as Bar; - oneOfType = Bar; - break; - case r'BarRef': - oneOfResult = serializers.deserialize( - oneOfDataSrc, - specifiedType: FullType(BarRef), - ) as BarRef; - oneOfType = BarRef; - break; - default: - throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); - } - result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart deleted file mode 100644 index b21c7f544bee..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart +++ /dev/null @@ -1,70 +0,0 @@ -/// A gregorian calendar date generated by -/// OpenAPI generator to differentiate -/// between [DateTime] and [Date] formats. -class Date implements Comparable { - final int year; - - /// January is 1. - final int month; - - /// First day is 1. - final int day; - - Date(this.year, this.month, this.day); - - /// The current date - static Date now({bool utc = false}) { - var now = DateTime.now(); - if (utc) { - now = now.toUtc(); - } - return now.toDate(); - } - - /// Convert to a [DateTime]. - DateTime toDateTime({bool utc = false}) { - if (utc) { - return DateTime.utc(year, month, day); - } else { - return DateTime(year, month, day); - } - } - - @override - int compareTo(Date other) { - int d = year.compareTo(other.year); - if (d != 0) { - return d; - } - d = month.compareTo(other.month); - if (d != 0) { - return d; - } - return day.compareTo(other.day); - } - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Date && - runtimeType == other.runtimeType && - year == other.year && - month == other.month && - day == other.day; - - @override - int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; - - @override - String toString() { - final yyyy = year.toString(); - final mm = month.toString().padLeft(2, '0'); - final dd = day.toString().padLeft(2, '0'); - - return '$yyyy-$mm-$dd'; - } -} - -extension DateTimeToDate on DateTime { - Date toDate() => Date(year, month, day); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart deleted file mode 100644 index 7e27fab47387..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart +++ /dev/null @@ -1,298 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/extensible.dart'; -import 'package:openapi/src/model/pizza_speziale.dart'; -import 'package:openapi/src/model/foo.dart'; -import 'package:openapi/src/model/pizza.dart'; -import 'package:openapi/src/model/addressable.dart'; -import 'package:openapi/src/model/pasta.dart'; -import 'package:openapi/src/model/bar_create.dart'; -import 'package:openapi/src/model/bar.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'entity.g.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 -@BuiltValue(instantiable: false) -abstract class Entity implements Addressable, Extensible { - static const String discriminatorFieldName = r'@type'; - - static const Map discriminatorMapping = { - r'Bar': Bar, - r'Bar_Create': BarCreate, - r'Foo': Foo, - r'Pasta': Pasta, - r'Pizza': Pizza, - r'PizzaSpeziale': PizzaSpeziale, - }; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$EntitySerializer(); -} - -extension EntityDiscriminatorExt on Entity { - String? get discriminatorValue { - if (this is Bar) { - return r'Bar'; - } - if (this is BarCreate) { - return r'Bar_Create'; - } - if (this is Foo) { - return r'Foo'; - } - if (this is Pasta) { - return r'Pasta'; - } - if (this is Pizza) { - return r'Pizza'; - } - if (this is PizzaSpeziale) { - return r'PizzaSpeziale'; - } - return null; - } -} -extension EntityBuilderDiscriminatorExt on EntityBuilder { - String? get discriminatorValue { - if (this is BarBuilder) { - return r'Bar'; - } - if (this is BarCreateBuilder) { - return r'Bar_Create'; - } - if (this is FooBuilder) { - return r'Foo'; - } - if (this is PastaBuilder) { - return r'Pasta'; - } - if (this is PizzaBuilder) { - return r'Pizza'; - } - if (this is PizzaSpezialeBuilder) { - return r'PizzaSpeziale'; - } - return null; - } -} - -class _$EntitySerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Entity]; - - @override - final String wireName = r'Entity'; - - Iterable _serializeProperties( - Serializers serializers, - Entity object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); - } - if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); - } - if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); - } - if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); - } - yield r'@type'; - yield serializers.serialize( - object.atType, - specifiedType: const FullType(String), - ); - } - - @override - Object serialize( - Serializers serializers, - Entity object, { - FullType specifiedType = FullType.unspecified, - }) { - if (object is Bar) { - return serializers.serialize(object, specifiedType: FullType(Bar))!; - } - if (object is BarCreate) { - return serializers.serialize(object, specifiedType: FullType(BarCreate))!; - } - if (object is Foo) { - return serializers.serialize(object, specifiedType: FullType(Foo))!; - } - if (object is Pasta) { - return serializers.serialize(object, specifiedType: FullType(Pasta))!; - } - if (object is Pizza) { - return serializers.serialize(object, specifiedType: FullType(Pizza))!; - } - if (object is PizzaSpeziale) { - return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; - } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - @override - Entity deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(Entity.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; - switch (discValue) { - case r'Bar': - return serializers.deserialize(serialized, specifiedType: FullType(Bar)) as Bar; - case r'Bar_Create': - return serializers.deserialize(serialized, specifiedType: FullType(BarCreate)) as BarCreate; - case r'Foo': - return serializers.deserialize(serialized, specifiedType: FullType(Foo)) as Foo; - case r'Pasta': - return serializers.deserialize(serialized, specifiedType: FullType(Pasta)) as Pasta; - case r'Pizza': - return serializers.deserialize(serialized, specifiedType: FullType(Pizza)) as Pizza; - case r'PizzaSpeziale': - return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; - default: - return serializers.deserialize(serialized, specifiedType: FullType($Entity)) as $Entity; - } - } -} - -/// a concrete implementation of [Entity], since [Entity] is not instantiable -@BuiltValue(instantiable: true) -abstract class $Entity implements Entity, Built<$Entity, $EntityBuilder> { - $Entity._(); - - factory $Entity([void Function($EntityBuilder)? updates]) = _$$Entity; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults($EntityBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer<$Entity> get serializer => _$$EntitySerializer(); -} - -class _$$EntitySerializer implements PrimitiveSerializer<$Entity> { - @override - final Iterable types = const [$Entity, _$$Entity]; - - @override - final String wireName = r'$Entity'; - - @override - Object serialize( - Serializers serializers, - $Entity object, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.serialize(object, specifiedType: FullType(Entity))!; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required EntityBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'@schemaLocation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atSchemaLocation = valueDes; - break; - case r'@baseType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atBaseType = valueDes; - break; - case r'href': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.href = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.id = valueDes; - break; - case r'@type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atType = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - $Entity deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = $EntityBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart deleted file mode 100644 index 7502c94dd7f3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart +++ /dev/null @@ -1,284 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/extensible.dart'; -import 'package:openapi/src/model/bar_ref.dart'; -import 'package:openapi/src/model/addressable.dart'; -import 'package:openapi/src/model/foo_ref.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'entity_ref.g.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 -@BuiltValue(instantiable: false) -abstract class EntityRef implements Addressable, Extensible { - /// The actual type of the target instance when needed for disambiguation. - @BuiltValueField(wireName: r'@referredType') - String? get atReferredType; - - /// Name of the related entity. - @BuiltValueField(wireName: r'name') - String? get name; - - static const String discriminatorFieldName = r'@type'; - - static const Map discriminatorMapping = { - r'BarRef': BarRef, - r'FooRef': FooRef, - }; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$EntityRefSerializer(); -} - -extension EntityRefDiscriminatorExt on EntityRef { - String? get discriminatorValue { - if (this is BarRef) { - return r'BarRef'; - } - if (this is FooRef) { - return r'FooRef'; - } - return null; - } -} -extension EntityRefBuilderDiscriminatorExt on EntityRefBuilder { - String? get discriminatorValue { - if (this is BarRefBuilder) { - return r'BarRef'; - } - if (this is FooRefBuilder) { - return r'FooRef'; - } - return null; - } -} - -class _$EntityRefSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [EntityRef]; - - @override - final String wireName = r'EntityRef'; - - Iterable _serializeProperties( - Serializers serializers, - EntityRef object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); - } - if (object.atReferredType != null) { - yield r'@referredType'; - yield serializers.serialize( - object.atReferredType, - specifiedType: const FullType(String), - ); - } - if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); - } - if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); - } - if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); - } - if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); - } - yield r'@type'; - yield serializers.serialize( - object.atType, - specifiedType: const FullType(String), - ); - } - - @override - Object serialize( - Serializers serializers, - EntityRef object, { - FullType specifiedType = FullType.unspecified, - }) { - if (object is BarRef) { - return serializers.serialize(object, specifiedType: FullType(BarRef))!; - } - if (object is FooRef) { - return serializers.serialize(object, specifiedType: FullType(FooRef))!; - } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - @override - EntityRef deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; - switch (discValue) { - case r'BarRef': - return serializers.deserialize(serialized, specifiedType: FullType(BarRef)) as BarRef; - case r'FooRef': - return serializers.deserialize(serialized, specifiedType: FullType(FooRef)) as FooRef; - default: - return serializers.deserialize(serialized, specifiedType: FullType($EntityRef)) as $EntityRef; - } - } -} - -/// a concrete implementation of [EntityRef], since [EntityRef] is not instantiable -@BuiltValue(instantiable: true) -abstract class $EntityRef implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { - $EntityRef._(); - - factory $EntityRef([void Function($EntityRefBuilder)? updates]) = _$$EntityRef; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults($EntityRefBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer<$EntityRef> get serializer => _$$EntityRefSerializer(); -} - -class _$$EntityRefSerializer implements PrimitiveSerializer<$EntityRef> { - @override - final Iterable types = const [$EntityRef, _$$EntityRef]; - - @override - final String wireName = r'$EntityRef'; - - @override - Object serialize( - Serializers serializers, - $EntityRef object, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.serialize(object, specifiedType: FullType(EntityRef))!; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required EntityRefBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'@schemaLocation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atSchemaLocation = valueDes; - break; - case r'@referredType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atReferredType = valueDes; - break; - case r'name': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.name = valueDes; - break; - case r'@baseType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atBaseType = valueDes; - break; - case r'href': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.href = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.id = valueDes; - break; - case r'@type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atType = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - $EntityRef deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = $EntityRefBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart deleted file mode 100644 index 2423fb276412..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart +++ /dev/null @@ -1,178 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'extensible.g.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 -@BuiltValue(instantiable: false) -abstract class Extensible { - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @BuiltValueField(wireName: r'@schemaLocation') - String? get atSchemaLocation; - - /// When sub-classing, this defines the super-class - @BuiltValueField(wireName: r'@baseType') - String? get atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @BuiltValueField(wireName: r'@type') - String get atType; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ExtensibleSerializer(); -} - -class _$ExtensibleSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Extensible]; - - @override - final String wireName = r'Extensible'; - - Iterable _serializeProperties( - Serializers serializers, - Extensible object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); - } - if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); - } - yield r'@type'; - yield serializers.serialize( - object.atType, - specifiedType: const FullType(String), - ); - } - - @override - Object serialize( - Serializers serializers, - Extensible object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - @override - Extensible deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.deserialize(serialized, specifiedType: FullType($Extensible)) as $Extensible; - } -} - -/// a concrete implementation of [Extensible], since [Extensible] is not instantiable -@BuiltValue(instantiable: true) -abstract class $Extensible implements Extensible, Built<$Extensible, $ExtensibleBuilder> { - $Extensible._(); - - factory $Extensible([void Function($ExtensibleBuilder)? updates]) = _$$Extensible; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults($ExtensibleBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer<$Extensible> get serializer => _$$ExtensibleSerializer(); -} - -class _$$ExtensibleSerializer implements PrimitiveSerializer<$Extensible> { - @override - final Iterable types = const [$Extensible, _$$Extensible]; - - @override - final String wireName = r'$Extensible'; - - @override - Object serialize( - Serializers serializers, - $Extensible object, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.serialize(object, specifiedType: FullType(Extensible))!; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required ExtensibleBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'@schemaLocation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atSchemaLocation = valueDes; - break; - case r'@baseType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atBaseType = valueDes; - break; - case r'@type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atType = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - $Extensible deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = $ExtensibleBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart deleted file mode 100644 index d2e1f5817f20..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart +++ /dev/null @@ -1,200 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/entity.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'foo.g.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 -@BuiltValue() -abstract class Foo implements Entity, Built { - @BuiltValueField(wireName: r'fooPropA') - String? get fooPropA; - - @BuiltValueField(wireName: r'fooPropB') - String? get fooPropB; - - Foo._(); - - factory Foo([void updates(FooBuilder b)]) = _$Foo; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooBuilder b) => b..atType=b.discriminatorValue; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FooSerializer(); -} - -class _$FooSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Foo, _$Foo]; - - @override - final String wireName = r'Foo'; - - Iterable _serializeProperties( - Serializers serializers, - Foo object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); - } - if (object.fooPropA != null) { - yield r'fooPropA'; - yield serializers.serialize( - object.fooPropA, - specifiedType: const FullType(String), - ); - } - if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); - } - if (object.fooPropB != null) { - yield r'fooPropB'; - yield serializers.serialize( - object.fooPropB, - specifiedType: const FullType(String), - ); - } - if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); - } - if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); - } - yield r'@type'; - yield serializers.serialize( - object.atType, - specifiedType: const FullType(String), - ); - } - - @override - Object serialize( - Serializers serializers, - Foo object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required FooBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'@schemaLocation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atSchemaLocation = valueDes; - break; - case r'fooPropA': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.fooPropA = valueDes; - break; - case r'@baseType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atBaseType = valueDes; - break; - case r'fooPropB': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.fooPropB = valueDes; - break; - case r'href': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.href = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.id = valueDes; - break; - case r'@type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atType = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - Foo deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = FooBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart deleted file mode 100644 index 1f77d990f0e8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart +++ /dev/null @@ -1,210 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/entity_ref.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'foo_ref.g.dart'; - -/// FooRef -/// -/// Properties: -/// * [foorefPropA] -/// * [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 -@BuiltValue() -abstract class FooRef implements EntityRef, Built { - @BuiltValueField(wireName: r'foorefPropA') - String? get foorefPropA; - - FooRef._(); - - factory FooRef([void updates(FooRefBuilder b)]) = _$FooRef; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooRefBuilder b) => b..atType=b.discriminatorValue; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FooRefSerializer(); -} - -class _$FooRefSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [FooRef, _$FooRef]; - - @override - final String wireName = r'FooRef'; - - Iterable _serializeProperties( - Serializers serializers, - FooRef object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); - } - if (object.atReferredType != null) { - yield r'@referredType'; - yield serializers.serialize( - object.atReferredType, - specifiedType: const FullType(String), - ); - } - if (object.foorefPropA != null) { - yield r'foorefPropA'; - yield serializers.serialize( - object.foorefPropA, - specifiedType: const FullType(String), - ); - } - if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); - } - if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); - } - if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); - } - if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); - } - yield r'@type'; - yield serializers.serialize( - object.atType, - specifiedType: const FullType(String), - ); - } - - @override - Object serialize( - Serializers serializers, - FooRef object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required FooRefBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'@schemaLocation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atSchemaLocation = valueDes; - break; - case r'@referredType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atReferredType = valueDes; - break; - case r'foorefPropA': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.foorefPropA = valueDes; - break; - case r'name': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.name = valueDes; - break; - case r'@baseType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atBaseType = valueDes; - break; - case r'href': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.href = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.id = valueDes; - break; - case r'@type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atType = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - FooRef deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = FooRefBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart deleted file mode 100644 index af3e4875d9d6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart +++ /dev/null @@ -1,129 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/foo.dart'; -import 'package:openapi/src/model/foo_ref.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:one_of/one_of.dart'; - -part 'foo_ref_or_value.g.dart'; - -/// FooRefOrValue -/// -/// 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 -@BuiltValue() -abstract class FooRefOrValue implements Built { - /// One Of [Foo], [FooRef] - OneOf get oneOf; - - static const String discriminatorFieldName = r'@type'; - - static const Map discriminatorMapping = { - r'Foo': Foo, - r'FooRef': FooRef, - }; - - FooRefOrValue._(); - - factory FooRefOrValue([void updates(FooRefOrValueBuilder b)]) = _$FooRefOrValue; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooRefOrValueBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FooRefOrValueSerializer(); -} - -extension FooRefOrValueDiscriminatorExt on FooRefOrValue { - String? get discriminatorValue { - if (this is Foo) { - return r'Foo'; - } - if (this is FooRef) { - return r'FooRef'; - } - return null; - } -} -extension FooRefOrValueBuilderDiscriminatorExt on FooRefOrValueBuilder { - String? get discriminatorValue { - if (this is FooBuilder) { - return r'Foo'; - } - if (this is FooRefBuilder) { - return r'FooRef'; - } - return null; - } -} - -class _$FooRefOrValueSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [FooRefOrValue, _$FooRefOrValue]; - - @override - final String wireName = r'FooRefOrValue'; - - Iterable _serializeProperties( - Serializers serializers, - FooRefOrValue object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - } - - @override - Object serialize( - Serializers serializers, - FooRefOrValue object, { - FullType specifiedType = FullType.unspecified, - }) { - final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; - } - - @override - FooRefOrValue deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = FooRefOrValueBuilder(); - Object? oneOfDataSrc; - final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; - oneOfDataSrc = serialized; - final oneOfTypes = [Foo, FooRef, ]; - Object oneOfResult; - Type oneOfType; - switch (discValue) { - case r'Foo': - oneOfResult = serializers.deserialize( - oneOfDataSrc, - specifiedType: FullType(Foo), - ) as Foo; - oneOfType = Foo; - break; - case r'FooRef': - oneOfResult = serializers.deserialize( - oneOfDataSrc, - specifiedType: FullType(FooRef), - ) as FooRef; - oneOfType = FooRef; - break; - default: - throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); - } - result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart deleted file mode 100644 index e8b1ebdf31ea..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart +++ /dev/null @@ -1,182 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/entity.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'pasta.g.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 -@BuiltValue() -abstract class Pasta implements Entity, Built { - @BuiltValueField(wireName: r'vendor') - String? get vendor; - - Pasta._(); - - factory Pasta([void updates(PastaBuilder b)]) = _$Pasta; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(PastaBuilder b) => b..atType=b.discriminatorValue; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$PastaSerializer(); -} - -class _$PastaSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Pasta, _$Pasta]; - - @override - final String wireName = r'Pasta'; - - Iterable _serializeProperties( - Serializers serializers, - Pasta object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); - } - if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); - } - if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); - } - if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); - } - yield r'@type'; - yield serializers.serialize( - object.atType, - specifiedType: const FullType(String), - ); - if (object.vendor != null) { - yield r'vendor'; - yield serializers.serialize( - object.vendor, - specifiedType: const FullType(String), - ); - } - } - - @override - Object serialize( - Serializers serializers, - Pasta object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required PastaBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'@schemaLocation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atSchemaLocation = valueDes; - break; - case r'@baseType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atBaseType = valueDes; - break; - case r'href': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.href = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.id = valueDes; - break; - case r'@type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atType = valueDes; - break; - case r'vendor': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.vendor = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - Pasta deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = PastaBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart deleted file mode 100644 index 14c06db06d7e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart +++ /dev/null @@ -1,250 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/pizza_speziale.dart'; -import 'package:openapi/src/model/entity.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'pizza.g.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 -@BuiltValue(instantiable: false) -abstract class Pizza implements Entity { - @BuiltValueField(wireName: r'pizzaSize') - num? get pizzaSize; - - static const String discriminatorFieldName = r'@type'; - - static const Map discriminatorMapping = { - r'PizzaSpeziale': PizzaSpeziale, - }; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$PizzaSerializer(); -} - -extension PizzaDiscriminatorExt on Pizza { - String? get discriminatorValue { - if (this is PizzaSpeziale) { - return r'PizzaSpeziale'; - } - return null; - } -} -extension PizzaBuilderDiscriminatorExt on PizzaBuilder { - String? get discriminatorValue { - if (this is PizzaSpezialeBuilder) { - return r'PizzaSpeziale'; - } - return null; - } -} - -class _$PizzaSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Pizza]; - - @override - final String wireName = r'Pizza'; - - Iterable _serializeProperties( - Serializers serializers, - Pizza object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.pizzaSize != null) { - yield r'pizzaSize'; - yield serializers.serialize( - object.pizzaSize, - specifiedType: const FullType(num), - ); - } - if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); - } - if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); - } - if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); - } - if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); - } - yield r'@type'; - yield serializers.serialize( - object.atType, - specifiedType: const FullType(String), - ); - } - - @override - Object serialize( - Serializers serializers, - Pizza object, { - FullType specifiedType = FullType.unspecified, - }) { - if (object is PizzaSpeziale) { - return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; - } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - @override - Pizza deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(Pizza.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; - switch (discValue) { - case r'PizzaSpeziale': - return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; - default: - return serializers.deserialize(serialized, specifiedType: FullType($Pizza)) as $Pizza; - } - } -} - -/// a concrete implementation of [Pizza], since [Pizza] is not instantiable -@BuiltValue(instantiable: true) -abstract class $Pizza implements Pizza, Built<$Pizza, $PizzaBuilder> { - $Pizza._(); - - factory $Pizza([void Function($PizzaBuilder)? updates]) = _$$Pizza; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults($PizzaBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer<$Pizza> get serializer => _$$PizzaSerializer(); -} - -class _$$PizzaSerializer implements PrimitiveSerializer<$Pizza> { - @override - final Iterable types = const [$Pizza, _$$Pizza]; - - @override - final String wireName = r'$Pizza'; - - @override - Object serialize( - Serializers serializers, - $Pizza object, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.serialize(object, specifiedType: FullType(Pizza))!; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required PizzaBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'pizzaSize': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(num), - ) as num; - result.pizzaSize = valueDes; - break; - case r'@schemaLocation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atSchemaLocation = valueDes; - break; - case r'@baseType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atBaseType = valueDes; - break; - case r'href': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.href = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.id = valueDes; - break; - case r'@type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atType = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - $Pizza deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = $PizzaBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart deleted file mode 100644 index 673052cc8fcf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart +++ /dev/null @@ -1,196 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/pizza.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'pizza_speziale.g.dart'; - -/// PizzaSpeziale -/// -/// Properties: -/// * [toppings] -/// * [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 -@BuiltValue() -abstract class PizzaSpeziale implements Pizza, Built { - @BuiltValueField(wireName: r'toppings') - String? get toppings; - - PizzaSpeziale._(); - - factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = _$PizzaSpeziale; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(PizzaSpezialeBuilder b) => b..atType=b.discriminatorValue; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$PizzaSpezialeSerializer(); -} - -class _$PizzaSpezialeSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [PizzaSpeziale, _$PizzaSpeziale]; - - @override - final String wireName = r'PizzaSpeziale'; - - Iterable _serializeProperties( - Serializers serializers, - PizzaSpeziale object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.atSchemaLocation != null) { - yield r'@schemaLocation'; - yield serializers.serialize( - object.atSchemaLocation, - specifiedType: const FullType(String), - ); - } - if (object.pizzaSize != null) { - yield r'pizzaSize'; - yield serializers.serialize( - object.pizzaSize, - specifiedType: const FullType(num), - ); - } - if (object.toppings != null) { - yield r'toppings'; - yield serializers.serialize( - object.toppings, - specifiedType: const FullType(String), - ); - } - if (object.atBaseType != null) { - yield r'@baseType'; - yield serializers.serialize( - object.atBaseType, - specifiedType: const FullType(String), - ); - } - if (object.href != null) { - yield r'href'; - yield serializers.serialize( - object.href, - specifiedType: const FullType(String), - ); - } - if (object.id != null) { - yield r'id'; - yield serializers.serialize( - object.id, - specifiedType: const FullType(String), - ); - } - yield r'@type'; - yield serializers.serialize( - object.atType, - specifiedType: const FullType(String), - ); - } - - @override - Object serialize( - Serializers serializers, - PizzaSpeziale object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required PizzaSpezialeBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'@schemaLocation': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atSchemaLocation = valueDes; - break; - case r'pizzaSize': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(num), - ) as num; - result.pizzaSize = valueDes; - break; - case r'toppings': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.toppings = valueDes; - break; - case r'@baseType': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atBaseType = valueDes; - break; - case r'href': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.href = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.id = valueDes; - break; - case r'@type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.atType = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - PizzaSpeziale deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = PizzaSpezialeBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart deleted file mode 100644 index 55083251e5e8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart +++ /dev/null @@ -1,67 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_import - -import 'package:one_of_serializer/any_of_serializer.dart'; -import 'package:one_of_serializer/one_of_serializer.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/json_object.dart'; -import 'package:built_value/serializer.dart'; -import 'package:built_value/standard_json_plugin.dart'; -import 'package:built_value/iso_8601_date_time_serializer.dart'; -import 'package:openapi/src/date_serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -import 'package:openapi/src/model/addressable.dart'; -import 'package:openapi/src/model/bar.dart'; -import 'package:openapi/src/model/bar_create.dart'; -import 'package:openapi/src/model/bar_ref.dart'; -import 'package:openapi/src/model/bar_ref_or_value.dart'; -import 'package:openapi/src/model/entity.dart'; -import 'package:openapi/src/model/entity_ref.dart'; -import 'package:openapi/src/model/extensible.dart'; -import 'package:openapi/src/model/foo.dart'; -import 'package:openapi/src/model/foo_ref.dart'; -import 'package:openapi/src/model/foo_ref_or_value.dart'; -import 'package:openapi/src/model/pasta.dart'; -import 'package:openapi/src/model/pizza.dart'; -import 'package:openapi/src/model/pizza_speziale.dart'; - -part 'serializers.g.dart'; - -@SerializersFor([ - Addressable,$Addressable, - Bar, - BarCreate, - BarRef, - BarRefOrValue, - Entity,$Entity, - EntityRef,$EntityRef, - Extensible,$Extensible, - Foo, - FooRef, - FooRefOrValue, - Pasta, - Pizza,$Pizza, - PizzaSpeziale, -]) -Serializers serializers = (_$serializers.toBuilder() - ..addBuilderFactory( - const FullType(BuiltList, [FullType(FooRefOrValue)]), - () => ListBuilder(), - ) - ..add(Addressable.serializer) - ..add(Entity.serializer) - ..add(EntityRef.serializer) - ..add(Extensible.serializer) - ..add(Pizza.serializer) - ..add(const OneOfSerializer()) - ..add(const AnyOfSerializer()) - ..add(const DateSerializer()) - ..add(Iso8601DateTimeSerializer())) - .build(); - -Serializers standardSerializers = - (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml deleted file mode 100644 index 50f62b7f8dae..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - 4.0.0 - org.openapitools - DartDioOneOfPolymorphismAndInheritance - pom - 1.0.0-SNAPSHOT - DartDio OneOf Polymorphism and Inheritance - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - pub-get - pre-integration-test - - exec - - - pub - - get - - - - - pub-run-build-runner - pre-integration-test - - exec - - - pub - - run - build_runner - build - - - - - dart-analyze - integration-test - - exec - - - dart - - analyze - --fatal-infos - - - - - dart-test - integration-test - - exec - - - dart - - test - - - - - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml deleted file mode 100644 index fb676f65c393..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '>=2.12.0 <3.0.0' - -dependencies: - dio: '>=4.0.1 <5.0.0' - one_of: '>=1.5.0 <2.0.0' - one_of_serializer: '>=1.5.0 <2.0.0' - built_value: '>=8.4.0 <9.0.0' - built_collection: '>=5.1.1 <6.0.0' - -dev_dependencies: - built_value_generator: '>=8.4.0 <9.0.0' - build_runner: any - test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/addressable_test.dart deleted file mode 100644 index 696e26e8e549..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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 instance = AddressableBuilder(); - // TODO add properties to the builder and call build() - - 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/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_api_test.dart deleted file mode 100644 index 73be91c446e0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_create_test.dart deleted file mode 100644 index 1bf90151be8b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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 instance = BarCreateBuilder(); - // TODO add properties to the builder and call build() - - 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/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart deleted file mode 100644 index c132ac09943b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BarRefOrValue -void main() { - final instance = BarRefOrValueBuilder(); - // TODO add properties to the builder and call build() - - group(BarRefOrValue, () { - // 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/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart deleted file mode 100644 index 9c410b2b5c54..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BarRef -void main() { - final instance = BarRefBuilder(); - // TODO add properties to the builder and call build() - - group(BarRef, () { - // 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/test/bar_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_test.dart deleted file mode 100644 index dc6daaa3400d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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 instance = BarBuilder(); - // TODO add properties to the builder and call build() - - 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/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart deleted file mode 100644 index 836289893fb4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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 instance = EntityRefBuilder(); - // TODO add properties to the builder and call build() - - 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/test/entity_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_test.dart deleted file mode 100644 index 30429747562d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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 instance = EntityBuilder(); - // TODO add properties to the builder and call build() - - 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/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/extensible_test.dart deleted file mode 100644 index 75e6211e074b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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 instance = ExtensibleBuilder(); - // TODO add properties to the builder and call build() - - 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/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_api_test.dart deleted file mode 100644 index f33986a08b69..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart deleted file mode 100644 index 029d030e5e35..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FooRefOrValue -void main() { - final instance = FooRefOrValueBuilder(); - // TODO add properties to the builder and call build() - - group(FooRefOrValue, () { - // 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/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart deleted file mode 100644 index a1398787bbcb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FooRef -void main() { - final instance = FooRefBuilder(); - // TODO add properties to the builder and call build() - - group(FooRef, () { - // String foorefPropA - test('to test the property `foorefPropA`', () 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/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_test.dart deleted file mode 100644 index 93a5286e2b45..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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 instance = FooBuilder(); - // TODO add properties to the builder and call build() - - 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/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pasta_test.dart deleted file mode 100644 index 6a3ae338eec2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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 instance = PastaBuilder(); - // TODO add properties to the builder and call build() - - 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/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart deleted file mode 100644 index 774320231c9e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for PizzaSpeziale -void main() { - final instance = PizzaSpezialeBuilder(); - // TODO add properties to the builder and call build() - - group(PizzaSpeziale, () { - // String toppings - test('to test the property `toppings`', () 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/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_test.dart deleted file mode 100644 index 5c6e1af95a59..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/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 instance = PizzaBuilder(); - // TODO add properties to the builder and call build() - - 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/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.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/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.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/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES deleted file mode 100644 index 7f2ac59bf645..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES +++ /dev/null @@ -1,21 +0,0 @@ -.gitignore -README.md -analysis_options.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/api_util.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/date_serializer.dart -lib/src/model/child.dart -lib/src/model/date.dart -lib/src/model/example.dart -lib/src/serializers.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION deleted file mode 100644 index d6b4ec4aa783..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md deleted file mode 100644 index a2993a23a019..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# openapi -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 -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.12.0 or later OR Flutter 1.26.0 or later -* Dio 4.0.0+ - -## Installation & Usage - -### pub.dev -To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml -```yaml -dependencies: - openapi: 1.0.0 -``` - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - git: - url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - #ref: main -``` - -### Local development -To use the package from your local drive, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - path: /path/to/openapi -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:openapi/openapi.dart'; - - -final api = Openapi().getDefaultApi(); - -try { - final response = await api.list(); - print(response); -} catch on DioError (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 - - All endpoints do not require authorization. - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml deleted file mode 100644 index a611887d3acf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml +++ /dev/null @@ -1,9 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md deleted file mode 100644 index bed0f2feec12..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md deleted file mode 100644 index abbf5f07f499..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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 DioError (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/doc/Example.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md deleted file mode 100644 index bf49bb137a60..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart deleted file mode 100644 index 220621d6961b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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/oauth.dart'; -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; - -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/oneof_primitive/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api.dart deleted file mode 100644 index 776737680d59..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api.dart +++ /dev/null @@ -1,73 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/serializers.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; - final Serializers serializers; - - Openapi({ - Dio? dio, - Serializers? serializers, - String? basePathOverride, - List? interceptors, - }) : this.serializers = serializers ?? standardSerializers, - this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: 5000, - receiveTimeout: 3000, - )) { - if (interceptors == null) { - this.dio.interceptors.addAll([ - OAuthInterceptor(), - BasicAuthInterceptor(), - BearerAuthInterceptor(), - ApiKeyAuthInterceptor(), - ]); - } else { - this.dio.interceptors.addAll(interceptors); - } - } - - void setOAuthToken(String name, String token) { - if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; - } - } - - void setBearerAuth(String name, String token) { - if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; - } - } - - void setBasicAuth(String name, String username, String password) { - if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - } - - void setApiKey(String name, String apiKey) { - if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - } - - /// Get 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, serializers); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart deleted file mode 100644 index 8d500cb70aad..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart +++ /dev/null @@ -1,92 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/example.dart'; - -class DefaultApi { - - final Dio _dio; - - final Serializers _serializers; - - const DefaultApi(this._dio, this._serializers); - - /// 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 [DioError] 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 { - const _responseType = FullType(Example); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as Example; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart deleted file mode 100644 index ed3bb12f25b8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart +++ /dev/null @@ -1,77 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/api_key_auth.dart deleted file mode 100644 index ee16e3f0f92f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/auth.dart deleted file mode 100644 index f7ae9bf3f11e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/basic_auth.dart deleted file mode 100644 index b6e6dce04f9c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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'] == '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/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 1d4402b376c0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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'] == '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/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/oauth.dart deleted file mode 100644 index 337cf762b0ce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart deleted file mode 100644 index db3c5c437db1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart +++ /dev/null @@ -1,31 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -class DateSerializer implements PrimitiveSerializer { - - const DateSerializer(); - - @override - Iterable get types => BuiltList.of([Date]); - - @override - String get wireName => 'Date'; - - @override - Date deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - final parsed = DateTime.parse(serialized as String); - return Date(parsed.year, parsed.month, parsed.day); - } - - @override - Object serialize(Serializers serializers, Date date, - {FullType specifiedType = FullType.unspecified}) { - return date.toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart deleted file mode 100644 index 987b52ca7240..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart +++ /dev/null @@ -1,108 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'child.g.dart'; - -/// Child -/// -/// Properties: -/// * [name] -@BuiltValue() -abstract class Child implements Built { - @BuiltValueField(wireName: r'name') - String? get name; - - Child._(); - - factory Child([void updates(ChildBuilder b)]) = _$Child; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ChildBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ChildSerializer(); -} - -class _$ChildSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Child, _$Child]; - - @override - final String wireName = r'Child'; - - Iterable _serializeProperties( - Serializers serializers, - Child object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.name != null) { - yield r'name'; - yield serializers.serialize( - object.name, - specifiedType: const FullType(String), - ); - } - } - - @override - Object serialize( - Serializers serializers, - Child object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required ChildBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'name': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.name = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - Child deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ChildBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart deleted file mode 100644 index b21c7f544bee..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart +++ /dev/null @@ -1,70 +0,0 @@ -/// A gregorian calendar date generated by -/// OpenAPI generator to differentiate -/// between [DateTime] and [Date] formats. -class Date implements Comparable { - final int year; - - /// January is 1. - final int month; - - /// First day is 1. - final int day; - - Date(this.year, this.month, this.day); - - /// The current date - static Date now({bool utc = false}) { - var now = DateTime.now(); - if (utc) { - now = now.toUtc(); - } - return now.toDate(); - } - - /// Convert to a [DateTime]. - DateTime toDateTime({bool utc = false}) { - if (utc) { - return DateTime.utc(year, month, day); - } else { - return DateTime(year, month, day); - } - } - - @override - int compareTo(Date other) { - int d = year.compareTo(other.year); - if (d != 0) { - return d; - } - d = month.compareTo(other.month); - if (d != 0) { - return d; - } - return day.compareTo(other.day); - } - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Date && - runtimeType == other.runtimeType && - year == other.year && - month == other.month && - day == other.day; - - @override - int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; - - @override - String toString() { - final yyyy = year.toString(); - final mm = month.toString().padLeft(2, '0'); - final dd = day.toString().padLeft(2, '0'); - - return '$yyyy-$mm-$dd'; - } -} - -extension DateTimeToDate on DateTime { - Date toDate() => Date(year, month, day); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart deleted file mode 100644 index 799b77e4e178..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/child.dart'; -import 'dart:core'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:one_of/one_of.dart'; - -part 'example.g.dart'; - -/// Example -/// -/// Properties: -/// * [name] -@BuiltValue() -abstract class Example implements Built { - /// One Of [Child], [int] - OneOf get oneOf; - - Example._(); - - factory Example([void updates(ExampleBuilder b)]) = _$Example; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ExampleBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ExampleSerializer(); -} - -class _$ExampleSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Example, _$Example]; - - @override - final String wireName = r'Example'; - - Iterable _serializeProperties( - Serializers serializers, - Example object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - } - - @override - Object serialize( - Serializers serializers, - Example object, { - FullType specifiedType = FullType.unspecified, - }) { - final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; - } - - @override - Example deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ExampleBuilder(); - Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [FullType(Child), FullType(int), ]); - oneOfDataSrc = serialized; - result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart deleted file mode 100644 index cbd8870dc676..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart +++ /dev/null @@ -1,34 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_import - -import 'package:one_of_serializer/any_of_serializer.dart'; -import 'package:one_of_serializer/one_of_serializer.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/json_object.dart'; -import 'package:built_value/serializer.dart'; -import 'package:built_value/standard_json_plugin.dart'; -import 'package:built_value/iso_8601_date_time_serializer.dart'; -import 'package:openapi/src/date_serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -import 'package:openapi/src/model/child.dart'; -import 'package:openapi/src/model/example.dart'; - -part 'serializers.g.dart'; - -@SerializersFor([ - Child, - Example, -]) -Serializers serializers = (_$serializers.toBuilder() - ..add(const OneOfSerializer()) - ..add(const AnyOfSerializer()) - ..add(const DateSerializer()) - ..add(Iso8601DateTimeSerializer())) - .build(); - -Serializers standardSerializers = - (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml deleted file mode 100644 index cceaebd895f6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - 4.0.0 - org.openapitools - DartDioOneOfPrimitive - pom - 1.0.0-SNAPSHOT - DartDio OneOf Primitive - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - pub-get - pre-integration-test - - exec - - - pub - - get - - - - - pub-run-build-runner - pre-integration-test - - exec - - - pub - - run - build_runner - build - - - - - dart-analyze - integration-test - - exec - - - dart - - analyze - --fatal-infos - - - - - dart-test - integration-test - - exec - - - dart - - test - - - - - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml deleted file mode 100644 index fb676f65c393..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '>=2.12.0 <3.0.0' - -dependencies: - dio: '>=4.0.1 <5.0.0' - one_of: '>=1.5.0 <2.0.0' - one_of_serializer: '>=1.5.0 <2.0.0' - built_value: '>=8.4.0 <9.0.0' - built_collection: '>=5.1.1 <6.0.0' - -dev_dependencies: - built_value_generator: '>=8.4.0 <9.0.0' - build_runner: any - test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/child_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/child_test.dart deleted file mode 100644 index d40451a84c2c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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 instance = ChildBuilder(); - // TODO add properties to the builder and call build() - - group(Child, () { - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/default_api_test.dart deleted file mode 100644 index e4ec57077946..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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/test/example_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/example_test.dart deleted file mode 100644 index ccb35121143e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/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 instance = ExampleBuilder(); - // TODO add properties to the builder and call build() - - group(Example, () { - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} From 3cf1790cb4ed7e01eb8192d3c5f61188858f799b Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 1 Jan 2023 22:42:57 +0200 Subject: [PATCH 16/20] add echo api --- .../dart-dio-echo-server-dio-built_value.yaml | 18 + ...dart-dio-echo-server-http-built_value.yaml | 17 + ...io-oneof-polymorphism-and-inheritance.yaml | 11 - bin/configs/dart-dio-oneof-primitive.yaml | 11 - bin/configs/dart-dio-oneof.yaml | 11 - .../src/test/resources/3_0/dart/echo_api.yaml | 970 ++++++++++++++++++ .../dart/dart-dio-built_value/.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 155 +++ .../.openapi-generator/VERSION | 1 + .../dart/dart-dio-built_value/README.md | 153 +++ .../analysis_options.yaml | 9 + .../doc/AdditionalPropertiesClass.md | 16 + .../dart-dio-built_value/doc/Addressable.md | 16 + .../doc/AllOfWithSingleRef.md | 16 + .../dart/dart-dio-built_value/doc/Animal.md | 16 + .../dart-dio-built_value/doc/ApiResponse.md | 17 + .../dart/dart-dio-built_value/doc/Apple.md | 15 + .../doc/ArrayOfArrayOfNumberOnly.md | 15 + .../doc/ArrayOfNumberOnly.md | 15 + .../dart-dio-built_value/doc/ArrayTest.md | 17 + .../dart/dart-dio-built_value/doc/Banana.md | 15 + .../dart/dart-dio-built_value/doc/Bar.md | 22 + .../dart-dio-built_value/doc/BarCreate.md | 22 + .../dart/dart-dio-built_value/doc/BarRef.md | 19 + .../dart-dio-built_value/doc/BarRefOrValue.md | 19 + .../dart/dart-dio-built_value/doc/BodyApi.md | 57 + .../doc/Capitalization.md | 20 + .../dart/dart-dio-built_value/doc/Cat.md | 17 + .../dart/dart-dio-built_value/doc/CatAllOf.md | 15 + .../dart/dart-dio-built_value/doc/Category.md | 16 + .../dart/dart-dio-built_value/doc/Child.md | 15 + .../dart-dio-built_value/doc/ClassModel.md | 15 + .../doc/DeprecatedObject.md | 15 + .../dart/dart-dio-built_value/doc/Dog.md | 17 + .../dart/dart-dio-built_value/doc/DogAllOf.md | 15 + .../dart/dart-dio-built_value/doc/Entity.md | 19 + .../dart-dio-built_value/doc/EntityRef.md | 21 + .../dart-dio-built_value/doc/EnumArrays.md | 16 + .../dart/dart-dio-built_value/doc/EnumTest.md | 22 + .../dart/dart-dio-built_value/doc/Example.md | 15 + .../doc/ExampleNonPrimitive.md | 14 + .../dart-dio-built_value/doc/Extensible.md | 17 + .../doc/FileSchemaTestClass.md | 16 + .../dart/dart-dio-built_value/doc/Foo.md | 21 + .../dart/dart-dio-built_value/doc/FooRef.md | 20 + .../dart-dio-built_value/doc/FooRefOrValue.md | 19 + .../dart-dio-built_value/doc/FormatTest.md | 30 + .../dart/dart-dio-built_value/doc/Fruit.md | 17 + .../doc/HasOnlyReadOnly.md | 16 + .../doc/HealthCheckResult.md | 15 + .../dart/dart-dio-built_value/doc/MapTest.md | 18 + ...dPropertiesAndAdditionalPropertiesClass.md | 17 + .../doc/Model200Response.md | 16 + .../dart-dio-built_value/doc/ModelClient.md | 15 + .../doc/ModelEnumClass.md | 14 + .../dart-dio-built_value/doc/ModelFile.md | 15 + .../dart-dio-built_value/doc/ModelList.md | 15 + .../dart-dio-built_value/doc/ModelReturn.md | 15 + .../dart/dart-dio-built_value/doc/Name.md | 18 + .../dart-dio-built_value/doc/NullableClass.md | 26 + .../dart-dio-built_value/doc/NumberOnly.md | 15 + .../doc/ObjectWithDeprecatedFields.md | 18 + .../dart/dart-dio-built_value/doc/Order.md | 20 + .../doc/OuterComposite.md | 17 + .../dart-dio-built_value/doc/OuterEnum.md | 14 + .../doc/OuterEnumDefaultValue.md | 14 + .../doc/OuterEnumInteger.md | 14 + .../doc/OuterEnumIntegerDefaultValue.md | 14 + .../doc/OuterObjectWithEnumProperty.md | 15 + .../dart/dart-dio-built_value/doc/Pasta.md | 20 + .../dart/dart-dio-built_value/doc/PathApi.md | 59 ++ .../dart/dart-dio-built_value/doc/Pet.md | 20 + .../dart/dart-dio-built_value/doc/Pizza.md | 20 + .../dart-dio-built_value/doc/PizzaSpeziale.md | 20 + .../dart/dart-dio-built_value/doc/QueryApi.md | 149 +++ .../dart-dio-built_value/doc/ReadOnlyFirst.md | 16 + .../dart-dio-built_value/doc/SingleRefType.md | 14 + .../doc/SpecialModelName.md | 15 + .../dart/dart-dio-built_value/doc/Tag.md | 16 + ...lodeTrueArrayStringQueryObjectParameter.md | 15 + .../dart/dart-dio-built_value/doc/User.md | 22 + .../dart-dio-built_value/lib/openapi.dart | 82 ++ .../dart-dio-built_value/lib/src/api.dart | 87 ++ .../lib/src/api/body_api.dart | 113 ++ .../lib/src/api/path_api.dart | 91 ++ .../lib/src/api/query_api.dart | 253 +++++ .../lib/src/api_util.dart | 77 ++ .../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/date_serializer.dart | 31 + .../model/additional_properties_class.dart | 127 +++ .../lib/src/model/addressable.dart | 161 +++ .../lib/src/model/all_of_with_single_ref.dart | 127 +++ .../lib/src/model/animal.dart | 205 ++++ .../lib/src/model/api_response.dart | 144 +++ .../lib/src/model/apple.dart | 108 ++ .../model/array_of_array_of_number_only.dart | 109 ++ .../lib/src/model/array_of_number_only.dart | 109 ++ .../lib/src/model/array_test.dart | 146 +++ .../lib/src/model/banana.dart | 108 ++ .../lib/src/model/bar.dart | 219 ++++ .../lib/src/model/bar_create.dart | 219 ++++ .../lib/src/model/bar_ref.dart | 192 ++++ .../lib/src/model/bar_ref_or_value.dart | 129 +++ .../lib/src/model/capitalization.dart | 199 ++++ .../lib/src/model/cat.dart | 136 +++ .../lib/src/model/cat_all_of.dart | 141 +++ .../lib/src/model/category.dart | 126 +++ .../lib/src/model/child.dart | 108 ++ .../lib/src/model/class_model.dart | 108 ++ .../lib/src/model/date.dart | 70 ++ .../lib/src/model/deprecated_object.dart | 108 ++ .../lib/src/model/dog.dart | 136 +++ .../lib/src/model/dog_all_of.dart | 141 +++ .../lib/src/model/entity.dart | 298 ++++++ .../lib/src/model/entity_ref.dart | 284 +++++ .../lib/src/model/enum_arrays.dart | 163 +++ .../lib/src/model/enum_test.dart | 318 ++++++ .../lib/src/model/example.dart | 72 ++ .../lib/src/model/example_non_primitive.dart | 68 ++ .../lib/src/model/extensible.dart | 178 ++++ .../lib/src/model/file_schema_test_class.dart | 128 +++ .../lib/src/model/foo.dart | 200 ++++ .../lib/src/model/foo_ref.dart | 210 ++++ .../lib/src/model/foo_ref_or_value.dart | 129 +++ .../lib/src/model/format_test.dart | 374 +++++++ .../lib/src/model/fruit.dart | 123 +++ .../lib/src/model/has_only_read_only.dart | 126 +++ .../lib/src/model/health_check_result.dart | 109 ++ .../lib/src/model/map_test.dart | 181 ++++ ...rties_and_additional_properties_class.dart | 146 +++ .../lib/src/model/model200_response.dart | 126 +++ .../lib/src/model/model_client.dart | 108 ++ .../lib/src/model/model_enum_class.dart | 38 + .../lib/src/model/model_file.dart | 109 ++ .../lib/src/model/model_list.dart | 108 ++ .../lib/src/model/model_return.dart | 108 ++ .../lib/src/model/name.dart | 160 +++ .../lib/src/model/nullable_class.dart | 319 ++++++ .../lib/src/model/number_only.dart | 108 ++ .../model/object_with_deprecated_fields.dart | 165 +++ .../lib/src/model/order.dart | 225 ++++ .../lib/src/model/outer_composite.dart | 144 +++ .../lib/src/model/outer_enum.dart | 38 + .../src/model/outer_enum_default_value.dart | 38 + .../lib/src/model/outer_enum_integer.dart | 38 + .../outer_enum_integer_default_value.dart | 38 + .../outer_object_with_enum_property.dart | 108 ++ .../lib/src/model/pasta.dart | 182 ++++ .../lib/src/model/pet.dart | 222 ++++ .../lib/src/model/pizza.dart | 250 +++++ .../lib/src/model/pizza_speziale.dart | 196 ++++ .../lib/src/model/read_only_first.dart | 126 +++ .../lib/src/model/single_ref_type.dart | 36 + .../lib/src/model/special_model_name.dart | 108 ++ .../lib/src/model/tag.dart | 126 +++ ...e_array_string_query_object_parameter.dart | 109 ++ .../lib/src/model/user.dart | 235 +++++ .../lib/src/serializers.dart | 176 ++++ .../dart/dart-dio-built_value/pubspec.yaml | 19 + .../additional_properties_class_test.dart | 21 + .../test/addressable_test.dart | 23 + .../test/all_of_with_single_ref_test.dart | 21 + .../test/animal_test.dart | 21 + .../test/api_response_test.dart | 26 + .../dart-dio-built_value/test/apple_test.dart | 16 + .../array_of_array_of_number_only_test.dart | 16 + .../test/array_of_number_only_test.dart | 16 + .../test/array_test_test.dart | 26 + .../test/banana_test.dart | 16 + .../test/bar_create_test.dart | 56 + .../test/bar_ref_or_value_test.dart | 41 + .../test/bar_ref_test.dart | 41 + .../dart-dio-built_value/test/bar_test.dart | 55 + .../test/body_api_test.dart | 20 + .../test/capitalization_test.dart | 42 + .../test/cat_all_of_test.dart | 16 + .../dart-dio-built_value/test/cat_test.dart | 26 + .../test/category_test.dart | 21 + .../dart-dio-built_value/test/child_test.dart | 16 + .../test/class_model_test.dart | 16 + .../test/deprecated_object_test.dart | 16 + .../test/dog_all_of_test.dart | 16 + .../dart-dio-built_value/test/dog_test.dart | 26 + .../test/entity_ref_test.dart | 53 + .../test/entity_test.dart | 41 + .../test/enum_arrays_test.dart | 21 + .../test/enum_test_test.dart | 51 + .../test/example_non_primitive_test.dart | 11 + .../test/example_test.dart | 16 + .../test/extensible_test.dart | 29 + .../test/file_schema_test_class_test.dart | 21 + .../test/foo_ref_or_value_test.dart | 41 + .../test/foo_ref_test.dart | 46 + .../dart-dio-built_value/test/foo_test.dart | 51 + .../test/format_test_test.dart | 93 ++ .../dart-dio-built_value/test/fruit_test.dart | 26 + .../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 + .../dart-dio-built_value/test/name_test.dart | 31 + .../test/nullable_class_test.dart | 71 ++ .../test/number_only_test.dart | 16 + .../object_with_deprecated_fields_test.dart | 31 + .../dart-dio-built_value/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 + .../dart-dio-built_value/test/pasta_test.dart | 46 + .../test/path_api_test.dart | 20 + .../dart-dio-built_value/test/pet_test.dart | 42 + .../test/pizza_speziale_test.dart | 46 + .../dart-dio-built_value/test/pizza_test.dart | 46 + .../test/query_api_test.dart | 38 + .../test/read_only_first_test.dart | 21 + .../test/single_ref_type_test.dart | 9 + .../test/special_model_name_test.dart | 16 + .../dart-dio-built_value/test/tag_test.dart | 21 + ...ay_string_query_object_parameter_test.dart | 16 + .../dart-dio-built_value/test/user_test.dart | 52 + .../dart/dart-http-built_value/.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 155 +++ .../.openapi-generator/VERSION | 1 + .../dart/dart-http-built_value/README.md | 153 +++ .../analysis_options.yaml | 9 + .../doc/AdditionalPropertiesClass.md | 16 + .../dart-http-built_value/doc/Addressable.md | 16 + .../doc/AllOfWithSingleRef.md | 16 + .../dart/dart-http-built_value/doc/Animal.md | 16 + .../dart-http-built_value/doc/ApiResponse.md | 17 + .../dart/dart-http-built_value/doc/Apple.md | 15 + .../doc/ArrayOfArrayOfNumberOnly.md | 15 + .../doc/ArrayOfNumberOnly.md | 15 + .../dart-http-built_value/doc/ArrayTest.md | 17 + .../dart/dart-http-built_value/doc/Banana.md | 15 + .../dart/dart-http-built_value/doc/Bar.md | 22 + .../dart-http-built_value/doc/BarCreate.md | 22 + .../dart/dart-http-built_value/doc/BarRef.md | 19 + .../doc/BarRefOrValue.md | 19 + .../dart/dart-http-built_value/doc/BodyApi.md | 57 + .../doc/Capitalization.md | 20 + .../dart/dart-http-built_value/doc/Cat.md | 17 + .../dart-http-built_value/doc/CatAllOf.md | 15 + .../dart-http-built_value/doc/Category.md | 16 + .../dart/dart-http-built_value/doc/Child.md | 15 + .../dart-http-built_value/doc/ClassModel.md | 15 + .../doc/DeprecatedObject.md | 15 + .../dart/dart-http-built_value/doc/Dog.md | 17 + .../dart-http-built_value/doc/DogAllOf.md | 15 + .../dart/dart-http-built_value/doc/Entity.md | 19 + .../dart-http-built_value/doc/EntityRef.md | 21 + .../dart-http-built_value/doc/EnumArrays.md | 16 + .../dart-http-built_value/doc/EnumTest.md | 22 + .../dart/dart-http-built_value/doc/Example.md | 15 + .../doc/ExampleNonPrimitive.md | 14 + .../dart-http-built_value/doc/Extensible.md | 17 + .../doc/FileSchemaTestClass.md | 16 + .../dart/dart-http-built_value/doc/Foo.md | 21 + .../dart/dart-http-built_value/doc/FooRef.md | 20 + .../doc/FooRefOrValue.md | 19 + .../dart-http-built_value/doc/FormatTest.md | 30 + .../dart/dart-http-built_value/doc/Fruit.md | 17 + .../doc/HasOnlyReadOnly.md | 16 + .../doc/HealthCheckResult.md | 15 + .../dart/dart-http-built_value/doc/MapTest.md | 18 + ...dPropertiesAndAdditionalPropertiesClass.md | 17 + .../doc/Model200Response.md | 16 + .../dart-http-built_value/doc/ModelClient.md | 15 + .../doc/ModelEnumClass.md | 14 + .../dart-http-built_value/doc/ModelFile.md | 15 + .../dart-http-built_value/doc/ModelList.md | 15 + .../dart-http-built_value/doc/ModelReturn.md | 15 + .../dart/dart-http-built_value/doc/Name.md | 18 + .../doc/NullableClass.md | 26 + .../dart-http-built_value/doc/NumberOnly.md | 15 + .../doc/ObjectWithDeprecatedFields.md | 18 + .../dart/dart-http-built_value/doc/Order.md | 20 + .../doc/OuterComposite.md | 17 + .../dart-http-built_value/doc/OuterEnum.md | 14 + .../doc/OuterEnumDefaultValue.md | 14 + .../doc/OuterEnumInteger.md | 14 + .../doc/OuterEnumIntegerDefaultValue.md | 14 + .../doc/OuterObjectWithEnumProperty.md | 15 + .../dart/dart-http-built_value/doc/Pasta.md | 20 + .../dart/dart-http-built_value/doc/PathApi.md | 59 ++ .../dart/dart-http-built_value/doc/Pet.md | 20 + .../dart/dart-http-built_value/doc/Pizza.md | 20 + .../doc/PizzaSpeziale.md | 20 + .../dart-http-built_value/doc/QueryApi.md | 149 +++ .../doc/ReadOnlyFirst.md | 16 + .../doc/SingleRefType.md | 14 + .../doc/SpecialModelName.md | 15 + .../dart/dart-http-built_value/doc/Tag.md | 16 + ...lodeTrueArrayStringQueryObjectParameter.md | 15 + .../dart/dart-http-built_value/doc/User.md | 22 + .../dart-http-built_value/lib/openapi.dart | 82 ++ .../dart-http-built_value/lib/src/api.dart | 50 + .../lib/src/api/body_api.dart | 113 ++ .../lib/src/api/path_api.dart | 91 ++ .../lib/src/api/query_api.dart | 253 +++++ .../lib/src/api_util.dart | 77 ++ .../lib/src/auth/api_key_auth.dart | 35 + .../lib/src/auth/authentication.dart | 9 + .../lib/src/auth/http_basic_auth.dart | 21 + .../lib/src/auth/http_bearer_auth.dart | 45 + .../lib/src/auth/oauth.dart | 20 + .../lib/src/date_serializer.dart | 31 + .../model/additional_properties_class.dart | 127 +++ .../lib/src/model/addressable.dart | 161 +++ .../lib/src/model/all_of_with_single_ref.dart | 127 +++ .../lib/src/model/animal.dart | 205 ++++ .../lib/src/model/api_response.dart | 144 +++ .../lib/src/model/apple.dart | 108 ++ .../model/array_of_array_of_number_only.dart | 109 ++ .../lib/src/model/array_of_number_only.dart | 109 ++ .../lib/src/model/array_test.dart | 146 +++ .../lib/src/model/banana.dart | 108 ++ .../lib/src/model/bar.dart | 219 ++++ .../lib/src/model/bar_create.dart | 219 ++++ .../lib/src/model/bar_ref.dart | 192 ++++ .../lib/src/model/bar_ref_or_value.dart | 129 +++ .../lib/src/model/capitalization.dart | 199 ++++ .../lib/src/model/cat.dart | 136 +++ .../lib/src/model/cat_all_of.dart | 141 +++ .../lib/src/model/category.dart | 126 +++ .../lib/src/model/child.dart | 108 ++ .../lib/src/model/class_model.dart | 108 ++ .../lib/src/model/date.dart | 70 ++ .../lib/src/model/deprecated_object.dart | 108 ++ .../lib/src/model/dog.dart | 136 +++ .../lib/src/model/dog_all_of.dart | 141 +++ .../lib/src/model/entity.dart | 298 ++++++ .../lib/src/model/entity_ref.dart | 284 +++++ .../lib/src/model/enum_arrays.dart | 163 +++ .../lib/src/model/enum_test.dart | 318 ++++++ .../lib/src/model/example.dart | 72 ++ .../lib/src/model/example_non_primitive.dart | 68 ++ .../lib/src/model/extensible.dart | 178 ++++ .../lib/src/model/file_schema_test_class.dart | 128 +++ .../lib/src/model/foo.dart | 200 ++++ .../lib/src/model/foo_ref.dart | 210 ++++ .../lib/src/model/foo_ref_or_value.dart | 129 +++ .../lib/src/model/format_test.dart | 374 +++++++ .../lib/src/model/fruit.dart | 123 +++ .../lib/src/model/has_only_read_only.dart | 126 +++ .../lib/src/model/health_check_result.dart | 109 ++ .../lib/src/model/map_test.dart | 181 ++++ ...rties_and_additional_properties_class.dart | 146 +++ .../lib/src/model/model200_response.dart | 126 +++ .../lib/src/model/model_client.dart | 108 ++ .../lib/src/model/model_enum_class.dart | 38 + .../lib/src/model/model_file.dart | 109 ++ .../lib/src/model/model_list.dart | 108 ++ .../lib/src/model/model_return.dart | 108 ++ .../lib/src/model/name.dart | 160 +++ .../lib/src/model/nullable_class.dart | 319 ++++++ .../lib/src/model/number_only.dart | 108 ++ .../model/object_with_deprecated_fields.dart | 165 +++ .../lib/src/model/order.dart | 225 ++++ .../lib/src/model/outer_composite.dart | 144 +++ .../lib/src/model/outer_enum.dart | 38 + .../src/model/outer_enum_default_value.dart | 38 + .../lib/src/model/outer_enum_integer.dart | 38 + .../outer_enum_integer_default_value.dart | 38 + .../outer_object_with_enum_property.dart | 108 ++ .../lib/src/model/pasta.dart | 182 ++++ .../lib/src/model/pet.dart | 222 ++++ .../lib/src/model/pizza.dart | 250 +++++ .../lib/src/model/pizza_speziale.dart | 196 ++++ .../lib/src/model/read_only_first.dart | 126 +++ .../lib/src/model/single_ref_type.dart | 36 + .../lib/src/model/special_model_name.dart | 108 ++ .../lib/src/model/tag.dart | 126 +++ ...e_array_string_query_object_parameter.dart | 109 ++ .../lib/src/model/user.dart | 235 +++++ .../lib/src/serializers.dart | 176 ++++ .../dart/dart-http-built_value/pubspec.yaml | 19 + .../additional_properties_class_test.dart | 21 + .../test/addressable_test.dart | 23 + .../test/all_of_with_single_ref_test.dart | 21 + .../test/animal_test.dart | 21 + .../test/api_response_test.dart | 26 + .../test/apple_test.dart | 16 + .../array_of_array_of_number_only_test.dart | 16 + .../test/array_of_number_only_test.dart | 16 + .../test/array_test_test.dart | 26 + .../test/banana_test.dart | 16 + .../test/bar_create_test.dart | 56 + .../test/bar_ref_or_value_test.dart | 41 + .../test/bar_ref_test.dart | 41 + .../dart-http-built_value/test/bar_test.dart | 55 + .../test/body_api_test.dart | 20 + .../test/capitalization_test.dart | 42 + .../test/cat_all_of_test.dart | 16 + .../dart-http-built_value/test/cat_test.dart | 26 + .../test/category_test.dart | 21 + .../test/child_test.dart | 16 + .../test/class_model_test.dart | 16 + .../test/deprecated_object_test.dart | 16 + .../test/dog_all_of_test.dart | 16 + .../dart-http-built_value/test/dog_test.dart | 26 + .../test/entity_ref_test.dart | 53 + .../test/entity_test.dart | 41 + .../test/enum_arrays_test.dart | 21 + .../test/enum_test_test.dart | 51 + .../test/example_non_primitive_test.dart | 11 + .../test/example_test.dart | 16 + .../test/extensible_test.dart | 29 + .../test/file_schema_test_class_test.dart | 21 + .../test/foo_ref_or_value_test.dart | 41 + .../test/foo_ref_test.dart | 46 + .../dart-http-built_value/test/foo_test.dart | 51 + .../test/format_test_test.dart | 93 ++ .../test/fruit_test.dart | 26 + .../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 + .../dart-http-built_value/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/pasta_test.dart | 46 + .../test/path_api_test.dart | 20 + .../dart-http-built_value/test/pet_test.dart | 42 + .../test/pizza_speziale_test.dart | 46 + .../test/pizza_test.dart | 46 + .../test/query_api_test.dart | 38 + .../test/read_only_first_test.dart | 21 + .../test/single_ref_type_test.dart | 9 + .../test/special_model_name_test.dart | 16 + .../dart-http-built_value/test/tag_test.dart | 21 + ...ay_string_query_object_parameter_test.dart | 16 + .../dart-http-built_value/test/user_test.dart | 52 + 462 files changed, 30673 insertions(+), 33 deletions(-) create mode 100644 bin/configs/dart-dio-echo-server-dio-built_value.yaml create mode 100644 bin/configs/dart-dio-echo-server-http-built_value.yaml delete mode 100644 bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml delete mode 100644 bin/configs/dart-dio-oneof-primitive.yaml delete mode 100644 bin/configs/dart-dio-oneof.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/dart/echo_api.yaml create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/.gitignore create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator-ignore create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator/FILES create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator/VERSION create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/README.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/analysis_options.yaml create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/AdditionalPropertiesClass.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Addressable.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/AllOfWithSingleRef.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Animal.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ApiResponse.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Apple.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ArrayOfNumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ArrayTest.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Banana.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Bar.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/BarCreate.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/BarRef.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/BarRefOrValue.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/BodyApi.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Capitalization.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Cat.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/CatAllOf.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Category.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Child.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ClassModel.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/DeprecatedObject.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Dog.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/DogAllOf.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Entity.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/EntityRef.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/EnumArrays.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/EnumTest.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Example.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ExampleNonPrimitive.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Extensible.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/FileSchemaTestClass.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Foo.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/FooRef.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/FooRefOrValue.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/FormatTest.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Fruit.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/HasOnlyReadOnly.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/HealthCheckResult.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/MapTest.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Model200Response.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ModelClient.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ModelEnumClass.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ModelFile.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ModelList.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ModelReturn.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Name.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/NullableClass.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/NumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ObjectWithDeprecatedFields.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Order.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/OuterComposite.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/OuterEnum.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/OuterEnumDefaultValue.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/OuterEnumInteger.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/OuterObjectWithEnumProperty.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Pasta.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/PathApi.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Pet.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Pizza.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/PizzaSpeziale.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/QueryApi.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/ReadOnlyFirst.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/SingleRefType.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/SpecialModelName.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/Tag.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/doc/User.md create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/openapi.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/api.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/api_util.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/api_key_auth.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/auth.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/basic_auth.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/bearer_auth.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/oauth.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/date_serializer.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/additional_properties_class.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/addressable.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/all_of_with_single_ref.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/animal.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/api_response.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/apple.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_array_of_number_only.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_number_only.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/banana.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_create.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref_or_value.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/capitalization.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat_all_of.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/category.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/child.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/class_model.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/date.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/deprecated_object.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog_all_of.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity_ref.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_arrays.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example_non_primitive.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/extensible.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/file_schema_test_class.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref_or_value.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/format_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/fruit.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/has_only_read_only.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/health_check_result.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/map_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model200_response.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_client.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_enum_class.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_file.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_list.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_return.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/name.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/nullable_class.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/number_only.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/object_with_deprecated_fields.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/order.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_composite.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_default_value.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer_default_value.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_object_with_enum_property.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pasta.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pet.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza_speziale.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/read_only_first.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/single_ref_type.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/special_model_name.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/tag.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/user.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/serializers.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/pubspec.yaml create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/additional_properties_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/addressable_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/all_of_with_single_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/animal_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/api_response_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/apple_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/array_of_array_of_number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/array_of_number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/array_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/banana_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/bar_create_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_or_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/bar_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/body_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/capitalization_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/cat_all_of_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/cat_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/category_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/child_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/class_model_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/deprecated_object_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/dog_all_of_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/dog_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/entity_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/entity_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/enum_arrays_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/enum_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/example_non_primitive_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/example_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/extensible_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/file_schema_test_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_or_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/foo_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/format_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/fruit_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/has_only_read_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/health_check_result_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/map_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/mixed_properties_and_additional_properties_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/model200_response_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/model_client_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/model_enum_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/model_file_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/model_list_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/model_return_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/name_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/nullable_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/object_with_deprecated_fields_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/order_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/outer_composite_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_default_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_default_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/outer_object_with_enum_property_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/pasta_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/path_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/pet_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/pizza_speziale_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/pizza_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/query_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/read_only_first_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/single_ref_type_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/special_model_name_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/tag_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/test/user_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/.gitignore create mode 100644 samples/client/echo_api/dart/dart-http-built_value/.openapi-generator-ignore create mode 100644 samples/client/echo_api/dart/dart-http-built_value/.openapi-generator/FILES create mode 100644 samples/client/echo_api/dart/dart-http-built_value/.openapi-generator/VERSION create mode 100644 samples/client/echo_api/dart/dart-http-built_value/README.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/analysis_options.yaml create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/AdditionalPropertiesClass.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Addressable.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/AllOfWithSingleRef.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Animal.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ApiResponse.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Apple.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ArrayOfNumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ArrayTest.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Banana.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Bar.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/BarCreate.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/BarRef.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/BarRefOrValue.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/BodyApi.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Capitalization.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Cat.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/CatAllOf.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Category.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Child.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ClassModel.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/DeprecatedObject.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Dog.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/DogAllOf.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Entity.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/EntityRef.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/EnumArrays.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/EnumTest.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Example.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ExampleNonPrimitive.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Extensible.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/FileSchemaTestClass.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Foo.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/FooRef.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/FooRefOrValue.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/FormatTest.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Fruit.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/HasOnlyReadOnly.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/HealthCheckResult.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/MapTest.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Model200Response.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ModelClient.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ModelEnumClass.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ModelFile.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ModelList.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ModelReturn.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Name.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/NullableClass.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/NumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ObjectWithDeprecatedFields.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Order.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/OuterComposite.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/OuterEnum.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/OuterEnumDefaultValue.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/OuterEnumInteger.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/OuterObjectWithEnumProperty.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Pasta.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/PathApi.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Pet.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Pizza.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/PizzaSpeziale.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/QueryApi.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/ReadOnlyFirst.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/SingleRefType.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/SpecialModelName.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/Tag.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/doc/User.md create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/openapi.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/authentication.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_basic_auth.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_bearer_auth.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/date_serializer.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/additional_properties_class.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/addressable.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/all_of_with_single_ref.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/animal.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/api_response.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/apple.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_array_of_number_only.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_number_only.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/banana.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_create.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref_or_value.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/capitalization.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat_all_of.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/category.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/child.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/class_model.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/date.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/deprecated_object.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog_all_of.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity_ref.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_arrays.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example_non_primitive.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/extensible.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/file_schema_test_class.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref_or_value.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/format_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/fruit.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/has_only_read_only.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/health_check_result.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/map_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model200_response.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_client.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_enum_class.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_file.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_list.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_return.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/name.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/nullable_class.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/number_only.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/object_with_deprecated_fields.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/order.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_composite.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_default_value.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer_default_value.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_object_with_enum_property.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pasta.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pet.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza_speziale.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/read_only_first.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/single_ref_type.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/special_model_name.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/tag.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/user.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/serializers.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/pubspec.yaml create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/additional_properties_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/addressable_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/all_of_with_single_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/animal_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/api_response_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/apple_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/array_of_array_of_number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/array_of_number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/array_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/banana_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/bar_create_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_or_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/bar_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/body_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/capitalization_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/cat_all_of_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/cat_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/category_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/child_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/class_model_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/deprecated_object_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/dog_all_of_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/dog_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/entity_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/entity_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/enum_arrays_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/enum_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/example_non_primitive_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/example_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/extensible_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/file_schema_test_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_or_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/foo_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/format_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/fruit_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/has_only_read_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/health_check_result_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/map_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/mixed_properties_and_additional_properties_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/model200_response_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/model_client_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/model_enum_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/model_file_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/model_list_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/model_return_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/name_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/nullable_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/object_with_deprecated_fields_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/order_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/outer_composite_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_default_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_default_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/outer_object_with_enum_property_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/pasta_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/path_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/pet_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/pizza_speziale_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/pizza_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/query_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/read_only_first_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/single_ref_type_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/special_model_name_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/tag_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/test/user_test.dart diff --git a/bin/configs/dart-dio-echo-server-dio-built_value.yaml b/bin/configs/dart-dio-echo-server-dio-built_value.yaml new file mode 100644 index 000000000000..8f6297608196 --- /dev/null +++ b/bin/configs/dart-dio-echo-server-dio-built_value.yaml @@ -0,0 +1,18 @@ +generatorName: dart-dio +outputDir: samples/client/echo_api/dart/dart-dio-built_value +inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/echo_api.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" + serializationLibrary: "built_value" + networkingLibrary: "dio" + artifactId: echo-api-dart-dio-built_value +reservedWordsMappings: + class: "classField" + + diff --git a/bin/configs/dart-dio-echo-server-http-built_value.yaml b/bin/configs/dart-dio-echo-server-http-built_value.yaml new file mode 100644 index 000000000000..b4b74b5422b0 --- /dev/null +++ b/bin/configs/dart-dio-echo-server-http-built_value.yaml @@ -0,0 +1,17 @@ +generatorName: dart-dio +outputDir: samples/client/echo_api/dart/dart-http-built_value +inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/echo_api.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" + serializationLibrary: "built_value" + networkingLibrary: "http" + artifactId: echo-api-dart-http-built_value +reservedWordsMappings: + class: "classField" + diff --git a/bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml b/bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml deleted file mode 100644 index d3d5b622bc0f..000000000000 --- a/bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/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: - Client: "ModelClient" - File: "ModelFile" - EnumClass: "ModelEnumClass" -additionalProperties: - hideGenerationTimestamp: "true" - enumUnknownDefaultCase: "true" diff --git a/bin/configs/dart-dio-oneof-primitive.yaml b/bin/configs/dart-dio-oneof-primitive.yaml deleted file mode 100644 index 29130b5dc468..000000000000 --- a/bin/configs/dart-dio-oneof-primitive.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/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: - Client: "ModelClient" - File: "ModelFile" - EnumClass: "ModelEnumClass" -additionalProperties: - hideGenerationTimestamp: "true" - enumUnknownDefaultCase: "true" diff --git a/bin/configs/dart-dio-oneof.yaml b/bin/configs/dart-dio-oneof.yaml deleted file mode 100644 index 865312cdd493..000000000000 --- a/bin/configs/dart-dio-oneof.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/oneof -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" - enumUnknownDefaultCase: "true" diff --git a/modules/openapi-generator/src/test/resources/3_0/dart/echo_api.yaml b/modules/openapi-generator/src/test/resources/3_0/dart/echo_api.yaml new file mode 100644 index 000000000000..67127803291d --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/dart/echo_api.yaml @@ -0,0 +1,970 @@ +# +# Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +openapi: 3.0.3 +info: + title: Echo Server API + description: Echo Server API + contact: + email: team@openapitools.org + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + version: 0.1.0 +servers: + - url: http://localhost:3000/ +paths: + # Path usually starts with parameter type such as path, query, header, form + # For body/form parameters, path starts with "/echo" so the the echo server + # will response with the same body in the HTTP request. + # + # path parameter tests + /path/string/{path_string}/integer/{path_integer}: + get: + tags: + - path + summary: Test path parameter(s) + description: Test path parameter(s) + operationId: tests/path/string/{path_string}/integer/{path_integer} + parameters: + - in: path + name: path_string + required: true + schema: + type: string + - in: path + name: path_integer + required: true + schema: + type: integer + responses: + '200': + description: Successful operation + content: + text/plain: + schema: + type: string + # query parameter tests + /query/integer/boolean/string: + get: + tags: + - query + summary: Test query parameter(s) + description: Test query parameter(s) + operationId: test/query/integer/boolean/string + parameters: + - in: query + name: integer_query + style: form #default + explode: true #default + schema: + type: integer + - in: query + name: boolean_query + style: form #default + explode: true #default + schema: + type: boolean + - in: query + name: string_query + style: form #default + explode: true #default + schema: + type: string + responses: + '200': + description: Successful operation + content: + text/plain: + schema: + type: string + /query/style_form/explode_true/array_string: + get: + tags: + - query + summary: Test query parameter(s) + description: Test query parameter(s) + operationId: test/query/style_form/explode_true/array_string + parameters: + - in: query + name: query_object + style: form #default + explode: true #default + schema: + type: object + properties: + values: + type: array + items: + type: string + responses: + '200': + description: Successful operation + content: + text/plain: + schema: + type: string + /query/style_form/explode_true/object: + get: + tags: + - query + summary: Test query parameter(s) + description: Test query parameter(s) + operationId: test/query/style_form/explode_true/object + parameters: + - in: query + name: query_object + style: form #default + explode: true #default + schema: + $ref: '#/components/schemas/Pet' + responses: + '200': + description: Successful operation + content: + text/plain: + schema: + type: string + /echo/body/Pet: + post: + tags: + - body + summary: Test body parameter(s) + description: Test body parameter(s) + operationId: test/echo/body/Pet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + +components: + requestBodies: + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + schemas: + fruit: + title: fruit + properties: + color: + type: string + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + # additionalProperties: + # type: string + # uncomment this when https://github.com/swagger-api/swagger-parser/issues/1252 is resolved + apple: + title: apple + type: object + properties: + kind: + type: string + banana: + title: banana + type: object + properties: + count: + type: number + ExampleNonPrimitive: + oneOf: + - type: string + format: uuid + - type: string + format: date-time + - type: integer + - type: number + + Child: + type: object + properties: + name: + type: string + Example: + oneOf: + - $ref: '#/components/schemas/Child' + - type: integer + format: int32 + Addressable: + type: object + properties: + href: + type: string + description: Hyperlink reference + id: + type: string + description: unique identifier + description: Base schema for addressable entities + Extensible: + type: object + properties: + "@schemaLocation": + type: string + description: A URI to a JSON-Schema file that defines additional attributes + and relationships + "@baseType": + type: string + description: When sub-classing, this defines the super-class + "@type": + type: string + description: When sub-classing, this defines the sub-class Extensible name + required: + - '@type' + Entity: + type: object + discriminator: + propertyName: '@type' + allOf: + - "$ref": "#/components/schemas/Addressable" + - "$ref": "#/components/schemas/Extensible" + EntityRef: + type: object + discriminator: + propertyName: '@type' + description: Entity reference schema to be use for all entityRef class. + properties: + name: + type: string + description: Name of the related entity. + '@referredType': + type: string + description: The actual type of the target instance when needed for disambiguation. + allOf: + - $ref: '#/components/schemas/Addressable' + - "$ref": "#/components/schemas/Extensible" + FooRefOrValue: + type: object + oneOf: + - $ref: "#/components/schemas/Foo" + - $ref: "#/components/schemas/FooRef" + discriminator: + propertyName: "@type" + Foo: + type: object + properties: + fooPropA: + type: string + fooPropB: + type: string + allOf: + - $ref: '#/components/schemas/Entity' + FooRef: + type: object + properties: + foorefPropA: + type: string + allOf: + - $ref: '#/components/schemas/EntityRef' + BarRef: + type: object + allOf: + - $ref: '#/components/schemas/EntityRef' + Bar_Create: + type: object + properties: + barPropA: + type: string + fooPropB: + type: string + foo: + $ref: '#/components/schemas/FooRefOrValue' + allOf: + - $ref: '#/components/schemas/Entity' + Bar: + type: object + required: + - id + properties: + id: + type: string + barPropA: + type: string + fooPropB: + type: string + foo: + $ref: '#/components/schemas/FooRefOrValue' + allOf: + - $ref: '#/components/schemas/Entity' + BarRefOrValue: + type: object + oneOf: + - $ref: "#/components/schemas/Bar" + - $ref: "#/components/schemas/BarRef" + Pizza: + type: object + properties: + pizzaSize: + type: number + allOf: + - $ref: '#/components/schemas/Entity' + Pasta: + type: object + properties: + vendor: + type: string + allOf: + - $ref: '#/components/schemas/Entity' + PizzaSpeziale: + type: object + properties: + toppings: + type: string + allOf: + - $ref: '#/components/schemas/Pizza' + + Category: + type: object + properties: + id: + type: integer + format: int64 + example: 1 + name: + type: string + example: Dogs + xml: + name: category + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: tag + Pet: + required: + - name + - photoUrls + type: object + properties: + id: + type: integer + format: int64 + example: 10 + name: + type: string + example: doggie + category: + $ref: '#/components/schemas/Category' + photoUrls: + type: array + xml: + wrapped: true + items: + type: string + xml: + name: photoUrl + tags: + type: array + xml: + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: pet + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + declawed: + type: boolean + Animal: + type: object + discriminator: + propertyName: className + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + dateTime: + type: string + format: date-time + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + minItems: 0 + maxItems: 3 + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + example: 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + OuterObjectWithEnumProperty: + type: object + example: + value: 2 + required: + - value + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + type: array + deprecated: true + items: + $ref: '#/components/schemas/Bar' + AllOfWithSingleRef: + type: object + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + SingleRefType: + type: string + title: SingleRefType + enum: + - admin + - user \ No newline at end of file diff --git a/samples/client/echo_api/dart/dart-dio-built_value/.gitignore b/samples/client/echo_api/dart/dart-dio-built_value/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/.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/client/echo_api/dart/dart-dio-built_value/.openapi-generator-ignore b/samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/.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/client/echo_api/dart/dart-dio-built_value/.openapi-generator/FILES b/samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator/FILES new file mode 100644 index 000000000000..803a09c98cbd --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator/FILES @@ -0,0 +1,155 @@ +.gitignore +README.md +analysis_options.yaml +doc/AdditionalPropertiesClass.md +doc/Addressable.md +doc/AllOfWithSingleRef.md +doc/Animal.md +doc/ApiResponse.md +doc/Apple.md +doc/ArrayOfArrayOfNumberOnly.md +doc/ArrayOfNumberOnly.md +doc/ArrayTest.md +doc/Banana.md +doc/Bar.md +doc/BarCreate.md +doc/BarRef.md +doc/BarRefOrValue.md +doc/BodyApi.md +doc/Capitalization.md +doc/Cat.md +doc/CatAllOf.md +doc/Category.md +doc/Child.md +doc/ClassModel.md +doc/DeprecatedObject.md +doc/Dog.md +doc/DogAllOf.md +doc/Entity.md +doc/EntityRef.md +doc/EnumArrays.md +doc/EnumTest.md +doc/Example.md +doc/ExampleNonPrimitive.md +doc/Extensible.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FooRef.md +doc/FooRefOrValue.md +doc/FormatTest.md +doc/Fruit.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/Pasta.md +doc/PathApi.md +doc/Pet.md +doc/Pizza.md +doc/PizzaSpeziale.md +doc/QueryApi.md +doc/ReadOnlyFirst.md +doc/SingleRefType.md +doc/SpecialModelName.md +doc/Tag.md +doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +doc/User.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/body_api.dart +lib/src/api/path_api.dart +lib/src/api/query_api.dart +lib/src/api_util.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/date_serializer.dart +lib/src/model/additional_properties_class.dart +lib/src/model/addressable.dart +lib/src/model/all_of_with_single_ref.dart +lib/src/model/animal.dart +lib/src/model/api_response.dart +lib/src/model/apple.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/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/capitalization.dart +lib/src/model/cat.dart +lib/src/model/cat_all_of.dart +lib/src/model/category.dart +lib/src/model/child.dart +lib/src/model/class_model.dart +lib/src/model/date.dart +lib/src/model/deprecated_object.dart +lib/src/model/dog.dart +lib/src/model/dog_all_of.dart +lib/src/model/entity.dart +lib/src/model/entity_ref.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/example.dart +lib/src/model/example_non_primitive.dart +lib/src/model/extensible.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/foo_ref.dart +lib/src/model/foo_ref_or_value.dart +lib/src/model/format_test.dart +lib/src/model/fruit.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/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/pasta.dart +lib/src/model/pet.dart +lib/src/model/pizza.dart +lib/src/model/pizza_speziale.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_query_style_form_explode_true_array_string_query_object_parameter.dart +lib/src/model/user.dart +lib/src/serializers.dart +pubspec.yaml diff --git a/samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator/VERSION b/samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator/VERSION new file mode 100644 index 000000000000..d6b4ec4aa783 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/echo_api/dart/dart-dio-built_value/README.md b/samples/client/echo_api/dart/dart-dio-built_value/README.md new file mode 100644 index 000000000000..ed9a0096600c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/README.md @@ -0,0 +1,153 @@ +# openapi +Echo Server API + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.1.0 +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.12.0 or later OR Flutter 1.26.0 or later +* Dio 4.0.0+ + +## Installation & Usage + +### pub.dev +To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml +```yaml +dependencies: + openapi: 1.0.0 +``` + +### Github +If this Dart package is published to Github, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + git: + url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git + #ref: main +``` + +### Local development +To use the package from your local drive, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + path: /path/to/openapi +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:openapi/openapi.dart'; + + +final api = Openapi().getBodyApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + final response = await api.testEchoBodyPet(pet); + print(response); +} catch on DioError (e) { + print("Exception when calling BodyApi->testEchoBodyPet: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:3000* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*BodyApi*](doc/BodyApi.md) | [**testEchoBodyPet**](doc/BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) +[*PathApi*](doc/PathApi.md) | [**testsPathStringPathStringIntegerPathInteger**](doc/PathApi.md#testspathstringpathstringintegerpathinteger) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryIntegerBooleanString**](doc/QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryStyleFormExplodeTrueArrayString**](doc/QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryStyleFormExplodeTrueObject**](doc/QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) + + +## Documentation For Models + + - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) + - [Addressable](doc/Addressable.md) + - [AllOfWithSingleRef](doc/AllOfWithSingleRef.md) + - [Animal](doc/Animal.md) + - [ApiResponse](doc/ApiResponse.md) + - [Apple](doc/Apple.md) + - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) + - [ArrayTest](doc/ArrayTest.md) + - [Banana](doc/Banana.md) + - [Bar](doc/Bar.md) + - [BarCreate](doc/BarCreate.md) + - [BarRef](doc/BarRef.md) + - [BarRefOrValue](doc/BarRefOrValue.md) + - [Capitalization](doc/Capitalization.md) + - [Cat](doc/Cat.md) + - [CatAllOf](doc/CatAllOf.md) + - [Category](doc/Category.md) + - [Child](doc/Child.md) + - [ClassModel](doc/ClassModel.md) + - [DeprecatedObject](doc/DeprecatedObject.md) + - [Dog](doc/Dog.md) + - [DogAllOf](doc/DogAllOf.md) + - [Entity](doc/Entity.md) + - [EntityRef](doc/EntityRef.md) + - [EnumArrays](doc/EnumArrays.md) + - [EnumTest](doc/EnumTest.md) + - [Example](doc/Example.md) + - [ExampleNonPrimitive](doc/ExampleNonPrimitive.md) + - [Extensible](doc/Extensible.md) + - [FileSchemaTestClass](doc/FileSchemaTestClass.md) + - [Foo](doc/Foo.md) + - [FooRef](doc/FooRef.md) + - [FooRefOrValue](doc/FooRefOrValue.md) + - [FormatTest](doc/FormatTest.md) + - [Fruit](doc/Fruit.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) + - [Pasta](doc/Pasta.md) + - [Pet](doc/Pet.md) + - [Pizza](doc/Pizza.md) + - [PizzaSpeziale](doc/PizzaSpeziale.md) + - [ReadOnlyFirst](doc/ReadOnlyFirst.md) + - [SingleRefType](doc/SingleRefType.md) + - [SpecialModelName](doc/SpecialModelName.md) + - [Tag](doc/Tag.md) + - [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md) + - [User](doc/User.md) + + +## Documentation For Authorization + + All endpoints do not require authorization. + + +## Author + +team@openapitools.org + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/analysis_options.yaml b/samples/client/echo_api/dart/dart-dio-built_value/analysis_options.yaml new file mode 100644 index 000000000000..a611887d3acf --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/analysis_options.yaml @@ -0,0 +1,9 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart diff --git a/samples/client/echo_api/dart/dart-dio-built_value/doc/AdditionalPropertiesClass.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..f9f7857894d0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | **BuiltMap<String, String>** | | [optional] +**mapOfMapProperty** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.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/client/echo_api/dart/dart-dio-built_value/doc/Addressable.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Addressable.md new file mode 100644 index 000000000000..0fcd81b80382 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/AllOfWithSingleRef.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4c6f3ab2fe11 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/Animal.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Animal.md new file mode 100644 index 000000000000..415b56e9bc2e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/ApiResponse.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ApiResponse.md new file mode 100644 index 000000000000..7ad5da0f89e4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/Apple.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Apple.md new file mode 100644 index 000000000000..c7f711b87cef --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/ArrayOfArrayOfNumberOnly.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..d1a272ab6023 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | [**BuiltList<BuiltList<num>>**](BuiltList.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/client/echo_api/dart/dart-dio-built_value/doc/ArrayOfNumberOnly.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..94b60f272fd4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | **BuiltList<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/client/echo_api/dart/dart-dio-built_value/doc/ArrayTest.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ArrayTest.md new file mode 100644 index 000000000000..0813d4fa93c6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | **BuiltList<String>** | | [optional] +**arrayArrayOfInteger** | [**BuiltList<BuiltList<int>>**](BuiltList.md) | | [optional] +**arrayArrayOfModel** | [**BuiltList<BuiltList<ReadOnlyFirst>>**](BuiltList.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/client/echo_api/dart/dart-dio-built_value/doc/Banana.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Banana.md new file mode 100644 index 000000000000..bef8a58a4276 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/Bar.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Bar.md new file mode 100644 index 000000000000..4cccc863a489 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/BarCreate.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/BarCreate.md new file mode 100644 index 000000000000..c0b4ba6edc9a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/BarRef.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/BarRef.md new file mode 100644 index 000000000000..949695f4d36f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/BarRef.md @@ -0,0 +1,19 @@ +# openapi.model.BarRef + +## 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/client/echo_api/dart/dart-dio-built_value/doc/BarRefOrValue.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/BarRefOrValue.md new file mode 100644 index 000000000000..9dafa2d6b220 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/BarRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.BarRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | +**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/client/echo_api/dart/dart-dio-built_value/doc/BodyApi.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/BodyApi.md new file mode 100644 index 000000000000..145854fc8d28 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/BodyApi.md @@ -0,0 +1,57 @@ +# openapi.api.BodyApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testEchoBodyPet**](BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) + + +# **testEchoBodyPet** +> Pet testEchoBodyPet(pet) + +Test body parameter(s) + +Test body parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getBodyApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + final response = api.testEchoBodyPet(pet); + print(response); +} catch on DioError (e) { + print('Exception when calling BodyApi->testEchoBodyPet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +[**Pet**](Pet.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/client/echo_api/dart/dart-dio-built_value/doc/Capitalization.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Capitalization.md new file mode 100644 index 000000000000..4a07b4eb820d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/Cat.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Cat.md new file mode 100644 index 000000000000..6552eea4b435 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/CatAllOf.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/CatAllOf.md new file mode 100644 index 000000000000..36b2ae0e8ab3 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/CatAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.CatAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/doc/Category.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Category.md new file mode 100644 index 000000000000..98d0b14be7b1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | | [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/client/echo_api/dart/dart-dio-built_value/doc/Child.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Child.md new file mode 100644 index 000000000000..bed0f2feec12 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/ClassModel.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ClassModel.md new file mode 100644 index 000000000000..9b80d4f71eea --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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 +------------ | ------------- | ------------- | ------------- +**classField** | **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/client/echo_api/dart/dart-dio-built_value/doc/DeprecatedObject.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/DeprecatedObject.md new file mode 100644 index 000000000000..bf2ef67a26fc --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/Dog.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Dog.md new file mode 100644 index 000000000000..d36439b767bb --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/DogAllOf.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/DogAllOf.md new file mode 100644 index 000000000000..97a7c8fba492 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/DogAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.DogAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/doc/Entity.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Entity.md new file mode 100644 index 000000000000..5ba2144b44fe --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/EntityRef.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/EntityRef.md new file mode 100644 index 000000000000..80eae55f4145 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/EnumArrays.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/EnumArrays.md new file mode 100644 index 000000000000..06170bb8f51d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | **BuiltList<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/client/echo_api/dart/dart-dio-built_value/doc/EnumTest.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/EnumTest.md new file mode 100644 index 000000000000..7c24fe2347b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/Example.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Example.md new file mode 100644 index 000000000000..bf49bb137a60 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/ExampleNonPrimitive.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ExampleNonPrimitive.md new file mode 100644 index 000000000000..2b63a98c6ad9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/ExampleNonPrimitive.md @@ -0,0 +1,14 @@ +# openapi.model.ExampleNonPrimitive + +## 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/client/echo_api/dart/dart-dio-built_value/doc/Extensible.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Extensible.md new file mode 100644 index 000000000000..7a781e578ea4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/FileSchemaTestClass.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/FileSchemaTestClass.md new file mode 100644 index 000000000000..105fece87f1d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | [**BuiltList<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/client/echo_api/dart/dart-dio-built_value/doc/Foo.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Foo.md new file mode 100644 index 000000000000..2627691fefe5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/FooRef.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/FooRef.md new file mode 100644 index 000000000000..68104b227292 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/FooRef.md @@ -0,0 +1,20 @@ +# openapi.model.FooRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foorefPropA** | **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/client/echo_api/dart/dart-dio-built_value/doc/FooRefOrValue.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/FooRefOrValue.md new file mode 100644 index 000000000000..35e9fd114e1d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/FooRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.FooRefOrValue + +## 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/client/echo_api/dart/dart-dio-built_value/doc/FormatTest.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/FormatTest.md new file mode 100644 index 000000000000..f811264ca2ba --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | [**Uint8List**](Uint8List.md) | | [optional] +**date** | [**Date**](Date.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/client/echo_api/dart/dart-dio-built_value/doc/Fruit.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Fruit.md new file mode 100644 index 000000000000..5d48cc6e6d38 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/HasOnlyReadOnly.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/HasOnlyReadOnly.md new file mode 100644 index 000000000000..32cae937155d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/HealthCheckResult.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/HealthCheckResult.md new file mode 100644 index 000000000000..4d6aeb75d965 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/MapTest.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/MapTest.md new file mode 100644 index 000000000000..4ad87df64232 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] +**mapOfEnumString** | **BuiltMap<String, String>** | | [optional] +**directMap** | **BuiltMap<String, bool>** | | [optional] +**indirectMap** | **BuiltMap<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/client/echo_api/dart/dart-dio-built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..b1a4c4ccc401 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | [**BuiltMap<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/client/echo_api/dart/dart-dio-built_value/doc/Model200Response.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Model200Response.md new file mode 100644 index 000000000000..e8b088ca1afa --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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] +**classField** | **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/client/echo_api/dart/dart-dio-built_value/doc/ModelClient.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ModelClient.md new file mode 100644 index 000000000000..f7b922f4a398 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/ModelEnumClass.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ModelEnumClass.md new file mode 100644 index 000000000000..ebaafb44c7f7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/ModelFile.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ModelFile.md new file mode 100644 index 000000000000..4be260e93f6e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/ModelList.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ModelList.md new file mode 100644 index 000000000000..283aa1f6b711 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/ModelReturn.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ModelReturn.md new file mode 100644 index 000000000000..bc02df7a3692 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/Name.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Name.md new file mode 100644 index 000000000000..25f49ea946b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/NullableClass.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/NullableClass.md new file mode 100644 index 000000000000..4ce8d5e17576 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | [**Date**](Date.md) | | [optional] +**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] +**arrayNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] +**arrayAndItemsNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] +**arrayItemsNullable** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] +**objectNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] +**objectAndItemsNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] +**objectItemsNullable** | [**BuiltMap<String, JsonObject>**](JsonObject.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/client/echo_api/dart/dart-dio-built_value/doc/NumberOnly.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/NumberOnly.md new file mode 100644 index 000000000000..d8096a3db37a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/ObjectWithDeprecatedFields.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..00d3cc694525 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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** | [**BuiltList<Bar>**](Bar.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/client/echo_api/dart/dart-dio-built_value/doc/Order.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Order.md new file mode 100644 index 000000000000..bde5ffe51a2c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/OuterComposite.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/OuterComposite.md new file mode 100644 index 000000000000..04bab7eff5d1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/OuterEnum.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/OuterEnum.md new file mode 100644 index 000000000000..af62ad87ab2e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/OuterEnumDefaultValue.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..c1bf8b0dec44 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/OuterEnumInteger.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/OuterEnumInteger.md new file mode 100644 index 000000000000..8c80a9e5c85f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/OuterEnumIntegerDefaultValue.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..eb8b55d70249 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/OuterObjectWithEnumProperty.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..eab2ae8f66b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/Pasta.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Pasta.md new file mode 100644 index 000000000000..034ff420d323 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/PathApi.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/PathApi.md new file mode 100644 index 000000000000..ae663a2f7f04 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/PathApi.md @@ -0,0 +1,59 @@ +# openapi.api.PathApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testsPathStringPathStringIntegerPathInteger**](PathApi.md#testspathstringpathstringintegerpathinteger) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s) + + +# **testsPathStringPathStringIntegerPathInteger** +> String testsPathStringPathStringIntegerPathInteger(pathString, pathInteger) + +Test path parameter(s) + +Test path parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getPathApi(); +final String pathString = pathString_example; // String | +final int pathInteger = 56; // int | + +try { + final response = api.testsPathStringPathStringIntegerPathInteger(pathString, pathInteger); + print(response); +} catch on DioError (e) { + print('Exception when calling PathApi->testsPathStringPathStringIntegerPathInteger: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pathString** | **String**| | + **pathInteger** | **int**| | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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/client/echo_api/dart/dart-dio-built_value/doc/Pet.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Pet.md new file mode 100644 index 000000000000..455b9330ff8e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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] +**name** | **String** | | +**category** | [**Category**](Category.md) | | [optional] +**photoUrls** | **BuiltList<String>** | | +**tags** | [**BuiltList<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/client/echo_api/dart/dart-dio-built_value/doc/Pizza.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Pizza.md new file mode 100644 index 000000000000..e4b040a6a79c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/PizzaSpeziale.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/PizzaSpeziale.md new file mode 100644 index 000000000000..e1d8434c077d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/PizzaSpeziale.md @@ -0,0 +1,20 @@ +# openapi.model.PizzaSpeziale + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toppings** | **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/client/echo_api/dart/dart-dio-built_value/doc/QueryApi.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/QueryApi.md new file mode 100644 index 000000000000..f92f9532a113 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/QueryApi.md @@ -0,0 +1,149 @@ +# openapi.api.QueryApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testQueryIntegerBooleanString**](QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s) +[**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +[**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) + + +# **testQueryIntegerBooleanString** +> String testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final int integerQuery = 56; // int | +final bool booleanQuery = true; // bool | +final String stringQuery = stringQuery_example; // String | + +try { + final response = api.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryIntegerBooleanString: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integerQuery** | **int**| | [optional] + **booleanQuery** | **bool**| | [optional] + **stringQuery** | **String**| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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) + +# **testQueryStyleFormExplodeTrueArrayString** +> String testQueryStyleFormExplodeTrueArrayString(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject = ; // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter | + +try { + final response = api.testQueryStyleFormExplodeTrueArrayString(queryObject); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryStyleFormExplodeTrueArrayString: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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) + +# **testQueryStyleFormExplodeTrueObject** +> String testQueryStyleFormExplodeTrueObject(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final Pet queryObject = ; // Pet | + +try { + final response = api.testQueryStyleFormExplodeTrueObject(queryObject); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryStyleFormExplodeTrueObject: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | [**Pet**](.md)| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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/client/echo_api/dart/dart-dio-built_value/doc/ReadOnlyFirst.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/ReadOnlyFirst.md new file mode 100644 index 000000000000..8f612e8ba19f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/SingleRefType.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/SingleRefType.md new file mode 100644 index 000000000000..0dc93840cd7f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/SpecialModelName.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/SpecialModelName.md new file mode 100644 index 000000000000..5fcfa98e0b36 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/Tag.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/Tag.md new file mode 100644 index 000000000000..c219f987c19c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md new file mode 100644 index 000000000000..9ee07596a0df --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -0,0 +1,15 @@ +# openapi.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | **BuiltList<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/client/echo_api/dart/dart-dio-built_value/doc/User.md b/samples/client/echo_api/dart/dart-dio-built_value/doc/User.md new file mode 100644 index 000000000000..fa87e64d8595 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/lib/openapi.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/openapi.dart new file mode 100644 index 000000000000..0b51813f1c05 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/openapi.dart @@ -0,0 +1,82 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:openapi/src/api.dart'; +export 'package:openapi/src/auth/api_key_auth.dart'; +export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; +export 'package:openapi/src/serializers.dart'; +export 'package:openapi/src/model/date.dart'; + +export 'package:openapi/src/api/body_api.dart'; +export 'package:openapi/src/api/path_api.dart'; +export 'package:openapi/src/api/query_api.dart'; + +export 'package:openapi/src/model/additional_properties_class.dart'; +export 'package:openapi/src/model/addressable.dart'; +export 'package:openapi/src/model/all_of_with_single_ref.dart'; +export 'package:openapi/src/model/animal.dart'; +export 'package:openapi/src/model/api_response.dart'; +export 'package:openapi/src/model/apple.dart'; +export 'package:openapi/src/model/array_of_array_of_number_only.dart'; +export 'package:openapi/src/model/array_of_number_only.dart'; +export 'package:openapi/src/model/array_test.dart'; +export 'package:openapi/src/model/banana.dart'; +export 'package:openapi/src/model/bar.dart'; +export 'package:openapi/src/model/bar_create.dart'; +export 'package:openapi/src/model/bar_ref.dart'; +export 'package:openapi/src/model/bar_ref_or_value.dart'; +export 'package:openapi/src/model/capitalization.dart'; +export 'package:openapi/src/model/cat.dart'; +export 'package:openapi/src/model/cat_all_of.dart'; +export 'package:openapi/src/model/category.dart'; +export 'package:openapi/src/model/child.dart'; +export 'package:openapi/src/model/class_model.dart'; +export 'package:openapi/src/model/deprecated_object.dart'; +export 'package:openapi/src/model/dog.dart'; +export 'package:openapi/src/model/dog_all_of.dart'; +export 'package:openapi/src/model/entity.dart'; +export 'package:openapi/src/model/entity_ref.dart'; +export 'package:openapi/src/model/enum_arrays.dart'; +export 'package:openapi/src/model/enum_test.dart'; +export 'package:openapi/src/model/example.dart'; +export 'package:openapi/src/model/example_non_primitive.dart'; +export 'package:openapi/src/model/extensible.dart'; +export 'package:openapi/src/model/file_schema_test_class.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/foo_ref.dart'; +export 'package:openapi/src/model/foo_ref_or_value.dart'; +export 'package:openapi/src/model/format_test.dart'; +export 'package:openapi/src/model/fruit.dart'; +export 'package:openapi/src/model/has_only_read_only.dart'; +export 'package:openapi/src/model/health_check_result.dart'; +export 'package:openapi/src/model/map_test.dart'; +export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +export 'package:openapi/src/model/model200_response.dart'; +export 'package:openapi/src/model/model_client.dart'; +export 'package:openapi/src/model/model_enum_class.dart'; +export 'package:openapi/src/model/model_file.dart'; +export 'package:openapi/src/model/model_list.dart'; +export 'package:openapi/src/model/model_return.dart'; +export 'package:openapi/src/model/name.dart'; +export 'package:openapi/src/model/nullable_class.dart'; +export 'package:openapi/src/model/number_only.dart'; +export 'package:openapi/src/model/object_with_deprecated_fields.dart'; +export 'package:openapi/src/model/order.dart'; +export 'package:openapi/src/model/outer_composite.dart'; +export 'package:openapi/src/model/outer_enum.dart'; +export 'package:openapi/src/model/outer_enum_default_value.dart'; +export 'package:openapi/src/model/outer_enum_integer.dart'; +export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +export 'package:openapi/src/model/outer_object_with_enum_property.dart'; +export 'package:openapi/src/model/pasta.dart'; +export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/pizza.dart'; +export 'package:openapi/src/model/pizza_speziale.dart'; +export 'package:openapi/src/model/read_only_first.dart'; +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/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; +export 'package:openapi/src/model/user.dart'; diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api.dart new file mode 100644 index 000000000000..5251ce5189f5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/serializers.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/body_api.dart'; +import 'package:openapi/src/api/path_api.dart'; +import 'package:openapi/src/api/query_api.dart'; + +class Openapi { + static const String basePath = r'http://localhost:3000'; + + final Dio dio; + final Serializers serializers; + + Openapi({ + Dio? dio, + Serializers? serializers, + String? basePathOverride, + List? interceptors, + }) : this.serializers = serializers ?? standardSerializers, + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: 5000, + receiveTimeout: 3000, + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + } + } + + /// Get BodyApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + BodyApi getBodyApi() { + return BodyApi(dio, serializers); + } + + /// Get PathApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + PathApi getPathApi() { + return PathApi(dio, serializers); + } + + /// Get QueryApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + QueryApi getQueryApi() { + return QueryApi(dio, serializers); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart new file mode 100644 index 000000000000..9c86b955a2d9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/pet.dart'; + +class BodyApi { + + final Dio _dio; + + final Serializers _serializers; + + const BodyApi(this._dio, this._serializers); + + /// Test body parameter(s) + /// Test body parameter(s) + /// + /// 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] containing a [Response] with a [Pet] as data + /// Throws [DioError] if API call or serialization fails + Future> testEchoBodyPet({ + Pet? pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/echo/body/Pet'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(Pet); + _bodyData = pet == null ? null : _serializers.serialize(pet, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Pet _responseData; + + try { + const _responseType = FullType(Pet); + _responseData = _serializers.deserialize( + _response.data!, + specifiedType: _responseType, + ) as Pet; + + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart new file mode 100644 index 000000000000..3d009a985a86 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart @@ -0,0 +1,91 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + + +class PathApi { + + final Dio _dio; + + final Serializers _serializers; + + const PathApi(this._dio, this._serializers); + + /// Test path parameter(s) + /// Test path parameter(s) + /// + /// Parameters: + /// * [pathString] + /// * [pathInteger] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testsPathStringPathStringIntegerPathInteger({ + required String pathString, + required int pathInteger, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/path/string/{path_string}/integer/{path_integer}'.replaceAll('{' r'path_string' '}', pathString.toString()).replaceAll('{' r'path_integer' '}', pathInteger.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, + ); + + String _responseData; + + try { + _responseData = _response.data as String; + + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart new file mode 100644 index 000000000000..d51aad8f6dcc --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart @@ -0,0 +1,253 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/api_util.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; + +class QueryApi { + + final Dio _dio; + + final Serializers _serializers; + + const QueryApi(this._dio, this._serializers); + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [integerQuery] + /// * [booleanQuery] + /// * [stringQuery] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testQueryIntegerBooleanString({ + int? integerQuery, + bool? booleanQuery, + String? stringQuery, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/query/integer/boolean/string'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (integerQuery != null) r'integer_query': encodeQueryParameter(_serializers, integerQuery, const FullType(int)), + if (booleanQuery != null) r'boolean_query': encodeQueryParameter(_serializers, booleanQuery, const FullType(bool)), + if (stringQuery != null) r'string_query': encodeQueryParameter(_serializers, stringQuery, const FullType(String)), + }; + + 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 DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [queryObject] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testQueryStyleFormExplodeTrueArrayString({ + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? queryObject, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/query/style_form/explode_true/array_string'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (queryObject != null) r'query_object': encodeQueryParameter(_serializers, queryObject, const FullType(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter)), + }; + + 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 DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [queryObject] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testQueryStyleFormExplodeTrueObject({ + Pet? queryObject, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/query/style_form/explode_true/object'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (queryObject != null) r'query_object': encodeQueryParameter(_serializers, queryObject, const FullType(Pet)), + }; + + 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 DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api_util.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api_util.dart new file mode 100644 index 000000000000..ed3bb12f25b8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api_util.dart @@ -0,0 +1,77 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/api_key_auth.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/lib/src/auth/auth.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/lib/src/auth/basic_auth.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b6e6dce04f9c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/basic_auth.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BasicAuthInfo { + final String username; + final String password; + + const BasicAuthInfo(this.username, this.password); +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + for (final info in metadataAuthInfo) { + final authName = info['name'] as String; + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/bearer_auth.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..1d4402b376c0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/bearer_auth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/oauth.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/lib/src/date_serializer.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/date_serializer.dart new file mode 100644 index 000000000000..db3c5c437db1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/date_serializer.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +class DateSerializer implements PrimitiveSerializer { + + const DateSerializer(); + + @override + Iterable get types => BuiltList.of([Date]); + + @override + String get wireName => 'Date'; + + @override + Date deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final parsed = DateTime.parse(serialized as String); + return Date(parsed.year, parsed.month, parsed.day); + } + + @override + Object serialize(Serializers serializers, Date date, + {FullType specifiedType = FullType.unspecified}) { + return date.toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/additional_properties_class.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/additional_properties_class.dart new file mode 100644 index 000000000000..3fdac6d5a44f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/additional_properties_class.dart @@ -0,0 +1,127 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'additional_properties_class.g.dart'; + +/// AdditionalPropertiesClass +/// +/// Properties: +/// * [mapProperty] +/// * [mapOfMapProperty] +@BuiltValue() +abstract class AdditionalPropertiesClass implements Built { + @BuiltValueField(wireName: r'map_property') + BuiltMap? get mapProperty; + + @BuiltValueField(wireName: r'map_of_map_property') + BuiltMap>? get mapOfMapProperty; + + AdditionalPropertiesClass._(); + + factory AdditionalPropertiesClass([void updates(AdditionalPropertiesClassBuilder b)]) = _$AdditionalPropertiesClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AdditionalPropertiesClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AdditionalPropertiesClassSerializer(); +} + +class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [AdditionalPropertiesClass, _$AdditionalPropertiesClass]; + + @override + final String wireName = r'AdditionalPropertiesClass'; + + Iterable _serializeProperties( + Serializers serializers, + AdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.mapProperty != null) { + yield r'map_property'; + yield serializers.serialize( + object.mapProperty, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]), + ); + } + if (object.mapOfMapProperty != null) { + yield r'map_of_map_property'; + yield serializers.serialize( + object.mapOfMapProperty, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + AdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AdditionalPropertiesClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'map_property': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]), + ) as BuiltMap; + result.mapProperty.replace(valueDes); + break; + case r'map_of_map_property': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ) as BuiltMap>; + result.mapOfMapProperty.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + AdditionalPropertiesClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AdditionalPropertiesClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/addressable.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/addressable.dart new file mode 100644 index 000000000000..0ab0936d5673 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/addressable.dart @@ -0,0 +1,161 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'addressable.g.dart'; + +/// Base schema for addressable entities +/// +/// Properties: +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +@BuiltValue(instantiable: false) +abstract class Addressable { + /// Hyperlink reference + @BuiltValueField(wireName: r'href') + String? get href; + + /// unique identifier + @BuiltValueField(wireName: r'id') + String? get id; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AddressableSerializer(); +} + +class _$AddressableSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Addressable]; + + @override + final String wireName = r'Addressable'; + + Iterable _serializeProperties( + Serializers serializers, + Addressable object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Addressable object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Addressable deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($Addressable)) as $Addressable; + } +} + +/// a concrete implementation of [Addressable], since [Addressable] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Addressable implements Addressable, Built<$Addressable, $AddressableBuilder> { + $Addressable._(); + + factory $Addressable([void Function($AddressableBuilder)? updates]) = _$$Addressable; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($AddressableBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Addressable> get serializer => _$$AddressableSerializer(); +} + +class _$$AddressableSerializer implements PrimitiveSerializer<$Addressable> { + @override + final Iterable types = const [$Addressable, _$$Addressable]; + + @override + final String wireName = r'$Addressable'; + + @override + Object serialize( + Serializers serializers, + $Addressable object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Addressable))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AddressableBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Addressable deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $AddressableBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/all_of_with_single_ref.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/all_of_with_single_ref.dart new file mode 100644 index 000000000000..04f59d360128 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/all_of_with_single_ref.dart @@ -0,0 +1,127 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/single_ref_type.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'all_of_with_single_ref.g.dart'; + +/// AllOfWithSingleRef +/// +/// Properties: +/// * [username] +/// * [singleRefType] +@BuiltValue() +abstract class AllOfWithSingleRef implements Built { + @BuiltValueField(wireName: r'username') + String? get username; + + @BuiltValueField(wireName: r'SingleRefType') + SingleRefType? get singleRefType; + + AllOfWithSingleRef._(); + + factory AllOfWithSingleRef([void updates(AllOfWithSingleRefBuilder b)]) = _$AllOfWithSingleRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AllOfWithSingleRefBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AllOfWithSingleRefSerializer(); +} + +class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [AllOfWithSingleRef, _$AllOfWithSingleRef]; + + @override + final String wireName = r'AllOfWithSingleRef'; + + Iterable _serializeProperties( + Serializers serializers, + AllOfWithSingleRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.username != null) { + yield r'username'; + yield serializers.serialize( + object.username, + specifiedType: const FullType(String), + ); + } + if (object.singleRefType != null) { + yield r'SingleRefType'; + yield serializers.serialize( + object.singleRefType, + specifiedType: const FullType(SingleRefType), + ); + } + } + + @override + Object serialize( + Serializers serializers, + AllOfWithSingleRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AllOfWithSingleRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'username': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.username = valueDes; + break; + case r'SingleRefType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(SingleRefType), + ) as SingleRefType; + result.singleRefType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + AllOfWithSingleRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AllOfWithSingleRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/animal.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/animal.dart new file mode 100644 index 000000000000..01a52a6a1707 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/animal.dart @@ -0,0 +1,205 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/dog.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'animal.g.dart'; + +/// Animal +/// +/// Properties: +/// * [className] +/// * [color] +@BuiltValue(instantiable: false) +abstract class Animal { + @BuiltValueField(wireName: r'className') + String get className; + + @BuiltValueField(wireName: r'color') + String? get color; + + static const String discriminatorFieldName = r'className'; + + static const Map discriminatorMapping = { + r'Cat': Cat, + r'Dog': Dog, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AnimalSerializer(); +} + +extension AnimalDiscriminatorExt on Animal { + String? get discriminatorValue { + if (this is Cat) { + return r'Cat'; + } + if (this is Dog) { + return r'Dog'; + } + return null; + } +} +extension AnimalBuilderDiscriminatorExt on AnimalBuilder { + String? get discriminatorValue { + if (this is CatBuilder) { + return r'Cat'; + } + if (this is DogBuilder) { + return r'Dog'; + } + return null; + } +} + +class _$AnimalSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Animal]; + + @override + final String wireName = r'Animal'; + + Iterable _serializeProperties( + Serializers serializers, + Animal object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'className'; + yield serializers.serialize( + object.className, + specifiedType: const FullType(String), + ); + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Animal object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is Cat) { + return serializers.serialize(object, specifiedType: FullType(Cat))!; + } + if (object is Dog) { + return serializers.serialize(object, specifiedType: FullType(Dog))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Animal deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(Animal.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'Cat': + return serializers.deserialize(serialized, specifiedType: FullType(Cat)) as Cat; + case r'Dog': + return serializers.deserialize(serialized, specifiedType: FullType(Dog)) as Dog; + default: + return serializers.deserialize(serialized, specifiedType: FullType($Animal)) as $Animal; + } + } +} + +/// a concrete implementation of [Animal], since [Animal] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Animal implements Animal, Built<$Animal, $AnimalBuilder> { + $Animal._(); + + factory $Animal([void Function($AnimalBuilder)? updates]) = _$$Animal; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($AnimalBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Animal> get serializer => _$$AnimalSerializer(); +} + +class _$$AnimalSerializer implements PrimitiveSerializer<$Animal> { + @override + final Iterable types = const [$Animal, _$$Animal]; + + @override + final String wireName = r'$Animal'; + + @override + Object serialize( + Serializers serializers, + $Animal object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Animal))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AnimalBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'className': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.className = valueDes; + break; + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Animal deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $AnimalBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/api_response.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/api_response.dart new file mode 100644 index 000000000000..aadcd792e2bf --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/api_response.dart @@ -0,0 +1,144 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'api_response.g.dart'; + +/// ApiResponse +/// +/// Properties: +/// * [code] +/// * [type] +/// * [message] +@BuiltValue() +abstract class ApiResponse implements Built { + @BuiltValueField(wireName: r'code') + int? get code; + + @BuiltValueField(wireName: r'type') + String? get type; + + @BuiltValueField(wireName: r'message') + String? get message; + + ApiResponse._(); + + factory ApiResponse([void updates(ApiResponseBuilder b)]) = _$ApiResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ApiResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ApiResponseSerializer(); +} + +class _$ApiResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ApiResponse, _$ApiResponse]; + + @override + final String wireName = r'ApiResponse'; + + Iterable _serializeProperties( + Serializers serializers, + ApiResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.code != null) { + yield r'code'; + yield serializers.serialize( + object.code, + specifiedType: const FullType(int), + ); + } + if (object.type != null) { + yield r'type'; + yield serializers.serialize( + object.type, + specifiedType: const FullType(String), + ); + } + if (object.message != null) { + yield r'message'; + yield serializers.serialize( + object.message, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ApiResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ApiResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'code': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.code = valueDes; + break; + case r'type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.type = valueDes; + break; + case r'message': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.message = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ApiResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ApiResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/apple.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/apple.dart new file mode 100644 index 000000000000..02ca94190b96 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/apple.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'apple.g.dart'; + +/// Apple +/// +/// Properties: +/// * [kind] +@BuiltValue() +abstract class Apple implements Built { + @BuiltValueField(wireName: r'kind') + String? get kind; + + Apple._(); + + factory Apple([void updates(AppleBuilder b)]) = _$Apple; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AppleBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AppleSerializer(); +} + +class _$AppleSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Apple, _$Apple]; + + @override + final String wireName = r'Apple'; + + Iterable _serializeProperties( + Serializers serializers, + Apple object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.kind != null) { + yield r'kind'; + yield serializers.serialize( + object.kind, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Apple object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AppleBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'kind': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.kind = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Apple deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AppleBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_array_of_number_only.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_array_of_number_only.dart new file mode 100644 index 000000000000..5bc0982b8ab0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_array_of_number_only.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'array_of_array_of_number_only.g.dart'; + +/// ArrayOfArrayOfNumberOnly +/// +/// Properties: +/// * [arrayArrayNumber] +@BuiltValue() +abstract class ArrayOfArrayOfNumberOnly implements Built { + @BuiltValueField(wireName: r'ArrayArrayNumber') + BuiltList>? get arrayArrayNumber; + + ArrayOfArrayOfNumberOnly._(); + + factory ArrayOfArrayOfNumberOnly([void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = _$ArrayOfArrayOfNumberOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ArrayOfArrayOfNumberOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ArrayOfArrayOfNumberOnlySerializer(); +} + +class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ArrayOfArrayOfNumberOnly, _$ArrayOfArrayOfNumberOnly]; + + @override + final String wireName = r'ArrayOfArrayOfNumberOnly'; + + Iterable _serializeProperties( + Serializers serializers, + ArrayOfArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.arrayArrayNumber != null) { + yield r'ArrayArrayNumber'; + yield serializers.serialize( + object.arrayArrayNumber, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ArrayOfArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ArrayOfArrayOfNumberOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'ArrayArrayNumber': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]), + ) as BuiltList>; + result.arrayArrayNumber.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ArrayOfArrayOfNumberOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ArrayOfArrayOfNumberOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_number_only.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_number_only.dart new file mode 100644 index 000000000000..72239924f5ec --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_number_only.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'array_of_number_only.g.dart'; + +/// ArrayOfNumberOnly +/// +/// Properties: +/// * [arrayNumber] +@BuiltValue() +abstract class ArrayOfNumberOnly implements Built { + @BuiltValueField(wireName: r'ArrayNumber') + BuiltList? get arrayNumber; + + ArrayOfNumberOnly._(); + + factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = _$ArrayOfNumberOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ArrayOfNumberOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ArrayOfNumberOnlySerializer(); +} + +class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly]; + + @override + final String wireName = r'ArrayOfNumberOnly'; + + Iterable _serializeProperties( + Serializers serializers, + ArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.arrayNumber != null) { + yield r'ArrayNumber'; + yield serializers.serialize( + object.arrayNumber, + specifiedType: const FullType(BuiltList, [FullType(num)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ArrayOfNumberOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'ArrayNumber': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(num)]), + ) as BuiltList; + result.arrayNumber.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ArrayOfNumberOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ArrayOfNumberOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_test.dart new file mode 100644 index 000000000000..21f3a5a4c2d5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_test.dart @@ -0,0 +1,146 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'array_test.g.dart'; + +/// ArrayTest +/// +/// Properties: +/// * [arrayOfString] +/// * [arrayArrayOfInteger] +/// * [arrayArrayOfModel] +@BuiltValue() +abstract class ArrayTest implements Built { + @BuiltValueField(wireName: r'array_of_string') + BuiltList? get arrayOfString; + + @BuiltValueField(wireName: r'array_array_of_integer') + BuiltList>? get arrayArrayOfInteger; + + @BuiltValueField(wireName: r'array_array_of_model') + BuiltList>? get arrayArrayOfModel; + + ArrayTest._(); + + factory ArrayTest([void updates(ArrayTestBuilder b)]) = _$ArrayTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ArrayTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ArrayTestSerializer(); +} + +class _$ArrayTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ArrayTest, _$ArrayTest]; + + @override + final String wireName = r'ArrayTest'; + + Iterable _serializeProperties( + Serializers serializers, + ArrayTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.arrayOfString != null) { + yield r'array_of_string'; + yield serializers.serialize( + object.arrayOfString, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); + } + if (object.arrayArrayOfInteger != null) { + yield r'array_array_of_integer'; + yield serializers.serialize( + object.arrayArrayOfInteger, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + ); + } + if (object.arrayArrayOfModel != null) { + yield r'array_array_of_model'; + yield serializers.serialize( + object.arrayArrayOfModel, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ArrayTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ArrayTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'array_of_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ) as BuiltList; + result.arrayOfString.replace(valueDes); + break; + case r'array_array_of_integer': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + ) as BuiltList>; + result.arrayArrayOfInteger.replace(valueDes); + break; + case r'array_array_of_model': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + ) as BuiltList>; + result.arrayArrayOfModel.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ArrayTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ArrayTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/banana.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/banana.dart new file mode 100644 index 000000000000..bf2d632ee114 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/banana.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'banana.g.dart'; + +/// Banana +/// +/// Properties: +/// * [count] +@BuiltValue() +abstract class Banana implements Built { + @BuiltValueField(wireName: r'count') + num? get count; + + Banana._(); + + factory Banana([void updates(BananaBuilder b)]) = _$Banana; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BananaBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BananaSerializer(); +} + +class _$BananaSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Banana, _$Banana]; + + @override + final String wireName = r'Banana'; + + Iterable _serializeProperties( + Serializers serializers, + Banana object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.count != null) { + yield r'count'; + yield serializers.serialize( + object.count, + specifiedType: const FullType(num), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Banana object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BananaBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'count': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.count = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Banana deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BananaBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar.dart new file mode 100644 index 000000000000..cb769550b4f2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar.dart @@ -0,0 +1,219 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'bar.g.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 +@BuiltValue() +abstract class Bar implements Entity, Built { + @BuiltValueField(wireName: r'foo') + FooRefOrValue? get foo; + + @BuiltValueField(wireName: r'fooPropB') + String? get fooPropB; + + @BuiltValueField(wireName: r'barPropA') + String? get barPropA; + + Bar._(); + + factory Bar([void updates(BarBuilder b)]) = _$Bar; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarSerializer(); +} + +class _$BarSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Bar, _$Bar]; + + @override + final String wireName = r'Bar'; + + Iterable _serializeProperties( + Serializers serializers, + Bar object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.foo != null) { + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(FooRefOrValue), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.fooPropB != null) { + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + if (object.barPropA != null) { + yield r'barPropA'; + yield serializers.serialize( + object.barPropA, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Bar object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BarBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'foo': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(FooRefOrValue), + ) as FooRefOrValue; + result.foo.replace(valueDes); + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'fooPropB': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropB = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + case r'barPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.barPropA = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Bar deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_create.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_create.dart new file mode 100644 index 000000000000..8942b6433f5e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_create.dart @@ -0,0 +1,219 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'bar_create.g.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 +@BuiltValue() +abstract class BarCreate implements Entity, Built { + @BuiltValueField(wireName: r'foo') + FooRefOrValue? get foo; + + @BuiltValueField(wireName: r'fooPropB') + String? get fooPropB; + + @BuiltValueField(wireName: r'barPropA') + String? get barPropA; + + BarCreate._(); + + factory BarCreate([void updates(BarCreateBuilder b)]) = _$BarCreate; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarCreateBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarCreateSerializer(); +} + +class _$BarCreateSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [BarCreate, _$BarCreate]; + + @override + final String wireName = r'BarCreate'; + + Iterable _serializeProperties( + Serializers serializers, + BarCreate object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.foo != null) { + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(FooRefOrValue), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.fooPropB != null) { + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + if (object.barPropA != null) { + yield r'barPropA'; + yield serializers.serialize( + object.barPropA, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + BarCreate object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BarCreateBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'foo': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(FooRefOrValue), + ) as FooRefOrValue; + result.foo.replace(valueDes); + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'fooPropB': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropB = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + case r'barPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.barPropA = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + BarCreate deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarCreateBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref.dart new file mode 100644 index 000000000000..2b9d2727a448 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref.dart @@ -0,0 +1,192 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'bar_ref.g.dart'; + +/// BarRef +/// +/// 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 +@BuiltValue() +abstract class BarRef implements EntityRef, Built { + BarRef._(); + + factory BarRef([void updates(BarRefBuilder b)]) = _$BarRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarRefBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarRefSerializer(); +} + +class _$BarRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [BarRef, _$BarRef]; + + @override + final String wireName = r'BarRef'; + + Iterable _serializeProperties( + Serializers serializers, + BarRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atReferredType != null) { + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + BarRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BarRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@referredType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atReferredType = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + BarRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref_or_value.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref_or_value.dart new file mode 100644 index 000000000000..4af61384ab76 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref_or_value.dart @@ -0,0 +1,129 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'bar_ref_or_value.g.dart'; + +/// BarRefOrValue +/// +/// 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 +@BuiltValue() +abstract class BarRefOrValue implements Built { + /// One Of [Bar], [BarRef] + OneOf get oneOf; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'Bar': Bar, + r'BarRef': BarRef, + }; + + BarRefOrValue._(); + + factory BarRefOrValue([void updates(BarRefOrValueBuilder b)]) = _$BarRefOrValue; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarRefOrValueBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarRefOrValueSerializer(); +} + +extension BarRefOrValueDiscriminatorExt on BarRefOrValue { + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; + } + if (this is BarRef) { + return r'BarRef'; + } + return null; + } +} +extension BarRefOrValueBuilderDiscriminatorExt on BarRefOrValueBuilder { + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarRefBuilder) { + return r'BarRef'; + } + return null; + } +} + +class _$BarRefOrValueSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [BarRefOrValue, _$BarRefOrValue]; + + @override + final String wireName = r'BarRefOrValue'; + + Iterable _serializeProperties( + Serializers serializers, + BarRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + BarRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + BarRefOrValue deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarRefOrValueBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [Bar, BarRef, ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'Bar': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(Bar), + ) as Bar; + oneOfType = Bar; + break; + case r'BarRef': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(BarRef), + ) as BarRef; + oneOfType = BarRef; + break; + default: + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/capitalization.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/capitalization.dart new file mode 100644 index 000000000000..75827b9a429e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/capitalization.dart @@ -0,0 +1,199 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'capitalization.g.dart'; + +/// Capitalization +/// +/// Properties: +/// * [smallCamel] +/// * [capitalCamel] +/// * [smallSnake] +/// * [capitalSnake] +/// * [sCAETHFlowPoints] +/// * [ATT_NAME] - Name of the pet +@BuiltValue() +abstract class Capitalization implements Built { + @BuiltValueField(wireName: r'smallCamel') + String? get smallCamel; + + @BuiltValueField(wireName: r'CapitalCamel') + String? get capitalCamel; + + @BuiltValueField(wireName: r'small_Snake') + String? get smallSnake; + + @BuiltValueField(wireName: r'Capital_Snake') + String? get capitalSnake; + + @BuiltValueField(wireName: r'SCA_ETH_Flow_Points') + String? get sCAETHFlowPoints; + + /// Name of the pet + @BuiltValueField(wireName: r'ATT_NAME') + String? get ATT_NAME; + + Capitalization._(); + + factory Capitalization([void updates(CapitalizationBuilder b)]) = _$Capitalization; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(CapitalizationBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CapitalizationSerializer(); +} + +class _$CapitalizationSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Capitalization, _$Capitalization]; + + @override + final String wireName = r'Capitalization'; + + Iterable _serializeProperties( + Serializers serializers, + Capitalization object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.smallCamel != null) { + yield r'smallCamel'; + yield serializers.serialize( + object.smallCamel, + specifiedType: const FullType(String), + ); + } + if (object.capitalCamel != null) { + yield r'CapitalCamel'; + yield serializers.serialize( + object.capitalCamel, + specifiedType: const FullType(String), + ); + } + if (object.smallSnake != null) { + yield r'small_Snake'; + yield serializers.serialize( + object.smallSnake, + specifiedType: const FullType(String), + ); + } + if (object.capitalSnake != null) { + yield r'Capital_Snake'; + yield serializers.serialize( + object.capitalSnake, + specifiedType: const FullType(String), + ); + } + if (object.sCAETHFlowPoints != null) { + yield r'SCA_ETH_Flow_Points'; + yield serializers.serialize( + object.sCAETHFlowPoints, + specifiedType: const FullType(String), + ); + } + if (object.ATT_NAME != null) { + yield r'ATT_NAME'; + yield serializers.serialize( + object.ATT_NAME, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Capitalization object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CapitalizationBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'smallCamel': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.smallCamel = valueDes; + break; + case r'CapitalCamel': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.capitalCamel = valueDes; + break; + case r'small_Snake': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.smallSnake = valueDes; + break; + case r'Capital_Snake': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.capitalSnake = valueDes; + break; + case r'SCA_ETH_Flow_Points': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.sCAETHFlowPoints = valueDes; + break; + case r'ATT_NAME': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.ATT_NAME = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Capitalization deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = CapitalizationBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat.dart new file mode 100644 index 000000000000..23d19b38b05a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat.dart @@ -0,0 +1,136 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:openapi/src/model/cat_all_of.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'cat.g.dart'; + +/// Cat +/// +/// Properties: +/// * [className] +/// * [color] +/// * [declawed] +@BuiltValue() +abstract class Cat implements Animal, CatAllOf, Built { + Cat._(); + + factory Cat([void updates(CatBuilder b)]) = _$Cat; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(CatBuilder b) => b..className=b.discriminatorValue + ..color = 'red'; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CatSerializer(); +} + +class _$CatSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Cat, _$Cat]; + + @override + final String wireName = r'Cat'; + + Iterable _serializeProperties( + Serializers serializers, + Cat object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'className'; + yield serializers.serialize( + object.className, + specifiedType: const FullType(String), + ); + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + if (object.declawed != null) { + yield r'declawed'; + yield serializers.serialize( + object.declawed, + specifiedType: const FullType(bool), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Cat object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CatBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'className': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.className = valueDes; + break; + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + case r'declawed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.declawed = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Cat deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = CatBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat_all_of.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat_all_of.dart new file mode 100644 index 000000000000..02d9cce0cae1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat_all_of.dart @@ -0,0 +1,141 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'cat_all_of.g.dart'; + +/// CatAllOf +/// +/// Properties: +/// * [declawed] +@BuiltValue(instantiable: false) +abstract class CatAllOf { + @BuiltValueField(wireName: r'declawed') + bool? get declawed; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CatAllOfSerializer(); +} + +class _$CatAllOfSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [CatAllOf]; + + @override + final String wireName = r'CatAllOf'; + + Iterable _serializeProperties( + Serializers serializers, + CatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.declawed != null) { + yield r'declawed'; + yield serializers.serialize( + object.declawed, + specifiedType: const FullType(bool), + ); + } + } + + @override + Object serialize( + Serializers serializers, + CatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + CatAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($CatAllOf)) as $CatAllOf; + } +} + +/// a concrete implementation of [CatAllOf], since [CatAllOf] is not instantiable +@BuiltValue(instantiable: true) +abstract class $CatAllOf implements CatAllOf, Built<$CatAllOf, $CatAllOfBuilder> { + $CatAllOf._(); + + factory $CatAllOf([void Function($CatAllOfBuilder)? updates]) = _$$CatAllOf; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($CatAllOfBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$CatAllOf> get serializer => _$$CatAllOfSerializer(); +} + +class _$$CatAllOfSerializer implements PrimitiveSerializer<$CatAllOf> { + @override + final Iterable types = const [$CatAllOf, _$$CatAllOf]; + + @override + final String wireName = r'$CatAllOf'; + + @override + Object serialize( + Serializers serializers, + $CatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(CatAllOf))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CatAllOfBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'declawed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.declawed = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $CatAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $CatAllOfBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/category.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/category.dart new file mode 100644 index 000000000000..b2be985a8507 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/category.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'category.g.dart'; + +/// Category +/// +/// Properties: +/// * [id] +/// * [name] +@BuiltValue() +abstract class Category implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'name') + String? get name; + + Category._(); + + factory Category([void updates(CategoryBuilder b)]) = _$Category; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(CategoryBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CategorySerializer(); +} + +class _$CategorySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Category, _$Category]; + + @override + final String wireName = r'Category'; + + Iterable _serializeProperties( + Serializers serializers, + Category object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Category object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CategoryBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Category deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = CategoryBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/child.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/child.dart new file mode 100644 index 000000000000..987b52ca7240 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/child.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'child.g.dart'; + +/// Child +/// +/// Properties: +/// * [name] +@BuiltValue() +abstract class Child implements Built { + @BuiltValueField(wireName: r'name') + String? get name; + + Child._(); + + factory Child([void updates(ChildBuilder b)]) = _$Child; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ChildBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ChildSerializer(); +} + +class _$ChildSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Child, _$Child]; + + @override + final String wireName = r'Child'; + + Iterable _serializeProperties( + Serializers serializers, + Child object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Child object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ChildBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Child deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ChildBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/class_model.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/class_model.dart new file mode 100644 index 000000000000..51166943c6cd --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/class_model.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'class_model.g.dart'; + +/// Model for testing model with \"_class\" property +/// +/// Properties: +/// * [classField] +@BuiltValue() +abstract class ClassModel implements Built { + @BuiltValueField(wireName: r'_class') + String? get classField; + + ClassModel._(); + + factory ClassModel([void updates(ClassModelBuilder b)]) = _$ClassModel; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ClassModelBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ClassModelSerializer(); +} + +class _$ClassModelSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ClassModel, _$ClassModel]; + + @override + final String wireName = r'ClassModel'; + + Iterable _serializeProperties( + Serializers serializers, + ClassModel object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.classField != null) { + yield r'_class'; + yield serializers.serialize( + object.classField, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ClassModel object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ClassModelBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'_class': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.classField = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ClassModel deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ClassModelBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/date.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/date.dart new file mode 100644 index 000000000000..b21c7f544bee --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/date.dart @@ -0,0 +1,70 @@ +/// A gregorian calendar date generated by +/// OpenAPI generator to differentiate +/// between [DateTime] and [Date] formats. +class Date implements Comparable { + final int year; + + /// January is 1. + final int month; + + /// First day is 1. + final int day; + + Date(this.year, this.month, this.day); + + /// The current date + static Date now({bool utc = false}) { + var now = DateTime.now(); + if (utc) { + now = now.toUtc(); + } + return now.toDate(); + } + + /// Convert to a [DateTime]. + DateTime toDateTime({bool utc = false}) { + if (utc) { + return DateTime.utc(year, month, day); + } else { + return DateTime(year, month, day); + } + } + + @override + int compareTo(Date other) { + int d = year.compareTo(other.year); + if (d != 0) { + return d; + } + d = month.compareTo(other.month); + if (d != 0) { + return d; + } + return day.compareTo(other.day); + } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Date && + runtimeType == other.runtimeType && + year == other.year && + month == other.month && + day == other.day; + + @override + int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; + + @override + String toString() { + final yyyy = year.toString(); + final mm = month.toString().padLeft(2, '0'); + final dd = day.toString().padLeft(2, '0'); + + return '$yyyy-$mm-$dd'; + } +} + +extension DateTimeToDate on DateTime { + Date toDate() => Date(year, month, day); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/deprecated_object.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/deprecated_object.dart new file mode 100644 index 000000000000..91d0b428e9bb --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/deprecated_object.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'deprecated_object.g.dart'; + +/// DeprecatedObject +/// +/// Properties: +/// * [name] +@BuiltValue() +abstract class DeprecatedObject implements Built { + @BuiltValueField(wireName: r'name') + String? get name; + + DeprecatedObject._(); + + factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = _$DeprecatedObject; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(DeprecatedObjectBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$DeprecatedObjectSerializer(); +} + +class _$DeprecatedObjectSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [DeprecatedObject, _$DeprecatedObject]; + + @override + final String wireName = r'DeprecatedObject'; + + Iterable _serializeProperties( + Serializers serializers, + DeprecatedObject object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + DeprecatedObject object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DeprecatedObjectBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + DeprecatedObject deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = DeprecatedObjectBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog.dart new file mode 100644 index 000000000000..4d9974f25b1d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog.dart @@ -0,0 +1,136 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/dog_all_of.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'dog.g.dart'; + +/// Dog +/// +/// Properties: +/// * [className] +/// * [color] +/// * [breed] +@BuiltValue() +abstract class Dog implements Animal, DogAllOf, Built { + Dog._(); + + factory Dog([void updates(DogBuilder b)]) = _$Dog; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(DogBuilder b) => b..className=b.discriminatorValue + ..color = 'red'; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$DogSerializer(); +} + +class _$DogSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Dog, _$Dog]; + + @override + final String wireName = r'Dog'; + + Iterable _serializeProperties( + Serializers serializers, + Dog object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'className'; + yield serializers.serialize( + object.className, + specifiedType: const FullType(String), + ); + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + if (object.breed != null) { + yield r'breed'; + yield serializers.serialize( + object.breed, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Dog object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DogBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'className': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.className = valueDes; + break; + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + case r'breed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.breed = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Dog deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = DogBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog_all_of.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog_all_of.dart new file mode 100644 index 000000000000..bd52567fa60a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog_all_of.dart @@ -0,0 +1,141 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'dog_all_of.g.dart'; + +/// DogAllOf +/// +/// Properties: +/// * [breed] +@BuiltValue(instantiable: false) +abstract class DogAllOf { + @BuiltValueField(wireName: r'breed') + String? get breed; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$DogAllOfSerializer(); +} + +class _$DogAllOfSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [DogAllOf]; + + @override + final String wireName = r'DogAllOf'; + + Iterable _serializeProperties( + Serializers serializers, + DogAllOf object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.breed != null) { + yield r'breed'; + yield serializers.serialize( + object.breed, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + DogAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + DogAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($DogAllOf)) as $DogAllOf; + } +} + +/// a concrete implementation of [DogAllOf], since [DogAllOf] is not instantiable +@BuiltValue(instantiable: true) +abstract class $DogAllOf implements DogAllOf, Built<$DogAllOf, $DogAllOfBuilder> { + $DogAllOf._(); + + factory $DogAllOf([void Function($DogAllOfBuilder)? updates]) = _$$DogAllOf; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($DogAllOfBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$DogAllOf> get serializer => _$$DogAllOfSerializer(); +} + +class _$$DogAllOfSerializer implements PrimitiveSerializer<$DogAllOf> { + @override + final Iterable types = const [$DogAllOf, _$$DogAllOf]; + + @override + final String wireName = r'$DogAllOf'; + + @override + Object serialize( + Serializers serializers, + $DogAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(DogAllOf))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DogAllOfBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'breed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.breed = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $DogAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $DogAllOfBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity.dart new file mode 100644 index 000000000000..7e27fab47387 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity.dart @@ -0,0 +1,298 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/pizza.dart'; +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/pasta.dart'; +import 'package:openapi/src/model/bar_create.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'entity.g.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 +@BuiltValue(instantiable: false) +abstract class Entity implements Addressable, Extensible { + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'Bar': Bar, + r'Bar_Create': BarCreate, + r'Foo': Foo, + r'Pasta': Pasta, + r'Pizza': Pizza, + r'PizzaSpeziale': PizzaSpeziale, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EntitySerializer(); +} + +extension EntityDiscriminatorExt on Entity { + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; + } + if (this is BarCreate) { + return r'Bar_Create'; + } + if (this is Foo) { + return r'Foo'; + } + if (this is Pasta) { + return r'Pasta'; + } + if (this is Pizza) { + return r'Pizza'; + } + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; + } +} +extension EntityBuilderDiscriminatorExt on EntityBuilder { + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarCreateBuilder) { + return r'Bar_Create'; + } + if (this is FooBuilder) { + return r'Foo'; + } + if (this is PastaBuilder) { + return r'Pasta'; + } + if (this is PizzaBuilder) { + return r'Pizza'; + } + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; + } +} + +class _$EntitySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Entity]; + + @override + final String wireName = r'Entity'; + + Iterable _serializeProperties( + Serializers serializers, + Entity object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Entity object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is Bar) { + return serializers.serialize(object, specifiedType: FullType(Bar))!; + } + if (object is BarCreate) { + return serializers.serialize(object, specifiedType: FullType(BarCreate))!; + } + if (object is Foo) { + return serializers.serialize(object, specifiedType: FullType(Foo))!; + } + if (object is Pasta) { + return serializers.serialize(object, specifiedType: FullType(Pasta))!; + } + if (object is Pizza) { + return serializers.serialize(object, specifiedType: FullType(Pizza))!; + } + if (object is PizzaSpeziale) { + return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Entity deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(Entity.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'Bar': + return serializers.deserialize(serialized, specifiedType: FullType(Bar)) as Bar; + case r'Bar_Create': + return serializers.deserialize(serialized, specifiedType: FullType(BarCreate)) as BarCreate; + case r'Foo': + return serializers.deserialize(serialized, specifiedType: FullType(Foo)) as Foo; + case r'Pasta': + return serializers.deserialize(serialized, specifiedType: FullType(Pasta)) as Pasta; + case r'Pizza': + return serializers.deserialize(serialized, specifiedType: FullType(Pizza)) as Pizza; + case r'PizzaSpeziale': + return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + default: + return serializers.deserialize(serialized, specifiedType: FullType($Entity)) as $Entity; + } + } +} + +/// a concrete implementation of [Entity], since [Entity] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Entity implements Entity, Built<$Entity, $EntityBuilder> { + $Entity._(); + + factory $Entity([void Function($EntityBuilder)? updates]) = _$$Entity; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($EntityBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Entity> get serializer => _$$EntitySerializer(); +} + +class _$$EntitySerializer implements PrimitiveSerializer<$Entity> { + @override + final Iterable types = const [$Entity, _$$Entity]; + + @override + final String wireName = r'$Entity'; + + @override + Object serialize( + Serializers serializers, + $Entity object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Entity))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EntityBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Entity deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $EntityBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity_ref.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity_ref.dart new file mode 100644 index 000000000000..7502c94dd7f3 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity_ref.dart @@ -0,0 +1,284 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'entity_ref.g.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 +@BuiltValue(instantiable: false) +abstract class EntityRef implements Addressable, Extensible { + /// The actual type of the target instance when needed for disambiguation. + @BuiltValueField(wireName: r'@referredType') + String? get atReferredType; + + /// Name of the related entity. + @BuiltValueField(wireName: r'name') + String? get name; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'BarRef': BarRef, + r'FooRef': FooRef, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EntityRefSerializer(); +} + +extension EntityRefDiscriminatorExt on EntityRef { + String? get discriminatorValue { + if (this is BarRef) { + return r'BarRef'; + } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } +} +extension EntityRefBuilderDiscriminatorExt on EntityRefBuilder { + String? get discriminatorValue { + if (this is BarRefBuilder) { + return r'BarRef'; + } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; + } +} + +class _$EntityRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [EntityRef]; + + @override + final String wireName = r'EntityRef'; + + Iterable _serializeProperties( + Serializers serializers, + EntityRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atReferredType != null) { + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + EntityRef object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is BarRef) { + return serializers.serialize(object, specifiedType: FullType(BarRef))!; + } + if (object is FooRef) { + return serializers.serialize(object, specifiedType: FullType(FooRef))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + EntityRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'BarRef': + return serializers.deserialize(serialized, specifiedType: FullType(BarRef)) as BarRef; + case r'FooRef': + return serializers.deserialize(serialized, specifiedType: FullType(FooRef)) as FooRef; + default: + return serializers.deserialize(serialized, specifiedType: FullType($EntityRef)) as $EntityRef; + } + } +} + +/// a concrete implementation of [EntityRef], since [EntityRef] is not instantiable +@BuiltValue(instantiable: true) +abstract class $EntityRef implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { + $EntityRef._(); + + factory $EntityRef([void Function($EntityRefBuilder)? updates]) = _$$EntityRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($EntityRefBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$EntityRef> get serializer => _$$EntityRefSerializer(); +} + +class _$$EntityRefSerializer implements PrimitiveSerializer<$EntityRef> { + @override + final Iterable types = const [$EntityRef, _$$EntityRef]; + + @override + final String wireName = r'$EntityRef'; + + @override + Object serialize( + Serializers serializers, + $EntityRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(EntityRef))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EntityRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@referredType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atReferredType = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $EntityRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $EntityRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_arrays.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_arrays.dart new file mode 100644 index 000000000000..b79a175e833c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_arrays.dart @@ -0,0 +1,163 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'enum_arrays.g.dart'; + +/// EnumArrays +/// +/// Properties: +/// * [justSymbol] +/// * [arrayEnum] +@BuiltValue() +abstract class EnumArrays implements Built { + @BuiltValueField(wireName: r'just_symbol') + EnumArraysJustSymbolEnum? get justSymbol; + // enum justSymbolEnum { >=, $, }; + + @BuiltValueField(wireName: r'array_enum') + BuiltList? get arrayEnum; + // enum arrayEnumEnum { fish, crab, }; + + EnumArrays._(); + + factory EnumArrays([void updates(EnumArraysBuilder b)]) = _$EnumArrays; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(EnumArraysBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EnumArraysSerializer(); +} + +class _$EnumArraysSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [EnumArrays, _$EnumArrays]; + + @override + final String wireName = r'EnumArrays'; + + Iterable _serializeProperties( + Serializers serializers, + EnumArrays object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.justSymbol != null) { + yield r'just_symbol'; + yield serializers.serialize( + object.justSymbol, + specifiedType: const FullType(EnumArraysJustSymbolEnum), + ); + } + if (object.arrayEnum != null) { + yield r'array_enum'; + yield serializers.serialize( + object.arrayEnum, + specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + EnumArrays object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EnumArraysBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'just_symbol': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumArraysJustSymbolEnum), + ) as EnumArraysJustSymbolEnum; + result.justSymbol = valueDes; + break; + case r'array_enum': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + ) as BuiltList; + result.arrayEnum.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + EnumArrays deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = EnumArraysBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class EnumArraysJustSymbolEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'>=') + static const EnumArraysJustSymbolEnum greaterThanEqual = _$enumArraysJustSymbolEnum_greaterThanEqual; + @BuiltValueEnumConst(wireName: r'$') + static const EnumArraysJustSymbolEnum dollar = _$enumArraysJustSymbolEnum_dollar; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = _$enumArraysJustSymbolEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumArraysJustSymbolEnumSerializer; + + const EnumArraysJustSymbolEnum._(String name): super(name); + + static BuiltSet get values => _$enumArraysJustSymbolEnumValues; + static EnumArraysJustSymbolEnum valueOf(String name) => _$enumArraysJustSymbolEnumValueOf(name); +} + +class EnumArraysArrayEnumEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'fish') + static const EnumArraysArrayEnumEnum fish = _$enumArraysArrayEnumEnum_fish; + @BuiltValueEnumConst(wireName: r'crab') + static const EnumArraysArrayEnumEnum crab = _$enumArraysArrayEnumEnum_crab; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = _$enumArraysArrayEnumEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumArraysArrayEnumEnumSerializer; + + const EnumArraysArrayEnumEnum._(String name): super(name); + + static BuiltSet get values => _$enumArraysArrayEnumEnumValues; + static EnumArraysArrayEnumEnum valueOf(String name) => _$enumArraysArrayEnumEnumValueOf(name); +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_test.dart new file mode 100644 index 000000000000..831f5b9d6d2d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_test.dart @@ -0,0 +1,318 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'enum_test.g.dart'; + +/// EnumTest +/// +/// Properties: +/// * [enumString] +/// * [enumStringRequired] +/// * [enumInteger] +/// * [enumNumber] +/// * [outerEnum] +/// * [outerEnumInteger] +/// * [outerEnumDefaultValue] +/// * [outerEnumIntegerDefaultValue] +@BuiltValue() +abstract class EnumTest implements Built { + @BuiltValueField(wireName: r'enum_string') + EnumTestEnumStringEnum? get enumString; + // enum enumStringEnum { UPPER, lower, , }; + + @BuiltValueField(wireName: r'enum_string_required') + EnumTestEnumStringRequiredEnum get enumStringRequired; + // enum enumStringRequiredEnum { UPPER, lower, , }; + + @BuiltValueField(wireName: r'enum_integer') + EnumTestEnumIntegerEnum? get enumInteger; + // enum enumIntegerEnum { 1, -1, }; + + @BuiltValueField(wireName: r'enum_number') + EnumTestEnumNumberEnum? get enumNumber; + // enum enumNumberEnum { 1.1, -1.2, }; + + @BuiltValueField(wireName: r'outerEnum') + OuterEnum? get outerEnum; + // enum outerEnumEnum { placed, approved, delivered, }; + + @BuiltValueField(wireName: r'outerEnumInteger') + OuterEnumInteger? get outerEnumInteger; + // enum outerEnumIntegerEnum { 0, 1, 2, }; + + @BuiltValueField(wireName: r'outerEnumDefaultValue') + OuterEnumDefaultValue? get outerEnumDefaultValue; + // enum outerEnumDefaultValueEnum { placed, approved, delivered, }; + + @BuiltValueField(wireName: r'outerEnumIntegerDefaultValue') + OuterEnumIntegerDefaultValue? get outerEnumIntegerDefaultValue; + // enum outerEnumIntegerDefaultValueEnum { 0, 1, 2, }; + + EnumTest._(); + + factory EnumTest([void updates(EnumTestBuilder b)]) = _$EnumTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(EnumTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EnumTestSerializer(); +} + +class _$EnumTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [EnumTest, _$EnumTest]; + + @override + final String wireName = r'EnumTest'; + + Iterable _serializeProperties( + Serializers serializers, + EnumTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.enumString != null) { + yield r'enum_string'; + yield serializers.serialize( + object.enumString, + specifiedType: const FullType(EnumTestEnumStringEnum), + ); + } + yield r'enum_string_required'; + yield serializers.serialize( + object.enumStringRequired, + specifiedType: const FullType(EnumTestEnumStringRequiredEnum), + ); + if (object.enumInteger != null) { + yield r'enum_integer'; + yield serializers.serialize( + object.enumInteger, + specifiedType: const FullType(EnumTestEnumIntegerEnum), + ); + } + if (object.enumNumber != null) { + yield r'enum_number'; + yield serializers.serialize( + object.enumNumber, + specifiedType: const FullType(EnumTestEnumNumberEnum), + ); + } + if (object.outerEnum != null) { + yield r'outerEnum'; + yield serializers.serialize( + object.outerEnum, + specifiedType: const FullType.nullable(OuterEnum), + ); + } + if (object.outerEnumInteger != null) { + yield r'outerEnumInteger'; + yield serializers.serialize( + object.outerEnumInteger, + specifiedType: const FullType(OuterEnumInteger), + ); + } + if (object.outerEnumDefaultValue != null) { + yield r'outerEnumDefaultValue'; + yield serializers.serialize( + object.outerEnumDefaultValue, + specifiedType: const FullType(OuterEnumDefaultValue), + ); + } + if (object.outerEnumIntegerDefaultValue != null) { + yield r'outerEnumIntegerDefaultValue'; + yield serializers.serialize( + object.outerEnumIntegerDefaultValue, + specifiedType: const FullType(OuterEnumIntegerDefaultValue), + ); + } + } + + @override + Object serialize( + Serializers serializers, + EnumTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EnumTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'enum_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumStringEnum), + ) as EnumTestEnumStringEnum; + result.enumString = valueDes; + break; + case r'enum_string_required': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumStringRequiredEnum), + ) as EnumTestEnumStringRequiredEnum; + result.enumStringRequired = valueDes; + break; + case r'enum_integer': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumIntegerEnum), + ) as EnumTestEnumIntegerEnum; + result.enumInteger = valueDes; + break; + case r'enum_number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumNumberEnum), + ) as EnumTestEnumNumberEnum; + result.enumNumber = valueDes; + break; + case r'outerEnum': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(OuterEnum), + ) as OuterEnum?; + if (valueDes == null) continue; + result.outerEnum = valueDes; + break; + case r'outerEnumInteger': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumInteger), + ) as OuterEnumInteger; + result.outerEnumInteger = valueDes; + break; + case r'outerEnumDefaultValue': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumDefaultValue), + ) as OuterEnumDefaultValue; + result.outerEnumDefaultValue = valueDes; + break; + case r'outerEnumIntegerDefaultValue': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumIntegerDefaultValue), + ) as OuterEnumIntegerDefaultValue; + result.outerEnumIntegerDefaultValue = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + EnumTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = EnumTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class EnumTestEnumStringEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'UPPER') + static const EnumTestEnumStringEnum UPPER = _$enumTestEnumStringEnum_UPPER; + @BuiltValueEnumConst(wireName: r'lower') + static const EnumTestEnumStringEnum lower = _$enumTestEnumStringEnum_lower; + @BuiltValueEnumConst(wireName: r'') + static const EnumTestEnumStringEnum empty = _$enumTestEnumStringEnum_empty; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumTestEnumStringEnum unknownDefaultOpenApi = _$enumTestEnumStringEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumStringEnumSerializer; + + const EnumTestEnumStringEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumStringEnumValues; + static EnumTestEnumStringEnum valueOf(String name) => _$enumTestEnumStringEnumValueOf(name); +} + +class EnumTestEnumStringRequiredEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'UPPER') + static const EnumTestEnumStringRequiredEnum UPPER = _$enumTestEnumStringRequiredEnum_UPPER; + @BuiltValueEnumConst(wireName: r'lower') + static const EnumTestEnumStringRequiredEnum lower = _$enumTestEnumStringRequiredEnum_lower; + @BuiltValueEnumConst(wireName: r'') + static const EnumTestEnumStringRequiredEnum empty = _$enumTestEnumStringRequiredEnum_empty; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumStringRequiredEnumSerializer; + + const EnumTestEnumStringRequiredEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumStringRequiredEnumValues; + static EnumTestEnumStringRequiredEnum valueOf(String name) => _$enumTestEnumStringRequiredEnumValueOf(name); +} + +class EnumTestEnumIntegerEnum extends EnumClass { + + @BuiltValueEnumConst(wireNumber: 1) + static const EnumTestEnumIntegerEnum number1 = _$enumTestEnumIntegerEnum_number1; + @BuiltValueEnumConst(wireNumber: -1) + static const EnumTestEnumIntegerEnum numberNegative1 = _$enumTestEnumIntegerEnum_numberNegative1; + @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) + static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = _$enumTestEnumIntegerEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumIntegerEnumSerializer; + + const EnumTestEnumIntegerEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumIntegerEnumValues; + static EnumTestEnumIntegerEnum valueOf(String name) => _$enumTestEnumIntegerEnumValueOf(name); +} + +class EnumTestEnumNumberEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'1.1') + static const EnumTestEnumNumberEnum number1Period1 = _$enumTestEnumNumberEnum_number1Period1; + @BuiltValueEnumConst(wireName: r'-1.2') + static const EnumTestEnumNumberEnum numberNegative1Period2 = _$enumTestEnumNumberEnum_numberNegative1Period2; + @BuiltValueEnumConst(wireName: r'11184809', fallback: true) + static const EnumTestEnumNumberEnum unknownDefaultOpenApi = _$enumTestEnumNumberEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumNumberEnumSerializer; + + const EnumTestEnumNumberEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumNumberEnumValues; + static EnumTestEnumNumberEnum valueOf(String name) => _$enumTestEnumNumberEnumValueOf(name); +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example.dart new file mode 100644 index 000000000000..799b77e4e178 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/child.dart'; +import 'dart:core'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'example.g.dart'; + +/// Example +/// +/// Properties: +/// * [name] +@BuiltValue() +abstract class Example implements Built { + /// One Of [Child], [int] + OneOf get oneOf; + + Example._(); + + factory Example([void updates(ExampleBuilder b)]) = _$Example; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ExampleBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ExampleSerializer(); +} + +class _$ExampleSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Example, _$Example]; + + @override + final String wireName = r'Example'; + + Iterable _serializeProperties( + Serializers serializers, + Example object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + Example object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + Example deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ExampleBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [FullType(Child), FullType(int), ]); + oneOfDataSrc = serialized; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example_non_primitive.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example_non_primitive.dart new file mode 100644 index 000000000000..b12eea1f234d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example_non_primitive.dart @@ -0,0 +1,68 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'dart:core'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'example_non_primitive.g.dart'; + +/// ExampleNonPrimitive +@BuiltValue() +abstract class ExampleNonPrimitive implements Built { + /// One Of [DateTime], [String], [int], [num] + OneOf get oneOf; + + ExampleNonPrimitive._(); + + factory ExampleNonPrimitive([void updates(ExampleNonPrimitiveBuilder b)]) = _$ExampleNonPrimitive; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ExampleNonPrimitiveBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ExampleNonPrimitiveSerializer(); +} + +class _$ExampleNonPrimitiveSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ExampleNonPrimitive, _$ExampleNonPrimitive]; + + @override + final String wireName = r'ExampleNonPrimitive'; + + Iterable _serializeProperties( + Serializers serializers, + ExampleNonPrimitive object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + ExampleNonPrimitive object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + ExampleNonPrimitive deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ExampleNonPrimitiveBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [FullType(String), FullType(DateTime), FullType(int), FullType(num), ]); + oneOfDataSrc = serialized; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/extensible.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/extensible.dart new file mode 100644 index 000000000000..2423fb276412 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/extensible.dart @@ -0,0 +1,178 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'extensible.g.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 +@BuiltValue(instantiable: false) +abstract class Extensible { + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @BuiltValueField(wireName: r'@schemaLocation') + String? get atSchemaLocation; + + /// When sub-classing, this defines the super-class + @BuiltValueField(wireName: r'@baseType') + String? get atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @BuiltValueField(wireName: r'@type') + String get atType; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ExtensibleSerializer(); +} + +class _$ExtensibleSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Extensible]; + + @override + final String wireName = r'Extensible'; + + Iterable _serializeProperties( + Serializers serializers, + Extensible object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Extensible object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Extensible deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($Extensible)) as $Extensible; + } +} + +/// a concrete implementation of [Extensible], since [Extensible] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Extensible implements Extensible, Built<$Extensible, $ExtensibleBuilder> { + $Extensible._(); + + factory $Extensible([void Function($ExtensibleBuilder)? updates]) = _$$Extensible; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($ExtensibleBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Extensible> get serializer => _$$ExtensibleSerializer(); +} + +class _$$ExtensibleSerializer implements PrimitiveSerializer<$Extensible> { + @override + final Iterable types = const [$Extensible, _$$Extensible]; + + @override + final String wireName = r'$Extensible'; + + @override + Object serialize( + Serializers serializers, + $Extensible object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Extensible))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ExtensibleBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Extensible deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $ExtensibleBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/file_schema_test_class.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/file_schema_test_class.dart new file mode 100644 index 000000000000..5ab41d14f437 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/file_schema_test_class.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/model_file.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'file_schema_test_class.g.dart'; + +/// FileSchemaTestClass +/// +/// Properties: +/// * [file] +/// * [files] +@BuiltValue() +abstract class FileSchemaTestClass implements Built { + @BuiltValueField(wireName: r'file') + ModelFile? get file; + + @BuiltValueField(wireName: r'files') + BuiltList? get files; + + FileSchemaTestClass._(); + + factory FileSchemaTestClass([void updates(FileSchemaTestClassBuilder b)]) = _$FileSchemaTestClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FileSchemaTestClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FileSchemaTestClassSerializer(); +} + +class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FileSchemaTestClass, _$FileSchemaTestClass]; + + @override + final String wireName = r'FileSchemaTestClass'; + + Iterable _serializeProperties( + Serializers serializers, + FileSchemaTestClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.file != null) { + yield r'file'; + yield serializers.serialize( + object.file, + specifiedType: const FullType(ModelFile), + ); + } + if (object.files != null) { + yield r'files'; + yield serializers.serialize( + object.files, + specifiedType: const FullType(BuiltList, [FullType(ModelFile)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + FileSchemaTestClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FileSchemaTestClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'file': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(ModelFile), + ) as ModelFile; + result.file.replace(valueDes); + break; + case r'files': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(ModelFile)]), + ) as BuiltList; + result.files.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FileSchemaTestClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FileSchemaTestClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo.dart new file mode 100644 index 000000000000..d2e1f5817f20 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo.dart @@ -0,0 +1,200 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'foo.g.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 +@BuiltValue() +abstract class Foo implements Entity, Built { + @BuiltValueField(wireName: r'fooPropA') + String? get fooPropA; + + @BuiltValueField(wireName: r'fooPropB') + String? get fooPropB; + + Foo._(); + + factory Foo([void updates(FooBuilder b)]) = _$Foo; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FooBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FooSerializer(); +} + +class _$FooSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Foo, _$Foo]; + + @override + final String wireName = r'Foo'; + + Iterable _serializeProperties( + Serializers serializers, + Foo object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.fooPropA != null) { + yield r'fooPropA'; + yield serializers.serialize( + object.fooPropA, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.fooPropB != null) { + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Foo object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FooBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'fooPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropA = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'fooPropB': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropB = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Foo deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FooBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref.dart new file mode 100644 index 000000000000..1f77d990f0e8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref.dart @@ -0,0 +1,210 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'foo_ref.g.dart'; + +/// FooRef +/// +/// Properties: +/// * [foorefPropA] +/// * [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 +@BuiltValue() +abstract class FooRef implements EntityRef, Built { + @BuiltValueField(wireName: r'foorefPropA') + String? get foorefPropA; + + FooRef._(); + + factory FooRef([void updates(FooRefBuilder b)]) = _$FooRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FooRefBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FooRefSerializer(); +} + +class _$FooRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FooRef, _$FooRef]; + + @override + final String wireName = r'FooRef'; + + Iterable _serializeProperties( + Serializers serializers, + FooRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atReferredType != null) { + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); + } + if (object.foorefPropA != null) { + yield r'foorefPropA'; + yield serializers.serialize( + object.foorefPropA, + specifiedType: const FullType(String), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + FooRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FooRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@referredType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atReferredType = valueDes; + break; + case r'foorefPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.foorefPropA = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FooRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FooRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref_or_value.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref_or_value.dart new file mode 100644 index 000000000000..af3e4875d9d6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref_or_value.dart @@ -0,0 +1,129 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'foo_ref_or_value.g.dart'; + +/// FooRefOrValue +/// +/// 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 +@BuiltValue() +abstract class FooRefOrValue implements Built { + /// One Of [Foo], [FooRef] + OneOf get oneOf; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'Foo': Foo, + r'FooRef': FooRef, + }; + + FooRefOrValue._(); + + factory FooRefOrValue([void updates(FooRefOrValueBuilder b)]) = _$FooRefOrValue; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FooRefOrValueBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FooRefOrValueSerializer(); +} + +extension FooRefOrValueDiscriminatorExt on FooRefOrValue { + String? get discriminatorValue { + if (this is Foo) { + return r'Foo'; + } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } +} +extension FooRefOrValueBuilderDiscriminatorExt on FooRefOrValueBuilder { + String? get discriminatorValue { + if (this is FooBuilder) { + return r'Foo'; + } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; + } +} + +class _$FooRefOrValueSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FooRefOrValue, _$FooRefOrValue]; + + @override + final String wireName = r'FooRefOrValue'; + + Iterable _serializeProperties( + Serializers serializers, + FooRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + FooRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + FooRefOrValue deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FooRefOrValueBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [Foo, FooRef, ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'Foo': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(Foo), + ) as Foo; + oneOfType = Foo; + break; + case r'FooRef': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(FooRef), + ) as FooRef; + oneOfType = FooRef; + break; + default: + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/format_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/format_test.dart new file mode 100644 index 000000000000..33775231476e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/format_test.dart @@ -0,0 +1,374 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'dart:typed_data'; +import 'package:openapi/src/model/date.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'format_test.g.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. +@BuiltValue() +abstract class FormatTest implements Built { + @BuiltValueField(wireName: r'integer') + int? get integer; + + @BuiltValueField(wireName: r'int32') + int? get int32; + + @BuiltValueField(wireName: r'int64') + int? get int64; + + @BuiltValueField(wireName: r'number') + num get number; + + @BuiltValueField(wireName: r'float') + double? get float; + + @BuiltValueField(wireName: r'double') + double? get double_; + + @BuiltValueField(wireName: r'decimal') + double? get decimal; + + @BuiltValueField(wireName: r'string') + String? get string; + + @BuiltValueField(wireName: r'byte') + String get byte; + + @BuiltValueField(wireName: r'binary') + Uint8List? get binary; + + @BuiltValueField(wireName: r'date') + Date get date; + + @BuiltValueField(wireName: r'dateTime') + DateTime? get dateTime; + + @BuiltValueField(wireName: r'uuid') + String? get uuid; + + @BuiltValueField(wireName: r'password') + String get password; + + /// A string that is a 10 digit number. Can have leading zeros. + @BuiltValueField(wireName: r'pattern_with_digits') + String? get patternWithDigits; + + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + @BuiltValueField(wireName: r'pattern_with_digits_and_delimiter') + String? get patternWithDigitsAndDelimiter; + + FormatTest._(); + + factory FormatTest([void updates(FormatTestBuilder b)]) = _$FormatTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FormatTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FormatTestSerializer(); +} + +class _$FormatTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FormatTest, _$FormatTest]; + + @override + final String wireName = r'FormatTest'; + + Iterable _serializeProperties( + Serializers serializers, + FormatTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.integer != null) { + yield r'integer'; + yield serializers.serialize( + object.integer, + specifiedType: const FullType(int), + ); + } + if (object.int32 != null) { + yield r'int32'; + yield serializers.serialize( + object.int32, + specifiedType: const FullType(int), + ); + } + if (object.int64 != null) { + yield r'int64'; + yield serializers.serialize( + object.int64, + specifiedType: const FullType(int), + ); + } + yield r'number'; + yield serializers.serialize( + object.number, + specifiedType: const FullType(num), + ); + if (object.float != null) { + yield r'float'; + yield serializers.serialize( + object.float, + specifiedType: const FullType(double), + ); + } + if (object.double_ != null) { + yield r'double'; + yield serializers.serialize( + object.double_, + specifiedType: const FullType(double), + ); + } + if (object.decimal != null) { + yield r'decimal'; + yield serializers.serialize( + object.decimal, + specifiedType: const FullType(double), + ); + } + if (object.string != null) { + yield r'string'; + yield serializers.serialize( + object.string, + specifiedType: const FullType(String), + ); + } + yield r'byte'; + yield serializers.serialize( + object.byte, + specifiedType: const FullType(String), + ); + if (object.binary != null) { + yield r'binary'; + yield serializers.serialize( + object.binary, + specifiedType: const FullType(Uint8List), + ); + } + yield r'date'; + yield serializers.serialize( + object.date, + specifiedType: const FullType(Date), + ); + if (object.dateTime != null) { + yield r'dateTime'; + yield serializers.serialize( + object.dateTime, + specifiedType: const FullType(DateTime), + ); + } + if (object.uuid != null) { + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); + } + yield r'password'; + yield serializers.serialize( + object.password, + specifiedType: const FullType(String), + ); + if (object.patternWithDigits != null) { + yield r'pattern_with_digits'; + yield serializers.serialize( + object.patternWithDigits, + specifiedType: const FullType(String), + ); + } + if (object.patternWithDigitsAndDelimiter != null) { + yield r'pattern_with_digits_and_delimiter'; + yield serializers.serialize( + object.patternWithDigitsAndDelimiter, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + FormatTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FormatTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'integer': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.integer = valueDes; + break; + case r'int32': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.int32 = valueDes; + break; + case r'int64': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.int64 = valueDes; + break; + case r'number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.number = valueDes; + break; + case r'float': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(double), + ) as double; + result.float = valueDes; + break; + case r'double': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(double), + ) as double; + result.double_ = valueDes; + break; + case r'decimal': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(double), + ) as double; + result.decimal = valueDes; + break; + case r'string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.string = valueDes; + break; + case r'byte': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.byte = valueDes; + break; + case r'binary': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(Uint8List), + ) as Uint8List; + result.binary = valueDes; + break; + case r'date': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(Date), + ) as Date; + result.date = valueDes; + break; + case r'dateTime': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.dateTime = valueDes; + break; + case r'uuid': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.uuid = valueDes; + break; + case r'password': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.password = valueDes; + break; + case r'pattern_with_digits': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.patternWithDigits = valueDes; + break; + case r'pattern_with_digits_and_delimiter': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.patternWithDigitsAndDelimiter = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FormatTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FormatTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/fruit.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/fruit.dart new file mode 100644 index 000000000000..11f8cfa70501 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/fruit.dart @@ -0,0 +1,123 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit.g.dart'; + +/// Fruit +/// +/// Properties: +/// * [color] +/// * [kind] +/// * [count] +@BuiltValue() +abstract class Fruit implements Built { + @BuiltValueField(wireName: r'color') + String? get color; + + /// One Of [Apple], [Banana] + OneOf get oneOf; + + Fruit._(); + + factory Fruit([void updates(FruitBuilder b)]) = _$Fruit; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FruitSerializer(); +} + +class _$FruitSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Fruit, _$Fruit]; + + @override + final String wireName = r'Fruit'; + + Iterable _serializeProperties( + Serializers serializers, + Fruit object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Fruit object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); + return result; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FruitBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Fruit deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [FullType(Apple), FullType(Banana), ]); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + oneOfDataSrc = unhandled; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/has_only_read_only.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/has_only_read_only.dart new file mode 100644 index 000000000000..9683985cf198 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/has_only_read_only.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'has_only_read_only.g.dart'; + +/// HasOnlyReadOnly +/// +/// Properties: +/// * [bar] +/// * [foo] +@BuiltValue() +abstract class HasOnlyReadOnly implements Built { + @BuiltValueField(wireName: r'bar') + String? get bar; + + @BuiltValueField(wireName: r'foo') + String? get foo; + + HasOnlyReadOnly._(); + + factory HasOnlyReadOnly([void updates(HasOnlyReadOnlyBuilder b)]) = _$HasOnlyReadOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(HasOnlyReadOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$HasOnlyReadOnlySerializer(); +} + +class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [HasOnlyReadOnly, _$HasOnlyReadOnly]; + + @override + final String wireName = r'HasOnlyReadOnly'; + + Iterable _serializeProperties( + Serializers serializers, + HasOnlyReadOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.bar != null) { + yield r'bar'; + yield serializers.serialize( + object.bar, + specifiedType: const FullType(String), + ); + } + if (object.foo != null) { + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + HasOnlyReadOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required HasOnlyReadOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'bar': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.bar = valueDes; + break; + case r'foo': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.foo = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + HasOnlyReadOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = HasOnlyReadOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/health_check_result.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/health_check_result.dart new file mode 100644 index 000000000000..c092a535f2fc --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/health_check_result.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'health_check_result.g.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] +@BuiltValue() +abstract class HealthCheckResult implements Built { + @BuiltValueField(wireName: r'NullableMessage') + String? get nullableMessage; + + HealthCheckResult._(); + + factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = _$HealthCheckResult; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(HealthCheckResultBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$HealthCheckResultSerializer(); +} + +class _$HealthCheckResultSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [HealthCheckResult, _$HealthCheckResult]; + + @override + final String wireName = r'HealthCheckResult'; + + Iterable _serializeProperties( + Serializers serializers, + HealthCheckResult object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.nullableMessage != null) { + yield r'NullableMessage'; + yield serializers.serialize( + object.nullableMessage, + specifiedType: const FullType.nullable(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + HealthCheckResult object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required HealthCheckResultBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'NullableMessage': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(String), + ) as String?; + if (valueDes == null) continue; + result.nullableMessage = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + HealthCheckResult deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = HealthCheckResultBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/map_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/map_test.dart new file mode 100644 index 000000000000..9fa58677a84a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/map_test.dart @@ -0,0 +1,181 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'map_test.g.dart'; + +/// MapTest +/// +/// Properties: +/// * [mapMapOfString] +/// * [mapOfEnumString] +/// * [directMap] +/// * [indirectMap] +@BuiltValue() +abstract class MapTest implements Built { + @BuiltValueField(wireName: r'map_map_of_string') + BuiltMap>? get mapMapOfString; + + @BuiltValueField(wireName: r'map_of_enum_string') + BuiltMap? get mapOfEnumString; + // enum mapOfEnumStringEnum { UPPER, lower, }; + + @BuiltValueField(wireName: r'direct_map') + BuiltMap? get directMap; + + @BuiltValueField(wireName: r'indirect_map') + BuiltMap? get indirectMap; + + MapTest._(); + + factory MapTest([void updates(MapTestBuilder b)]) = _$MapTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(MapTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$MapTestSerializer(); +} + +class _$MapTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [MapTest, _$MapTest]; + + @override + final String wireName = r'MapTest'; + + Iterable _serializeProperties( + Serializers serializers, + MapTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.mapMapOfString != null) { + yield r'map_map_of_string'; + yield serializers.serialize( + object.mapMapOfString, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ); + } + if (object.mapOfEnumString != null) { + yield r'map_of_enum_string'; + yield serializers.serialize( + object.mapOfEnumString, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + ); + } + if (object.directMap != null) { + yield r'direct_map'; + yield serializers.serialize( + object.directMap, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ); + } + if (object.indirectMap != null) { + yield r'indirect_map'; + yield serializers.serialize( + object.indirectMap, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + MapTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required MapTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'map_map_of_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ) as BuiltMap>; + result.mapMapOfString.replace(valueDes); + break; + case r'map_of_enum_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + ) as BuiltMap; + result.mapOfEnumString.replace(valueDes); + break; + case r'direct_map': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ) as BuiltMap; + result.directMap.replace(valueDes); + break; + case r'indirect_map': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ) as BuiltMap; + result.indirectMap.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + MapTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = MapTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class MapTestMapOfEnumStringEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'UPPER') + static const MapTestMapOfEnumStringEnum UPPER = _$mapTestMapOfEnumStringEnum_UPPER; + @BuiltValueEnumConst(wireName: r'lower') + static const MapTestMapOfEnumStringEnum lower = _$mapTestMapOfEnumStringEnum_lower; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const MapTestMapOfEnumStringEnum unknownDefaultOpenApi = _$mapTestMapOfEnumStringEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$mapTestMapOfEnumStringEnumSerializer; + + const MapTestMapOfEnumStringEnum._(String name): super(name); + + static BuiltSet get values => _$mapTestMapOfEnumStringEnumValues; + static MapTestMapOfEnumStringEnum valueOf(String name) => _$mapTestMapOfEnumStringEnumValueOf(name); +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart new file mode 100644 index 000000000000..76b5933ae5a7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -0,0 +1,146 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'mixed_properties_and_additional_properties_class.g.dart'; + +/// MixedPropertiesAndAdditionalPropertiesClass +/// +/// Properties: +/// * [uuid] +/// * [dateTime] +/// * [map] +@BuiltValue() +abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built { + @BuiltValueField(wireName: r'uuid') + String? get uuid; + + @BuiltValueField(wireName: r'dateTime') + DateTime? get dateTime; + + @BuiltValueField(wireName: r'map') + BuiltMap? get map; + + MixedPropertiesAndAdditionalPropertiesClass._(); + + factory MixedPropertiesAndAdditionalPropertiesClass([void updates(MixedPropertiesAndAdditionalPropertiesClassBuilder b)]) = _$MixedPropertiesAndAdditionalPropertiesClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(MixedPropertiesAndAdditionalPropertiesClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); +} + +class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [MixedPropertiesAndAdditionalPropertiesClass, _$MixedPropertiesAndAdditionalPropertiesClass]; + + @override + final String wireName = r'MixedPropertiesAndAdditionalPropertiesClass'; + + Iterable _serializeProperties( + Serializers serializers, + MixedPropertiesAndAdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.uuid != null) { + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); + } + if (object.dateTime != null) { + yield r'dateTime'; + yield serializers.serialize( + object.dateTime, + specifiedType: const FullType(DateTime), + ); + } + if (object.map != null) { + yield r'map'; + yield serializers.serialize( + object.map, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + MixedPropertiesAndAdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required MixedPropertiesAndAdditionalPropertiesClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'uuid': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.uuid = valueDes; + break; + case r'dateTime': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.dateTime = valueDes; + break; + case r'map': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + ) as BuiltMap; + result.map.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + MixedPropertiesAndAdditionalPropertiesClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = MixedPropertiesAndAdditionalPropertiesClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model200_response.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model200_response.dart new file mode 100644 index 000000000000..0a2cfb4411ac --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model200_response.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model200_response.g.dart'; + +/// Model for testing model name starting with number +/// +/// Properties: +/// * [name] +/// * [classField] +@BuiltValue() +abstract class Model200Response implements Built { + @BuiltValueField(wireName: r'name') + int? get name; + + @BuiltValueField(wireName: r'class') + String? get classField; + + Model200Response._(); + + factory Model200Response([void updates(Model200ResponseBuilder b)]) = _$Model200Response; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(Model200ResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$Model200ResponseSerializer(); +} + +class _$Model200ResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Model200Response, _$Model200Response]; + + @override + final String wireName = r'Model200Response'; + + Iterable _serializeProperties( + Serializers serializers, + Model200Response object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(int), + ); + } + if (object.classField != null) { + yield r'class'; + yield serializers.serialize( + object.classField, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Model200Response object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required Model200ResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.name = valueDes; + break; + case r'class': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.classField = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Model200Response deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = Model200ResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_client.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_client.dart new file mode 100644 index 000000000000..36690977421b --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_client.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_client.g.dart'; + +/// ModelClient +/// +/// Properties: +/// * [client] +@BuiltValue() +abstract class ModelClient implements Built { + @BuiltValueField(wireName: r'client') + String? get client; + + ModelClient._(); + + factory ModelClient([void updates(ModelClientBuilder b)]) = _$ModelClient; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelClientBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelClientSerializer(); +} + +class _$ModelClientSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelClient, _$ModelClient]; + + @override + final String wireName = r'ModelClient'; + + Iterable _serializeProperties( + Serializers serializers, + ModelClient object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.client != null) { + yield r'client'; + yield serializers.serialize( + object.client, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelClient object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelClientBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'client': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.client = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelClient deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelClientBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_enum_class.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_enum_class.dart new file mode 100644 index 000000000000..ac609bfd15ad --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_enum_class.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_enum_class.g.dart'; + +class ModelEnumClass extends EnumClass { + + @BuiltValueEnumConst(wireName: r'_abc') + static const ModelEnumClass abc = _$abc; + @BuiltValueEnumConst(wireName: r'-efg') + static const ModelEnumClass efg = _$efg; + @BuiltValueEnumConst(wireName: r'(xyz)') + static const ModelEnumClass leftParenthesisXyzRightParenthesis = _$leftParenthesisXyzRightParenthesis; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const ModelEnumClass unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$modelEnumClassSerializer; + + const ModelEnumClass._(String name): super(name); + + static BuiltSet get values => _$values; + static ModelEnumClass valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class ModelEnumClassMixin = Object with _$ModelEnumClassMixin; + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_file.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_file.dart new file mode 100644 index 000000000000..2702c21d36f2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_file.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_file.g.dart'; + +/// Must be named `File` for test. +/// +/// Properties: +/// * [sourceURI] - Test capitalization +@BuiltValue() +abstract class ModelFile implements Built { + /// Test capitalization + @BuiltValueField(wireName: r'sourceURI') + String? get sourceURI; + + ModelFile._(); + + factory ModelFile([void updates(ModelFileBuilder b)]) = _$ModelFile; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelFileBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelFileSerializer(); +} + +class _$ModelFileSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelFile, _$ModelFile]; + + @override + final String wireName = r'ModelFile'; + + Iterable _serializeProperties( + Serializers serializers, + ModelFile object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.sourceURI != null) { + yield r'sourceURI'; + yield serializers.serialize( + object.sourceURI, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelFile object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelFileBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'sourceURI': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.sourceURI = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelFile deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelFileBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_list.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_list.dart new file mode 100644 index 000000000000..579853258f8e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_list.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_list.g.dart'; + +/// ModelList +/// +/// Properties: +/// * [n123list] +@BuiltValue() +abstract class ModelList implements Built { + @BuiltValueField(wireName: r'123-list') + String? get n123list; + + ModelList._(); + + factory ModelList([void updates(ModelListBuilder b)]) = _$ModelList; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelListBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelListSerializer(); +} + +class _$ModelListSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelList, _$ModelList]; + + @override + final String wireName = r'ModelList'; + + Iterable _serializeProperties( + Serializers serializers, + ModelList object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.n123list != null) { + yield r'123-list'; + yield serializers.serialize( + object.n123list, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelList object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelListBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'123-list': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.n123list = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelList deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelListBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_return.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_return.dart new file mode 100644 index 000000000000..45a2f67f8a40 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_return.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_return.g.dart'; + +/// Model for testing reserved words +/// +/// Properties: +/// * [return_] +@BuiltValue() +abstract class ModelReturn implements Built { + @BuiltValueField(wireName: r'return') + int? get return_; + + ModelReturn._(); + + factory ModelReturn([void updates(ModelReturnBuilder b)]) = _$ModelReturn; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelReturnBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelReturnSerializer(); +} + +class _$ModelReturnSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelReturn, _$ModelReturn]; + + @override + final String wireName = r'ModelReturn'; + + Iterable _serializeProperties( + Serializers serializers, + ModelReturn object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.return_ != null) { + yield r'return'; + yield serializers.serialize( + object.return_, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelReturn object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelReturnBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'return': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.return_ = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelReturn deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelReturnBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/name.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/name.dart new file mode 100644 index 000000000000..10fa99e6a5f7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/name.dart @@ -0,0 +1,160 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'name.g.dart'; + +/// Model for testing model name same as property name +/// +/// Properties: +/// * [name] +/// * [snakeCase] +/// * [property] +/// * [n123number] +@BuiltValue() +abstract class Name implements Built { + @BuiltValueField(wireName: r'name') + int get name; + + @BuiltValueField(wireName: r'snake_case') + int? get snakeCase; + + @BuiltValueField(wireName: r'property') + String? get property; + + @BuiltValueField(wireName: r'123Number') + int? get n123number; + + Name._(); + + factory Name([void updates(NameBuilder b)]) = _$Name; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(NameBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$NameSerializer(); +} + +class _$NameSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Name, _$Name]; + + @override + final String wireName = r'Name'; + + Iterable _serializeProperties( + Serializers serializers, + Name object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(int), + ); + if (object.snakeCase != null) { + yield r'snake_case'; + yield serializers.serialize( + object.snakeCase, + specifiedType: const FullType(int), + ); + } + if (object.property != null) { + yield r'property'; + yield serializers.serialize( + object.property, + specifiedType: const FullType(String), + ); + } + if (object.n123number != null) { + yield r'123Number'; + yield serializers.serialize( + object.n123number, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Name object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required NameBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.name = valueDes; + break; + case r'snake_case': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.snakeCase = valueDes; + break; + case r'property': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.property = valueDes; + break; + case r'123Number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.n123number = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Name deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = NameBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/nullable_class.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/nullable_class.dart new file mode 100644 index 000000000000..c993a41303f0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/nullable_class.dart @@ -0,0 +1,319 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/date.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'nullable_class.g.dart'; + +/// NullableClass +/// +/// Properties: +/// * [integerProp] +/// * [numberProp] +/// * [booleanProp] +/// * [stringProp] +/// * [dateProp] +/// * [datetimeProp] +/// * [arrayNullableProp] +/// * [arrayAndItemsNullableProp] +/// * [arrayItemsNullable] +/// * [objectNullableProp] +/// * [objectAndItemsNullableProp] +/// * [objectItemsNullable] +@BuiltValue() +abstract class NullableClass implements Built { + @BuiltValueField(wireName: r'integer_prop') + int? get integerProp; + + @BuiltValueField(wireName: r'number_prop') + num? get numberProp; + + @BuiltValueField(wireName: r'boolean_prop') + bool? get booleanProp; + + @BuiltValueField(wireName: r'string_prop') + String? get stringProp; + + @BuiltValueField(wireName: r'date_prop') + Date? get dateProp; + + @BuiltValueField(wireName: r'datetime_prop') + DateTime? get datetimeProp; + + @BuiltValueField(wireName: r'array_nullable_prop') + BuiltList? get arrayNullableProp; + + @BuiltValueField(wireName: r'array_and_items_nullable_prop') + BuiltList? get arrayAndItemsNullableProp; + + @BuiltValueField(wireName: r'array_items_nullable') + BuiltList? get arrayItemsNullable; + + @BuiltValueField(wireName: r'object_nullable_prop') + BuiltMap? get objectNullableProp; + + @BuiltValueField(wireName: r'object_and_items_nullable_prop') + BuiltMap? get objectAndItemsNullableProp; + + @BuiltValueField(wireName: r'object_items_nullable') + BuiltMap? get objectItemsNullable; + + NullableClass._(); + + factory NullableClass([void updates(NullableClassBuilder b)]) = _$NullableClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(NullableClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$NullableClassSerializer(); +} + +class _$NullableClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [NullableClass, _$NullableClass]; + + @override + final String wireName = r'NullableClass'; + + Iterable _serializeProperties( + Serializers serializers, + NullableClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.integerProp != null) { + yield r'integer_prop'; + yield serializers.serialize( + object.integerProp, + specifiedType: const FullType.nullable(int), + ); + } + if (object.numberProp != null) { + yield r'number_prop'; + yield serializers.serialize( + object.numberProp, + specifiedType: const FullType.nullable(num), + ); + } + if (object.booleanProp != null) { + yield r'boolean_prop'; + yield serializers.serialize( + object.booleanProp, + specifiedType: const FullType.nullable(bool), + ); + } + if (object.stringProp != null) { + yield r'string_prop'; + yield serializers.serialize( + object.stringProp, + specifiedType: const FullType.nullable(String), + ); + } + if (object.dateProp != null) { + yield r'date_prop'; + yield serializers.serialize( + object.dateProp, + specifiedType: const FullType.nullable(Date), + ); + } + if (object.datetimeProp != null) { + yield r'datetime_prop'; + yield serializers.serialize( + object.datetimeProp, + specifiedType: const FullType.nullable(DateTime), + ); + } + if (object.arrayNullableProp != null) { + yield r'array_nullable_prop'; + yield serializers.serialize( + object.arrayNullableProp, + specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + ); + } + if (object.arrayAndItemsNullableProp != null) { + yield r'array_and_items_nullable_prop'; + yield serializers.serialize( + object.arrayAndItemsNullableProp, + specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + ); + } + if (object.arrayItemsNullable != null) { + yield r'array_items_nullable'; + yield serializers.serialize( + object.arrayItemsNullable, + specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + ); + } + if (object.objectNullableProp != null) { + yield r'object_nullable_prop'; + yield serializers.serialize( + object.objectNullableProp, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + ); + } + if (object.objectAndItemsNullableProp != null) { + yield r'object_and_items_nullable_prop'; + yield serializers.serialize( + object.objectAndItemsNullableProp, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); + } + if (object.objectItemsNullable != null) { + yield r'object_items_nullable'; + yield serializers.serialize( + object.objectItemsNullable, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + NullableClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required NullableClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'integer_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(int), + ) as int?; + if (valueDes == null) continue; + result.integerProp = valueDes; + break; + case r'number_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(num), + ) as num?; + if (valueDes == null) continue; + result.numberProp = valueDes; + break; + case r'boolean_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(bool), + ) as bool?; + if (valueDes == null) continue; + result.booleanProp = valueDes; + break; + case r'string_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(String), + ) as String?; + if (valueDes == null) continue; + result.stringProp = valueDes; + break; + case r'date_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(Date), + ) as Date?; + if (valueDes == null) continue; + result.dateProp = valueDes; + break; + case r'datetime_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(DateTime), + ) as DateTime?; + if (valueDes == null) continue; + result.datetimeProp = valueDes; + break; + case r'array_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + ) as BuiltList?; + if (valueDes == null) continue; + result.arrayNullableProp.replace(valueDes); + break; + case r'array_and_items_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + ) as BuiltList?; + if (valueDes == null) continue; + result.arrayAndItemsNullableProp.replace(valueDes); + break; + case r'array_items_nullable': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + ) as BuiltList; + result.arrayItemsNullable.replace(valueDes); + break; + case r'object_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + ) as BuiltMap?; + if (valueDes == null) continue; + result.objectNullableProp.replace(valueDes); + break; + case r'object_and_items_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ) as BuiltMap?; + if (valueDes == null) continue; + result.objectAndItemsNullableProp.replace(valueDes); + break; + case r'object_items_nullable': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ) as BuiltMap; + result.objectItemsNullable.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + NullableClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = NullableClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/number_only.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/number_only.dart new file mode 100644 index 000000000000..482a95f3e521 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/number_only.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'number_only.g.dart'; + +/// NumberOnly +/// +/// Properties: +/// * [justNumber] +@BuiltValue() +abstract class NumberOnly implements Built { + @BuiltValueField(wireName: r'JustNumber') + num? get justNumber; + + NumberOnly._(); + + factory NumberOnly([void updates(NumberOnlyBuilder b)]) = _$NumberOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(NumberOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$NumberOnlySerializer(); +} + +class _$NumberOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [NumberOnly, _$NumberOnly]; + + @override + final String wireName = r'NumberOnly'; + + Iterable _serializeProperties( + Serializers serializers, + NumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.justNumber != null) { + yield r'JustNumber'; + yield serializers.serialize( + object.justNumber, + specifiedType: const FullType(num), + ); + } + } + + @override + Object serialize( + Serializers serializers, + NumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required NumberOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'JustNumber': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.justNumber = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + NumberOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = NumberOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/object_with_deprecated_fields.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/object_with_deprecated_fields.dart new file mode 100644 index 000000000000..90f4df85934f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/object_with_deprecated_fields.dart @@ -0,0 +1,165 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'object_with_deprecated_fields.g.dart'; + +/// ObjectWithDeprecatedFields +/// +/// Properties: +/// * [uuid] +/// * [id] +/// * [deprecatedRef] +/// * [bars] +@BuiltValue() +abstract class ObjectWithDeprecatedFields implements Built { + @BuiltValueField(wireName: r'uuid') + String? get uuid; + + @BuiltValueField(wireName: r'id') + num? get id; + + @BuiltValueField(wireName: r'deprecatedRef') + DeprecatedObject? get deprecatedRef; + + @BuiltValueField(wireName: r'bars') + BuiltList? get bars; + + ObjectWithDeprecatedFields._(); + + factory ObjectWithDeprecatedFields([void updates(ObjectWithDeprecatedFieldsBuilder b)]) = _$ObjectWithDeprecatedFields; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ObjectWithDeprecatedFieldsBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ObjectWithDeprecatedFieldsSerializer(); +} + +class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ObjectWithDeprecatedFields, _$ObjectWithDeprecatedFields]; + + @override + final String wireName = r'ObjectWithDeprecatedFields'; + + Iterable _serializeProperties( + Serializers serializers, + ObjectWithDeprecatedFields object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.uuid != null) { + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(num), + ); + } + if (object.deprecatedRef != null) { + yield r'deprecatedRef'; + yield serializers.serialize( + object.deprecatedRef, + specifiedType: const FullType(DeprecatedObject), + ); + } + if (object.bars != null) { + yield r'bars'; + yield serializers.serialize( + object.bars, + specifiedType: const FullType(BuiltList, [FullType(Bar)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ObjectWithDeprecatedFields object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ObjectWithDeprecatedFieldsBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'uuid': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.uuid = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.id = valueDes; + break; + case r'deprecatedRef': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DeprecatedObject), + ) as DeprecatedObject; + result.deprecatedRef.replace(valueDes); + break; + case r'bars': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(Bar)]), + ) as BuiltList; + result.bars.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ObjectWithDeprecatedFields deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ObjectWithDeprecatedFieldsBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/order.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/order.dart new file mode 100644 index 000000000000..a44e1b340c1e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/order.dart @@ -0,0 +1,225 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'order.g.dart'; + +/// Order +/// +/// Properties: +/// * [id] +/// * [petId] +/// * [quantity] +/// * [shipDate] +/// * [status] - Order Status +/// * [complete] +@BuiltValue() +abstract class Order implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'petId') + int? get petId; + + @BuiltValueField(wireName: r'quantity') + int? get quantity; + + @BuiltValueField(wireName: r'shipDate') + DateTime? get shipDate; + + /// Order Status + @BuiltValueField(wireName: r'status') + OrderStatusEnum? get status; + // enum statusEnum { placed, approved, delivered, }; + + @BuiltValueField(wireName: r'complete') + bool? get complete; + + Order._(); + + factory Order([void updates(OrderBuilder b)]) = _$Order; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(OrderBuilder b) => b + ..complete = false; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$OrderSerializer(); +} + +class _$OrderSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Order, _$Order]; + + @override + final String wireName = r'Order'; + + Iterable _serializeProperties( + Serializers serializers, + Order object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.petId != null) { + yield r'petId'; + yield serializers.serialize( + object.petId, + specifiedType: const FullType(int), + ); + } + if (object.quantity != null) { + yield r'quantity'; + yield serializers.serialize( + object.quantity, + specifiedType: const FullType(int), + ); + } + if (object.shipDate != null) { + yield r'shipDate'; + yield serializers.serialize( + object.shipDate, + specifiedType: const FullType(DateTime), + ); + } + if (object.status != null) { + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(OrderStatusEnum), + ); + } + if (object.complete != null) { + yield r'complete'; + yield serializers.serialize( + object.complete, + specifiedType: const FullType(bool), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Order object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required OrderBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'petId': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.petId = valueDes; + break; + case r'quantity': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.quantity = valueDes; + break; + case r'shipDate': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.shipDate = valueDes; + break; + case r'status': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OrderStatusEnum), + ) as OrderStatusEnum; + result.status = valueDes; + break; + case r'complete': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.complete = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Order deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = OrderBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class OrderStatusEnum extends EnumClass { + + /// Order Status + @BuiltValueEnumConst(wireName: r'placed') + static const OrderStatusEnum placed = _$orderStatusEnum_placed; + /// Order Status + @BuiltValueEnumConst(wireName: r'approved') + static const OrderStatusEnum approved = _$orderStatusEnum_approved; + /// Order Status + @BuiltValueEnumConst(wireName: r'delivered') + static const OrderStatusEnum delivered = _$orderStatusEnum_delivered; + /// Order Status + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const OrderStatusEnum unknownDefaultOpenApi = _$orderStatusEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$orderStatusEnumSerializer; + + const OrderStatusEnum._(String name): super(name); + + static BuiltSet get values => _$orderStatusEnumValues; + static OrderStatusEnum valueOf(String name) => _$orderStatusEnumValueOf(name); +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_composite.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_composite.dart new file mode 100644 index 000000000000..0d6341cc1299 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_composite.dart @@ -0,0 +1,144 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_composite.g.dart'; + +/// OuterComposite +/// +/// Properties: +/// * [myNumber] +/// * [myString] +/// * [myBoolean] +@BuiltValue() +abstract class OuterComposite implements Built { + @BuiltValueField(wireName: r'my_number') + num? get myNumber; + + @BuiltValueField(wireName: r'my_string') + String? get myString; + + @BuiltValueField(wireName: r'my_boolean') + bool? get myBoolean; + + OuterComposite._(); + + factory OuterComposite([void updates(OuterCompositeBuilder b)]) = _$OuterComposite; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(OuterCompositeBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$OuterCompositeSerializer(); +} + +class _$OuterCompositeSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [OuterComposite, _$OuterComposite]; + + @override + final String wireName = r'OuterComposite'; + + Iterable _serializeProperties( + Serializers serializers, + OuterComposite object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.myNumber != null) { + yield r'my_number'; + yield serializers.serialize( + object.myNumber, + specifiedType: const FullType(num), + ); + } + if (object.myString != null) { + yield r'my_string'; + yield serializers.serialize( + object.myString, + specifiedType: const FullType(String), + ); + } + if (object.myBoolean != null) { + yield r'my_boolean'; + yield serializers.serialize( + object.myBoolean, + specifiedType: const FullType(bool), + ); + } + } + + @override + Object serialize( + Serializers serializers, + OuterComposite object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required OuterCompositeBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'my_number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.myNumber = valueDes; + break; + case r'my_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.myString = valueDes; + break; + case r'my_boolean': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.myBoolean = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + OuterComposite deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = OuterCompositeBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum.dart new file mode 100644 index 000000000000..5ad5d8009bdf --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum.g.dart'; + +class OuterEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'placed') + static const OuterEnum placed = _$placed; + @BuiltValueEnumConst(wireName: r'approved') + static const OuterEnum approved = _$approved; + @BuiltValueEnumConst(wireName: r'delivered') + static const OuterEnum delivered = _$delivered; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const OuterEnum unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumSerializer; + + const OuterEnum._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnum valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumMixin = Object with _$OuterEnumMixin; + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_default_value.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_default_value.dart new file mode 100644 index 000000000000..62c3cefe8456 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_default_value.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum_default_value.g.dart'; + +class OuterEnumDefaultValue extends EnumClass { + + @BuiltValueEnumConst(wireName: r'placed') + static const OuterEnumDefaultValue placed = _$placed; + @BuiltValueEnumConst(wireName: r'approved') + static const OuterEnumDefaultValue approved = _$approved; + @BuiltValueEnumConst(wireName: r'delivered') + static const OuterEnumDefaultValue delivered = _$delivered; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const OuterEnumDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumDefaultValueSerializer; + + const OuterEnumDefaultValue._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnumDefaultValue valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumDefaultValueMixin = Object with _$OuterEnumDefaultValueMixin; + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer.dart new file mode 100644 index 000000000000..988b30785d30 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum_integer.g.dart'; + +class OuterEnumInteger extends EnumClass { + + @BuiltValueEnumConst(wireNumber: 0) + static const OuterEnumInteger number0 = _$number0; + @BuiltValueEnumConst(wireNumber: 1) + static const OuterEnumInteger number1 = _$number1; + @BuiltValueEnumConst(wireNumber: 2) + static const OuterEnumInteger number2 = _$number2; + @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) + static const OuterEnumInteger unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumIntegerSerializer; + + const OuterEnumInteger._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnumInteger valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumIntegerMixin = Object with _$OuterEnumIntegerMixin; + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer_default_value.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer_default_value.dart new file mode 100644 index 000000000000..3fe792cedbe9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer_default_value.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum_integer_default_value.g.dart'; + +class OuterEnumIntegerDefaultValue extends EnumClass { + + @BuiltValueEnumConst(wireNumber: 0) + static const OuterEnumIntegerDefaultValue number0 = _$number0; + @BuiltValueEnumConst(wireNumber: 1) + static const OuterEnumIntegerDefaultValue number1 = _$number1; + @BuiltValueEnumConst(wireNumber: 2) + static const OuterEnumIntegerDefaultValue number2 = _$number2; + @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) + static const OuterEnumIntegerDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumIntegerDefaultValueSerializer; + + const OuterEnumIntegerDefaultValue._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnumIntegerDefaultValue valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumIntegerDefaultValueMixin = Object with _$OuterEnumIntegerDefaultValueMixin; + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_object_with_enum_property.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_object_with_enum_property.dart new file mode 100644 index 000000000000..173329856452 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_object_with_enum_property.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_object_with_enum_property.g.dart'; + +/// OuterObjectWithEnumProperty +/// +/// Properties: +/// * [value] +@BuiltValue() +abstract class OuterObjectWithEnumProperty implements Built { + @BuiltValueField(wireName: r'value') + OuterEnumInteger get value; + // enum valueEnum { 0, 1, 2, }; + + OuterObjectWithEnumProperty._(); + + factory OuterObjectWithEnumProperty([void updates(OuterObjectWithEnumPropertyBuilder b)]) = _$OuterObjectWithEnumProperty; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(OuterObjectWithEnumPropertyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$OuterObjectWithEnumPropertySerializer(); +} + +class _$OuterObjectWithEnumPropertySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [OuterObjectWithEnumProperty, _$OuterObjectWithEnumProperty]; + + @override + final String wireName = r'OuterObjectWithEnumProperty'; + + Iterable _serializeProperties( + Serializers serializers, + OuterObjectWithEnumProperty object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'value'; + yield serializers.serialize( + object.value, + specifiedType: const FullType(OuterEnumInteger), + ); + } + + @override + Object serialize( + Serializers serializers, + OuterObjectWithEnumProperty object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required OuterObjectWithEnumPropertyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'value': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumInteger), + ) as OuterEnumInteger; + result.value = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + OuterObjectWithEnumProperty deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = OuterObjectWithEnumPropertyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pasta.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pasta.dart new file mode 100644 index 000000000000..e8b1ebdf31ea --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pasta.dart @@ -0,0 +1,182 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pasta.g.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 +@BuiltValue() +abstract class Pasta implements Entity, Built { + @BuiltValueField(wireName: r'vendor') + String? get vendor; + + Pasta._(); + + factory Pasta([void updates(PastaBuilder b)]) = _$Pasta; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PastaBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PastaSerializer(); +} + +class _$PastaSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Pasta, _$Pasta]; + + @override + final String wireName = r'Pasta'; + + Iterable _serializeProperties( + Serializers serializers, + Pasta object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + if (object.vendor != null) { + yield r'vendor'; + yield serializers.serialize( + object.vendor, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Pasta object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PastaBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + case r'vendor': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.vendor = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Pasta deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PastaBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pet.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pet.dart new file mode 100644 index 000000000000..aeb788e8f7ff --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pet.dart @@ -0,0 +1,222 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pet.g.dart'; + +/// Pet +/// +/// Properties: +/// * [id] +/// * [name] +/// * [category] +/// * [photoUrls] +/// * [tags] +/// * [status] - pet status in the store +@BuiltValue() +abstract class Pet implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'name') + String get name; + + @BuiltValueField(wireName: r'category') + Category? get category; + + @BuiltValueField(wireName: r'photoUrls') + BuiltList get photoUrls; + + @BuiltValueField(wireName: r'tags') + BuiltList? get tags; + + /// pet status in the store + @BuiltValueField(wireName: r'status') + PetStatusEnum? get status; + // enum statusEnum { available, pending, sold, }; + + Pet._(); + + factory Pet([void updates(PetBuilder b)]) = _$Pet; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PetBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PetSerializer(); +} + +class _$PetSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Pet, _$Pet]; + + @override + final String wireName = r'Pet'; + + Iterable _serializeProperties( + Serializers serializers, + Pet object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + if (object.category != null) { + yield r'category'; + yield serializers.serialize( + object.category, + specifiedType: const FullType(Category), + ); + } + yield r'photoUrls'; + yield serializers.serialize( + object.photoUrls, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); + if (object.tags != null) { + yield r'tags'; + yield serializers.serialize( + object.tags, + specifiedType: const FullType(BuiltList, [FullType(Tag)]), + ); + } + if (object.status != null) { + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(PetStatusEnum), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Pet object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PetBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'category': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(Category), + ) as Category; + result.category.replace(valueDes); + break; + case r'photoUrls': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ) as BuiltList; + result.photoUrls.replace(valueDes); + break; + case r'tags': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(Tag)]), + ) as BuiltList; + result.tags.replace(valueDes); + break; + case r'status': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(PetStatusEnum), + ) as PetStatusEnum; + result.status = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Pet deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PetBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class PetStatusEnum extends EnumClass { + + /// pet status in the store + @BuiltValueEnumConst(wireName: r'available') + static const PetStatusEnum available = _$petStatusEnum_available; + /// pet status in the store + @BuiltValueEnumConst(wireName: r'pending') + static const PetStatusEnum pending = _$petStatusEnum_pending; + /// pet status in the store + @BuiltValueEnumConst(wireName: r'sold') + static const PetStatusEnum sold = _$petStatusEnum_sold; + /// pet status in the store + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const PetStatusEnum unknownDefaultOpenApi = _$petStatusEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$petStatusEnumSerializer; + + const PetStatusEnum._(String name): super(name); + + static BuiltSet get values => _$petStatusEnumValues; + static PetStatusEnum valueOf(String name) => _$petStatusEnumValueOf(name); +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza.dart new file mode 100644 index 000000000000..14c06db06d7e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza.dart @@ -0,0 +1,250 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pizza.g.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 +@BuiltValue(instantiable: false) +abstract class Pizza implements Entity { + @BuiltValueField(wireName: r'pizzaSize') + num? get pizzaSize; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'PizzaSpeziale': PizzaSpeziale, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PizzaSerializer(); +} + +extension PizzaDiscriminatorExt on Pizza { + String? get discriminatorValue { + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; + } +} +extension PizzaBuilderDiscriminatorExt on PizzaBuilder { + String? get discriminatorValue { + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; + } +} + +class _$PizzaSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Pizza]; + + @override + final String wireName = r'Pizza'; + + Iterable _serializeProperties( + Serializers serializers, + Pizza object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.pizzaSize != null) { + yield r'pizzaSize'; + yield serializers.serialize( + object.pizzaSize, + specifiedType: const FullType(num), + ); + } + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Pizza object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is PizzaSpeziale) { + return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Pizza deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(Pizza.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'PizzaSpeziale': + return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + default: + return serializers.deserialize(serialized, specifiedType: FullType($Pizza)) as $Pizza; + } + } +} + +/// a concrete implementation of [Pizza], since [Pizza] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Pizza implements Pizza, Built<$Pizza, $PizzaBuilder> { + $Pizza._(); + + factory $Pizza([void Function($PizzaBuilder)? updates]) = _$$Pizza; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($PizzaBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Pizza> get serializer => _$$PizzaSerializer(); +} + +class _$$PizzaSerializer implements PrimitiveSerializer<$Pizza> { + @override + final Iterable types = const [$Pizza, _$$Pizza]; + + @override + final String wireName = r'$Pizza'; + + @override + Object serialize( + Serializers serializers, + $Pizza object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Pizza))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PizzaBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'pizzaSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.pizzaSize = valueDes; + break; + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Pizza deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $PizzaBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza_speziale.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza_speziale.dart new file mode 100644 index 000000000000..673052cc8fcf --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza_speziale.dart @@ -0,0 +1,196 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/pizza.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pizza_speziale.g.dart'; + +/// PizzaSpeziale +/// +/// Properties: +/// * [toppings] +/// * [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 +@BuiltValue() +abstract class PizzaSpeziale implements Pizza, Built { + @BuiltValueField(wireName: r'toppings') + String? get toppings; + + PizzaSpeziale._(); + + factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = _$PizzaSpeziale; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PizzaSpezialeBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PizzaSpezialeSerializer(); +} + +class _$PizzaSpezialeSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PizzaSpeziale, _$PizzaSpeziale]; + + @override + final String wireName = r'PizzaSpeziale'; + + Iterable _serializeProperties( + Serializers serializers, + PizzaSpeziale object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.pizzaSize != null) { + yield r'pizzaSize'; + yield serializers.serialize( + object.pizzaSize, + specifiedType: const FullType(num), + ); + } + if (object.toppings != null) { + yield r'toppings'; + yield serializers.serialize( + object.toppings, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + PizzaSpeziale object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PizzaSpezialeBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'pizzaSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.pizzaSize = valueDes; + break; + case r'toppings': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.toppings = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PizzaSpeziale deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PizzaSpezialeBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/read_only_first.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/read_only_first.dart new file mode 100644 index 000000000000..b619217ab3cb --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/read_only_first.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'read_only_first.g.dart'; + +/// ReadOnlyFirst +/// +/// Properties: +/// * [bar] +/// * [baz] +@BuiltValue() +abstract class ReadOnlyFirst implements Built { + @BuiltValueField(wireName: r'bar') + String? get bar; + + @BuiltValueField(wireName: r'baz') + String? get baz; + + ReadOnlyFirst._(); + + factory ReadOnlyFirst([void updates(ReadOnlyFirstBuilder b)]) = _$ReadOnlyFirst; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ReadOnlyFirstBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ReadOnlyFirstSerializer(); +} + +class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ReadOnlyFirst, _$ReadOnlyFirst]; + + @override + final String wireName = r'ReadOnlyFirst'; + + Iterable _serializeProperties( + Serializers serializers, + ReadOnlyFirst object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.bar != null) { + yield r'bar'; + yield serializers.serialize( + object.bar, + specifiedType: const FullType(String), + ); + } + if (object.baz != null) { + yield r'baz'; + yield serializers.serialize( + object.baz, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ReadOnlyFirst object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ReadOnlyFirstBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'bar': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.bar = valueDes; + break; + case r'baz': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.baz = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ReadOnlyFirst deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ReadOnlyFirstBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/single_ref_type.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/single_ref_type.dart new file mode 100644 index 000000000000..b51e77292e8e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/single_ref_type.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'single_ref_type.g.dart'; + +class SingleRefType extends EnumClass { + + @BuiltValueEnumConst(wireName: r'admin') + static const SingleRefType admin = _$admin; + @BuiltValueEnumConst(wireName: r'user') + static const SingleRefType user = _$user; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const SingleRefType unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$singleRefTypeSerializer; + + const SingleRefType._(String name): super(name); + + static BuiltSet get values => _$values; + static SingleRefType valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class SingleRefTypeMixin = Object with _$SingleRefTypeMixin; + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/special_model_name.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/special_model_name.dart new file mode 100644 index 000000000000..fa860056b45d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/special_model_name.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'special_model_name.g.dart'; + +/// SpecialModelName +/// +/// Properties: +/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] +@BuiltValue() +abstract class SpecialModelName implements Built { + @BuiltValueField(wireName: r'$special[property.name]') + int? get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + SpecialModelName._(); + + factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = _$SpecialModelName; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(SpecialModelNameBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$SpecialModelNameSerializer(); +} + +class _$SpecialModelNameSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [SpecialModelName, _$SpecialModelName]; + + @override + final String wireName = r'SpecialModelName'; + + Iterable _serializeProperties( + Serializers serializers, + SpecialModelName object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket != null) { + yield r'$special[property.name]'; + yield serializers.serialize( + object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + SpecialModelName object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required SpecialModelNameBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'$special[property.name]': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + SpecialModelName deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = SpecialModelNameBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/tag.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/tag.dart new file mode 100644 index 000000000000..3be220d8188e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/tag.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'tag.g.dart'; + +/// Tag +/// +/// Properties: +/// * [id] +/// * [name] +@BuiltValue() +abstract class Tag implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'name') + String? get name; + + Tag._(); + + factory Tag([void updates(TagBuilder b)]) = _$Tag; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(TagBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$TagSerializer(); +} + +class _$TagSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Tag, _$Tag]; + + @override + final String wireName = r'Tag'; + + Iterable _serializeProperties( + Serializers serializers, + Tag object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Tag object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required TagBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Tag deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = TagBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart new file mode 100644 index 000000000000..62190487b0ce --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'test_query_style_form_explode_true_array_string_query_object_parameter.g.dart'; + +/// TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter +/// +/// Properties: +/// * [values] +@BuiltValue() +abstract class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter implements Built { + @BuiltValueField(wireName: r'values') + BuiltList? get values; + + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter._(); + + factory TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter([void updates(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder b)]) = _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer(); +} + +class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter]; + + @override + final String wireName = r'TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter'; + + Iterable _serializeProperties( + Serializers serializers, + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.values != null) { + yield r'values'; + yield serializers.serialize( + object.values, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'values': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ) as BuiltList; + result.values.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/user.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/user.dart new file mode 100644 index 000000000000..f7577d7e1ee9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/user.dart @@ -0,0 +1,235 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'user.g.dart'; + +/// User +/// +/// Properties: +/// * [id] +/// * [username] +/// * [firstName] +/// * [lastName] +/// * [email] +/// * [password] +/// * [phone] +/// * [userStatus] - User Status +@BuiltValue() +abstract class User implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'username') + String? get username; + + @BuiltValueField(wireName: r'firstName') + String? get firstName; + + @BuiltValueField(wireName: r'lastName') + String? get lastName; + + @BuiltValueField(wireName: r'email') + String? get email; + + @BuiltValueField(wireName: r'password') + String? get password; + + @BuiltValueField(wireName: r'phone') + String? get phone; + + /// User Status + @BuiltValueField(wireName: r'userStatus') + int? get userStatus; + + User._(); + + factory User([void updates(UserBuilder b)]) = _$User; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(UserBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$UserSerializer(); +} + +class _$UserSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [User, _$User]; + + @override + final String wireName = r'User'; + + Iterable _serializeProperties( + Serializers serializers, + User object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.username != null) { + yield r'username'; + yield serializers.serialize( + object.username, + specifiedType: const FullType(String), + ); + } + if (object.firstName != null) { + yield r'firstName'; + yield serializers.serialize( + object.firstName, + specifiedType: const FullType(String), + ); + } + if (object.lastName != null) { + yield r'lastName'; + yield serializers.serialize( + object.lastName, + specifiedType: const FullType(String), + ); + } + if (object.email != null) { + yield r'email'; + yield serializers.serialize( + object.email, + specifiedType: const FullType(String), + ); + } + if (object.password != null) { + yield r'password'; + yield serializers.serialize( + object.password, + specifiedType: const FullType(String), + ); + } + if (object.phone != null) { + yield r'phone'; + yield serializers.serialize( + object.phone, + specifiedType: const FullType(String), + ); + } + if (object.userStatus != null) { + yield r'userStatus'; + yield serializers.serialize( + object.userStatus, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + User object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required UserBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'username': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.username = valueDes; + break; + case r'firstName': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.firstName = valueDes; + break; + case r'lastName': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.lastName = valueDes; + break; + case r'email': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.email = valueDes; + break; + case r'password': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.password = valueDes; + break; + case r'phone': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.phone = valueDes; + break; + case r'userStatus': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.userStatus = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + User deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = UserBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/serializers.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/serializers.dart new file mode 100644 index 000000000000..c693e7afc032 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/serializers.dart @@ -0,0 +1,176 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_import + +import 'package:one_of_serializer/any_of_serializer.dart'; +import 'package:one_of_serializer/one_of_serializer.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/serializer.dart'; +import 'package:built_value/standard_json_plugin.dart'; +import 'package:built_value/iso_8601_date_time_serializer.dart'; +import 'package:openapi/src/date_serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +import 'package:openapi/src/model/additional_properties_class.dart'; +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/all_of_with_single_ref.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/array_of_array_of_number_only.dart'; +import 'package:openapi/src/model/array_of_number_only.dart'; +import 'package:openapi/src/model/array_test.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:openapi/src/model/bar_create.dart'; +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar_ref_or_value.dart'; +import 'package:openapi/src/model/capitalization.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:openapi/src/model/cat_all_of.dart'; +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/child.dart'; +import 'package:openapi/src/model/class_model.dart'; +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/dog.dart'; +import 'package:openapi/src/model/dog_all_of.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:openapi/src/model/enum_arrays.dart'; +import 'package:openapi/src/model/enum_test.dart'; +import 'package:openapi/src/model/example.dart'; +import 'package:openapi/src/model/example_non_primitive.dart'; +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/format_test.dart'; +import 'package:openapi/src/model/fruit.dart'; +import 'package:openapi/src/model/has_only_read_only.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/map_test.dart'; +import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +import 'package:openapi/src/model/model200_response.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_enum_class.dart'; +import 'package:openapi/src/model/model_file.dart'; +import 'package:openapi/src/model/model_list.dart'; +import 'package:openapi/src/model/model_return.dart'; +import 'package:openapi/src/model/name.dart'; +import 'package:openapi/src/model/nullable_class.dart'; +import 'package:openapi/src/model/number_only.dart'; +import 'package:openapi/src/model/object_with_deprecated_fields.dart'; +import 'package:openapi/src/model/order.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pasta.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/pizza.dart'; +import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:openapi/src/model/single_ref_type.dart'; +import 'package:openapi/src/model/special_model_name.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; +import 'package:openapi/src/model/user.dart'; + +part 'serializers.g.dart'; + +@SerializersFor([ + AdditionalPropertiesClass, + Addressable,$Addressable, + AllOfWithSingleRef, + Animal,$Animal, + ApiResponse, + Apple, + ArrayOfArrayOfNumberOnly, + ArrayOfNumberOnly, + ArrayTest, + Banana, + Bar, + BarCreate, + BarRef, + BarRefOrValue, + Capitalization, + Cat, + CatAllOf,$CatAllOf, + Category, + Child, + ClassModel, + DeprecatedObject, + Dog, + DogAllOf,$DogAllOf, + Entity,$Entity, + EntityRef,$EntityRef, + EnumArrays, + EnumTest, + Example, + ExampleNonPrimitive, + Extensible,$Extensible, + FileSchemaTestClass, + Foo, + FooRef, + FooRefOrValue, + FormatTest, + Fruit, + HasOnlyReadOnly, + HealthCheckResult, + MapTest, + MixedPropertiesAndAdditionalPropertiesClass, + Model200Response, + ModelClient, + ModelEnumClass, + ModelFile, + ModelList, + ModelReturn, + Name, + NullableClass, + NumberOnly, + ObjectWithDeprecatedFields, + Order, + OuterComposite, + OuterEnum, + OuterEnumDefaultValue, + OuterEnumInteger, + OuterEnumIntegerDefaultValue, + OuterObjectWithEnumProperty, + Pasta, + Pet, + Pizza,$Pizza, + PizzaSpeziale, + ReadOnlyFirst, + SingleRefType, + SpecialModelName, + Tag, + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, + User, +]) +Serializers serializers = (_$serializers.toBuilder() + ..addBuilderFactory( + const FullType(BuiltMap, [FullType(String), FullType(String)]), + () => MapBuilder(), + ) + ..add(Addressable.serializer) + ..add(Animal.serializer) + ..add(CatAllOf.serializer) + ..add(DogAllOf.serializer) + ..add(Entity.serializer) + ..add(EntityRef.serializer) + ..add(Extensible.serializer) + ..add(Pizza.serializer) + ..add(const OneOfSerializer()) + ..add(const AnyOfSerializer()) + ..add(const DateSerializer()) + ..add(Iso8601DateTimeSerializer())) + .build(); + +Serializers standardSerializers = + (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/client/echo_api/dart/dart-dio-built_value/pubspec.yaml b/samples/client/echo_api/dart/dart-dio-built_value/pubspec.yaml new file mode 100644 index 000000000000..fb676f65c393 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/pubspec.yaml @@ -0,0 +1,19 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '>=2.12.0 <3.0.0' + +dependencies: + dio: '>=4.0.1 <5.0.0' + one_of: '>=1.5.0 <2.0.0' + one_of_serializer: '>=1.5.0 <2.0.0' + built_value: '>=8.4.0 <9.0.0' + built_collection: '>=5.1.1 <6.0.0' + +dev_dependencies: + built_value_generator: '>=8.4.0 <9.0.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/additional_properties_class_test.dart new file mode 100644 index 000000000000..c231e6dc2807 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/additional_properties_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AdditionalPropertiesClass +void main() { + final instance = AdditionalPropertiesClassBuilder(); + // TODO add properties to the builder and call build() + + group(AdditionalPropertiesClass, () { + // BuiltMap mapProperty + test('to test the property `mapProperty`', () async { + // TODO + }); + + // BuiltMap> mapOfMapProperty + test('to test the property `mapOfMapProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/addressable_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/addressable_test.dart new file mode 100644 index 000000000000..696e26e8e549 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/addressable_test.dart @@ -0,0 +1,23 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Addressable +void main() { + //final instance = AddressableBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-dio-built_value/test/all_of_with_single_ref_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/all_of_with_single_ref_test.dart new file mode 100644 index 000000000000..64e241a4dce3 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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 instance = AllOfWithSingleRefBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-dio-built_value/test/animal_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/animal_test.dart new file mode 100644 index 000000000000..39b8b59cdf51 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/animal_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Animal +void main() { + //final instance = AnimalBuilder(); + // TODO add properties to the builder and call build() + + group(Animal, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/api_response_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/api_response_test.dart new file mode 100644 index 000000000000..cf1a744cd629 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/api_response_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ApiResponse +void main() { + final instance = ApiResponseBuilder(); + // TODO add properties to the builder and call build() + + group(ApiResponse, () { + // int code + test('to test the property `code`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String message + test('to test the property `message`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/apple_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/apple_test.dart new file mode 100644 index 000000000000..1d542169550d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/apple_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Apple +void main() { + final instance = AppleBuilder(); + // TODO add properties to the builder and call build() + + group(Apple, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_array_of_number_only_test.dart new file mode 100644 index 000000000000..a679a6c4223d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfArrayOfNumberOnly +void main() { + final instance = ArrayOfArrayOfNumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayOfArrayOfNumberOnly, () { + // BuiltList> arrayArrayNumber + test('to test the property `arrayArrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_number_only_test.dart new file mode 100644 index 000000000000..cc648bc115c5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfNumberOnly +void main() { + final instance = ArrayOfNumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayOfNumberOnly, () { + // BuiltList arrayNumber + test('to test the property `arrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/array_test_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/array_test_test.dart new file mode 100644 index 000000000000..210216f224b5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/array_test_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayTest +void main() { + final instance = ArrayTestBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayTest, () { + // BuiltList arrayOfString + test('to test the property `arrayOfString`', () async { + // TODO + }); + + // BuiltList> arrayArrayOfInteger + test('to test the property `arrayArrayOfInteger`', () async { + // TODO + }); + + // BuiltList> arrayArrayOfModel + test('to test the property `arrayArrayOfModel`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/banana_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/banana_test.dart new file mode 100644 index 000000000000..a883acc0a9e8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/banana_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Banana +void main() { + final instance = BananaBuilder(); + // TODO add properties to the builder and call build() + + group(Banana, () { + // num count + test('to test the property `count`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/bar_create_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_create_test.dart new file mode 100644 index 000000000000..1bf90151be8b --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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 instance = BarCreateBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-dio-built_value/test/bar_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_or_value_test.dart new file mode 100644 index 000000000000..c132ac09943b --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_or_value_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRefOrValue +void main() { + final instance = BarRefOrValueBuilder(); + // TODO add properties to the builder and call build() + + group(BarRefOrValue, () { + // 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/client/echo_api/dart/dart-dio-built_value/test/bar_ref_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_test.dart new file mode 100644 index 000000000000..9c410b2b5c54 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRef +void main() { + final instance = BarRefBuilder(); + // TODO add properties to the builder and call build() + + group(BarRef, () { + // 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/client/echo_api/dart/dart-dio-built_value/test/bar_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_test.dart new file mode 100644 index 000000000000..dc6daaa3400d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_test.dart @@ -0,0 +1,55 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Bar +void main() { + final instance = BarBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-dio-built_value/test/body_api_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/body_api_test.dart new file mode 100644 index 000000000000..067b2ca7c7c7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/body_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for BodyApi +void main() { + final instance = Openapi().getBodyApi(); + + group(BodyApi, () { + // Test body parameter(s) + // + // Test body parameter(s) + // + //Future testEchoBodyPet({ Pet pet }) async + test('test testEchoBodyPet', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/capitalization_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/capitalization_test.dart new file mode 100644 index 000000000000..23e04b0001bb --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/capitalization_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Capitalization +void main() { + final instance = CapitalizationBuilder(); + // TODO add properties to the builder and call build() + + group(Capitalization, () { + // String smallCamel + test('to test the property `smallCamel`', () async { + // TODO + }); + + // String capitalCamel + test('to test the property `capitalCamel`', () async { + // TODO + }); + + // String smallSnake + test('to test the property `smallSnake`', () async { + // TODO + }); + + // String capitalSnake + test('to test the property `capitalSnake`', () async { + // TODO + }); + + // String sCAETHFlowPoints + test('to test the property `sCAETHFlowPoints`', () async { + // TODO + }); + + // Name of the pet + // String ATT_NAME + test('to test the property `ATT_NAME`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/cat_all_of_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/cat_all_of_test.dart new file mode 100644 index 000000000000..fb7e999bf8d1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/cat_all_of_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for CatAllOf +void main() { + //final instance = CatAllOfBuilder(); + // TODO add properties to the builder and call build() + + group(CatAllOf, () { + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/cat_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/cat_test.dart new file mode 100644 index 000000000000..b8fc252acc60 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/cat_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Cat +void main() { + final instance = CatBuilder(); + // TODO add properties to the builder and call build() + + group(Cat, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/category_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/category_test.dart new file mode 100644 index 000000000000..de682b2ff15b --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/category_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Category +void main() { + final instance = CategoryBuilder(); + // TODO add properties to the builder and call build() + + group(Category, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/child_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/child_test.dart new file mode 100644 index 000000000000..d40451a84c2c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/child_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Child +void main() { + final instance = ChildBuilder(); + // TODO add properties to the builder and call build() + + group(Child, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/class_model_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/class_model_test.dart new file mode 100644 index 000000000000..89f1d35e556b --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/class_model_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ClassModel +void main() { + final instance = ClassModelBuilder(); + // TODO add properties to the builder and call build() + + group(ClassModel, () { + // String classField + test('to test the property `classField`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/deprecated_object_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/deprecated_object_test.dart new file mode 100644 index 000000000000..98ab991b2b14 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/deprecated_object_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DeprecatedObject +void main() { + final instance = DeprecatedObjectBuilder(); + // TODO add properties to the builder and call build() + + group(DeprecatedObject, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/dog_all_of_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/dog_all_of_test.dart new file mode 100644 index 000000000000..7b4f4095dc9f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/dog_all_of_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DogAllOf +void main() { + //final instance = DogAllOfBuilder(); + // TODO add properties to the builder and call build() + + group(DogAllOf, () { + // String breed + test('to test the property `breed`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/dog_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/dog_test.dart new file mode 100644 index 000000000000..f57fcdc413df --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/dog_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Dog +void main() { + final instance = DogBuilder(); + // TODO add properties to the builder and call build() + + group(Dog, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // String breed + test('to test the property `breed`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/entity_ref_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/entity_ref_test.dart new file mode 100644 index 000000000000..836289893fb4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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 instance = EntityRefBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-dio-built_value/test/entity_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/entity_test.dart new file mode 100644 index 000000000000..30429747562d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/entity_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Entity +void main() { + //final instance = EntityBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-dio-built_value/test/enum_arrays_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/enum_arrays_test.dart new file mode 100644 index 000000000000..438c36db0745 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/enum_arrays_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumArrays +void main() { + final instance = EnumArraysBuilder(); + // TODO add properties to the builder and call build() + + group(EnumArrays, () { + // String justSymbol + test('to test the property `justSymbol`', () async { + // TODO + }); + + // BuiltList arrayEnum + test('to test the property `arrayEnum`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/enum_test_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/enum_test_test.dart new file mode 100644 index 000000000000..b5f3aeb7fbdd --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/enum_test_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumTest +void main() { + final instance = EnumTestBuilder(); + // TODO add properties to the builder and call build() + + group(EnumTest, () { + // String enumString + test('to test the property `enumString`', () async { + // TODO + }); + + // String enumStringRequired + test('to test the property `enumStringRequired`', () async { + // TODO + }); + + // int enumInteger + test('to test the property `enumInteger`', () async { + // TODO + }); + + // double enumNumber + test('to test the property `enumNumber`', () async { + // TODO + }); + + // OuterEnum outerEnum + test('to test the property `outerEnum`', () async { + // TODO + }); + + // OuterEnumInteger outerEnumInteger + test('to test the property `outerEnumInteger`', () async { + // TODO + }); + + // OuterEnumDefaultValue outerEnumDefaultValue + test('to test the property `outerEnumDefaultValue`', () async { + // TODO + }); + + // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue + test('to test the property `outerEnumIntegerDefaultValue`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/example_non_primitive_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/example_non_primitive_test.dart new file mode 100644 index 000000000000..93f736780e93 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/example_non_primitive_test.dart @@ -0,0 +1,11 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ExampleNonPrimitive +void main() { + final instance = ExampleNonPrimitiveBuilder(); + // TODO add properties to the builder and call build() + + group(ExampleNonPrimitive, () { + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/example_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/example_test.dart new file mode 100644 index 000000000000..ccb35121143e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/example_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Example +void main() { + final instance = ExampleBuilder(); + // TODO add properties to the builder and call build() + + group(Example, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/extensible_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/extensible_test.dart new file mode 100644 index 000000000000..75e6211e074b --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/extensible_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Extensible +void main() { + //final instance = ExtensibleBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-dio-built_value/test/file_schema_test_class_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/file_schema_test_class_test.dart new file mode 100644 index 000000000000..ca8695bd4a47 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/file_schema_test_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FileSchemaTestClass +void main() { + final instance = FileSchemaTestClassBuilder(); + // TODO add properties to the builder and call build() + + group(FileSchemaTestClass, () { + // ModelFile file + test('to test the property `file`', () async { + // TODO + }); + + // BuiltList files + test('to test the property `files`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_or_value_test.dart new file mode 100644 index 000000000000..029d030e5e35 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_or_value_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRefOrValue +void main() { + final instance = FooRefOrValueBuilder(); + // TODO add properties to the builder and call build() + + group(FooRefOrValue, () { + // 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/client/echo_api/dart/dart-dio-built_value/test/foo_ref_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_test.dart new file mode 100644 index 000000000000..a1398787bbcb --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRef +void main() { + final instance = FooRefBuilder(); + // TODO add properties to the builder and call build() + + group(FooRef, () { + // String foorefPropA + test('to test the property `foorefPropA`', () 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/client/echo_api/dart/dart-dio-built_value/test/foo_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_test.dart new file mode 100644 index 000000000000..93a5286e2b45 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final instance = FooBuilder(); + // TODO add properties to the builder and call build() + + group(Foo, () { + // String 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/client/echo_api/dart/dart-dio-built_value/test/format_test_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/format_test_test.dart new file mode 100644 index 000000000000..558c3aa4b659 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/format_test_test.dart @@ -0,0 +1,93 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FormatTest +void main() { + final instance = FormatTestBuilder(); + // TODO add properties to the builder and call build() + + group(FormatTest, () { + // int integer + test('to test the property `integer`', () async { + // TODO + }); + + // int int32 + test('to test the property `int32`', () async { + // TODO + }); + + // int int64 + test('to test the property `int64`', () async { + // TODO + }); + + // num number + test('to test the property `number`', () async { + // TODO + }); + + // double float + test('to test the property `float`', () async { + // TODO + }); + + // double double_ + test('to test the property `double_`', () async { + // TODO + }); + + // double decimal + test('to test the property `decimal`', () async { + // TODO + }); + + // String string + test('to test the property `string`', () async { + // TODO + }); + + // String byte + test('to test the property `byte`', () async { + // TODO + }); + + // Uint8List binary + test('to test the property `binary`', () async { + // TODO + }); + + // Date 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/client/echo_api/dart/dart-dio-built_value/test/fruit_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/fruit_test.dart new file mode 100644 index 000000000000..c18790ae9566 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/fruit_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Fruit +void main() { + final instance = FruitBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-dio-built_value/test/has_only_read_only_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/has_only_read_only_test.dart new file mode 100644 index 000000000000..c34522214751 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/has_only_read_only_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HasOnlyReadOnly +void main() { + final instance = HasOnlyReadOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(HasOnlyReadOnly, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String foo + test('to test the property `foo`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/health_check_result_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/health_check_result_test.dart new file mode 100644 index 000000000000..fda0c9218217 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/health_check_result_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HealthCheckResult +void main() { + final instance = HealthCheckResultBuilder(); + // TODO add properties to the builder and call build() + + group(HealthCheckResult, () { + // String nullableMessage + test('to test the property `nullableMessage`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/map_test_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/map_test_test.dart new file mode 100644 index 000000000000..56a27610ee5a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/map_test_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MapTest +void main() { + final instance = MapTestBuilder(); + // TODO add properties to the builder and call build() + + group(MapTest, () { + // BuiltMap> mapMapOfString + test('to test the property `mapMapOfString`', () async { + // TODO + }); + + // BuiltMap mapOfEnumString + test('to test the property `mapOfEnumString`', () async { + // TODO + }); + + // BuiltMap directMap + test('to test the property `directMap`', () async { + // TODO + }); + + // BuiltMap indirectMap + test('to test the property `indirectMap`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/mixed_properties_and_additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/mixed_properties_and_additional_properties_class_test.dart new file mode 100644 index 000000000000..85b113387a08 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/mixed_properties_and_additional_properties_class_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MixedPropertiesAndAdditionalPropertiesClass +void main() { + final instance = MixedPropertiesAndAdditionalPropertiesClassBuilder(); + // TODO add properties to the builder and call build() + + group(MixedPropertiesAndAdditionalPropertiesClass, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // DateTime dateTime + test('to test the property `dateTime`', () async { + // TODO + }); + + // BuiltMap map + test('to test the property `map`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/model200_response_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model200_response_test.dart new file mode 100644 index 000000000000..11bac07fafb8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/model200_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Model200Response +void main() { + final instance = Model200ResponseBuilder(); + // TODO add properties to the builder and call build() + + group(Model200Response, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // String classField + test('to test the property `classField`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/model_client_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model_client_test.dart new file mode 100644 index 000000000000..f494dfd08499 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/model_client_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelClient +void main() { + final instance = ModelClientBuilder(); + // TODO add properties to the builder and call build() + + group(ModelClient, () { + // String client + test('to test the property `client`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/model_enum_class_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model_enum_class_test.dart new file mode 100644 index 000000000000..03e5855bf004 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/test/model_file_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model_file_test.dart new file mode 100644 index 000000000000..4f1397726226 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/model_file_test.dart @@ -0,0 +1,17 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelFile +void main() { + final instance = ModelFileBuilder(); + // TODO add properties to the builder and call build() + + group(ModelFile, () { + // Test capitalization + // String sourceURI + test('to test the property `sourceURI`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/model_list_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model_list_test.dart new file mode 100644 index 000000000000..d35e02fe0c9a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/model_list_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelList +void main() { + final instance = ModelListBuilder(); + // TODO add properties to the builder and call build() + + group(ModelList, () { + // String n123list + test('to test the property `n123list`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/model_return_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model_return_test.dart new file mode 100644 index 000000000000..eedfe7eb281a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/model_return_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelReturn +void main() { + final instance = ModelReturnBuilder(); + // TODO add properties to the builder and call build() + + group(ModelReturn, () { + // int return_ + test('to test the property `return_`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/name_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/name_test.dart new file mode 100644 index 000000000000..6b2329bb0819 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/name_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Name +void main() { + final instance = NameBuilder(); + // TODO add properties to the builder and call build() + + group(Name, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // int snakeCase + test('to test the property `snakeCase`', () async { + // TODO + }); + + // String property + test('to test the property `property`', () async { + // TODO + }); + + // int n123number + test('to test the property `n123number`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/nullable_class_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/nullable_class_test.dart new file mode 100644 index 000000000000..1a6767dbb2ab --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/nullable_class_test.dart @@ -0,0 +1,71 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NullableClass +void main() { + final instance = NullableClassBuilder(); + // TODO add properties to the builder and call build() + + group(NullableClass, () { + // int integerProp + test('to test the property `integerProp`', () async { + // TODO + }); + + // num numberProp + test('to test the property `numberProp`', () async { + // TODO + }); + + // bool booleanProp + test('to test the property `booleanProp`', () async { + // TODO + }); + + // String stringProp + test('to test the property `stringProp`', () async { + // TODO + }); + + // Date dateProp + test('to test the property `dateProp`', () async { + // TODO + }); + + // DateTime datetimeProp + test('to test the property `datetimeProp`', () async { + // TODO + }); + + // BuiltList arrayNullableProp + test('to test the property `arrayNullableProp`', () async { + // TODO + }); + + // BuiltList arrayAndItemsNullableProp + test('to test the property `arrayAndItemsNullableProp`', () async { + // TODO + }); + + // BuiltList arrayItemsNullable + test('to test the property `arrayItemsNullable`', () async { + // TODO + }); + + // BuiltMap objectNullableProp + test('to test the property `objectNullableProp`', () async { + // TODO + }); + + // BuiltMap objectAndItemsNullableProp + test('to test the property `objectAndItemsNullableProp`', () async { + // TODO + }); + + // BuiltMap objectItemsNullable + test('to test the property `objectItemsNullable`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/number_only_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/number_only_test.dart new file mode 100644 index 000000000000..7167d78a4962 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NumberOnly +void main() { + final instance = NumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(NumberOnly, () { + // num justNumber + test('to test the property `justNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/object_with_deprecated_fields_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/object_with_deprecated_fields_test.dart new file mode 100644 index 000000000000..67275d513f56 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/object_with_deprecated_fields_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ObjectWithDeprecatedFields +void main() { + final instance = ObjectWithDeprecatedFieldsBuilder(); + // TODO add properties to the builder and call build() + + group(ObjectWithDeprecatedFields, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // num id + test('to test the property `id`', () async { + // TODO + }); + + // DeprecatedObject deprecatedRef + test('to test the property `deprecatedRef`', () async { + // TODO + }); + + // BuiltList bars + test('to test the property `bars`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/order_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/order_test.dart new file mode 100644 index 000000000000..7ff992230bf6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/order_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Order +void main() { + final instance = OrderBuilder(); + // TODO add properties to the builder and call build() + + group(Order, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // int petId + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_composite_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_composite_test.dart new file mode 100644 index 000000000000..dac257d9a0d6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_composite_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterComposite +void main() { + final instance = OuterCompositeBuilder(); + // TODO add properties to the builder and call build() + + group(OuterComposite, () { + // num myNumber + test('to test the property `myNumber`', () async { + // TODO + }); + + // String myString + test('to test the property `myString`', () async { + // TODO + }); + + // bool myBoolean + test('to test the property `myBoolean`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_default_value_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_default_value_test.dart new file mode 100644 index 000000000000..502c8326be58 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_default_value_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_default_value_test.dart new file mode 100644 index 000000000000..c535fe8ac354 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_test.dart new file mode 100644 index 000000000000..d945bc8c489d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/test/outer_enum_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_test.dart new file mode 100644 index 000000000000..8e11eb02fb8a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/test/outer_object_with_enum_property_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_object_with_enum_property_test.dart new file mode 100644 index 000000000000..d6d763c5d93a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_object_with_enum_property_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterObjectWithEnumProperty +void main() { + final instance = OuterObjectWithEnumPropertyBuilder(); + // TODO add properties to the builder and call build() + + group(OuterObjectWithEnumProperty, () { + // OuterEnumInteger value + test('to test the property `value`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/pasta_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/pasta_test.dart new file mode 100644 index 000000000000..6a3ae338eec2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/pasta_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pasta +void main() { + final instance = PastaBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-dio-built_value/test/path_api_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/path_api_test.dart new file mode 100644 index 000000000000..4ffdcc4567be --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/path_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for PathApi +void main() { + final instance = Openapi().getPathApi(); + + group(PathApi, () { + // Test path parameter(s) + // + // Test path parameter(s) + // + //Future testsPathStringPathStringIntegerPathInteger(String pathString, int pathInteger) async + test('test testsPathStringPathStringIntegerPathInteger', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/pet_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/pet_test.dart new file mode 100644 index 000000000000..94089dce62cf --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/pet_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pet +void main() { + final instance = PetBuilder(); + // TODO add properties to the builder and call build() + + group(Pet, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Category category + test('to test the property `category`', () async { + // TODO + }); + + // BuiltList photoUrls + test('to test the property `photoUrls`', () async { + // TODO + }); + + // BuiltList 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/client/echo_api/dart/dart-dio-built_value/test/pizza_speziale_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_speziale_test.dart new file mode 100644 index 000000000000..774320231c9e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_speziale_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PizzaSpeziale +void main() { + final instance = PizzaSpezialeBuilder(); + // TODO add properties to the builder and call build() + + group(PizzaSpeziale, () { + // String toppings + test('to test the property `toppings`', () 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/client/echo_api/dart/dart-dio-built_value/test/pizza_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_test.dart new file mode 100644 index 000000000000..5c6e1af95a59 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pizza +void main() { + //final instance = PizzaBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-dio-built_value/test/query_api_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/query_api_test.dart new file mode 100644 index 000000000000..fbb29ec74c85 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/query_api_test.dart @@ -0,0 +1,38 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for QueryApi +void main() { + final instance = Openapi().getQueryApi(); + + group(QueryApi, () { + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryIntegerBooleanString({ int integerQuery, bool booleanQuery, String stringQuery }) async + test('test testQueryIntegerBooleanString', () async { + // TODO + }); + + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryStyleFormExplodeTrueArrayString({ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject }) async + test('test testQueryStyleFormExplodeTrueArrayString', () async { + // TODO + }); + + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryStyleFormExplodeTrueObject({ Pet queryObject }) async + test('test testQueryStyleFormExplodeTrueObject', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/read_only_first_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/read_only_first_test.dart new file mode 100644 index 000000000000..550d3d793ec6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/read_only_first_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ReadOnlyFirst +void main() { + final instance = ReadOnlyFirstBuilder(); + // TODO add properties to the builder and call build() + + group(ReadOnlyFirst, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String baz + test('to test the property `baz`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/single_ref_type_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/single_ref_type_test.dart new file mode 100644 index 000000000000..5cd85add393e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/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/client/echo_api/dart/dart-dio-built_value/test/special_model_name_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/special_model_name_test.dart new file mode 100644 index 000000000000..08a4592a1ed7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/special_model_name_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SpecialModelName +void main() { + final instance = SpecialModelNameBuilder(); + // TODO add properties to the builder and call build() + + group(SpecialModelName, () { + // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/tag_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/tag_test.dart new file mode 100644 index 000000000000..6f7c63b8f0c2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/tag_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Tag +void main() { + final instance = TagBuilder(); + // TODO add properties to the builder and call build() + + group(Tag, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart new file mode 100644 index 000000000000..2017e0c3d8d1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter +void main() { + final instance = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); + // TODO add properties to the builder and call build() + + group(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, () { + // BuiltList values + test('to test the property `values`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/user_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/user_test.dart new file mode 100644 index 000000000000..1e6a1bc23faa --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/user_test.dart @@ -0,0 +1,52 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for User +void main() { + final instance = UserBuilder(); + // TODO add properties to the builder and call build() + + group(User, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String username + test('to test the property `username`', () async { + // TODO + }); + + // String firstName + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName + test('to test the property `lastName`', () async { + // TODO + }); + + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // String phone + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus + test('to test the property `userStatus`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/.gitignore b/samples/client/echo_api/dart/dart-http-built_value/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/.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/client/echo_api/dart/dart-http-built_value/.openapi-generator-ignore b/samples/client/echo_api/dart/dart-http-built_value/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/.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/client/echo_api/dart/dart-http-built_value/.openapi-generator/FILES b/samples/client/echo_api/dart/dart-http-built_value/.openapi-generator/FILES new file mode 100644 index 000000000000..0c1bfee18ae8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/.openapi-generator/FILES @@ -0,0 +1,155 @@ +.gitignore +README.md +analysis_options.yaml +doc/AdditionalPropertiesClass.md +doc/Addressable.md +doc/AllOfWithSingleRef.md +doc/Animal.md +doc/ApiResponse.md +doc/Apple.md +doc/ArrayOfArrayOfNumberOnly.md +doc/ArrayOfNumberOnly.md +doc/ArrayTest.md +doc/Banana.md +doc/Bar.md +doc/BarCreate.md +doc/BarRef.md +doc/BarRefOrValue.md +doc/BodyApi.md +doc/Capitalization.md +doc/Cat.md +doc/CatAllOf.md +doc/Category.md +doc/Child.md +doc/ClassModel.md +doc/DeprecatedObject.md +doc/Dog.md +doc/DogAllOf.md +doc/Entity.md +doc/EntityRef.md +doc/EnumArrays.md +doc/EnumTest.md +doc/Example.md +doc/ExampleNonPrimitive.md +doc/Extensible.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FooRef.md +doc/FooRefOrValue.md +doc/FormatTest.md +doc/Fruit.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/Pasta.md +doc/PathApi.md +doc/Pet.md +doc/Pizza.md +doc/PizzaSpeziale.md +doc/QueryApi.md +doc/ReadOnlyFirst.md +doc/SingleRefType.md +doc/SpecialModelName.md +doc/Tag.md +doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +doc/User.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/body_api.dart +lib/src/api/path_api.dart +lib/src/api/query_api.dart +lib/src/api_util.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/authentication.dart +lib/src/auth/http_basic_auth.dart +lib/src/auth/http_bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/date_serializer.dart +lib/src/model/additional_properties_class.dart +lib/src/model/addressable.dart +lib/src/model/all_of_with_single_ref.dart +lib/src/model/animal.dart +lib/src/model/api_response.dart +lib/src/model/apple.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/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/capitalization.dart +lib/src/model/cat.dart +lib/src/model/cat_all_of.dart +lib/src/model/category.dart +lib/src/model/child.dart +lib/src/model/class_model.dart +lib/src/model/date.dart +lib/src/model/deprecated_object.dart +lib/src/model/dog.dart +lib/src/model/dog_all_of.dart +lib/src/model/entity.dart +lib/src/model/entity_ref.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/example.dart +lib/src/model/example_non_primitive.dart +lib/src/model/extensible.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/foo_ref.dart +lib/src/model/foo_ref_or_value.dart +lib/src/model/format_test.dart +lib/src/model/fruit.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/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/pasta.dart +lib/src/model/pet.dart +lib/src/model/pizza.dart +lib/src/model/pizza_speziale.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_query_style_form_explode_true_array_string_query_object_parameter.dart +lib/src/model/user.dart +lib/src/serializers.dart +pubspec.yaml diff --git a/samples/client/echo_api/dart/dart-http-built_value/.openapi-generator/VERSION b/samples/client/echo_api/dart/dart-http-built_value/.openapi-generator/VERSION new file mode 100644 index 000000000000..d6b4ec4aa783 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/echo_api/dart/dart-http-built_value/README.md b/samples/client/echo_api/dart/dart-http-built_value/README.md new file mode 100644 index 000000000000..83dce6ed3339 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/README.md @@ -0,0 +1,153 @@ +# openapi +Echo Server API + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.1.0 +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.12.0 or later OR Flutter 1.26.0 or later +* http 0.13.5+ + +## 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().getBodyApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + final response = await api.testEchoBodyPet(pet); + print(response); +} catch on DioError (e) { + print("Exception when calling BodyApi->testEchoBodyPet: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:3000* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*BodyApi*](doc/BodyApi.md) | [**testEchoBodyPet**](doc/BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) +[*PathApi*](doc/PathApi.md) | [**testsPathStringPathStringIntegerPathInteger**](doc/PathApi.md#testspathstringpathstringintegerpathinteger) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryIntegerBooleanString**](doc/QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryStyleFormExplodeTrueArrayString**](doc/QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryStyleFormExplodeTrueObject**](doc/QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) + + +## Documentation For Models + + - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) + - [Addressable](doc/Addressable.md) + - [AllOfWithSingleRef](doc/AllOfWithSingleRef.md) + - [Animal](doc/Animal.md) + - [ApiResponse](doc/ApiResponse.md) + - [Apple](doc/Apple.md) + - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) + - [ArrayTest](doc/ArrayTest.md) + - [Banana](doc/Banana.md) + - [Bar](doc/Bar.md) + - [BarCreate](doc/BarCreate.md) + - [BarRef](doc/BarRef.md) + - [BarRefOrValue](doc/BarRefOrValue.md) + - [Capitalization](doc/Capitalization.md) + - [Cat](doc/Cat.md) + - [CatAllOf](doc/CatAllOf.md) + - [Category](doc/Category.md) + - [Child](doc/Child.md) + - [ClassModel](doc/ClassModel.md) + - [DeprecatedObject](doc/DeprecatedObject.md) + - [Dog](doc/Dog.md) + - [DogAllOf](doc/DogAllOf.md) + - [Entity](doc/Entity.md) + - [EntityRef](doc/EntityRef.md) + - [EnumArrays](doc/EnumArrays.md) + - [EnumTest](doc/EnumTest.md) + - [Example](doc/Example.md) + - [ExampleNonPrimitive](doc/ExampleNonPrimitive.md) + - [Extensible](doc/Extensible.md) + - [FileSchemaTestClass](doc/FileSchemaTestClass.md) + - [Foo](doc/Foo.md) + - [FooRef](doc/FooRef.md) + - [FooRefOrValue](doc/FooRefOrValue.md) + - [FormatTest](doc/FormatTest.md) + - [Fruit](doc/Fruit.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) + - [Pasta](doc/Pasta.md) + - [Pet](doc/Pet.md) + - [Pizza](doc/Pizza.md) + - [PizzaSpeziale](doc/PizzaSpeziale.md) + - [ReadOnlyFirst](doc/ReadOnlyFirst.md) + - [SingleRefType](doc/SingleRefType.md) + - [SpecialModelName](doc/SpecialModelName.md) + - [Tag](doc/Tag.md) + - [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md) + - [User](doc/User.md) + + +## Documentation For Authorization + + All endpoints do not require authorization. + + +## Author + +team@openapitools.org + diff --git a/samples/client/echo_api/dart/dart-http-built_value/analysis_options.yaml b/samples/client/echo_api/dart/dart-http-built_value/analysis_options.yaml new file mode 100644 index 000000000000..a611887d3acf --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/analysis_options.yaml @@ -0,0 +1,9 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart diff --git a/samples/client/echo_api/dart/dart-http-built_value/doc/AdditionalPropertiesClass.md b/samples/client/echo_api/dart/dart-http-built_value/doc/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..f9f7857894d0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | **BuiltMap<String, String>** | | [optional] +**mapOfMapProperty** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.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/client/echo_api/dart/dart-http-built_value/doc/Addressable.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Addressable.md new file mode 100644 index 000000000000..0fcd81b80382 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/AllOfWithSingleRef.md b/samples/client/echo_api/dart/dart-http-built_value/doc/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4c6f3ab2fe11 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/Animal.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Animal.md new file mode 100644 index 000000000000..415b56e9bc2e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/ApiResponse.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ApiResponse.md new file mode 100644 index 000000000000..7ad5da0f89e4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/Apple.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Apple.md new file mode 100644 index 000000000000..c7f711b87cef --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/ArrayOfArrayOfNumberOnly.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..d1a272ab6023 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | [**BuiltList<BuiltList<num>>**](BuiltList.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/client/echo_api/dart/dart-http-built_value/doc/ArrayOfNumberOnly.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..94b60f272fd4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | **BuiltList<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/client/echo_api/dart/dart-http-built_value/doc/ArrayTest.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ArrayTest.md new file mode 100644 index 000000000000..0813d4fa93c6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | **BuiltList<String>** | | [optional] +**arrayArrayOfInteger** | [**BuiltList<BuiltList<int>>**](BuiltList.md) | | [optional] +**arrayArrayOfModel** | [**BuiltList<BuiltList<ReadOnlyFirst>>**](BuiltList.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/client/echo_api/dart/dart-http-built_value/doc/Banana.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Banana.md new file mode 100644 index 000000000000..bef8a58a4276 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/Bar.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Bar.md new file mode 100644 index 000000000000..4cccc863a489 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/BarCreate.md b/samples/client/echo_api/dart/dart-http-built_value/doc/BarCreate.md new file mode 100644 index 000000000000..c0b4ba6edc9a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/BarRef.md b/samples/client/echo_api/dart/dart-http-built_value/doc/BarRef.md new file mode 100644 index 000000000000..949695f4d36f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/BarRef.md @@ -0,0 +1,19 @@ +# openapi.model.BarRef + +## 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/client/echo_api/dart/dart-http-built_value/doc/BarRefOrValue.md b/samples/client/echo_api/dart/dart-http-built_value/doc/BarRefOrValue.md new file mode 100644 index 000000000000..9dafa2d6b220 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/BarRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.BarRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | +**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/client/echo_api/dart/dart-http-built_value/doc/BodyApi.md b/samples/client/echo_api/dart/dart-http-built_value/doc/BodyApi.md new file mode 100644 index 000000000000..145854fc8d28 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/BodyApi.md @@ -0,0 +1,57 @@ +# openapi.api.BodyApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testEchoBodyPet**](BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) + + +# **testEchoBodyPet** +> Pet testEchoBodyPet(pet) + +Test body parameter(s) + +Test body parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getBodyApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + final response = api.testEchoBodyPet(pet); + print(response); +} catch on DioError (e) { + print('Exception when calling BodyApi->testEchoBodyPet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +[**Pet**](Pet.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/client/echo_api/dart/dart-http-built_value/doc/Capitalization.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Capitalization.md new file mode 100644 index 000000000000..4a07b4eb820d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/Cat.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Cat.md new file mode 100644 index 000000000000..6552eea4b435 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/CatAllOf.md b/samples/client/echo_api/dart/dart-http-built_value/doc/CatAllOf.md new file mode 100644 index 000000000000..36b2ae0e8ab3 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/CatAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.CatAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-built_value/doc/Category.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Category.md new file mode 100644 index 000000000000..98d0b14be7b1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | | [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/client/echo_api/dart/dart-http-built_value/doc/Child.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Child.md new file mode 100644 index 000000000000..bed0f2feec12 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/ClassModel.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ClassModel.md new file mode 100644 index 000000000000..9b80d4f71eea --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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 +------------ | ------------- | ------------- | ------------- +**classField** | **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/client/echo_api/dart/dart-http-built_value/doc/DeprecatedObject.md b/samples/client/echo_api/dart/dart-http-built_value/doc/DeprecatedObject.md new file mode 100644 index 000000000000..bf2ef67a26fc --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/Dog.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Dog.md new file mode 100644 index 000000000000..d36439b767bb --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/DogAllOf.md b/samples/client/echo_api/dart/dart-http-built_value/doc/DogAllOf.md new file mode 100644 index 000000000000..97a7c8fba492 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/DogAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.DogAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-built_value/doc/Entity.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Entity.md new file mode 100644 index 000000000000..5ba2144b44fe --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/EntityRef.md b/samples/client/echo_api/dart/dart-http-built_value/doc/EntityRef.md new file mode 100644 index 000000000000..80eae55f4145 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/EnumArrays.md b/samples/client/echo_api/dart/dart-http-built_value/doc/EnumArrays.md new file mode 100644 index 000000000000..06170bb8f51d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | **BuiltList<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/client/echo_api/dart/dart-http-built_value/doc/EnumTest.md b/samples/client/echo_api/dart/dart-http-built_value/doc/EnumTest.md new file mode 100644 index 000000000000..7c24fe2347b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/Example.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Example.md new file mode 100644 index 000000000000..bf49bb137a60 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/ExampleNonPrimitive.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ExampleNonPrimitive.md new file mode 100644 index 000000000000..2b63a98c6ad9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/ExampleNonPrimitive.md @@ -0,0 +1,14 @@ +# openapi.model.ExampleNonPrimitive + +## 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/client/echo_api/dart/dart-http-built_value/doc/Extensible.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Extensible.md new file mode 100644 index 000000000000..7a781e578ea4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/FileSchemaTestClass.md b/samples/client/echo_api/dart/dart-http-built_value/doc/FileSchemaTestClass.md new file mode 100644 index 000000000000..105fece87f1d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | [**BuiltList<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/client/echo_api/dart/dart-http-built_value/doc/Foo.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Foo.md new file mode 100644 index 000000000000..2627691fefe5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/FooRef.md b/samples/client/echo_api/dart/dart-http-built_value/doc/FooRef.md new file mode 100644 index 000000000000..68104b227292 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/FooRef.md @@ -0,0 +1,20 @@ +# openapi.model.FooRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foorefPropA** | **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/client/echo_api/dart/dart-http-built_value/doc/FooRefOrValue.md b/samples/client/echo_api/dart/dart-http-built_value/doc/FooRefOrValue.md new file mode 100644 index 000000000000..35e9fd114e1d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/FooRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.FooRefOrValue + +## 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/client/echo_api/dart/dart-http-built_value/doc/FormatTest.md b/samples/client/echo_api/dart/dart-http-built_value/doc/FormatTest.md new file mode 100644 index 000000000000..f811264ca2ba --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | [**Uint8List**](Uint8List.md) | | [optional] +**date** | [**Date**](Date.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/client/echo_api/dart/dart-http-built_value/doc/Fruit.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Fruit.md new file mode 100644 index 000000000000..5d48cc6e6d38 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/HasOnlyReadOnly.md b/samples/client/echo_api/dart/dart-http-built_value/doc/HasOnlyReadOnly.md new file mode 100644 index 000000000000..32cae937155d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/HealthCheckResult.md b/samples/client/echo_api/dart/dart-http-built_value/doc/HealthCheckResult.md new file mode 100644 index 000000000000..4d6aeb75d965 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/MapTest.md b/samples/client/echo_api/dart/dart-http-built_value/doc/MapTest.md new file mode 100644 index 000000000000..4ad87df64232 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] +**mapOfEnumString** | **BuiltMap<String, String>** | | [optional] +**directMap** | **BuiltMap<String, bool>** | | [optional] +**indirectMap** | **BuiltMap<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/client/echo_api/dart/dart-http-built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/echo_api/dart/dart-http-built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..b1a4c4ccc401 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | [**BuiltMap<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/client/echo_api/dart/dart-http-built_value/doc/Model200Response.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Model200Response.md new file mode 100644 index 000000000000..e8b088ca1afa --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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] +**classField** | **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/client/echo_api/dart/dart-http-built_value/doc/ModelClient.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ModelClient.md new file mode 100644 index 000000000000..f7b922f4a398 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/ModelEnumClass.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ModelEnumClass.md new file mode 100644 index 000000000000..ebaafb44c7f7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/ModelFile.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ModelFile.md new file mode 100644 index 000000000000..4be260e93f6e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/ModelList.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ModelList.md new file mode 100644 index 000000000000..283aa1f6b711 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/ModelReturn.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ModelReturn.md new file mode 100644 index 000000000000..bc02df7a3692 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/Name.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Name.md new file mode 100644 index 000000000000..25f49ea946b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/NullableClass.md b/samples/client/echo_api/dart/dart-http-built_value/doc/NullableClass.md new file mode 100644 index 000000000000..4ce8d5e17576 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | [**Date**](Date.md) | | [optional] +**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] +**arrayNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] +**arrayAndItemsNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] +**arrayItemsNullable** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] +**objectNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] +**objectAndItemsNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] +**objectItemsNullable** | [**BuiltMap<String, JsonObject>**](JsonObject.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/client/echo_api/dart/dart-http-built_value/doc/NumberOnly.md b/samples/client/echo_api/dart/dart-http-built_value/doc/NumberOnly.md new file mode 100644 index 000000000000..d8096a3db37a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/ObjectWithDeprecatedFields.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..00d3cc694525 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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** | [**BuiltList<Bar>**](Bar.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/client/echo_api/dart/dart-http-built_value/doc/Order.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Order.md new file mode 100644 index 000000000000..bde5ffe51a2c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/OuterComposite.md b/samples/client/echo_api/dart/dart-http-built_value/doc/OuterComposite.md new file mode 100644 index 000000000000..04bab7eff5d1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/OuterEnum.md b/samples/client/echo_api/dart/dart-http-built_value/doc/OuterEnum.md new file mode 100644 index 000000000000..af62ad87ab2e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/OuterEnumDefaultValue.md b/samples/client/echo_api/dart/dart-http-built_value/doc/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..c1bf8b0dec44 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/OuterEnumInteger.md b/samples/client/echo_api/dart/dart-http-built_value/doc/OuterEnumInteger.md new file mode 100644 index 000000000000..8c80a9e5c85f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/OuterEnumIntegerDefaultValue.md b/samples/client/echo_api/dart/dart-http-built_value/doc/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..eb8b55d70249 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/OuterObjectWithEnumProperty.md b/samples/client/echo_api/dart/dart-http-built_value/doc/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..eab2ae8f66b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/Pasta.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Pasta.md new file mode 100644 index 000000000000..034ff420d323 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/PathApi.md b/samples/client/echo_api/dart/dart-http-built_value/doc/PathApi.md new file mode 100644 index 000000000000..ae663a2f7f04 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/PathApi.md @@ -0,0 +1,59 @@ +# openapi.api.PathApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testsPathStringPathStringIntegerPathInteger**](PathApi.md#testspathstringpathstringintegerpathinteger) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s) + + +# **testsPathStringPathStringIntegerPathInteger** +> String testsPathStringPathStringIntegerPathInteger(pathString, pathInteger) + +Test path parameter(s) + +Test path parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getPathApi(); +final String pathString = pathString_example; // String | +final int pathInteger = 56; // int | + +try { + final response = api.testsPathStringPathStringIntegerPathInteger(pathString, pathInteger); + print(response); +} catch on DioError (e) { + print('Exception when calling PathApi->testsPathStringPathStringIntegerPathInteger: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pathString** | **String**| | + **pathInteger** | **int**| | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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/client/echo_api/dart/dart-http-built_value/doc/Pet.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Pet.md new file mode 100644 index 000000000000..455b9330ff8e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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] +**name** | **String** | | +**category** | [**Category**](Category.md) | | [optional] +**photoUrls** | **BuiltList<String>** | | +**tags** | [**BuiltList<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/client/echo_api/dart/dart-http-built_value/doc/Pizza.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Pizza.md new file mode 100644 index 000000000000..e4b040a6a79c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/PizzaSpeziale.md b/samples/client/echo_api/dart/dart-http-built_value/doc/PizzaSpeziale.md new file mode 100644 index 000000000000..e1d8434c077d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/PizzaSpeziale.md @@ -0,0 +1,20 @@ +# openapi.model.PizzaSpeziale + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toppings** | **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/client/echo_api/dart/dart-http-built_value/doc/QueryApi.md b/samples/client/echo_api/dart/dart-http-built_value/doc/QueryApi.md new file mode 100644 index 000000000000..f92f9532a113 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/QueryApi.md @@ -0,0 +1,149 @@ +# openapi.api.QueryApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testQueryIntegerBooleanString**](QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s) +[**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +[**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) + + +# **testQueryIntegerBooleanString** +> String testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final int integerQuery = 56; // int | +final bool booleanQuery = true; // bool | +final String stringQuery = stringQuery_example; // String | + +try { + final response = api.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryIntegerBooleanString: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integerQuery** | **int**| | [optional] + **booleanQuery** | **bool**| | [optional] + **stringQuery** | **String**| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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) + +# **testQueryStyleFormExplodeTrueArrayString** +> String testQueryStyleFormExplodeTrueArrayString(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject = ; // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter | + +try { + final response = api.testQueryStyleFormExplodeTrueArrayString(queryObject); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryStyleFormExplodeTrueArrayString: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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) + +# **testQueryStyleFormExplodeTrueObject** +> String testQueryStyleFormExplodeTrueObject(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final Pet queryObject = ; // Pet | + +try { + final response = api.testQueryStyleFormExplodeTrueObject(queryObject); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryStyleFormExplodeTrueObject: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | [**Pet**](.md)| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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/client/echo_api/dart/dart-http-built_value/doc/ReadOnlyFirst.md b/samples/client/echo_api/dart/dart-http-built_value/doc/ReadOnlyFirst.md new file mode 100644 index 000000000000..8f612e8ba19f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/SingleRefType.md b/samples/client/echo_api/dart/dart-http-built_value/doc/SingleRefType.md new file mode 100644 index 000000000000..0dc93840cd7f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/SpecialModelName.md b/samples/client/echo_api/dart/dart-http-built_value/doc/SpecialModelName.md new file mode 100644 index 000000000000..5fcfa98e0b36 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/Tag.md b/samples/client/echo_api/dart/dart-http-built_value/doc/Tag.md new file mode 100644 index 000000000000..c219f987c19c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/dart/dart-http-built_value/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md new file mode 100644 index 000000000000..9ee07596a0df --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -0,0 +1,15 @@ +# openapi.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | **BuiltList<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/client/echo_api/dart/dart-http-built_value/doc/User.md b/samples/client/echo_api/dart/dart-http-built_value/doc/User.md new file mode 100644 index 000000000000..fa87e64d8595 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/lib/openapi.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/openapi.dart new file mode 100644 index 000000000000..0b51813f1c05 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/openapi.dart @@ -0,0 +1,82 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:openapi/src/api.dart'; +export 'package:openapi/src/auth/api_key_auth.dart'; +export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; +export 'package:openapi/src/serializers.dart'; +export 'package:openapi/src/model/date.dart'; + +export 'package:openapi/src/api/body_api.dart'; +export 'package:openapi/src/api/path_api.dart'; +export 'package:openapi/src/api/query_api.dart'; + +export 'package:openapi/src/model/additional_properties_class.dart'; +export 'package:openapi/src/model/addressable.dart'; +export 'package:openapi/src/model/all_of_with_single_ref.dart'; +export 'package:openapi/src/model/animal.dart'; +export 'package:openapi/src/model/api_response.dart'; +export 'package:openapi/src/model/apple.dart'; +export 'package:openapi/src/model/array_of_array_of_number_only.dart'; +export 'package:openapi/src/model/array_of_number_only.dart'; +export 'package:openapi/src/model/array_test.dart'; +export 'package:openapi/src/model/banana.dart'; +export 'package:openapi/src/model/bar.dart'; +export 'package:openapi/src/model/bar_create.dart'; +export 'package:openapi/src/model/bar_ref.dart'; +export 'package:openapi/src/model/bar_ref_or_value.dart'; +export 'package:openapi/src/model/capitalization.dart'; +export 'package:openapi/src/model/cat.dart'; +export 'package:openapi/src/model/cat_all_of.dart'; +export 'package:openapi/src/model/category.dart'; +export 'package:openapi/src/model/child.dart'; +export 'package:openapi/src/model/class_model.dart'; +export 'package:openapi/src/model/deprecated_object.dart'; +export 'package:openapi/src/model/dog.dart'; +export 'package:openapi/src/model/dog_all_of.dart'; +export 'package:openapi/src/model/entity.dart'; +export 'package:openapi/src/model/entity_ref.dart'; +export 'package:openapi/src/model/enum_arrays.dart'; +export 'package:openapi/src/model/enum_test.dart'; +export 'package:openapi/src/model/example.dart'; +export 'package:openapi/src/model/example_non_primitive.dart'; +export 'package:openapi/src/model/extensible.dart'; +export 'package:openapi/src/model/file_schema_test_class.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/foo_ref.dart'; +export 'package:openapi/src/model/foo_ref_or_value.dart'; +export 'package:openapi/src/model/format_test.dart'; +export 'package:openapi/src/model/fruit.dart'; +export 'package:openapi/src/model/has_only_read_only.dart'; +export 'package:openapi/src/model/health_check_result.dart'; +export 'package:openapi/src/model/map_test.dart'; +export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +export 'package:openapi/src/model/model200_response.dart'; +export 'package:openapi/src/model/model_client.dart'; +export 'package:openapi/src/model/model_enum_class.dart'; +export 'package:openapi/src/model/model_file.dart'; +export 'package:openapi/src/model/model_list.dart'; +export 'package:openapi/src/model/model_return.dart'; +export 'package:openapi/src/model/name.dart'; +export 'package:openapi/src/model/nullable_class.dart'; +export 'package:openapi/src/model/number_only.dart'; +export 'package:openapi/src/model/object_with_deprecated_fields.dart'; +export 'package:openapi/src/model/order.dart'; +export 'package:openapi/src/model/outer_composite.dart'; +export 'package:openapi/src/model/outer_enum.dart'; +export 'package:openapi/src/model/outer_enum_default_value.dart'; +export 'package:openapi/src/model/outer_enum_integer.dart'; +export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +export 'package:openapi/src/model/outer_object_with_enum_property.dart'; +export 'package:openapi/src/model/pasta.dart'; +export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/pizza.dart'; +export 'package:openapi/src/model/pizza_speziale.dart'; +export 'package:openapi/src/model/read_only_first.dart'; +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/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; +export 'package:openapi/src/model/user.dart'; diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart new file mode 100644 index 000000000000..a44ff57958c2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart @@ -0,0 +1,50 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:http/http.dart' as http; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/serializers.dart'; +import 'package:openapi/src/auth/api_key_auth.dart'; +import 'package:openapi/src/auth/authentication.dart'; +import 'package:openapi/src/auth/http_basic_auth.dart'; +import 'package:openapi/src/auth/http_bearer_auth.dart'; +import 'package:openapi/src/auth/oauth.dart'; +import 'package:openapi/src/api/body_api.dart'; +import 'package:openapi/src/api/path_api.dart'; +import 'package:openapi/src/api/query_api.dart'; + +class Openapi { + static const String basePath = r'http://localhost:3000'; + + final http.Client client; + final String actualBasePath; + final Serializers serializers; + + Openapi({ + http.Client? client, + Serializers? serializers, + String? basePathOverride, + }) : this.serializers = serializers ?? standardSerializers, + this.client = client ?? http.Client(), + this.actualBasePath = basePathOverride ?? basePath; + + + /// Get BodyApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + BodyApi getBodyApi() { + return BodyApi(client, serializers, actualBasePath); + } + + /// Get PathApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + PathApi getPathApi() { + return PathApi(client, serializers, actualBasePath); + } + + /// Get QueryApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + QueryApi getQueryApi() { + return QueryApi(client, serializers, actualBasePath); + } +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart new file mode 100644 index 000000000000..5f0544fde2b5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:http/http.dart' as http; + +import 'package:openapi/src/model/pet.dart'; + +class BodyApi { + final String _basePath; + final http.Client? _client; + + final Serializers _serializers; + + const BodyApi(this._client, this._serializers, this._basePath); + + /// Test body parameter(s) + /// Test body parameter(s) + /// + /// 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] containing a [Response] with a [Pet] as data + /// Throws [DioError] if API call or serialization fails + Future> testEchoBodyPet({ + Pet? pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/echo/body/Pet'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(Pet); + _bodyData = pet == null ? null : _serializers.serialize(pet, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Pet _responseData; + + try { + const _responseType = FullType(Pet); + _responseData = _serializers.deserialize( + _response.data!, + specifiedType: _responseType, + ) as Pet; + + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart new file mode 100644 index 000000000000..53cfeacb3125 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart @@ -0,0 +1,91 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:http/http.dart' as http; + + +class PathApi { + final String _basePath; + final http.Client? _client; + + final Serializers _serializers; + + const PathApi(this._client, this._serializers, this._basePath); + + /// Test path parameter(s) + /// Test path parameter(s) + /// + /// Parameters: + /// * [pathString] + /// * [pathInteger] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testsPathStringPathStringIntegerPathInteger({ + required String pathString, + required int pathInteger, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/path/string/{path_string}/integer/{path_integer}'.replaceAll('{' r'path_string' '}', pathString.toString()).replaceAll('{' r'path_integer' '}', pathInteger.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, + ); + + String _responseData; + + try { + _responseData = _response.data as String; + + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart new file mode 100644 index 000000000000..9153f71a847e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart @@ -0,0 +1,253 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:http/http.dart' as http; + +import 'package:openapi/src/api_util.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; + +class QueryApi { + final String _basePath; + final http.Client? _client; + + final Serializers _serializers; + + const QueryApi(this._client, this._serializers, this._basePath); + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [integerQuery] + /// * [booleanQuery] + /// * [stringQuery] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testQueryIntegerBooleanString({ + int? integerQuery, + bool? booleanQuery, + String? stringQuery, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/query/integer/boolean/string'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (integerQuery != null) r'integer_query': encodeQueryParameter(_serializers, integerQuery, const FullType(int)), + if (booleanQuery != null) r'boolean_query': encodeQueryParameter(_serializers, booleanQuery, const FullType(bool)), + if (stringQuery != null) r'string_query': encodeQueryParameter(_serializers, stringQuery, const FullType(String)), + }; + + 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 DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [queryObject] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testQueryStyleFormExplodeTrueArrayString({ + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? queryObject, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/query/style_form/explode_true/array_string'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (queryObject != null) r'query_object': encodeQueryParameter(_serializers, queryObject, const FullType(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter)), + }; + + 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 DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [queryObject] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testQueryStyleFormExplodeTrueObject({ + Pet? queryObject, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/query/style_form/explode_true/object'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (queryObject != null) r'query_object': encodeQueryParameter(_serializers, queryObject, const FullType(Pet)), + }; + + 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 DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart new file mode 100644 index 000000000000..ed3bb12f25b8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart @@ -0,0 +1,77 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..13f1d0ad300e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart @@ -0,0 +1,35 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'authentication.dart'; + +class ApiKeyAuth implements Authentication { + ApiKeyAuth(this.location, this.paramName); + + final String location; + final String paramName; + + String apiKeyPrefix = ''; + String apiKey = ''; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey'; + + if (paramValue.isNotEmpty) { + if (location == 'query') { + queryParams.add(QueryParam(paramName, paramValue)); + } else if (location == 'header') { + headerParams[paramName] = paramValue; + } else if (location == 'cookie') { + headerParams.update( + 'Cookie', + (existingCookie) => '$existingCookie; $paramName=$paramValue', + ifAbsent: () => '$paramName=$paramValue', + ); + } + } + } +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/authentication.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/authentication.dart new file mode 100644 index 000000000000..352222256cb5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/authentication.dart @@ -0,0 +1,9 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore: one_member_abstracts +abstract class Authentication { + /// Apply authentication settings to header and query params. + Future applyToParams(List queryParams, Map headerParams); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_basic_auth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_basic_auth.dart new file mode 100644 index 000000000000..da801f677dad --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_basic_auth.dart @@ -0,0 +1,21 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'authentication.dart'; + +class HttpBasicAuth implements Authentication { + HttpBasicAuth({this.username = '', this.password = ''}); + + String username; + String password; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (username.isNotEmpty && password.isNotEmpty) { + final credentials = '$username:$password'; + headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; + } + } +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_bearer_auth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_bearer_auth.dart new file mode 100644 index 000000000000..ec12948a0d3f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_bearer_auth.dart @@ -0,0 +1,45 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'authentication.dart'; + + +typedef HttpBearerAuthProvider = String Function(); + +class HttpBearerAuth implements Authentication { + HttpBearerAuth(); + + dynamic _accessToken; + + dynamic get accessToken => _accessToken; + + set accessToken(dynamic accessToken) { + if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { + throw ArgumentError('accessToken value must be either a String or a String Function().'); + } + _accessToken = accessToken; + } + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (_accessToken == null) { + return; + } + + String accessToken; + + if (_accessToken is String) { + accessToken = _accessToken; + } else if (_accessToken is HttpBearerAuthProvider) { + accessToken = _accessToken!(); + } else { + return; + } + + if (accessToken.isNotEmpty) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..e915e2cd55ca --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'authentication.dart'; + + +class OAuth implements Authentication { + OAuth({this.accessToken = ''}); + + String accessToken; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (accessToken.isNotEmpty) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/date_serializer.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/date_serializer.dart new file mode 100644 index 000000000000..db3c5c437db1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/date_serializer.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +class DateSerializer implements PrimitiveSerializer { + + const DateSerializer(); + + @override + Iterable get types => BuiltList.of([Date]); + + @override + String get wireName => 'Date'; + + @override + Date deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final parsed = DateTime.parse(serialized as String); + return Date(parsed.year, parsed.month, parsed.day); + } + + @override + Object serialize(Serializers serializers, Date date, + {FullType specifiedType = FullType.unspecified}) { + return date.toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/additional_properties_class.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/additional_properties_class.dart new file mode 100644 index 000000000000..3fdac6d5a44f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/additional_properties_class.dart @@ -0,0 +1,127 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'additional_properties_class.g.dart'; + +/// AdditionalPropertiesClass +/// +/// Properties: +/// * [mapProperty] +/// * [mapOfMapProperty] +@BuiltValue() +abstract class AdditionalPropertiesClass implements Built { + @BuiltValueField(wireName: r'map_property') + BuiltMap? get mapProperty; + + @BuiltValueField(wireName: r'map_of_map_property') + BuiltMap>? get mapOfMapProperty; + + AdditionalPropertiesClass._(); + + factory AdditionalPropertiesClass([void updates(AdditionalPropertiesClassBuilder b)]) = _$AdditionalPropertiesClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AdditionalPropertiesClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AdditionalPropertiesClassSerializer(); +} + +class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [AdditionalPropertiesClass, _$AdditionalPropertiesClass]; + + @override + final String wireName = r'AdditionalPropertiesClass'; + + Iterable _serializeProperties( + Serializers serializers, + AdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.mapProperty != null) { + yield r'map_property'; + yield serializers.serialize( + object.mapProperty, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]), + ); + } + if (object.mapOfMapProperty != null) { + yield r'map_of_map_property'; + yield serializers.serialize( + object.mapOfMapProperty, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + AdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AdditionalPropertiesClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'map_property': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]), + ) as BuiltMap; + result.mapProperty.replace(valueDes); + break; + case r'map_of_map_property': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ) as BuiltMap>; + result.mapOfMapProperty.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + AdditionalPropertiesClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AdditionalPropertiesClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/addressable.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/addressable.dart new file mode 100644 index 000000000000..0ab0936d5673 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/addressable.dart @@ -0,0 +1,161 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'addressable.g.dart'; + +/// Base schema for addressable entities +/// +/// Properties: +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +@BuiltValue(instantiable: false) +abstract class Addressable { + /// Hyperlink reference + @BuiltValueField(wireName: r'href') + String? get href; + + /// unique identifier + @BuiltValueField(wireName: r'id') + String? get id; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AddressableSerializer(); +} + +class _$AddressableSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Addressable]; + + @override + final String wireName = r'Addressable'; + + Iterable _serializeProperties( + Serializers serializers, + Addressable object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Addressable object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Addressable deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($Addressable)) as $Addressable; + } +} + +/// a concrete implementation of [Addressable], since [Addressable] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Addressable implements Addressable, Built<$Addressable, $AddressableBuilder> { + $Addressable._(); + + factory $Addressable([void Function($AddressableBuilder)? updates]) = _$$Addressable; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($AddressableBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Addressable> get serializer => _$$AddressableSerializer(); +} + +class _$$AddressableSerializer implements PrimitiveSerializer<$Addressable> { + @override + final Iterable types = const [$Addressable, _$$Addressable]; + + @override + final String wireName = r'$Addressable'; + + @override + Object serialize( + Serializers serializers, + $Addressable object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Addressable))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AddressableBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Addressable deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $AddressableBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/all_of_with_single_ref.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/all_of_with_single_ref.dart new file mode 100644 index 000000000000..04f59d360128 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/all_of_with_single_ref.dart @@ -0,0 +1,127 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/single_ref_type.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'all_of_with_single_ref.g.dart'; + +/// AllOfWithSingleRef +/// +/// Properties: +/// * [username] +/// * [singleRefType] +@BuiltValue() +abstract class AllOfWithSingleRef implements Built { + @BuiltValueField(wireName: r'username') + String? get username; + + @BuiltValueField(wireName: r'SingleRefType') + SingleRefType? get singleRefType; + + AllOfWithSingleRef._(); + + factory AllOfWithSingleRef([void updates(AllOfWithSingleRefBuilder b)]) = _$AllOfWithSingleRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AllOfWithSingleRefBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AllOfWithSingleRefSerializer(); +} + +class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [AllOfWithSingleRef, _$AllOfWithSingleRef]; + + @override + final String wireName = r'AllOfWithSingleRef'; + + Iterable _serializeProperties( + Serializers serializers, + AllOfWithSingleRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.username != null) { + yield r'username'; + yield serializers.serialize( + object.username, + specifiedType: const FullType(String), + ); + } + if (object.singleRefType != null) { + yield r'SingleRefType'; + yield serializers.serialize( + object.singleRefType, + specifiedType: const FullType(SingleRefType), + ); + } + } + + @override + Object serialize( + Serializers serializers, + AllOfWithSingleRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AllOfWithSingleRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'username': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.username = valueDes; + break; + case r'SingleRefType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(SingleRefType), + ) as SingleRefType; + result.singleRefType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + AllOfWithSingleRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AllOfWithSingleRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/animal.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/animal.dart new file mode 100644 index 000000000000..01a52a6a1707 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/animal.dart @@ -0,0 +1,205 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/dog.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'animal.g.dart'; + +/// Animal +/// +/// Properties: +/// * [className] +/// * [color] +@BuiltValue(instantiable: false) +abstract class Animal { + @BuiltValueField(wireName: r'className') + String get className; + + @BuiltValueField(wireName: r'color') + String? get color; + + static const String discriminatorFieldName = r'className'; + + static const Map discriminatorMapping = { + r'Cat': Cat, + r'Dog': Dog, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AnimalSerializer(); +} + +extension AnimalDiscriminatorExt on Animal { + String? get discriminatorValue { + if (this is Cat) { + return r'Cat'; + } + if (this is Dog) { + return r'Dog'; + } + return null; + } +} +extension AnimalBuilderDiscriminatorExt on AnimalBuilder { + String? get discriminatorValue { + if (this is CatBuilder) { + return r'Cat'; + } + if (this is DogBuilder) { + return r'Dog'; + } + return null; + } +} + +class _$AnimalSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Animal]; + + @override + final String wireName = r'Animal'; + + Iterable _serializeProperties( + Serializers serializers, + Animal object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'className'; + yield serializers.serialize( + object.className, + specifiedType: const FullType(String), + ); + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Animal object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is Cat) { + return serializers.serialize(object, specifiedType: FullType(Cat))!; + } + if (object is Dog) { + return serializers.serialize(object, specifiedType: FullType(Dog))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Animal deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(Animal.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'Cat': + return serializers.deserialize(serialized, specifiedType: FullType(Cat)) as Cat; + case r'Dog': + return serializers.deserialize(serialized, specifiedType: FullType(Dog)) as Dog; + default: + return serializers.deserialize(serialized, specifiedType: FullType($Animal)) as $Animal; + } + } +} + +/// a concrete implementation of [Animal], since [Animal] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Animal implements Animal, Built<$Animal, $AnimalBuilder> { + $Animal._(); + + factory $Animal([void Function($AnimalBuilder)? updates]) = _$$Animal; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($AnimalBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Animal> get serializer => _$$AnimalSerializer(); +} + +class _$$AnimalSerializer implements PrimitiveSerializer<$Animal> { + @override + final Iterable types = const [$Animal, _$$Animal]; + + @override + final String wireName = r'$Animal'; + + @override + Object serialize( + Serializers serializers, + $Animal object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Animal))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AnimalBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'className': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.className = valueDes; + break; + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Animal deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $AnimalBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/api_response.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/api_response.dart new file mode 100644 index 000000000000..aadcd792e2bf --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/api_response.dart @@ -0,0 +1,144 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'api_response.g.dart'; + +/// ApiResponse +/// +/// Properties: +/// * [code] +/// * [type] +/// * [message] +@BuiltValue() +abstract class ApiResponse implements Built { + @BuiltValueField(wireName: r'code') + int? get code; + + @BuiltValueField(wireName: r'type') + String? get type; + + @BuiltValueField(wireName: r'message') + String? get message; + + ApiResponse._(); + + factory ApiResponse([void updates(ApiResponseBuilder b)]) = _$ApiResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ApiResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ApiResponseSerializer(); +} + +class _$ApiResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ApiResponse, _$ApiResponse]; + + @override + final String wireName = r'ApiResponse'; + + Iterable _serializeProperties( + Serializers serializers, + ApiResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.code != null) { + yield r'code'; + yield serializers.serialize( + object.code, + specifiedType: const FullType(int), + ); + } + if (object.type != null) { + yield r'type'; + yield serializers.serialize( + object.type, + specifiedType: const FullType(String), + ); + } + if (object.message != null) { + yield r'message'; + yield serializers.serialize( + object.message, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ApiResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ApiResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'code': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.code = valueDes; + break; + case r'type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.type = valueDes; + break; + case r'message': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.message = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ApiResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ApiResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/apple.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/apple.dart new file mode 100644 index 000000000000..02ca94190b96 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/apple.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'apple.g.dart'; + +/// Apple +/// +/// Properties: +/// * [kind] +@BuiltValue() +abstract class Apple implements Built { + @BuiltValueField(wireName: r'kind') + String? get kind; + + Apple._(); + + factory Apple([void updates(AppleBuilder b)]) = _$Apple; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AppleBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AppleSerializer(); +} + +class _$AppleSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Apple, _$Apple]; + + @override + final String wireName = r'Apple'; + + Iterable _serializeProperties( + Serializers serializers, + Apple object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.kind != null) { + yield r'kind'; + yield serializers.serialize( + object.kind, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Apple object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AppleBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'kind': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.kind = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Apple deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AppleBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_array_of_number_only.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_array_of_number_only.dart new file mode 100644 index 000000000000..5bc0982b8ab0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_array_of_number_only.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'array_of_array_of_number_only.g.dart'; + +/// ArrayOfArrayOfNumberOnly +/// +/// Properties: +/// * [arrayArrayNumber] +@BuiltValue() +abstract class ArrayOfArrayOfNumberOnly implements Built { + @BuiltValueField(wireName: r'ArrayArrayNumber') + BuiltList>? get arrayArrayNumber; + + ArrayOfArrayOfNumberOnly._(); + + factory ArrayOfArrayOfNumberOnly([void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = _$ArrayOfArrayOfNumberOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ArrayOfArrayOfNumberOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ArrayOfArrayOfNumberOnlySerializer(); +} + +class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ArrayOfArrayOfNumberOnly, _$ArrayOfArrayOfNumberOnly]; + + @override + final String wireName = r'ArrayOfArrayOfNumberOnly'; + + Iterable _serializeProperties( + Serializers serializers, + ArrayOfArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.arrayArrayNumber != null) { + yield r'ArrayArrayNumber'; + yield serializers.serialize( + object.arrayArrayNumber, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ArrayOfArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ArrayOfArrayOfNumberOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'ArrayArrayNumber': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]), + ) as BuiltList>; + result.arrayArrayNumber.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ArrayOfArrayOfNumberOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ArrayOfArrayOfNumberOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_number_only.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_number_only.dart new file mode 100644 index 000000000000..72239924f5ec --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_number_only.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'array_of_number_only.g.dart'; + +/// ArrayOfNumberOnly +/// +/// Properties: +/// * [arrayNumber] +@BuiltValue() +abstract class ArrayOfNumberOnly implements Built { + @BuiltValueField(wireName: r'ArrayNumber') + BuiltList? get arrayNumber; + + ArrayOfNumberOnly._(); + + factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = _$ArrayOfNumberOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ArrayOfNumberOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ArrayOfNumberOnlySerializer(); +} + +class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly]; + + @override + final String wireName = r'ArrayOfNumberOnly'; + + Iterable _serializeProperties( + Serializers serializers, + ArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.arrayNumber != null) { + yield r'ArrayNumber'; + yield serializers.serialize( + object.arrayNumber, + specifiedType: const FullType(BuiltList, [FullType(num)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ArrayOfNumberOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'ArrayNumber': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(num)]), + ) as BuiltList; + result.arrayNumber.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ArrayOfNumberOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ArrayOfNumberOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_test.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_test.dart new file mode 100644 index 000000000000..21f3a5a4c2d5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_test.dart @@ -0,0 +1,146 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'array_test.g.dart'; + +/// ArrayTest +/// +/// Properties: +/// * [arrayOfString] +/// * [arrayArrayOfInteger] +/// * [arrayArrayOfModel] +@BuiltValue() +abstract class ArrayTest implements Built { + @BuiltValueField(wireName: r'array_of_string') + BuiltList? get arrayOfString; + + @BuiltValueField(wireName: r'array_array_of_integer') + BuiltList>? get arrayArrayOfInteger; + + @BuiltValueField(wireName: r'array_array_of_model') + BuiltList>? get arrayArrayOfModel; + + ArrayTest._(); + + factory ArrayTest([void updates(ArrayTestBuilder b)]) = _$ArrayTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ArrayTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ArrayTestSerializer(); +} + +class _$ArrayTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ArrayTest, _$ArrayTest]; + + @override + final String wireName = r'ArrayTest'; + + Iterable _serializeProperties( + Serializers serializers, + ArrayTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.arrayOfString != null) { + yield r'array_of_string'; + yield serializers.serialize( + object.arrayOfString, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); + } + if (object.arrayArrayOfInteger != null) { + yield r'array_array_of_integer'; + yield serializers.serialize( + object.arrayArrayOfInteger, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + ); + } + if (object.arrayArrayOfModel != null) { + yield r'array_array_of_model'; + yield serializers.serialize( + object.arrayArrayOfModel, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ArrayTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ArrayTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'array_of_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ) as BuiltList; + result.arrayOfString.replace(valueDes); + break; + case r'array_array_of_integer': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + ) as BuiltList>; + result.arrayArrayOfInteger.replace(valueDes); + break; + case r'array_array_of_model': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + ) as BuiltList>; + result.arrayArrayOfModel.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ArrayTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ArrayTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/banana.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/banana.dart new file mode 100644 index 000000000000..bf2d632ee114 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/banana.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'banana.g.dart'; + +/// Banana +/// +/// Properties: +/// * [count] +@BuiltValue() +abstract class Banana implements Built { + @BuiltValueField(wireName: r'count') + num? get count; + + Banana._(); + + factory Banana([void updates(BananaBuilder b)]) = _$Banana; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BananaBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BananaSerializer(); +} + +class _$BananaSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Banana, _$Banana]; + + @override + final String wireName = r'Banana'; + + Iterable _serializeProperties( + Serializers serializers, + Banana object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.count != null) { + yield r'count'; + yield serializers.serialize( + object.count, + specifiedType: const FullType(num), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Banana object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BananaBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'count': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.count = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Banana deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BananaBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar.dart new file mode 100644 index 000000000000..cb769550b4f2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar.dart @@ -0,0 +1,219 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'bar.g.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 +@BuiltValue() +abstract class Bar implements Entity, Built { + @BuiltValueField(wireName: r'foo') + FooRefOrValue? get foo; + + @BuiltValueField(wireName: r'fooPropB') + String? get fooPropB; + + @BuiltValueField(wireName: r'barPropA') + String? get barPropA; + + Bar._(); + + factory Bar([void updates(BarBuilder b)]) = _$Bar; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarSerializer(); +} + +class _$BarSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Bar, _$Bar]; + + @override + final String wireName = r'Bar'; + + Iterable _serializeProperties( + Serializers serializers, + Bar object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.foo != null) { + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(FooRefOrValue), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.fooPropB != null) { + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + if (object.barPropA != null) { + yield r'barPropA'; + yield serializers.serialize( + object.barPropA, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Bar object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BarBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'foo': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(FooRefOrValue), + ) as FooRefOrValue; + result.foo.replace(valueDes); + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'fooPropB': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropB = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + case r'barPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.barPropA = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Bar deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_create.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_create.dart new file mode 100644 index 000000000000..8942b6433f5e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_create.dart @@ -0,0 +1,219 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'bar_create.g.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 +@BuiltValue() +abstract class BarCreate implements Entity, Built { + @BuiltValueField(wireName: r'foo') + FooRefOrValue? get foo; + + @BuiltValueField(wireName: r'fooPropB') + String? get fooPropB; + + @BuiltValueField(wireName: r'barPropA') + String? get barPropA; + + BarCreate._(); + + factory BarCreate([void updates(BarCreateBuilder b)]) = _$BarCreate; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarCreateBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarCreateSerializer(); +} + +class _$BarCreateSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [BarCreate, _$BarCreate]; + + @override + final String wireName = r'BarCreate'; + + Iterable _serializeProperties( + Serializers serializers, + BarCreate object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.foo != null) { + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(FooRefOrValue), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.fooPropB != null) { + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + if (object.barPropA != null) { + yield r'barPropA'; + yield serializers.serialize( + object.barPropA, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + BarCreate object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BarCreateBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'foo': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(FooRefOrValue), + ) as FooRefOrValue; + result.foo.replace(valueDes); + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'fooPropB': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropB = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + case r'barPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.barPropA = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + BarCreate deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarCreateBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref.dart new file mode 100644 index 000000000000..2b9d2727a448 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref.dart @@ -0,0 +1,192 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'bar_ref.g.dart'; + +/// BarRef +/// +/// 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 +@BuiltValue() +abstract class BarRef implements EntityRef, Built { + BarRef._(); + + factory BarRef([void updates(BarRefBuilder b)]) = _$BarRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarRefBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarRefSerializer(); +} + +class _$BarRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [BarRef, _$BarRef]; + + @override + final String wireName = r'BarRef'; + + Iterable _serializeProperties( + Serializers serializers, + BarRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atReferredType != null) { + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + BarRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BarRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@referredType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atReferredType = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + BarRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref_or_value.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref_or_value.dart new file mode 100644 index 000000000000..4af61384ab76 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref_or_value.dart @@ -0,0 +1,129 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'bar_ref_or_value.g.dart'; + +/// BarRefOrValue +/// +/// 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 +@BuiltValue() +abstract class BarRefOrValue implements Built { + /// One Of [Bar], [BarRef] + OneOf get oneOf; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'Bar': Bar, + r'BarRef': BarRef, + }; + + BarRefOrValue._(); + + factory BarRefOrValue([void updates(BarRefOrValueBuilder b)]) = _$BarRefOrValue; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarRefOrValueBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarRefOrValueSerializer(); +} + +extension BarRefOrValueDiscriminatorExt on BarRefOrValue { + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; + } + if (this is BarRef) { + return r'BarRef'; + } + return null; + } +} +extension BarRefOrValueBuilderDiscriminatorExt on BarRefOrValueBuilder { + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarRefBuilder) { + return r'BarRef'; + } + return null; + } +} + +class _$BarRefOrValueSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [BarRefOrValue, _$BarRefOrValue]; + + @override + final String wireName = r'BarRefOrValue'; + + Iterable _serializeProperties( + Serializers serializers, + BarRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + BarRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + BarRefOrValue deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarRefOrValueBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [Bar, BarRef, ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'Bar': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(Bar), + ) as Bar; + oneOfType = Bar; + break; + case r'BarRef': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(BarRef), + ) as BarRef; + oneOfType = BarRef; + break; + default: + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/capitalization.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/capitalization.dart new file mode 100644 index 000000000000..75827b9a429e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/capitalization.dart @@ -0,0 +1,199 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'capitalization.g.dart'; + +/// Capitalization +/// +/// Properties: +/// * [smallCamel] +/// * [capitalCamel] +/// * [smallSnake] +/// * [capitalSnake] +/// * [sCAETHFlowPoints] +/// * [ATT_NAME] - Name of the pet +@BuiltValue() +abstract class Capitalization implements Built { + @BuiltValueField(wireName: r'smallCamel') + String? get smallCamel; + + @BuiltValueField(wireName: r'CapitalCamel') + String? get capitalCamel; + + @BuiltValueField(wireName: r'small_Snake') + String? get smallSnake; + + @BuiltValueField(wireName: r'Capital_Snake') + String? get capitalSnake; + + @BuiltValueField(wireName: r'SCA_ETH_Flow_Points') + String? get sCAETHFlowPoints; + + /// Name of the pet + @BuiltValueField(wireName: r'ATT_NAME') + String? get ATT_NAME; + + Capitalization._(); + + factory Capitalization([void updates(CapitalizationBuilder b)]) = _$Capitalization; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(CapitalizationBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CapitalizationSerializer(); +} + +class _$CapitalizationSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Capitalization, _$Capitalization]; + + @override + final String wireName = r'Capitalization'; + + Iterable _serializeProperties( + Serializers serializers, + Capitalization object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.smallCamel != null) { + yield r'smallCamel'; + yield serializers.serialize( + object.smallCamel, + specifiedType: const FullType(String), + ); + } + if (object.capitalCamel != null) { + yield r'CapitalCamel'; + yield serializers.serialize( + object.capitalCamel, + specifiedType: const FullType(String), + ); + } + if (object.smallSnake != null) { + yield r'small_Snake'; + yield serializers.serialize( + object.smallSnake, + specifiedType: const FullType(String), + ); + } + if (object.capitalSnake != null) { + yield r'Capital_Snake'; + yield serializers.serialize( + object.capitalSnake, + specifiedType: const FullType(String), + ); + } + if (object.sCAETHFlowPoints != null) { + yield r'SCA_ETH_Flow_Points'; + yield serializers.serialize( + object.sCAETHFlowPoints, + specifiedType: const FullType(String), + ); + } + if (object.ATT_NAME != null) { + yield r'ATT_NAME'; + yield serializers.serialize( + object.ATT_NAME, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Capitalization object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CapitalizationBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'smallCamel': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.smallCamel = valueDes; + break; + case r'CapitalCamel': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.capitalCamel = valueDes; + break; + case r'small_Snake': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.smallSnake = valueDes; + break; + case r'Capital_Snake': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.capitalSnake = valueDes; + break; + case r'SCA_ETH_Flow_Points': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.sCAETHFlowPoints = valueDes; + break; + case r'ATT_NAME': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.ATT_NAME = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Capitalization deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = CapitalizationBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat.dart new file mode 100644 index 000000000000..23d19b38b05a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat.dart @@ -0,0 +1,136 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:openapi/src/model/cat_all_of.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'cat.g.dart'; + +/// Cat +/// +/// Properties: +/// * [className] +/// * [color] +/// * [declawed] +@BuiltValue() +abstract class Cat implements Animal, CatAllOf, Built { + Cat._(); + + factory Cat([void updates(CatBuilder b)]) = _$Cat; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(CatBuilder b) => b..className=b.discriminatorValue + ..color = 'red'; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CatSerializer(); +} + +class _$CatSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Cat, _$Cat]; + + @override + final String wireName = r'Cat'; + + Iterable _serializeProperties( + Serializers serializers, + Cat object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'className'; + yield serializers.serialize( + object.className, + specifiedType: const FullType(String), + ); + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + if (object.declawed != null) { + yield r'declawed'; + yield serializers.serialize( + object.declawed, + specifiedType: const FullType(bool), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Cat object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CatBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'className': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.className = valueDes; + break; + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + case r'declawed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.declawed = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Cat deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = CatBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat_all_of.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat_all_of.dart new file mode 100644 index 000000000000..02d9cce0cae1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat_all_of.dart @@ -0,0 +1,141 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'cat_all_of.g.dart'; + +/// CatAllOf +/// +/// Properties: +/// * [declawed] +@BuiltValue(instantiable: false) +abstract class CatAllOf { + @BuiltValueField(wireName: r'declawed') + bool? get declawed; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CatAllOfSerializer(); +} + +class _$CatAllOfSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [CatAllOf]; + + @override + final String wireName = r'CatAllOf'; + + Iterable _serializeProperties( + Serializers serializers, + CatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.declawed != null) { + yield r'declawed'; + yield serializers.serialize( + object.declawed, + specifiedType: const FullType(bool), + ); + } + } + + @override + Object serialize( + Serializers serializers, + CatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + CatAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($CatAllOf)) as $CatAllOf; + } +} + +/// a concrete implementation of [CatAllOf], since [CatAllOf] is not instantiable +@BuiltValue(instantiable: true) +abstract class $CatAllOf implements CatAllOf, Built<$CatAllOf, $CatAllOfBuilder> { + $CatAllOf._(); + + factory $CatAllOf([void Function($CatAllOfBuilder)? updates]) = _$$CatAllOf; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($CatAllOfBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$CatAllOf> get serializer => _$$CatAllOfSerializer(); +} + +class _$$CatAllOfSerializer implements PrimitiveSerializer<$CatAllOf> { + @override + final Iterable types = const [$CatAllOf, _$$CatAllOf]; + + @override + final String wireName = r'$CatAllOf'; + + @override + Object serialize( + Serializers serializers, + $CatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(CatAllOf))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CatAllOfBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'declawed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.declawed = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $CatAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $CatAllOfBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/category.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/category.dart new file mode 100644 index 000000000000..b2be985a8507 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/category.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'category.g.dart'; + +/// Category +/// +/// Properties: +/// * [id] +/// * [name] +@BuiltValue() +abstract class Category implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'name') + String? get name; + + Category._(); + + factory Category([void updates(CategoryBuilder b)]) = _$Category; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(CategoryBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CategorySerializer(); +} + +class _$CategorySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Category, _$Category]; + + @override + final String wireName = r'Category'; + + Iterable _serializeProperties( + Serializers serializers, + Category object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Category object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CategoryBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Category deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = CategoryBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/child.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/child.dart new file mode 100644 index 000000000000..987b52ca7240 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/child.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'child.g.dart'; + +/// Child +/// +/// Properties: +/// * [name] +@BuiltValue() +abstract class Child implements Built { + @BuiltValueField(wireName: r'name') + String? get name; + + Child._(); + + factory Child([void updates(ChildBuilder b)]) = _$Child; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ChildBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ChildSerializer(); +} + +class _$ChildSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Child, _$Child]; + + @override + final String wireName = r'Child'; + + Iterable _serializeProperties( + Serializers serializers, + Child object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Child object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ChildBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Child deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ChildBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/class_model.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/class_model.dart new file mode 100644 index 000000000000..51166943c6cd --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/class_model.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'class_model.g.dart'; + +/// Model for testing model with \"_class\" property +/// +/// Properties: +/// * [classField] +@BuiltValue() +abstract class ClassModel implements Built { + @BuiltValueField(wireName: r'_class') + String? get classField; + + ClassModel._(); + + factory ClassModel([void updates(ClassModelBuilder b)]) = _$ClassModel; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ClassModelBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ClassModelSerializer(); +} + +class _$ClassModelSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ClassModel, _$ClassModel]; + + @override + final String wireName = r'ClassModel'; + + Iterable _serializeProperties( + Serializers serializers, + ClassModel object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.classField != null) { + yield r'_class'; + yield serializers.serialize( + object.classField, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ClassModel object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ClassModelBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'_class': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.classField = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ClassModel deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ClassModelBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/date.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/date.dart new file mode 100644 index 000000000000..b21c7f544bee --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/date.dart @@ -0,0 +1,70 @@ +/// A gregorian calendar date generated by +/// OpenAPI generator to differentiate +/// between [DateTime] and [Date] formats. +class Date implements Comparable { + final int year; + + /// January is 1. + final int month; + + /// First day is 1. + final int day; + + Date(this.year, this.month, this.day); + + /// The current date + static Date now({bool utc = false}) { + var now = DateTime.now(); + if (utc) { + now = now.toUtc(); + } + return now.toDate(); + } + + /// Convert to a [DateTime]. + DateTime toDateTime({bool utc = false}) { + if (utc) { + return DateTime.utc(year, month, day); + } else { + return DateTime(year, month, day); + } + } + + @override + int compareTo(Date other) { + int d = year.compareTo(other.year); + if (d != 0) { + return d; + } + d = month.compareTo(other.month); + if (d != 0) { + return d; + } + return day.compareTo(other.day); + } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Date && + runtimeType == other.runtimeType && + year == other.year && + month == other.month && + day == other.day; + + @override + int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; + + @override + String toString() { + final yyyy = year.toString(); + final mm = month.toString().padLeft(2, '0'); + final dd = day.toString().padLeft(2, '0'); + + return '$yyyy-$mm-$dd'; + } +} + +extension DateTimeToDate on DateTime { + Date toDate() => Date(year, month, day); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/deprecated_object.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/deprecated_object.dart new file mode 100644 index 000000000000..91d0b428e9bb --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/deprecated_object.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'deprecated_object.g.dart'; + +/// DeprecatedObject +/// +/// Properties: +/// * [name] +@BuiltValue() +abstract class DeprecatedObject implements Built { + @BuiltValueField(wireName: r'name') + String? get name; + + DeprecatedObject._(); + + factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = _$DeprecatedObject; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(DeprecatedObjectBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$DeprecatedObjectSerializer(); +} + +class _$DeprecatedObjectSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [DeprecatedObject, _$DeprecatedObject]; + + @override + final String wireName = r'DeprecatedObject'; + + Iterable _serializeProperties( + Serializers serializers, + DeprecatedObject object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + DeprecatedObject object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DeprecatedObjectBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + DeprecatedObject deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = DeprecatedObjectBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog.dart new file mode 100644 index 000000000000..4d9974f25b1d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog.dart @@ -0,0 +1,136 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/dog_all_of.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'dog.g.dart'; + +/// Dog +/// +/// Properties: +/// * [className] +/// * [color] +/// * [breed] +@BuiltValue() +abstract class Dog implements Animal, DogAllOf, Built { + Dog._(); + + factory Dog([void updates(DogBuilder b)]) = _$Dog; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(DogBuilder b) => b..className=b.discriminatorValue + ..color = 'red'; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$DogSerializer(); +} + +class _$DogSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Dog, _$Dog]; + + @override + final String wireName = r'Dog'; + + Iterable _serializeProperties( + Serializers serializers, + Dog object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'className'; + yield serializers.serialize( + object.className, + specifiedType: const FullType(String), + ); + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + if (object.breed != null) { + yield r'breed'; + yield serializers.serialize( + object.breed, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Dog object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DogBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'className': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.className = valueDes; + break; + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + case r'breed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.breed = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Dog deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = DogBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog_all_of.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog_all_of.dart new file mode 100644 index 000000000000..bd52567fa60a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog_all_of.dart @@ -0,0 +1,141 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'dog_all_of.g.dart'; + +/// DogAllOf +/// +/// Properties: +/// * [breed] +@BuiltValue(instantiable: false) +abstract class DogAllOf { + @BuiltValueField(wireName: r'breed') + String? get breed; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$DogAllOfSerializer(); +} + +class _$DogAllOfSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [DogAllOf]; + + @override + final String wireName = r'DogAllOf'; + + Iterable _serializeProperties( + Serializers serializers, + DogAllOf object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.breed != null) { + yield r'breed'; + yield serializers.serialize( + object.breed, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + DogAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + DogAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($DogAllOf)) as $DogAllOf; + } +} + +/// a concrete implementation of [DogAllOf], since [DogAllOf] is not instantiable +@BuiltValue(instantiable: true) +abstract class $DogAllOf implements DogAllOf, Built<$DogAllOf, $DogAllOfBuilder> { + $DogAllOf._(); + + factory $DogAllOf([void Function($DogAllOfBuilder)? updates]) = _$$DogAllOf; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($DogAllOfBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$DogAllOf> get serializer => _$$DogAllOfSerializer(); +} + +class _$$DogAllOfSerializer implements PrimitiveSerializer<$DogAllOf> { + @override + final Iterable types = const [$DogAllOf, _$$DogAllOf]; + + @override + final String wireName = r'$DogAllOf'; + + @override + Object serialize( + Serializers serializers, + $DogAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(DogAllOf))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DogAllOfBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'breed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.breed = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $DogAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $DogAllOfBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity.dart new file mode 100644 index 000000000000..7e27fab47387 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity.dart @@ -0,0 +1,298 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/pizza.dart'; +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/pasta.dart'; +import 'package:openapi/src/model/bar_create.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'entity.g.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 +@BuiltValue(instantiable: false) +abstract class Entity implements Addressable, Extensible { + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'Bar': Bar, + r'Bar_Create': BarCreate, + r'Foo': Foo, + r'Pasta': Pasta, + r'Pizza': Pizza, + r'PizzaSpeziale': PizzaSpeziale, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EntitySerializer(); +} + +extension EntityDiscriminatorExt on Entity { + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; + } + if (this is BarCreate) { + return r'Bar_Create'; + } + if (this is Foo) { + return r'Foo'; + } + if (this is Pasta) { + return r'Pasta'; + } + if (this is Pizza) { + return r'Pizza'; + } + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; + } +} +extension EntityBuilderDiscriminatorExt on EntityBuilder { + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarCreateBuilder) { + return r'Bar_Create'; + } + if (this is FooBuilder) { + return r'Foo'; + } + if (this is PastaBuilder) { + return r'Pasta'; + } + if (this is PizzaBuilder) { + return r'Pizza'; + } + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; + } +} + +class _$EntitySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Entity]; + + @override + final String wireName = r'Entity'; + + Iterable _serializeProperties( + Serializers serializers, + Entity object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Entity object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is Bar) { + return serializers.serialize(object, specifiedType: FullType(Bar))!; + } + if (object is BarCreate) { + return serializers.serialize(object, specifiedType: FullType(BarCreate))!; + } + if (object is Foo) { + return serializers.serialize(object, specifiedType: FullType(Foo))!; + } + if (object is Pasta) { + return serializers.serialize(object, specifiedType: FullType(Pasta))!; + } + if (object is Pizza) { + return serializers.serialize(object, specifiedType: FullType(Pizza))!; + } + if (object is PizzaSpeziale) { + return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Entity deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(Entity.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'Bar': + return serializers.deserialize(serialized, specifiedType: FullType(Bar)) as Bar; + case r'Bar_Create': + return serializers.deserialize(serialized, specifiedType: FullType(BarCreate)) as BarCreate; + case r'Foo': + return serializers.deserialize(serialized, specifiedType: FullType(Foo)) as Foo; + case r'Pasta': + return serializers.deserialize(serialized, specifiedType: FullType(Pasta)) as Pasta; + case r'Pizza': + return serializers.deserialize(serialized, specifiedType: FullType(Pizza)) as Pizza; + case r'PizzaSpeziale': + return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + default: + return serializers.deserialize(serialized, specifiedType: FullType($Entity)) as $Entity; + } + } +} + +/// a concrete implementation of [Entity], since [Entity] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Entity implements Entity, Built<$Entity, $EntityBuilder> { + $Entity._(); + + factory $Entity([void Function($EntityBuilder)? updates]) = _$$Entity; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($EntityBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Entity> get serializer => _$$EntitySerializer(); +} + +class _$$EntitySerializer implements PrimitiveSerializer<$Entity> { + @override + final Iterable types = const [$Entity, _$$Entity]; + + @override + final String wireName = r'$Entity'; + + @override + Object serialize( + Serializers serializers, + $Entity object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Entity))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EntityBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Entity deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $EntityBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity_ref.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity_ref.dart new file mode 100644 index 000000000000..7502c94dd7f3 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity_ref.dart @@ -0,0 +1,284 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'entity_ref.g.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 +@BuiltValue(instantiable: false) +abstract class EntityRef implements Addressable, Extensible { + /// The actual type of the target instance when needed for disambiguation. + @BuiltValueField(wireName: r'@referredType') + String? get atReferredType; + + /// Name of the related entity. + @BuiltValueField(wireName: r'name') + String? get name; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'BarRef': BarRef, + r'FooRef': FooRef, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EntityRefSerializer(); +} + +extension EntityRefDiscriminatorExt on EntityRef { + String? get discriminatorValue { + if (this is BarRef) { + return r'BarRef'; + } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } +} +extension EntityRefBuilderDiscriminatorExt on EntityRefBuilder { + String? get discriminatorValue { + if (this is BarRefBuilder) { + return r'BarRef'; + } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; + } +} + +class _$EntityRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [EntityRef]; + + @override + final String wireName = r'EntityRef'; + + Iterable _serializeProperties( + Serializers serializers, + EntityRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atReferredType != null) { + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + EntityRef object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is BarRef) { + return serializers.serialize(object, specifiedType: FullType(BarRef))!; + } + if (object is FooRef) { + return serializers.serialize(object, specifiedType: FullType(FooRef))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + EntityRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'BarRef': + return serializers.deserialize(serialized, specifiedType: FullType(BarRef)) as BarRef; + case r'FooRef': + return serializers.deserialize(serialized, specifiedType: FullType(FooRef)) as FooRef; + default: + return serializers.deserialize(serialized, specifiedType: FullType($EntityRef)) as $EntityRef; + } + } +} + +/// a concrete implementation of [EntityRef], since [EntityRef] is not instantiable +@BuiltValue(instantiable: true) +abstract class $EntityRef implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { + $EntityRef._(); + + factory $EntityRef([void Function($EntityRefBuilder)? updates]) = _$$EntityRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($EntityRefBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$EntityRef> get serializer => _$$EntityRefSerializer(); +} + +class _$$EntityRefSerializer implements PrimitiveSerializer<$EntityRef> { + @override + final Iterable types = const [$EntityRef, _$$EntityRef]; + + @override + final String wireName = r'$EntityRef'; + + @override + Object serialize( + Serializers serializers, + $EntityRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(EntityRef))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EntityRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@referredType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atReferredType = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $EntityRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $EntityRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_arrays.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_arrays.dart new file mode 100644 index 000000000000..b79a175e833c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_arrays.dart @@ -0,0 +1,163 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'enum_arrays.g.dart'; + +/// EnumArrays +/// +/// Properties: +/// * [justSymbol] +/// * [arrayEnum] +@BuiltValue() +abstract class EnumArrays implements Built { + @BuiltValueField(wireName: r'just_symbol') + EnumArraysJustSymbolEnum? get justSymbol; + // enum justSymbolEnum { >=, $, }; + + @BuiltValueField(wireName: r'array_enum') + BuiltList? get arrayEnum; + // enum arrayEnumEnum { fish, crab, }; + + EnumArrays._(); + + factory EnumArrays([void updates(EnumArraysBuilder b)]) = _$EnumArrays; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(EnumArraysBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EnumArraysSerializer(); +} + +class _$EnumArraysSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [EnumArrays, _$EnumArrays]; + + @override + final String wireName = r'EnumArrays'; + + Iterable _serializeProperties( + Serializers serializers, + EnumArrays object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.justSymbol != null) { + yield r'just_symbol'; + yield serializers.serialize( + object.justSymbol, + specifiedType: const FullType(EnumArraysJustSymbolEnum), + ); + } + if (object.arrayEnum != null) { + yield r'array_enum'; + yield serializers.serialize( + object.arrayEnum, + specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + EnumArrays object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EnumArraysBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'just_symbol': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumArraysJustSymbolEnum), + ) as EnumArraysJustSymbolEnum; + result.justSymbol = valueDes; + break; + case r'array_enum': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + ) as BuiltList; + result.arrayEnum.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + EnumArrays deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = EnumArraysBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class EnumArraysJustSymbolEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'>=') + static const EnumArraysJustSymbolEnum greaterThanEqual = _$enumArraysJustSymbolEnum_greaterThanEqual; + @BuiltValueEnumConst(wireName: r'$') + static const EnumArraysJustSymbolEnum dollar = _$enumArraysJustSymbolEnum_dollar; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = _$enumArraysJustSymbolEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumArraysJustSymbolEnumSerializer; + + const EnumArraysJustSymbolEnum._(String name): super(name); + + static BuiltSet get values => _$enumArraysJustSymbolEnumValues; + static EnumArraysJustSymbolEnum valueOf(String name) => _$enumArraysJustSymbolEnumValueOf(name); +} + +class EnumArraysArrayEnumEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'fish') + static const EnumArraysArrayEnumEnum fish = _$enumArraysArrayEnumEnum_fish; + @BuiltValueEnumConst(wireName: r'crab') + static const EnumArraysArrayEnumEnum crab = _$enumArraysArrayEnumEnum_crab; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = _$enumArraysArrayEnumEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumArraysArrayEnumEnumSerializer; + + const EnumArraysArrayEnumEnum._(String name): super(name); + + static BuiltSet get values => _$enumArraysArrayEnumEnumValues; + static EnumArraysArrayEnumEnum valueOf(String name) => _$enumArraysArrayEnumEnumValueOf(name); +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_test.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_test.dart new file mode 100644 index 000000000000..831f5b9d6d2d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_test.dart @@ -0,0 +1,318 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'enum_test.g.dart'; + +/// EnumTest +/// +/// Properties: +/// * [enumString] +/// * [enumStringRequired] +/// * [enumInteger] +/// * [enumNumber] +/// * [outerEnum] +/// * [outerEnumInteger] +/// * [outerEnumDefaultValue] +/// * [outerEnumIntegerDefaultValue] +@BuiltValue() +abstract class EnumTest implements Built { + @BuiltValueField(wireName: r'enum_string') + EnumTestEnumStringEnum? get enumString; + // enum enumStringEnum { UPPER, lower, , }; + + @BuiltValueField(wireName: r'enum_string_required') + EnumTestEnumStringRequiredEnum get enumStringRequired; + // enum enumStringRequiredEnum { UPPER, lower, , }; + + @BuiltValueField(wireName: r'enum_integer') + EnumTestEnumIntegerEnum? get enumInteger; + // enum enumIntegerEnum { 1, -1, }; + + @BuiltValueField(wireName: r'enum_number') + EnumTestEnumNumberEnum? get enumNumber; + // enum enumNumberEnum { 1.1, -1.2, }; + + @BuiltValueField(wireName: r'outerEnum') + OuterEnum? get outerEnum; + // enum outerEnumEnum { placed, approved, delivered, }; + + @BuiltValueField(wireName: r'outerEnumInteger') + OuterEnumInteger? get outerEnumInteger; + // enum outerEnumIntegerEnum { 0, 1, 2, }; + + @BuiltValueField(wireName: r'outerEnumDefaultValue') + OuterEnumDefaultValue? get outerEnumDefaultValue; + // enum outerEnumDefaultValueEnum { placed, approved, delivered, }; + + @BuiltValueField(wireName: r'outerEnumIntegerDefaultValue') + OuterEnumIntegerDefaultValue? get outerEnumIntegerDefaultValue; + // enum outerEnumIntegerDefaultValueEnum { 0, 1, 2, }; + + EnumTest._(); + + factory EnumTest([void updates(EnumTestBuilder b)]) = _$EnumTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(EnumTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EnumTestSerializer(); +} + +class _$EnumTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [EnumTest, _$EnumTest]; + + @override + final String wireName = r'EnumTest'; + + Iterable _serializeProperties( + Serializers serializers, + EnumTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.enumString != null) { + yield r'enum_string'; + yield serializers.serialize( + object.enumString, + specifiedType: const FullType(EnumTestEnumStringEnum), + ); + } + yield r'enum_string_required'; + yield serializers.serialize( + object.enumStringRequired, + specifiedType: const FullType(EnumTestEnumStringRequiredEnum), + ); + if (object.enumInteger != null) { + yield r'enum_integer'; + yield serializers.serialize( + object.enumInteger, + specifiedType: const FullType(EnumTestEnumIntegerEnum), + ); + } + if (object.enumNumber != null) { + yield r'enum_number'; + yield serializers.serialize( + object.enumNumber, + specifiedType: const FullType(EnumTestEnumNumberEnum), + ); + } + if (object.outerEnum != null) { + yield r'outerEnum'; + yield serializers.serialize( + object.outerEnum, + specifiedType: const FullType.nullable(OuterEnum), + ); + } + if (object.outerEnumInteger != null) { + yield r'outerEnumInteger'; + yield serializers.serialize( + object.outerEnumInteger, + specifiedType: const FullType(OuterEnumInteger), + ); + } + if (object.outerEnumDefaultValue != null) { + yield r'outerEnumDefaultValue'; + yield serializers.serialize( + object.outerEnumDefaultValue, + specifiedType: const FullType(OuterEnumDefaultValue), + ); + } + if (object.outerEnumIntegerDefaultValue != null) { + yield r'outerEnumIntegerDefaultValue'; + yield serializers.serialize( + object.outerEnumIntegerDefaultValue, + specifiedType: const FullType(OuterEnumIntegerDefaultValue), + ); + } + } + + @override + Object serialize( + Serializers serializers, + EnumTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EnumTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'enum_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumStringEnum), + ) as EnumTestEnumStringEnum; + result.enumString = valueDes; + break; + case r'enum_string_required': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumStringRequiredEnum), + ) as EnumTestEnumStringRequiredEnum; + result.enumStringRequired = valueDes; + break; + case r'enum_integer': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumIntegerEnum), + ) as EnumTestEnumIntegerEnum; + result.enumInteger = valueDes; + break; + case r'enum_number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumNumberEnum), + ) as EnumTestEnumNumberEnum; + result.enumNumber = valueDes; + break; + case r'outerEnum': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(OuterEnum), + ) as OuterEnum?; + if (valueDes == null) continue; + result.outerEnum = valueDes; + break; + case r'outerEnumInteger': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumInteger), + ) as OuterEnumInteger; + result.outerEnumInteger = valueDes; + break; + case r'outerEnumDefaultValue': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumDefaultValue), + ) as OuterEnumDefaultValue; + result.outerEnumDefaultValue = valueDes; + break; + case r'outerEnumIntegerDefaultValue': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumIntegerDefaultValue), + ) as OuterEnumIntegerDefaultValue; + result.outerEnumIntegerDefaultValue = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + EnumTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = EnumTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class EnumTestEnumStringEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'UPPER') + static const EnumTestEnumStringEnum UPPER = _$enumTestEnumStringEnum_UPPER; + @BuiltValueEnumConst(wireName: r'lower') + static const EnumTestEnumStringEnum lower = _$enumTestEnumStringEnum_lower; + @BuiltValueEnumConst(wireName: r'') + static const EnumTestEnumStringEnum empty = _$enumTestEnumStringEnum_empty; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumTestEnumStringEnum unknownDefaultOpenApi = _$enumTestEnumStringEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumStringEnumSerializer; + + const EnumTestEnumStringEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumStringEnumValues; + static EnumTestEnumStringEnum valueOf(String name) => _$enumTestEnumStringEnumValueOf(name); +} + +class EnumTestEnumStringRequiredEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'UPPER') + static const EnumTestEnumStringRequiredEnum UPPER = _$enumTestEnumStringRequiredEnum_UPPER; + @BuiltValueEnumConst(wireName: r'lower') + static const EnumTestEnumStringRequiredEnum lower = _$enumTestEnumStringRequiredEnum_lower; + @BuiltValueEnumConst(wireName: r'') + static const EnumTestEnumStringRequiredEnum empty = _$enumTestEnumStringRequiredEnum_empty; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumStringRequiredEnumSerializer; + + const EnumTestEnumStringRequiredEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumStringRequiredEnumValues; + static EnumTestEnumStringRequiredEnum valueOf(String name) => _$enumTestEnumStringRequiredEnumValueOf(name); +} + +class EnumTestEnumIntegerEnum extends EnumClass { + + @BuiltValueEnumConst(wireNumber: 1) + static const EnumTestEnumIntegerEnum number1 = _$enumTestEnumIntegerEnum_number1; + @BuiltValueEnumConst(wireNumber: -1) + static const EnumTestEnumIntegerEnum numberNegative1 = _$enumTestEnumIntegerEnum_numberNegative1; + @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) + static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = _$enumTestEnumIntegerEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumIntegerEnumSerializer; + + const EnumTestEnumIntegerEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumIntegerEnumValues; + static EnumTestEnumIntegerEnum valueOf(String name) => _$enumTestEnumIntegerEnumValueOf(name); +} + +class EnumTestEnumNumberEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'1.1') + static const EnumTestEnumNumberEnum number1Period1 = _$enumTestEnumNumberEnum_number1Period1; + @BuiltValueEnumConst(wireName: r'-1.2') + static const EnumTestEnumNumberEnum numberNegative1Period2 = _$enumTestEnumNumberEnum_numberNegative1Period2; + @BuiltValueEnumConst(wireName: r'11184809', fallback: true) + static const EnumTestEnumNumberEnum unknownDefaultOpenApi = _$enumTestEnumNumberEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumNumberEnumSerializer; + + const EnumTestEnumNumberEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumNumberEnumValues; + static EnumTestEnumNumberEnum valueOf(String name) => _$enumTestEnumNumberEnumValueOf(name); +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example.dart new file mode 100644 index 000000000000..799b77e4e178 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/child.dart'; +import 'dart:core'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'example.g.dart'; + +/// Example +/// +/// Properties: +/// * [name] +@BuiltValue() +abstract class Example implements Built { + /// One Of [Child], [int] + OneOf get oneOf; + + Example._(); + + factory Example([void updates(ExampleBuilder b)]) = _$Example; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ExampleBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ExampleSerializer(); +} + +class _$ExampleSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Example, _$Example]; + + @override + final String wireName = r'Example'; + + Iterable _serializeProperties( + Serializers serializers, + Example object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + Example object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + Example deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ExampleBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [FullType(Child), FullType(int), ]); + oneOfDataSrc = serialized; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example_non_primitive.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example_non_primitive.dart new file mode 100644 index 000000000000..b12eea1f234d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example_non_primitive.dart @@ -0,0 +1,68 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'dart:core'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'example_non_primitive.g.dart'; + +/// ExampleNonPrimitive +@BuiltValue() +abstract class ExampleNonPrimitive implements Built { + /// One Of [DateTime], [String], [int], [num] + OneOf get oneOf; + + ExampleNonPrimitive._(); + + factory ExampleNonPrimitive([void updates(ExampleNonPrimitiveBuilder b)]) = _$ExampleNonPrimitive; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ExampleNonPrimitiveBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ExampleNonPrimitiveSerializer(); +} + +class _$ExampleNonPrimitiveSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ExampleNonPrimitive, _$ExampleNonPrimitive]; + + @override + final String wireName = r'ExampleNonPrimitive'; + + Iterable _serializeProperties( + Serializers serializers, + ExampleNonPrimitive object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + ExampleNonPrimitive object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + ExampleNonPrimitive deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ExampleNonPrimitiveBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [FullType(String), FullType(DateTime), FullType(int), FullType(num), ]); + oneOfDataSrc = serialized; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/extensible.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/extensible.dart new file mode 100644 index 000000000000..2423fb276412 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/extensible.dart @@ -0,0 +1,178 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'extensible.g.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 +@BuiltValue(instantiable: false) +abstract class Extensible { + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @BuiltValueField(wireName: r'@schemaLocation') + String? get atSchemaLocation; + + /// When sub-classing, this defines the super-class + @BuiltValueField(wireName: r'@baseType') + String? get atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @BuiltValueField(wireName: r'@type') + String get atType; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ExtensibleSerializer(); +} + +class _$ExtensibleSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Extensible]; + + @override + final String wireName = r'Extensible'; + + Iterable _serializeProperties( + Serializers serializers, + Extensible object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Extensible object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Extensible deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($Extensible)) as $Extensible; + } +} + +/// a concrete implementation of [Extensible], since [Extensible] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Extensible implements Extensible, Built<$Extensible, $ExtensibleBuilder> { + $Extensible._(); + + factory $Extensible([void Function($ExtensibleBuilder)? updates]) = _$$Extensible; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($ExtensibleBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Extensible> get serializer => _$$ExtensibleSerializer(); +} + +class _$$ExtensibleSerializer implements PrimitiveSerializer<$Extensible> { + @override + final Iterable types = const [$Extensible, _$$Extensible]; + + @override + final String wireName = r'$Extensible'; + + @override + Object serialize( + Serializers serializers, + $Extensible object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Extensible))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ExtensibleBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Extensible deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $ExtensibleBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/file_schema_test_class.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/file_schema_test_class.dart new file mode 100644 index 000000000000..5ab41d14f437 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/file_schema_test_class.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/model_file.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'file_schema_test_class.g.dart'; + +/// FileSchemaTestClass +/// +/// Properties: +/// * [file] +/// * [files] +@BuiltValue() +abstract class FileSchemaTestClass implements Built { + @BuiltValueField(wireName: r'file') + ModelFile? get file; + + @BuiltValueField(wireName: r'files') + BuiltList? get files; + + FileSchemaTestClass._(); + + factory FileSchemaTestClass([void updates(FileSchemaTestClassBuilder b)]) = _$FileSchemaTestClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FileSchemaTestClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FileSchemaTestClassSerializer(); +} + +class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FileSchemaTestClass, _$FileSchemaTestClass]; + + @override + final String wireName = r'FileSchemaTestClass'; + + Iterable _serializeProperties( + Serializers serializers, + FileSchemaTestClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.file != null) { + yield r'file'; + yield serializers.serialize( + object.file, + specifiedType: const FullType(ModelFile), + ); + } + if (object.files != null) { + yield r'files'; + yield serializers.serialize( + object.files, + specifiedType: const FullType(BuiltList, [FullType(ModelFile)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + FileSchemaTestClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FileSchemaTestClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'file': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(ModelFile), + ) as ModelFile; + result.file.replace(valueDes); + break; + case r'files': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(ModelFile)]), + ) as BuiltList; + result.files.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FileSchemaTestClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FileSchemaTestClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo.dart new file mode 100644 index 000000000000..d2e1f5817f20 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo.dart @@ -0,0 +1,200 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'foo.g.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 +@BuiltValue() +abstract class Foo implements Entity, Built { + @BuiltValueField(wireName: r'fooPropA') + String? get fooPropA; + + @BuiltValueField(wireName: r'fooPropB') + String? get fooPropB; + + Foo._(); + + factory Foo([void updates(FooBuilder b)]) = _$Foo; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FooBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FooSerializer(); +} + +class _$FooSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Foo, _$Foo]; + + @override + final String wireName = r'Foo'; + + Iterable _serializeProperties( + Serializers serializers, + Foo object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.fooPropA != null) { + yield r'fooPropA'; + yield serializers.serialize( + object.fooPropA, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.fooPropB != null) { + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Foo object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FooBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'fooPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropA = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'fooPropB': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropB = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Foo deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FooBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref.dart new file mode 100644 index 000000000000..1f77d990f0e8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref.dart @@ -0,0 +1,210 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'foo_ref.g.dart'; + +/// FooRef +/// +/// Properties: +/// * [foorefPropA] +/// * [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 +@BuiltValue() +abstract class FooRef implements EntityRef, Built { + @BuiltValueField(wireName: r'foorefPropA') + String? get foorefPropA; + + FooRef._(); + + factory FooRef([void updates(FooRefBuilder b)]) = _$FooRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FooRefBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FooRefSerializer(); +} + +class _$FooRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FooRef, _$FooRef]; + + @override + final String wireName = r'FooRef'; + + Iterable _serializeProperties( + Serializers serializers, + FooRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atReferredType != null) { + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); + } + if (object.foorefPropA != null) { + yield r'foorefPropA'; + yield serializers.serialize( + object.foorefPropA, + specifiedType: const FullType(String), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + FooRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FooRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@referredType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atReferredType = valueDes; + break; + case r'foorefPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.foorefPropA = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FooRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FooRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref_or_value.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref_or_value.dart new file mode 100644 index 000000000000..af3e4875d9d6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref_or_value.dart @@ -0,0 +1,129 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'foo_ref_or_value.g.dart'; + +/// FooRefOrValue +/// +/// 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 +@BuiltValue() +abstract class FooRefOrValue implements Built { + /// One Of [Foo], [FooRef] + OneOf get oneOf; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'Foo': Foo, + r'FooRef': FooRef, + }; + + FooRefOrValue._(); + + factory FooRefOrValue([void updates(FooRefOrValueBuilder b)]) = _$FooRefOrValue; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FooRefOrValueBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FooRefOrValueSerializer(); +} + +extension FooRefOrValueDiscriminatorExt on FooRefOrValue { + String? get discriminatorValue { + if (this is Foo) { + return r'Foo'; + } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } +} +extension FooRefOrValueBuilderDiscriminatorExt on FooRefOrValueBuilder { + String? get discriminatorValue { + if (this is FooBuilder) { + return r'Foo'; + } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; + } +} + +class _$FooRefOrValueSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FooRefOrValue, _$FooRefOrValue]; + + @override + final String wireName = r'FooRefOrValue'; + + Iterable _serializeProperties( + Serializers serializers, + FooRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + FooRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + FooRefOrValue deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FooRefOrValueBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [Foo, FooRef, ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'Foo': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(Foo), + ) as Foo; + oneOfType = Foo; + break; + case r'FooRef': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(FooRef), + ) as FooRef; + oneOfType = FooRef; + break; + default: + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/format_test.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/format_test.dart new file mode 100644 index 000000000000..33775231476e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/format_test.dart @@ -0,0 +1,374 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'dart:typed_data'; +import 'package:openapi/src/model/date.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'format_test.g.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. +@BuiltValue() +abstract class FormatTest implements Built { + @BuiltValueField(wireName: r'integer') + int? get integer; + + @BuiltValueField(wireName: r'int32') + int? get int32; + + @BuiltValueField(wireName: r'int64') + int? get int64; + + @BuiltValueField(wireName: r'number') + num get number; + + @BuiltValueField(wireName: r'float') + double? get float; + + @BuiltValueField(wireName: r'double') + double? get double_; + + @BuiltValueField(wireName: r'decimal') + double? get decimal; + + @BuiltValueField(wireName: r'string') + String? get string; + + @BuiltValueField(wireName: r'byte') + String get byte; + + @BuiltValueField(wireName: r'binary') + Uint8List? get binary; + + @BuiltValueField(wireName: r'date') + Date get date; + + @BuiltValueField(wireName: r'dateTime') + DateTime? get dateTime; + + @BuiltValueField(wireName: r'uuid') + String? get uuid; + + @BuiltValueField(wireName: r'password') + String get password; + + /// A string that is a 10 digit number. Can have leading zeros. + @BuiltValueField(wireName: r'pattern_with_digits') + String? get patternWithDigits; + + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + @BuiltValueField(wireName: r'pattern_with_digits_and_delimiter') + String? get patternWithDigitsAndDelimiter; + + FormatTest._(); + + factory FormatTest([void updates(FormatTestBuilder b)]) = _$FormatTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FormatTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FormatTestSerializer(); +} + +class _$FormatTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FormatTest, _$FormatTest]; + + @override + final String wireName = r'FormatTest'; + + Iterable _serializeProperties( + Serializers serializers, + FormatTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.integer != null) { + yield r'integer'; + yield serializers.serialize( + object.integer, + specifiedType: const FullType(int), + ); + } + if (object.int32 != null) { + yield r'int32'; + yield serializers.serialize( + object.int32, + specifiedType: const FullType(int), + ); + } + if (object.int64 != null) { + yield r'int64'; + yield serializers.serialize( + object.int64, + specifiedType: const FullType(int), + ); + } + yield r'number'; + yield serializers.serialize( + object.number, + specifiedType: const FullType(num), + ); + if (object.float != null) { + yield r'float'; + yield serializers.serialize( + object.float, + specifiedType: const FullType(double), + ); + } + if (object.double_ != null) { + yield r'double'; + yield serializers.serialize( + object.double_, + specifiedType: const FullType(double), + ); + } + if (object.decimal != null) { + yield r'decimal'; + yield serializers.serialize( + object.decimal, + specifiedType: const FullType(double), + ); + } + if (object.string != null) { + yield r'string'; + yield serializers.serialize( + object.string, + specifiedType: const FullType(String), + ); + } + yield r'byte'; + yield serializers.serialize( + object.byte, + specifiedType: const FullType(String), + ); + if (object.binary != null) { + yield r'binary'; + yield serializers.serialize( + object.binary, + specifiedType: const FullType(Uint8List), + ); + } + yield r'date'; + yield serializers.serialize( + object.date, + specifiedType: const FullType(Date), + ); + if (object.dateTime != null) { + yield r'dateTime'; + yield serializers.serialize( + object.dateTime, + specifiedType: const FullType(DateTime), + ); + } + if (object.uuid != null) { + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); + } + yield r'password'; + yield serializers.serialize( + object.password, + specifiedType: const FullType(String), + ); + if (object.patternWithDigits != null) { + yield r'pattern_with_digits'; + yield serializers.serialize( + object.patternWithDigits, + specifiedType: const FullType(String), + ); + } + if (object.patternWithDigitsAndDelimiter != null) { + yield r'pattern_with_digits_and_delimiter'; + yield serializers.serialize( + object.patternWithDigitsAndDelimiter, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + FormatTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FormatTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'integer': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.integer = valueDes; + break; + case r'int32': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.int32 = valueDes; + break; + case r'int64': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.int64 = valueDes; + break; + case r'number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.number = valueDes; + break; + case r'float': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(double), + ) as double; + result.float = valueDes; + break; + case r'double': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(double), + ) as double; + result.double_ = valueDes; + break; + case r'decimal': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(double), + ) as double; + result.decimal = valueDes; + break; + case r'string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.string = valueDes; + break; + case r'byte': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.byte = valueDes; + break; + case r'binary': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(Uint8List), + ) as Uint8List; + result.binary = valueDes; + break; + case r'date': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(Date), + ) as Date; + result.date = valueDes; + break; + case r'dateTime': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.dateTime = valueDes; + break; + case r'uuid': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.uuid = valueDes; + break; + case r'password': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.password = valueDes; + break; + case r'pattern_with_digits': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.patternWithDigits = valueDes; + break; + case r'pattern_with_digits_and_delimiter': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.patternWithDigitsAndDelimiter = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FormatTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FormatTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/fruit.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/fruit.dart new file mode 100644 index 000000000000..11f8cfa70501 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/fruit.dart @@ -0,0 +1,123 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit.g.dart'; + +/// Fruit +/// +/// Properties: +/// * [color] +/// * [kind] +/// * [count] +@BuiltValue() +abstract class Fruit implements Built { + @BuiltValueField(wireName: r'color') + String? get color; + + /// One Of [Apple], [Banana] + OneOf get oneOf; + + Fruit._(); + + factory Fruit([void updates(FruitBuilder b)]) = _$Fruit; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FruitSerializer(); +} + +class _$FruitSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Fruit, _$Fruit]; + + @override + final String wireName = r'Fruit'; + + Iterable _serializeProperties( + Serializers serializers, + Fruit object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Fruit object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); + return result; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FruitBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Fruit deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [FullType(Apple), FullType(Banana), ]); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + oneOfDataSrc = unhandled; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/has_only_read_only.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/has_only_read_only.dart new file mode 100644 index 000000000000..9683985cf198 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/has_only_read_only.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'has_only_read_only.g.dart'; + +/// HasOnlyReadOnly +/// +/// Properties: +/// * [bar] +/// * [foo] +@BuiltValue() +abstract class HasOnlyReadOnly implements Built { + @BuiltValueField(wireName: r'bar') + String? get bar; + + @BuiltValueField(wireName: r'foo') + String? get foo; + + HasOnlyReadOnly._(); + + factory HasOnlyReadOnly([void updates(HasOnlyReadOnlyBuilder b)]) = _$HasOnlyReadOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(HasOnlyReadOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$HasOnlyReadOnlySerializer(); +} + +class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [HasOnlyReadOnly, _$HasOnlyReadOnly]; + + @override + final String wireName = r'HasOnlyReadOnly'; + + Iterable _serializeProperties( + Serializers serializers, + HasOnlyReadOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.bar != null) { + yield r'bar'; + yield serializers.serialize( + object.bar, + specifiedType: const FullType(String), + ); + } + if (object.foo != null) { + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + HasOnlyReadOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required HasOnlyReadOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'bar': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.bar = valueDes; + break; + case r'foo': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.foo = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + HasOnlyReadOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = HasOnlyReadOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/health_check_result.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/health_check_result.dart new file mode 100644 index 000000000000..c092a535f2fc --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/health_check_result.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'health_check_result.g.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] +@BuiltValue() +abstract class HealthCheckResult implements Built { + @BuiltValueField(wireName: r'NullableMessage') + String? get nullableMessage; + + HealthCheckResult._(); + + factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = _$HealthCheckResult; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(HealthCheckResultBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$HealthCheckResultSerializer(); +} + +class _$HealthCheckResultSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [HealthCheckResult, _$HealthCheckResult]; + + @override + final String wireName = r'HealthCheckResult'; + + Iterable _serializeProperties( + Serializers serializers, + HealthCheckResult object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.nullableMessage != null) { + yield r'NullableMessage'; + yield serializers.serialize( + object.nullableMessage, + specifiedType: const FullType.nullable(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + HealthCheckResult object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required HealthCheckResultBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'NullableMessage': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(String), + ) as String?; + if (valueDes == null) continue; + result.nullableMessage = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + HealthCheckResult deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = HealthCheckResultBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/map_test.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/map_test.dart new file mode 100644 index 000000000000..9fa58677a84a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/map_test.dart @@ -0,0 +1,181 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'map_test.g.dart'; + +/// MapTest +/// +/// Properties: +/// * [mapMapOfString] +/// * [mapOfEnumString] +/// * [directMap] +/// * [indirectMap] +@BuiltValue() +abstract class MapTest implements Built { + @BuiltValueField(wireName: r'map_map_of_string') + BuiltMap>? get mapMapOfString; + + @BuiltValueField(wireName: r'map_of_enum_string') + BuiltMap? get mapOfEnumString; + // enum mapOfEnumStringEnum { UPPER, lower, }; + + @BuiltValueField(wireName: r'direct_map') + BuiltMap? get directMap; + + @BuiltValueField(wireName: r'indirect_map') + BuiltMap? get indirectMap; + + MapTest._(); + + factory MapTest([void updates(MapTestBuilder b)]) = _$MapTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(MapTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$MapTestSerializer(); +} + +class _$MapTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [MapTest, _$MapTest]; + + @override + final String wireName = r'MapTest'; + + Iterable _serializeProperties( + Serializers serializers, + MapTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.mapMapOfString != null) { + yield r'map_map_of_string'; + yield serializers.serialize( + object.mapMapOfString, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ); + } + if (object.mapOfEnumString != null) { + yield r'map_of_enum_string'; + yield serializers.serialize( + object.mapOfEnumString, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + ); + } + if (object.directMap != null) { + yield r'direct_map'; + yield serializers.serialize( + object.directMap, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ); + } + if (object.indirectMap != null) { + yield r'indirect_map'; + yield serializers.serialize( + object.indirectMap, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + MapTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required MapTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'map_map_of_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ) as BuiltMap>; + result.mapMapOfString.replace(valueDes); + break; + case r'map_of_enum_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + ) as BuiltMap; + result.mapOfEnumString.replace(valueDes); + break; + case r'direct_map': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ) as BuiltMap; + result.directMap.replace(valueDes); + break; + case r'indirect_map': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ) as BuiltMap; + result.indirectMap.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + MapTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = MapTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class MapTestMapOfEnumStringEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'UPPER') + static const MapTestMapOfEnumStringEnum UPPER = _$mapTestMapOfEnumStringEnum_UPPER; + @BuiltValueEnumConst(wireName: r'lower') + static const MapTestMapOfEnumStringEnum lower = _$mapTestMapOfEnumStringEnum_lower; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const MapTestMapOfEnumStringEnum unknownDefaultOpenApi = _$mapTestMapOfEnumStringEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$mapTestMapOfEnumStringEnumSerializer; + + const MapTestMapOfEnumStringEnum._(String name): super(name); + + static BuiltSet get values => _$mapTestMapOfEnumStringEnumValues; + static MapTestMapOfEnumStringEnum valueOf(String name) => _$mapTestMapOfEnumStringEnumValueOf(name); +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart new file mode 100644 index 000000000000..76b5933ae5a7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -0,0 +1,146 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'mixed_properties_and_additional_properties_class.g.dart'; + +/// MixedPropertiesAndAdditionalPropertiesClass +/// +/// Properties: +/// * [uuid] +/// * [dateTime] +/// * [map] +@BuiltValue() +abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built { + @BuiltValueField(wireName: r'uuid') + String? get uuid; + + @BuiltValueField(wireName: r'dateTime') + DateTime? get dateTime; + + @BuiltValueField(wireName: r'map') + BuiltMap? get map; + + MixedPropertiesAndAdditionalPropertiesClass._(); + + factory MixedPropertiesAndAdditionalPropertiesClass([void updates(MixedPropertiesAndAdditionalPropertiesClassBuilder b)]) = _$MixedPropertiesAndAdditionalPropertiesClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(MixedPropertiesAndAdditionalPropertiesClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); +} + +class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [MixedPropertiesAndAdditionalPropertiesClass, _$MixedPropertiesAndAdditionalPropertiesClass]; + + @override + final String wireName = r'MixedPropertiesAndAdditionalPropertiesClass'; + + Iterable _serializeProperties( + Serializers serializers, + MixedPropertiesAndAdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.uuid != null) { + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); + } + if (object.dateTime != null) { + yield r'dateTime'; + yield serializers.serialize( + object.dateTime, + specifiedType: const FullType(DateTime), + ); + } + if (object.map != null) { + yield r'map'; + yield serializers.serialize( + object.map, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + MixedPropertiesAndAdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required MixedPropertiesAndAdditionalPropertiesClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'uuid': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.uuid = valueDes; + break; + case r'dateTime': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.dateTime = valueDes; + break; + case r'map': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + ) as BuiltMap; + result.map.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + MixedPropertiesAndAdditionalPropertiesClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = MixedPropertiesAndAdditionalPropertiesClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model200_response.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model200_response.dart new file mode 100644 index 000000000000..0a2cfb4411ac --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model200_response.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model200_response.g.dart'; + +/// Model for testing model name starting with number +/// +/// Properties: +/// * [name] +/// * [classField] +@BuiltValue() +abstract class Model200Response implements Built { + @BuiltValueField(wireName: r'name') + int? get name; + + @BuiltValueField(wireName: r'class') + String? get classField; + + Model200Response._(); + + factory Model200Response([void updates(Model200ResponseBuilder b)]) = _$Model200Response; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(Model200ResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$Model200ResponseSerializer(); +} + +class _$Model200ResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Model200Response, _$Model200Response]; + + @override + final String wireName = r'Model200Response'; + + Iterable _serializeProperties( + Serializers serializers, + Model200Response object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(int), + ); + } + if (object.classField != null) { + yield r'class'; + yield serializers.serialize( + object.classField, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Model200Response object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required Model200ResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.name = valueDes; + break; + case r'class': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.classField = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Model200Response deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = Model200ResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_client.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_client.dart new file mode 100644 index 000000000000..36690977421b --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_client.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_client.g.dart'; + +/// ModelClient +/// +/// Properties: +/// * [client] +@BuiltValue() +abstract class ModelClient implements Built { + @BuiltValueField(wireName: r'client') + String? get client; + + ModelClient._(); + + factory ModelClient([void updates(ModelClientBuilder b)]) = _$ModelClient; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelClientBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelClientSerializer(); +} + +class _$ModelClientSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelClient, _$ModelClient]; + + @override + final String wireName = r'ModelClient'; + + Iterable _serializeProperties( + Serializers serializers, + ModelClient object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.client != null) { + yield r'client'; + yield serializers.serialize( + object.client, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelClient object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelClientBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'client': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.client = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelClient deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelClientBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_enum_class.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_enum_class.dart new file mode 100644 index 000000000000..ac609bfd15ad --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_enum_class.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_enum_class.g.dart'; + +class ModelEnumClass extends EnumClass { + + @BuiltValueEnumConst(wireName: r'_abc') + static const ModelEnumClass abc = _$abc; + @BuiltValueEnumConst(wireName: r'-efg') + static const ModelEnumClass efg = _$efg; + @BuiltValueEnumConst(wireName: r'(xyz)') + static const ModelEnumClass leftParenthesisXyzRightParenthesis = _$leftParenthesisXyzRightParenthesis; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const ModelEnumClass unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$modelEnumClassSerializer; + + const ModelEnumClass._(String name): super(name); + + static BuiltSet get values => _$values; + static ModelEnumClass valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class ModelEnumClassMixin = Object with _$ModelEnumClassMixin; + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_file.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_file.dart new file mode 100644 index 000000000000..2702c21d36f2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_file.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_file.g.dart'; + +/// Must be named `File` for test. +/// +/// Properties: +/// * [sourceURI] - Test capitalization +@BuiltValue() +abstract class ModelFile implements Built { + /// Test capitalization + @BuiltValueField(wireName: r'sourceURI') + String? get sourceURI; + + ModelFile._(); + + factory ModelFile([void updates(ModelFileBuilder b)]) = _$ModelFile; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelFileBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelFileSerializer(); +} + +class _$ModelFileSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelFile, _$ModelFile]; + + @override + final String wireName = r'ModelFile'; + + Iterable _serializeProperties( + Serializers serializers, + ModelFile object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.sourceURI != null) { + yield r'sourceURI'; + yield serializers.serialize( + object.sourceURI, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelFile object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelFileBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'sourceURI': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.sourceURI = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelFile deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelFileBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_list.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_list.dart new file mode 100644 index 000000000000..579853258f8e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_list.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_list.g.dart'; + +/// ModelList +/// +/// Properties: +/// * [n123list] +@BuiltValue() +abstract class ModelList implements Built { + @BuiltValueField(wireName: r'123-list') + String? get n123list; + + ModelList._(); + + factory ModelList([void updates(ModelListBuilder b)]) = _$ModelList; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelListBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelListSerializer(); +} + +class _$ModelListSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelList, _$ModelList]; + + @override + final String wireName = r'ModelList'; + + Iterable _serializeProperties( + Serializers serializers, + ModelList object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.n123list != null) { + yield r'123-list'; + yield serializers.serialize( + object.n123list, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelList object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelListBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'123-list': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.n123list = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelList deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelListBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_return.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_return.dart new file mode 100644 index 000000000000..45a2f67f8a40 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_return.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_return.g.dart'; + +/// Model for testing reserved words +/// +/// Properties: +/// * [return_] +@BuiltValue() +abstract class ModelReturn implements Built { + @BuiltValueField(wireName: r'return') + int? get return_; + + ModelReturn._(); + + factory ModelReturn([void updates(ModelReturnBuilder b)]) = _$ModelReturn; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelReturnBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelReturnSerializer(); +} + +class _$ModelReturnSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelReturn, _$ModelReturn]; + + @override + final String wireName = r'ModelReturn'; + + Iterable _serializeProperties( + Serializers serializers, + ModelReturn object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.return_ != null) { + yield r'return'; + yield serializers.serialize( + object.return_, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelReturn object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelReturnBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'return': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.return_ = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelReturn deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelReturnBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/name.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/name.dart new file mode 100644 index 000000000000..10fa99e6a5f7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/name.dart @@ -0,0 +1,160 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'name.g.dart'; + +/// Model for testing model name same as property name +/// +/// Properties: +/// * [name] +/// * [snakeCase] +/// * [property] +/// * [n123number] +@BuiltValue() +abstract class Name implements Built { + @BuiltValueField(wireName: r'name') + int get name; + + @BuiltValueField(wireName: r'snake_case') + int? get snakeCase; + + @BuiltValueField(wireName: r'property') + String? get property; + + @BuiltValueField(wireName: r'123Number') + int? get n123number; + + Name._(); + + factory Name([void updates(NameBuilder b)]) = _$Name; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(NameBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$NameSerializer(); +} + +class _$NameSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Name, _$Name]; + + @override + final String wireName = r'Name'; + + Iterable _serializeProperties( + Serializers serializers, + Name object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(int), + ); + if (object.snakeCase != null) { + yield r'snake_case'; + yield serializers.serialize( + object.snakeCase, + specifiedType: const FullType(int), + ); + } + if (object.property != null) { + yield r'property'; + yield serializers.serialize( + object.property, + specifiedType: const FullType(String), + ); + } + if (object.n123number != null) { + yield r'123Number'; + yield serializers.serialize( + object.n123number, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Name object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required NameBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.name = valueDes; + break; + case r'snake_case': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.snakeCase = valueDes; + break; + case r'property': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.property = valueDes; + break; + case r'123Number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.n123number = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Name deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = NameBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/nullable_class.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/nullable_class.dart new file mode 100644 index 000000000000..c993a41303f0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/nullable_class.dart @@ -0,0 +1,319 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/date.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'nullable_class.g.dart'; + +/// NullableClass +/// +/// Properties: +/// * [integerProp] +/// * [numberProp] +/// * [booleanProp] +/// * [stringProp] +/// * [dateProp] +/// * [datetimeProp] +/// * [arrayNullableProp] +/// * [arrayAndItemsNullableProp] +/// * [arrayItemsNullable] +/// * [objectNullableProp] +/// * [objectAndItemsNullableProp] +/// * [objectItemsNullable] +@BuiltValue() +abstract class NullableClass implements Built { + @BuiltValueField(wireName: r'integer_prop') + int? get integerProp; + + @BuiltValueField(wireName: r'number_prop') + num? get numberProp; + + @BuiltValueField(wireName: r'boolean_prop') + bool? get booleanProp; + + @BuiltValueField(wireName: r'string_prop') + String? get stringProp; + + @BuiltValueField(wireName: r'date_prop') + Date? get dateProp; + + @BuiltValueField(wireName: r'datetime_prop') + DateTime? get datetimeProp; + + @BuiltValueField(wireName: r'array_nullable_prop') + BuiltList? get arrayNullableProp; + + @BuiltValueField(wireName: r'array_and_items_nullable_prop') + BuiltList? get arrayAndItemsNullableProp; + + @BuiltValueField(wireName: r'array_items_nullable') + BuiltList? get arrayItemsNullable; + + @BuiltValueField(wireName: r'object_nullable_prop') + BuiltMap? get objectNullableProp; + + @BuiltValueField(wireName: r'object_and_items_nullable_prop') + BuiltMap? get objectAndItemsNullableProp; + + @BuiltValueField(wireName: r'object_items_nullable') + BuiltMap? get objectItemsNullable; + + NullableClass._(); + + factory NullableClass([void updates(NullableClassBuilder b)]) = _$NullableClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(NullableClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$NullableClassSerializer(); +} + +class _$NullableClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [NullableClass, _$NullableClass]; + + @override + final String wireName = r'NullableClass'; + + Iterable _serializeProperties( + Serializers serializers, + NullableClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.integerProp != null) { + yield r'integer_prop'; + yield serializers.serialize( + object.integerProp, + specifiedType: const FullType.nullable(int), + ); + } + if (object.numberProp != null) { + yield r'number_prop'; + yield serializers.serialize( + object.numberProp, + specifiedType: const FullType.nullable(num), + ); + } + if (object.booleanProp != null) { + yield r'boolean_prop'; + yield serializers.serialize( + object.booleanProp, + specifiedType: const FullType.nullable(bool), + ); + } + if (object.stringProp != null) { + yield r'string_prop'; + yield serializers.serialize( + object.stringProp, + specifiedType: const FullType.nullable(String), + ); + } + if (object.dateProp != null) { + yield r'date_prop'; + yield serializers.serialize( + object.dateProp, + specifiedType: const FullType.nullable(Date), + ); + } + if (object.datetimeProp != null) { + yield r'datetime_prop'; + yield serializers.serialize( + object.datetimeProp, + specifiedType: const FullType.nullable(DateTime), + ); + } + if (object.arrayNullableProp != null) { + yield r'array_nullable_prop'; + yield serializers.serialize( + object.arrayNullableProp, + specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + ); + } + if (object.arrayAndItemsNullableProp != null) { + yield r'array_and_items_nullable_prop'; + yield serializers.serialize( + object.arrayAndItemsNullableProp, + specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + ); + } + if (object.arrayItemsNullable != null) { + yield r'array_items_nullable'; + yield serializers.serialize( + object.arrayItemsNullable, + specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + ); + } + if (object.objectNullableProp != null) { + yield r'object_nullable_prop'; + yield serializers.serialize( + object.objectNullableProp, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + ); + } + if (object.objectAndItemsNullableProp != null) { + yield r'object_and_items_nullable_prop'; + yield serializers.serialize( + object.objectAndItemsNullableProp, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); + } + if (object.objectItemsNullable != null) { + yield r'object_items_nullable'; + yield serializers.serialize( + object.objectItemsNullable, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + NullableClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required NullableClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'integer_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(int), + ) as int?; + if (valueDes == null) continue; + result.integerProp = valueDes; + break; + case r'number_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(num), + ) as num?; + if (valueDes == null) continue; + result.numberProp = valueDes; + break; + case r'boolean_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(bool), + ) as bool?; + if (valueDes == null) continue; + result.booleanProp = valueDes; + break; + case r'string_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(String), + ) as String?; + if (valueDes == null) continue; + result.stringProp = valueDes; + break; + case r'date_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(Date), + ) as Date?; + if (valueDes == null) continue; + result.dateProp = valueDes; + break; + case r'datetime_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(DateTime), + ) as DateTime?; + if (valueDes == null) continue; + result.datetimeProp = valueDes; + break; + case r'array_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + ) as BuiltList?; + if (valueDes == null) continue; + result.arrayNullableProp.replace(valueDes); + break; + case r'array_and_items_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + ) as BuiltList?; + if (valueDes == null) continue; + result.arrayAndItemsNullableProp.replace(valueDes); + break; + case r'array_items_nullable': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + ) as BuiltList; + result.arrayItemsNullable.replace(valueDes); + break; + case r'object_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + ) as BuiltMap?; + if (valueDes == null) continue; + result.objectNullableProp.replace(valueDes); + break; + case r'object_and_items_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ) as BuiltMap?; + if (valueDes == null) continue; + result.objectAndItemsNullableProp.replace(valueDes); + break; + case r'object_items_nullable': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ) as BuiltMap; + result.objectItemsNullable.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + NullableClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = NullableClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/number_only.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/number_only.dart new file mode 100644 index 000000000000..482a95f3e521 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/number_only.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'number_only.g.dart'; + +/// NumberOnly +/// +/// Properties: +/// * [justNumber] +@BuiltValue() +abstract class NumberOnly implements Built { + @BuiltValueField(wireName: r'JustNumber') + num? get justNumber; + + NumberOnly._(); + + factory NumberOnly([void updates(NumberOnlyBuilder b)]) = _$NumberOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(NumberOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$NumberOnlySerializer(); +} + +class _$NumberOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [NumberOnly, _$NumberOnly]; + + @override + final String wireName = r'NumberOnly'; + + Iterable _serializeProperties( + Serializers serializers, + NumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.justNumber != null) { + yield r'JustNumber'; + yield serializers.serialize( + object.justNumber, + specifiedType: const FullType(num), + ); + } + } + + @override + Object serialize( + Serializers serializers, + NumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required NumberOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'JustNumber': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.justNumber = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + NumberOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = NumberOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/object_with_deprecated_fields.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/object_with_deprecated_fields.dart new file mode 100644 index 000000000000..90f4df85934f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/object_with_deprecated_fields.dart @@ -0,0 +1,165 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'object_with_deprecated_fields.g.dart'; + +/// ObjectWithDeprecatedFields +/// +/// Properties: +/// * [uuid] +/// * [id] +/// * [deprecatedRef] +/// * [bars] +@BuiltValue() +abstract class ObjectWithDeprecatedFields implements Built { + @BuiltValueField(wireName: r'uuid') + String? get uuid; + + @BuiltValueField(wireName: r'id') + num? get id; + + @BuiltValueField(wireName: r'deprecatedRef') + DeprecatedObject? get deprecatedRef; + + @BuiltValueField(wireName: r'bars') + BuiltList? get bars; + + ObjectWithDeprecatedFields._(); + + factory ObjectWithDeprecatedFields([void updates(ObjectWithDeprecatedFieldsBuilder b)]) = _$ObjectWithDeprecatedFields; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ObjectWithDeprecatedFieldsBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ObjectWithDeprecatedFieldsSerializer(); +} + +class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ObjectWithDeprecatedFields, _$ObjectWithDeprecatedFields]; + + @override + final String wireName = r'ObjectWithDeprecatedFields'; + + Iterable _serializeProperties( + Serializers serializers, + ObjectWithDeprecatedFields object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.uuid != null) { + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(num), + ); + } + if (object.deprecatedRef != null) { + yield r'deprecatedRef'; + yield serializers.serialize( + object.deprecatedRef, + specifiedType: const FullType(DeprecatedObject), + ); + } + if (object.bars != null) { + yield r'bars'; + yield serializers.serialize( + object.bars, + specifiedType: const FullType(BuiltList, [FullType(Bar)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ObjectWithDeprecatedFields object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ObjectWithDeprecatedFieldsBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'uuid': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.uuid = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.id = valueDes; + break; + case r'deprecatedRef': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DeprecatedObject), + ) as DeprecatedObject; + result.deprecatedRef.replace(valueDes); + break; + case r'bars': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(Bar)]), + ) as BuiltList; + result.bars.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ObjectWithDeprecatedFields deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ObjectWithDeprecatedFieldsBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/order.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/order.dart new file mode 100644 index 000000000000..a44e1b340c1e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/order.dart @@ -0,0 +1,225 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'order.g.dart'; + +/// Order +/// +/// Properties: +/// * [id] +/// * [petId] +/// * [quantity] +/// * [shipDate] +/// * [status] - Order Status +/// * [complete] +@BuiltValue() +abstract class Order implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'petId') + int? get petId; + + @BuiltValueField(wireName: r'quantity') + int? get quantity; + + @BuiltValueField(wireName: r'shipDate') + DateTime? get shipDate; + + /// Order Status + @BuiltValueField(wireName: r'status') + OrderStatusEnum? get status; + // enum statusEnum { placed, approved, delivered, }; + + @BuiltValueField(wireName: r'complete') + bool? get complete; + + Order._(); + + factory Order([void updates(OrderBuilder b)]) = _$Order; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(OrderBuilder b) => b + ..complete = false; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$OrderSerializer(); +} + +class _$OrderSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Order, _$Order]; + + @override + final String wireName = r'Order'; + + Iterable _serializeProperties( + Serializers serializers, + Order object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.petId != null) { + yield r'petId'; + yield serializers.serialize( + object.petId, + specifiedType: const FullType(int), + ); + } + if (object.quantity != null) { + yield r'quantity'; + yield serializers.serialize( + object.quantity, + specifiedType: const FullType(int), + ); + } + if (object.shipDate != null) { + yield r'shipDate'; + yield serializers.serialize( + object.shipDate, + specifiedType: const FullType(DateTime), + ); + } + if (object.status != null) { + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(OrderStatusEnum), + ); + } + if (object.complete != null) { + yield r'complete'; + yield serializers.serialize( + object.complete, + specifiedType: const FullType(bool), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Order object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required OrderBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'petId': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.petId = valueDes; + break; + case r'quantity': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.quantity = valueDes; + break; + case r'shipDate': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.shipDate = valueDes; + break; + case r'status': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OrderStatusEnum), + ) as OrderStatusEnum; + result.status = valueDes; + break; + case r'complete': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.complete = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Order deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = OrderBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class OrderStatusEnum extends EnumClass { + + /// Order Status + @BuiltValueEnumConst(wireName: r'placed') + static const OrderStatusEnum placed = _$orderStatusEnum_placed; + /// Order Status + @BuiltValueEnumConst(wireName: r'approved') + static const OrderStatusEnum approved = _$orderStatusEnum_approved; + /// Order Status + @BuiltValueEnumConst(wireName: r'delivered') + static const OrderStatusEnum delivered = _$orderStatusEnum_delivered; + /// Order Status + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const OrderStatusEnum unknownDefaultOpenApi = _$orderStatusEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$orderStatusEnumSerializer; + + const OrderStatusEnum._(String name): super(name); + + static BuiltSet get values => _$orderStatusEnumValues; + static OrderStatusEnum valueOf(String name) => _$orderStatusEnumValueOf(name); +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_composite.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_composite.dart new file mode 100644 index 000000000000..0d6341cc1299 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_composite.dart @@ -0,0 +1,144 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_composite.g.dart'; + +/// OuterComposite +/// +/// Properties: +/// * [myNumber] +/// * [myString] +/// * [myBoolean] +@BuiltValue() +abstract class OuterComposite implements Built { + @BuiltValueField(wireName: r'my_number') + num? get myNumber; + + @BuiltValueField(wireName: r'my_string') + String? get myString; + + @BuiltValueField(wireName: r'my_boolean') + bool? get myBoolean; + + OuterComposite._(); + + factory OuterComposite([void updates(OuterCompositeBuilder b)]) = _$OuterComposite; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(OuterCompositeBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$OuterCompositeSerializer(); +} + +class _$OuterCompositeSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [OuterComposite, _$OuterComposite]; + + @override + final String wireName = r'OuterComposite'; + + Iterable _serializeProperties( + Serializers serializers, + OuterComposite object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.myNumber != null) { + yield r'my_number'; + yield serializers.serialize( + object.myNumber, + specifiedType: const FullType(num), + ); + } + if (object.myString != null) { + yield r'my_string'; + yield serializers.serialize( + object.myString, + specifiedType: const FullType(String), + ); + } + if (object.myBoolean != null) { + yield r'my_boolean'; + yield serializers.serialize( + object.myBoolean, + specifiedType: const FullType(bool), + ); + } + } + + @override + Object serialize( + Serializers serializers, + OuterComposite object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required OuterCompositeBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'my_number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.myNumber = valueDes; + break; + case r'my_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.myString = valueDes; + break; + case r'my_boolean': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.myBoolean = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + OuterComposite deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = OuterCompositeBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum.dart new file mode 100644 index 000000000000..5ad5d8009bdf --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum.g.dart'; + +class OuterEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'placed') + static const OuterEnum placed = _$placed; + @BuiltValueEnumConst(wireName: r'approved') + static const OuterEnum approved = _$approved; + @BuiltValueEnumConst(wireName: r'delivered') + static const OuterEnum delivered = _$delivered; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const OuterEnum unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumSerializer; + + const OuterEnum._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnum valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumMixin = Object with _$OuterEnumMixin; + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_default_value.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_default_value.dart new file mode 100644 index 000000000000..62c3cefe8456 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_default_value.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum_default_value.g.dart'; + +class OuterEnumDefaultValue extends EnumClass { + + @BuiltValueEnumConst(wireName: r'placed') + static const OuterEnumDefaultValue placed = _$placed; + @BuiltValueEnumConst(wireName: r'approved') + static const OuterEnumDefaultValue approved = _$approved; + @BuiltValueEnumConst(wireName: r'delivered') + static const OuterEnumDefaultValue delivered = _$delivered; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const OuterEnumDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumDefaultValueSerializer; + + const OuterEnumDefaultValue._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnumDefaultValue valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumDefaultValueMixin = Object with _$OuterEnumDefaultValueMixin; + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer.dart new file mode 100644 index 000000000000..988b30785d30 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum_integer.g.dart'; + +class OuterEnumInteger extends EnumClass { + + @BuiltValueEnumConst(wireNumber: 0) + static const OuterEnumInteger number0 = _$number0; + @BuiltValueEnumConst(wireNumber: 1) + static const OuterEnumInteger number1 = _$number1; + @BuiltValueEnumConst(wireNumber: 2) + static const OuterEnumInteger number2 = _$number2; + @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) + static const OuterEnumInteger unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumIntegerSerializer; + + const OuterEnumInteger._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnumInteger valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumIntegerMixin = Object with _$OuterEnumIntegerMixin; + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer_default_value.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer_default_value.dart new file mode 100644 index 000000000000..3fe792cedbe9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer_default_value.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum_integer_default_value.g.dart'; + +class OuterEnumIntegerDefaultValue extends EnumClass { + + @BuiltValueEnumConst(wireNumber: 0) + static const OuterEnumIntegerDefaultValue number0 = _$number0; + @BuiltValueEnumConst(wireNumber: 1) + static const OuterEnumIntegerDefaultValue number1 = _$number1; + @BuiltValueEnumConst(wireNumber: 2) + static const OuterEnumIntegerDefaultValue number2 = _$number2; + @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) + static const OuterEnumIntegerDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumIntegerDefaultValueSerializer; + + const OuterEnumIntegerDefaultValue._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnumIntegerDefaultValue valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumIntegerDefaultValueMixin = Object with _$OuterEnumIntegerDefaultValueMixin; + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_object_with_enum_property.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_object_with_enum_property.dart new file mode 100644 index 000000000000..173329856452 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_object_with_enum_property.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_object_with_enum_property.g.dart'; + +/// OuterObjectWithEnumProperty +/// +/// Properties: +/// * [value] +@BuiltValue() +abstract class OuterObjectWithEnumProperty implements Built { + @BuiltValueField(wireName: r'value') + OuterEnumInteger get value; + // enum valueEnum { 0, 1, 2, }; + + OuterObjectWithEnumProperty._(); + + factory OuterObjectWithEnumProperty([void updates(OuterObjectWithEnumPropertyBuilder b)]) = _$OuterObjectWithEnumProperty; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(OuterObjectWithEnumPropertyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$OuterObjectWithEnumPropertySerializer(); +} + +class _$OuterObjectWithEnumPropertySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [OuterObjectWithEnumProperty, _$OuterObjectWithEnumProperty]; + + @override + final String wireName = r'OuterObjectWithEnumProperty'; + + Iterable _serializeProperties( + Serializers serializers, + OuterObjectWithEnumProperty object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'value'; + yield serializers.serialize( + object.value, + specifiedType: const FullType(OuterEnumInteger), + ); + } + + @override + Object serialize( + Serializers serializers, + OuterObjectWithEnumProperty object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required OuterObjectWithEnumPropertyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'value': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumInteger), + ) as OuterEnumInteger; + result.value = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + OuterObjectWithEnumProperty deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = OuterObjectWithEnumPropertyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pasta.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pasta.dart new file mode 100644 index 000000000000..e8b1ebdf31ea --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pasta.dart @@ -0,0 +1,182 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pasta.g.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 +@BuiltValue() +abstract class Pasta implements Entity, Built { + @BuiltValueField(wireName: r'vendor') + String? get vendor; + + Pasta._(); + + factory Pasta([void updates(PastaBuilder b)]) = _$Pasta; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PastaBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PastaSerializer(); +} + +class _$PastaSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Pasta, _$Pasta]; + + @override + final String wireName = r'Pasta'; + + Iterable _serializeProperties( + Serializers serializers, + Pasta object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + if (object.vendor != null) { + yield r'vendor'; + yield serializers.serialize( + object.vendor, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Pasta object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PastaBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + case r'vendor': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.vendor = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Pasta deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PastaBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pet.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pet.dart new file mode 100644 index 000000000000..aeb788e8f7ff --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pet.dart @@ -0,0 +1,222 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pet.g.dart'; + +/// Pet +/// +/// Properties: +/// * [id] +/// * [name] +/// * [category] +/// * [photoUrls] +/// * [tags] +/// * [status] - pet status in the store +@BuiltValue() +abstract class Pet implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'name') + String get name; + + @BuiltValueField(wireName: r'category') + Category? get category; + + @BuiltValueField(wireName: r'photoUrls') + BuiltList get photoUrls; + + @BuiltValueField(wireName: r'tags') + BuiltList? get tags; + + /// pet status in the store + @BuiltValueField(wireName: r'status') + PetStatusEnum? get status; + // enum statusEnum { available, pending, sold, }; + + Pet._(); + + factory Pet([void updates(PetBuilder b)]) = _$Pet; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PetBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PetSerializer(); +} + +class _$PetSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Pet, _$Pet]; + + @override + final String wireName = r'Pet'; + + Iterable _serializeProperties( + Serializers serializers, + Pet object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + if (object.category != null) { + yield r'category'; + yield serializers.serialize( + object.category, + specifiedType: const FullType(Category), + ); + } + yield r'photoUrls'; + yield serializers.serialize( + object.photoUrls, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); + if (object.tags != null) { + yield r'tags'; + yield serializers.serialize( + object.tags, + specifiedType: const FullType(BuiltList, [FullType(Tag)]), + ); + } + if (object.status != null) { + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(PetStatusEnum), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Pet object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PetBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'category': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(Category), + ) as Category; + result.category.replace(valueDes); + break; + case r'photoUrls': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ) as BuiltList; + result.photoUrls.replace(valueDes); + break; + case r'tags': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(Tag)]), + ) as BuiltList; + result.tags.replace(valueDes); + break; + case r'status': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(PetStatusEnum), + ) as PetStatusEnum; + result.status = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Pet deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PetBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class PetStatusEnum extends EnumClass { + + /// pet status in the store + @BuiltValueEnumConst(wireName: r'available') + static const PetStatusEnum available = _$petStatusEnum_available; + /// pet status in the store + @BuiltValueEnumConst(wireName: r'pending') + static const PetStatusEnum pending = _$petStatusEnum_pending; + /// pet status in the store + @BuiltValueEnumConst(wireName: r'sold') + static const PetStatusEnum sold = _$petStatusEnum_sold; + /// pet status in the store + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const PetStatusEnum unknownDefaultOpenApi = _$petStatusEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$petStatusEnumSerializer; + + const PetStatusEnum._(String name): super(name); + + static BuiltSet get values => _$petStatusEnumValues; + static PetStatusEnum valueOf(String name) => _$petStatusEnumValueOf(name); +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza.dart new file mode 100644 index 000000000000..14c06db06d7e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza.dart @@ -0,0 +1,250 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pizza.g.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 +@BuiltValue(instantiable: false) +abstract class Pizza implements Entity { + @BuiltValueField(wireName: r'pizzaSize') + num? get pizzaSize; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'PizzaSpeziale': PizzaSpeziale, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PizzaSerializer(); +} + +extension PizzaDiscriminatorExt on Pizza { + String? get discriminatorValue { + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; + } +} +extension PizzaBuilderDiscriminatorExt on PizzaBuilder { + String? get discriminatorValue { + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; + } +} + +class _$PizzaSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Pizza]; + + @override + final String wireName = r'Pizza'; + + Iterable _serializeProperties( + Serializers serializers, + Pizza object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.pizzaSize != null) { + yield r'pizzaSize'; + yield serializers.serialize( + object.pizzaSize, + specifiedType: const FullType(num), + ); + } + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Pizza object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is PizzaSpeziale) { + return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Pizza deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(Pizza.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'PizzaSpeziale': + return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + default: + return serializers.deserialize(serialized, specifiedType: FullType($Pizza)) as $Pizza; + } + } +} + +/// a concrete implementation of [Pizza], since [Pizza] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Pizza implements Pizza, Built<$Pizza, $PizzaBuilder> { + $Pizza._(); + + factory $Pizza([void Function($PizzaBuilder)? updates]) = _$$Pizza; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($PizzaBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Pizza> get serializer => _$$PizzaSerializer(); +} + +class _$$PizzaSerializer implements PrimitiveSerializer<$Pizza> { + @override + final Iterable types = const [$Pizza, _$$Pizza]; + + @override + final String wireName = r'$Pizza'; + + @override + Object serialize( + Serializers serializers, + $Pizza object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Pizza))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PizzaBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'pizzaSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.pizzaSize = valueDes; + break; + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Pizza deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $PizzaBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza_speziale.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza_speziale.dart new file mode 100644 index 000000000000..673052cc8fcf --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza_speziale.dart @@ -0,0 +1,196 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/pizza.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pizza_speziale.g.dart'; + +/// PizzaSpeziale +/// +/// Properties: +/// * [toppings] +/// * [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 +@BuiltValue() +abstract class PizzaSpeziale implements Pizza, Built { + @BuiltValueField(wireName: r'toppings') + String? get toppings; + + PizzaSpeziale._(); + + factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = _$PizzaSpeziale; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PizzaSpezialeBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PizzaSpezialeSerializer(); +} + +class _$PizzaSpezialeSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PizzaSpeziale, _$PizzaSpeziale]; + + @override + final String wireName = r'PizzaSpeziale'; + + Iterable _serializeProperties( + Serializers serializers, + PizzaSpeziale object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.pizzaSize != null) { + yield r'pizzaSize'; + yield serializers.serialize( + object.pizzaSize, + specifiedType: const FullType(num), + ); + } + if (object.toppings != null) { + yield r'toppings'; + yield serializers.serialize( + object.toppings, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + PizzaSpeziale object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PizzaSpezialeBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'pizzaSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.pizzaSize = valueDes; + break; + case r'toppings': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.toppings = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PizzaSpeziale deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PizzaSpezialeBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/read_only_first.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/read_only_first.dart new file mode 100644 index 000000000000..b619217ab3cb --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/read_only_first.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'read_only_first.g.dart'; + +/// ReadOnlyFirst +/// +/// Properties: +/// * [bar] +/// * [baz] +@BuiltValue() +abstract class ReadOnlyFirst implements Built { + @BuiltValueField(wireName: r'bar') + String? get bar; + + @BuiltValueField(wireName: r'baz') + String? get baz; + + ReadOnlyFirst._(); + + factory ReadOnlyFirst([void updates(ReadOnlyFirstBuilder b)]) = _$ReadOnlyFirst; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ReadOnlyFirstBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ReadOnlyFirstSerializer(); +} + +class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ReadOnlyFirst, _$ReadOnlyFirst]; + + @override + final String wireName = r'ReadOnlyFirst'; + + Iterable _serializeProperties( + Serializers serializers, + ReadOnlyFirst object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.bar != null) { + yield r'bar'; + yield serializers.serialize( + object.bar, + specifiedType: const FullType(String), + ); + } + if (object.baz != null) { + yield r'baz'; + yield serializers.serialize( + object.baz, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ReadOnlyFirst object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ReadOnlyFirstBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'bar': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.bar = valueDes; + break; + case r'baz': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.baz = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ReadOnlyFirst deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ReadOnlyFirstBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/single_ref_type.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/single_ref_type.dart new file mode 100644 index 000000000000..b51e77292e8e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/single_ref_type.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'single_ref_type.g.dart'; + +class SingleRefType extends EnumClass { + + @BuiltValueEnumConst(wireName: r'admin') + static const SingleRefType admin = _$admin; + @BuiltValueEnumConst(wireName: r'user') + static const SingleRefType user = _$user; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const SingleRefType unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$singleRefTypeSerializer; + + const SingleRefType._(String name): super(name); + + static BuiltSet get values => _$values; + static SingleRefType valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class SingleRefTypeMixin = Object with _$SingleRefTypeMixin; + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/special_model_name.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/special_model_name.dart new file mode 100644 index 000000000000..fa860056b45d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/special_model_name.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'special_model_name.g.dart'; + +/// SpecialModelName +/// +/// Properties: +/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] +@BuiltValue() +abstract class SpecialModelName implements Built { + @BuiltValueField(wireName: r'$special[property.name]') + int? get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + SpecialModelName._(); + + factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = _$SpecialModelName; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(SpecialModelNameBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$SpecialModelNameSerializer(); +} + +class _$SpecialModelNameSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [SpecialModelName, _$SpecialModelName]; + + @override + final String wireName = r'SpecialModelName'; + + Iterable _serializeProperties( + Serializers serializers, + SpecialModelName object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket != null) { + yield r'$special[property.name]'; + yield serializers.serialize( + object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + SpecialModelName object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required SpecialModelNameBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'$special[property.name]': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + SpecialModelName deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = SpecialModelNameBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/tag.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/tag.dart new file mode 100644 index 000000000000..3be220d8188e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/tag.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'tag.g.dart'; + +/// Tag +/// +/// Properties: +/// * [id] +/// * [name] +@BuiltValue() +abstract class Tag implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'name') + String? get name; + + Tag._(); + + factory Tag([void updates(TagBuilder b)]) = _$Tag; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(TagBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$TagSerializer(); +} + +class _$TagSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Tag, _$Tag]; + + @override + final String wireName = r'Tag'; + + Iterable _serializeProperties( + Serializers serializers, + Tag object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Tag object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required TagBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Tag deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = TagBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart new file mode 100644 index 000000000000..62190487b0ce --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'test_query_style_form_explode_true_array_string_query_object_parameter.g.dart'; + +/// TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter +/// +/// Properties: +/// * [values] +@BuiltValue() +abstract class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter implements Built { + @BuiltValueField(wireName: r'values') + BuiltList? get values; + + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter._(); + + factory TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter([void updates(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder b)]) = _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer(); +} + +class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter]; + + @override + final String wireName = r'TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter'; + + Iterable _serializeProperties( + Serializers serializers, + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.values != null) { + yield r'values'; + yield serializers.serialize( + object.values, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'values': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ) as BuiltList; + result.values.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/user.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/user.dart new file mode 100644 index 000000000000..f7577d7e1ee9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/user.dart @@ -0,0 +1,235 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'user.g.dart'; + +/// User +/// +/// Properties: +/// * [id] +/// * [username] +/// * [firstName] +/// * [lastName] +/// * [email] +/// * [password] +/// * [phone] +/// * [userStatus] - User Status +@BuiltValue() +abstract class User implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'username') + String? get username; + + @BuiltValueField(wireName: r'firstName') + String? get firstName; + + @BuiltValueField(wireName: r'lastName') + String? get lastName; + + @BuiltValueField(wireName: r'email') + String? get email; + + @BuiltValueField(wireName: r'password') + String? get password; + + @BuiltValueField(wireName: r'phone') + String? get phone; + + /// User Status + @BuiltValueField(wireName: r'userStatus') + int? get userStatus; + + User._(); + + factory User([void updates(UserBuilder b)]) = _$User; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(UserBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$UserSerializer(); +} + +class _$UserSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [User, _$User]; + + @override + final String wireName = r'User'; + + Iterable _serializeProperties( + Serializers serializers, + User object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.username != null) { + yield r'username'; + yield serializers.serialize( + object.username, + specifiedType: const FullType(String), + ); + } + if (object.firstName != null) { + yield r'firstName'; + yield serializers.serialize( + object.firstName, + specifiedType: const FullType(String), + ); + } + if (object.lastName != null) { + yield r'lastName'; + yield serializers.serialize( + object.lastName, + specifiedType: const FullType(String), + ); + } + if (object.email != null) { + yield r'email'; + yield serializers.serialize( + object.email, + specifiedType: const FullType(String), + ); + } + if (object.password != null) { + yield r'password'; + yield serializers.serialize( + object.password, + specifiedType: const FullType(String), + ); + } + if (object.phone != null) { + yield r'phone'; + yield serializers.serialize( + object.phone, + specifiedType: const FullType(String), + ); + } + if (object.userStatus != null) { + yield r'userStatus'; + yield serializers.serialize( + object.userStatus, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + User object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required UserBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'username': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.username = valueDes; + break; + case r'firstName': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.firstName = valueDes; + break; + case r'lastName': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.lastName = valueDes; + break; + case r'email': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.email = valueDes; + break; + case r'password': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.password = valueDes; + break; + case r'phone': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.phone = valueDes; + break; + case r'userStatus': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.userStatus = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + User deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = UserBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/serializers.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/serializers.dart new file mode 100644 index 000000000000..c693e7afc032 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/serializers.dart @@ -0,0 +1,176 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_import + +import 'package:one_of_serializer/any_of_serializer.dart'; +import 'package:one_of_serializer/one_of_serializer.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/serializer.dart'; +import 'package:built_value/standard_json_plugin.dart'; +import 'package:built_value/iso_8601_date_time_serializer.dart'; +import 'package:openapi/src/date_serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +import 'package:openapi/src/model/additional_properties_class.dart'; +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/all_of_with_single_ref.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/array_of_array_of_number_only.dart'; +import 'package:openapi/src/model/array_of_number_only.dart'; +import 'package:openapi/src/model/array_test.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:openapi/src/model/bar_create.dart'; +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar_ref_or_value.dart'; +import 'package:openapi/src/model/capitalization.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:openapi/src/model/cat_all_of.dart'; +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/child.dart'; +import 'package:openapi/src/model/class_model.dart'; +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/dog.dart'; +import 'package:openapi/src/model/dog_all_of.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:openapi/src/model/enum_arrays.dart'; +import 'package:openapi/src/model/enum_test.dart'; +import 'package:openapi/src/model/example.dart'; +import 'package:openapi/src/model/example_non_primitive.dart'; +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/format_test.dart'; +import 'package:openapi/src/model/fruit.dart'; +import 'package:openapi/src/model/has_only_read_only.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/map_test.dart'; +import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +import 'package:openapi/src/model/model200_response.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_enum_class.dart'; +import 'package:openapi/src/model/model_file.dart'; +import 'package:openapi/src/model/model_list.dart'; +import 'package:openapi/src/model/model_return.dart'; +import 'package:openapi/src/model/name.dart'; +import 'package:openapi/src/model/nullable_class.dart'; +import 'package:openapi/src/model/number_only.dart'; +import 'package:openapi/src/model/object_with_deprecated_fields.dart'; +import 'package:openapi/src/model/order.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pasta.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/pizza.dart'; +import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:openapi/src/model/single_ref_type.dart'; +import 'package:openapi/src/model/special_model_name.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; +import 'package:openapi/src/model/user.dart'; + +part 'serializers.g.dart'; + +@SerializersFor([ + AdditionalPropertiesClass, + Addressable,$Addressable, + AllOfWithSingleRef, + Animal,$Animal, + ApiResponse, + Apple, + ArrayOfArrayOfNumberOnly, + ArrayOfNumberOnly, + ArrayTest, + Banana, + Bar, + BarCreate, + BarRef, + BarRefOrValue, + Capitalization, + Cat, + CatAllOf,$CatAllOf, + Category, + Child, + ClassModel, + DeprecatedObject, + Dog, + DogAllOf,$DogAllOf, + Entity,$Entity, + EntityRef,$EntityRef, + EnumArrays, + EnumTest, + Example, + ExampleNonPrimitive, + Extensible,$Extensible, + FileSchemaTestClass, + Foo, + FooRef, + FooRefOrValue, + FormatTest, + Fruit, + HasOnlyReadOnly, + HealthCheckResult, + MapTest, + MixedPropertiesAndAdditionalPropertiesClass, + Model200Response, + ModelClient, + ModelEnumClass, + ModelFile, + ModelList, + ModelReturn, + Name, + NullableClass, + NumberOnly, + ObjectWithDeprecatedFields, + Order, + OuterComposite, + OuterEnum, + OuterEnumDefaultValue, + OuterEnumInteger, + OuterEnumIntegerDefaultValue, + OuterObjectWithEnumProperty, + Pasta, + Pet, + Pizza,$Pizza, + PizzaSpeziale, + ReadOnlyFirst, + SingleRefType, + SpecialModelName, + Tag, + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, + User, +]) +Serializers serializers = (_$serializers.toBuilder() + ..addBuilderFactory( + const FullType(BuiltMap, [FullType(String), FullType(String)]), + () => MapBuilder(), + ) + ..add(Addressable.serializer) + ..add(Animal.serializer) + ..add(CatAllOf.serializer) + ..add(DogAllOf.serializer) + ..add(Entity.serializer) + ..add(EntityRef.serializer) + ..add(Extensible.serializer) + ..add(Pizza.serializer) + ..add(const OneOfSerializer()) + ..add(const AnyOfSerializer()) + ..add(const DateSerializer()) + ..add(Iso8601DateTimeSerializer())) + .build(); + +Serializers standardSerializers = + (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/client/echo_api/dart/dart-http-built_value/pubspec.yaml b/samples/client/echo_api/dart/dart-http-built_value/pubspec.yaml new file mode 100644 index 000000000000..cf19769cab8f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/pubspec.yaml @@ -0,0 +1,19 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '>=2.12.0 <3.0.0' + +dependencies: + http: '>=0.13.5 <2.0.0' + one_of: '>=1.5.0 <2.0.0' + one_of_serializer: '>=1.5.0 <2.0.0' + built_value: '>=8.4.0 <9.0.0' + built_collection: '>=5.1.1 <6.0.0' + +dev_dependencies: + built_value_generator: '>=8.4.0 <9.0.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/additional_properties_class_test.dart new file mode 100644 index 000000000000..c231e6dc2807 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/additional_properties_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AdditionalPropertiesClass +void main() { + final instance = AdditionalPropertiesClassBuilder(); + // TODO add properties to the builder and call build() + + group(AdditionalPropertiesClass, () { + // BuiltMap mapProperty + test('to test the property `mapProperty`', () async { + // TODO + }); + + // BuiltMap> mapOfMapProperty + test('to test the property `mapOfMapProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/addressable_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/addressable_test.dart new file mode 100644 index 000000000000..696e26e8e549 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/addressable_test.dart @@ -0,0 +1,23 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Addressable +void main() { + //final instance = AddressableBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-http-built_value/test/all_of_with_single_ref_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/all_of_with_single_ref_test.dart new file mode 100644 index 000000000000..64e241a4dce3 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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 instance = AllOfWithSingleRefBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-http-built_value/test/animal_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/animal_test.dart new file mode 100644 index 000000000000..39b8b59cdf51 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/animal_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Animal +void main() { + //final instance = AnimalBuilder(); + // TODO add properties to the builder and call build() + + group(Animal, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/api_response_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/api_response_test.dart new file mode 100644 index 000000000000..cf1a744cd629 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/api_response_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ApiResponse +void main() { + final instance = ApiResponseBuilder(); + // TODO add properties to the builder and call build() + + group(ApiResponse, () { + // int code + test('to test the property `code`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String message + test('to test the property `message`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/apple_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/apple_test.dart new file mode 100644 index 000000000000..1d542169550d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/apple_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Apple +void main() { + final instance = AppleBuilder(); + // TODO add properties to the builder and call build() + + group(Apple, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/array_of_array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/array_of_array_of_number_only_test.dart new file mode 100644 index 000000000000..a679a6c4223d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/array_of_array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfArrayOfNumberOnly +void main() { + final instance = ArrayOfArrayOfNumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayOfArrayOfNumberOnly, () { + // BuiltList> arrayArrayNumber + test('to test the property `arrayArrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/array_of_number_only_test.dart new file mode 100644 index 000000000000..cc648bc115c5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfNumberOnly +void main() { + final instance = ArrayOfNumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayOfNumberOnly, () { + // BuiltList arrayNumber + test('to test the property `arrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/array_test_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/array_test_test.dart new file mode 100644 index 000000000000..210216f224b5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/array_test_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayTest +void main() { + final instance = ArrayTestBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayTest, () { + // BuiltList arrayOfString + test('to test the property `arrayOfString`', () async { + // TODO + }); + + // BuiltList> arrayArrayOfInteger + test('to test the property `arrayArrayOfInteger`', () async { + // TODO + }); + + // BuiltList> arrayArrayOfModel + test('to test the property `arrayArrayOfModel`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/banana_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/banana_test.dart new file mode 100644 index 000000000000..a883acc0a9e8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/banana_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Banana +void main() { + final instance = BananaBuilder(); + // TODO add properties to the builder and call build() + + group(Banana, () { + // num count + test('to test the property `count`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/bar_create_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/bar_create_test.dart new file mode 100644 index 000000000000..1bf90151be8b --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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 instance = BarCreateBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-http-built_value/test/bar_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_or_value_test.dart new file mode 100644 index 000000000000..c132ac09943b --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_or_value_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRefOrValue +void main() { + final instance = BarRefOrValueBuilder(); + // TODO add properties to the builder and call build() + + group(BarRefOrValue, () { + // 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/client/echo_api/dart/dart-http-built_value/test/bar_ref_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_test.dart new file mode 100644 index 000000000000..9c410b2b5c54 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRef +void main() { + final instance = BarRefBuilder(); + // TODO add properties to the builder and call build() + + group(BarRef, () { + // 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/client/echo_api/dart/dart-http-built_value/test/bar_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/bar_test.dart new file mode 100644 index 000000000000..dc6daaa3400d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/bar_test.dart @@ -0,0 +1,55 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Bar +void main() { + final instance = BarBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-http-built_value/test/body_api_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/body_api_test.dart new file mode 100644 index 000000000000..067b2ca7c7c7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/body_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for BodyApi +void main() { + final instance = Openapi().getBodyApi(); + + group(BodyApi, () { + // Test body parameter(s) + // + // Test body parameter(s) + // + //Future testEchoBodyPet({ Pet pet }) async + test('test testEchoBodyPet', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/capitalization_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/capitalization_test.dart new file mode 100644 index 000000000000..23e04b0001bb --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/capitalization_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Capitalization +void main() { + final instance = CapitalizationBuilder(); + // TODO add properties to the builder and call build() + + group(Capitalization, () { + // String smallCamel + test('to test the property `smallCamel`', () async { + // TODO + }); + + // String capitalCamel + test('to test the property `capitalCamel`', () async { + // TODO + }); + + // String smallSnake + test('to test the property `smallSnake`', () async { + // TODO + }); + + // String capitalSnake + test('to test the property `capitalSnake`', () async { + // TODO + }); + + // String sCAETHFlowPoints + test('to test the property `sCAETHFlowPoints`', () async { + // TODO + }); + + // Name of the pet + // String ATT_NAME + test('to test the property `ATT_NAME`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/cat_all_of_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/cat_all_of_test.dart new file mode 100644 index 000000000000..fb7e999bf8d1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/cat_all_of_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for CatAllOf +void main() { + //final instance = CatAllOfBuilder(); + // TODO add properties to the builder and call build() + + group(CatAllOf, () { + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/cat_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/cat_test.dart new file mode 100644 index 000000000000..b8fc252acc60 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/cat_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Cat +void main() { + final instance = CatBuilder(); + // TODO add properties to the builder and call build() + + group(Cat, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/category_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/category_test.dart new file mode 100644 index 000000000000..de682b2ff15b --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/category_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Category +void main() { + final instance = CategoryBuilder(); + // TODO add properties to the builder and call build() + + group(Category, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/child_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/child_test.dart new file mode 100644 index 000000000000..d40451a84c2c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/child_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Child +void main() { + final instance = ChildBuilder(); + // TODO add properties to the builder and call build() + + group(Child, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/class_model_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/class_model_test.dart new file mode 100644 index 000000000000..89f1d35e556b --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/class_model_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ClassModel +void main() { + final instance = ClassModelBuilder(); + // TODO add properties to the builder and call build() + + group(ClassModel, () { + // String classField + test('to test the property `classField`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/deprecated_object_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/deprecated_object_test.dart new file mode 100644 index 000000000000..98ab991b2b14 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/deprecated_object_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DeprecatedObject +void main() { + final instance = DeprecatedObjectBuilder(); + // TODO add properties to the builder and call build() + + group(DeprecatedObject, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/dog_all_of_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/dog_all_of_test.dart new file mode 100644 index 000000000000..7b4f4095dc9f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/dog_all_of_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DogAllOf +void main() { + //final instance = DogAllOfBuilder(); + // TODO add properties to the builder and call build() + + group(DogAllOf, () { + // String breed + test('to test the property `breed`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/dog_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/dog_test.dart new file mode 100644 index 000000000000..f57fcdc413df --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/dog_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Dog +void main() { + final instance = DogBuilder(); + // TODO add properties to the builder and call build() + + group(Dog, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // String breed + test('to test the property `breed`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/entity_ref_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/entity_ref_test.dart new file mode 100644 index 000000000000..836289893fb4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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 instance = EntityRefBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-http-built_value/test/entity_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/entity_test.dart new file mode 100644 index 000000000000..30429747562d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/entity_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Entity +void main() { + //final instance = EntityBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-http-built_value/test/enum_arrays_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/enum_arrays_test.dart new file mode 100644 index 000000000000..438c36db0745 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/enum_arrays_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumArrays +void main() { + final instance = EnumArraysBuilder(); + // TODO add properties to the builder and call build() + + group(EnumArrays, () { + // String justSymbol + test('to test the property `justSymbol`', () async { + // TODO + }); + + // BuiltList arrayEnum + test('to test the property `arrayEnum`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/enum_test_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/enum_test_test.dart new file mode 100644 index 000000000000..b5f3aeb7fbdd --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/enum_test_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumTest +void main() { + final instance = EnumTestBuilder(); + // TODO add properties to the builder and call build() + + group(EnumTest, () { + // String enumString + test('to test the property `enumString`', () async { + // TODO + }); + + // String enumStringRequired + test('to test the property `enumStringRequired`', () async { + // TODO + }); + + // int enumInteger + test('to test the property `enumInteger`', () async { + // TODO + }); + + // double enumNumber + test('to test the property `enumNumber`', () async { + // TODO + }); + + // OuterEnum outerEnum + test('to test the property `outerEnum`', () async { + // TODO + }); + + // OuterEnumInteger outerEnumInteger + test('to test the property `outerEnumInteger`', () async { + // TODO + }); + + // OuterEnumDefaultValue outerEnumDefaultValue + test('to test the property `outerEnumDefaultValue`', () async { + // TODO + }); + + // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue + test('to test the property `outerEnumIntegerDefaultValue`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/example_non_primitive_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/example_non_primitive_test.dart new file mode 100644 index 000000000000..93f736780e93 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/example_non_primitive_test.dart @@ -0,0 +1,11 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ExampleNonPrimitive +void main() { + final instance = ExampleNonPrimitiveBuilder(); + // TODO add properties to the builder and call build() + + group(ExampleNonPrimitive, () { + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/example_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/example_test.dart new file mode 100644 index 000000000000..ccb35121143e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/example_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Example +void main() { + final instance = ExampleBuilder(); + // TODO add properties to the builder and call build() + + group(Example, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/extensible_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/extensible_test.dart new file mode 100644 index 000000000000..75e6211e074b --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/extensible_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Extensible +void main() { + //final instance = ExtensibleBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-http-built_value/test/file_schema_test_class_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/file_schema_test_class_test.dart new file mode 100644 index 000000000000..ca8695bd4a47 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/file_schema_test_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FileSchemaTestClass +void main() { + final instance = FileSchemaTestClassBuilder(); + // TODO add properties to the builder and call build() + + group(FileSchemaTestClass, () { + // ModelFile file + test('to test the property `file`', () async { + // TODO + }); + + // BuiltList files + test('to test the property `files`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_or_value_test.dart new file mode 100644 index 000000000000..029d030e5e35 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_or_value_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRefOrValue +void main() { + final instance = FooRefOrValueBuilder(); + // TODO add properties to the builder and call build() + + group(FooRefOrValue, () { + // 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/client/echo_api/dart/dart-http-built_value/test/foo_ref_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_test.dart new file mode 100644 index 000000000000..a1398787bbcb --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRef +void main() { + final instance = FooRefBuilder(); + // TODO add properties to the builder and call build() + + group(FooRef, () { + // String foorefPropA + test('to test the property `foorefPropA`', () 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/client/echo_api/dart/dart-http-built_value/test/foo_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/foo_test.dart new file mode 100644 index 000000000000..93a5286e2b45 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/foo_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final instance = FooBuilder(); + // TODO add properties to the builder and call build() + + group(Foo, () { + // String 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/client/echo_api/dart/dart-http-built_value/test/format_test_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/format_test_test.dart new file mode 100644 index 000000000000..558c3aa4b659 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/format_test_test.dart @@ -0,0 +1,93 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FormatTest +void main() { + final instance = FormatTestBuilder(); + // TODO add properties to the builder and call build() + + group(FormatTest, () { + // int integer + test('to test the property `integer`', () async { + // TODO + }); + + // int int32 + test('to test the property `int32`', () async { + // TODO + }); + + // int int64 + test('to test the property `int64`', () async { + // TODO + }); + + // num number + test('to test the property `number`', () async { + // TODO + }); + + // double float + test('to test the property `float`', () async { + // TODO + }); + + // double double_ + test('to test the property `double_`', () async { + // TODO + }); + + // double decimal + test('to test the property `decimal`', () async { + // TODO + }); + + // String string + test('to test the property `string`', () async { + // TODO + }); + + // String byte + test('to test the property `byte`', () async { + // TODO + }); + + // Uint8List binary + test('to test the property `binary`', () async { + // TODO + }); + + // Date 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/client/echo_api/dart/dart-http-built_value/test/fruit_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/fruit_test.dart new file mode 100644 index 000000000000..c18790ae9566 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/fruit_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Fruit +void main() { + final instance = FruitBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-http-built_value/test/has_only_read_only_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/has_only_read_only_test.dart new file mode 100644 index 000000000000..c34522214751 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/has_only_read_only_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HasOnlyReadOnly +void main() { + final instance = HasOnlyReadOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(HasOnlyReadOnly, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String foo + test('to test the property `foo`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/health_check_result_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/health_check_result_test.dart new file mode 100644 index 000000000000..fda0c9218217 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/health_check_result_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HealthCheckResult +void main() { + final instance = HealthCheckResultBuilder(); + // TODO add properties to the builder and call build() + + group(HealthCheckResult, () { + // String nullableMessage + test('to test the property `nullableMessage`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/map_test_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/map_test_test.dart new file mode 100644 index 000000000000..56a27610ee5a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/map_test_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MapTest +void main() { + final instance = MapTestBuilder(); + // TODO add properties to the builder and call build() + + group(MapTest, () { + // BuiltMap> mapMapOfString + test('to test the property `mapMapOfString`', () async { + // TODO + }); + + // BuiltMap mapOfEnumString + test('to test the property `mapOfEnumString`', () async { + // TODO + }); + + // BuiltMap directMap + test('to test the property `directMap`', () async { + // TODO + }); + + // BuiltMap indirectMap + test('to test the property `indirectMap`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/mixed_properties_and_additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/mixed_properties_and_additional_properties_class_test.dart new file mode 100644 index 000000000000..85b113387a08 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/mixed_properties_and_additional_properties_class_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MixedPropertiesAndAdditionalPropertiesClass +void main() { + final instance = MixedPropertiesAndAdditionalPropertiesClassBuilder(); + // TODO add properties to the builder and call build() + + group(MixedPropertiesAndAdditionalPropertiesClass, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // DateTime dateTime + test('to test the property `dateTime`', () async { + // TODO + }); + + // BuiltMap map + test('to test the property `map`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/model200_response_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model200_response_test.dart new file mode 100644 index 000000000000..11bac07fafb8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/model200_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Model200Response +void main() { + final instance = Model200ResponseBuilder(); + // TODO add properties to the builder and call build() + + group(Model200Response, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // String classField + test('to test the property `classField`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/model_client_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model_client_test.dart new file mode 100644 index 000000000000..f494dfd08499 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/model_client_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelClient +void main() { + final instance = ModelClientBuilder(); + // TODO add properties to the builder and call build() + + group(ModelClient, () { + // String client + test('to test the property `client`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/model_enum_class_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model_enum_class_test.dart new file mode 100644 index 000000000000..03e5855bf004 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/test/model_file_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model_file_test.dart new file mode 100644 index 000000000000..4f1397726226 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/model_file_test.dart @@ -0,0 +1,17 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelFile +void main() { + final instance = ModelFileBuilder(); + // TODO add properties to the builder and call build() + + group(ModelFile, () { + // Test capitalization + // String sourceURI + test('to test the property `sourceURI`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/model_list_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model_list_test.dart new file mode 100644 index 000000000000..d35e02fe0c9a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/model_list_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelList +void main() { + final instance = ModelListBuilder(); + // TODO add properties to the builder and call build() + + group(ModelList, () { + // String n123list + test('to test the property `n123list`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/model_return_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model_return_test.dart new file mode 100644 index 000000000000..eedfe7eb281a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/model_return_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelReturn +void main() { + final instance = ModelReturnBuilder(); + // TODO add properties to the builder and call build() + + group(ModelReturn, () { + // int return_ + test('to test the property `return_`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/name_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/name_test.dart new file mode 100644 index 000000000000..6b2329bb0819 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/name_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Name +void main() { + final instance = NameBuilder(); + // TODO add properties to the builder and call build() + + group(Name, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // int snakeCase + test('to test the property `snakeCase`', () async { + // TODO + }); + + // String property + test('to test the property `property`', () async { + // TODO + }); + + // int n123number + test('to test the property `n123number`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/nullable_class_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/nullable_class_test.dart new file mode 100644 index 000000000000..1a6767dbb2ab --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/nullable_class_test.dart @@ -0,0 +1,71 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NullableClass +void main() { + final instance = NullableClassBuilder(); + // TODO add properties to the builder and call build() + + group(NullableClass, () { + // int integerProp + test('to test the property `integerProp`', () async { + // TODO + }); + + // num numberProp + test('to test the property `numberProp`', () async { + // TODO + }); + + // bool booleanProp + test('to test the property `booleanProp`', () async { + // TODO + }); + + // String stringProp + test('to test the property `stringProp`', () async { + // TODO + }); + + // Date dateProp + test('to test the property `dateProp`', () async { + // TODO + }); + + // DateTime datetimeProp + test('to test the property `datetimeProp`', () async { + // TODO + }); + + // BuiltList arrayNullableProp + test('to test the property `arrayNullableProp`', () async { + // TODO + }); + + // BuiltList arrayAndItemsNullableProp + test('to test the property `arrayAndItemsNullableProp`', () async { + // TODO + }); + + // BuiltList arrayItemsNullable + test('to test the property `arrayItemsNullable`', () async { + // TODO + }); + + // BuiltMap objectNullableProp + test('to test the property `objectNullableProp`', () async { + // TODO + }); + + // BuiltMap objectAndItemsNullableProp + test('to test the property `objectAndItemsNullableProp`', () async { + // TODO + }); + + // BuiltMap objectItemsNullable + test('to test the property `objectItemsNullable`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/number_only_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/number_only_test.dart new file mode 100644 index 000000000000..7167d78a4962 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NumberOnly +void main() { + final instance = NumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(NumberOnly, () { + // num justNumber + test('to test the property `justNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/object_with_deprecated_fields_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/object_with_deprecated_fields_test.dart new file mode 100644 index 000000000000..67275d513f56 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/object_with_deprecated_fields_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ObjectWithDeprecatedFields +void main() { + final instance = ObjectWithDeprecatedFieldsBuilder(); + // TODO add properties to the builder and call build() + + group(ObjectWithDeprecatedFields, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // num id + test('to test the property `id`', () async { + // TODO + }); + + // DeprecatedObject deprecatedRef + test('to test the property `deprecatedRef`', () async { + // TODO + }); + + // BuiltList bars + test('to test the property `bars`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/order_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/order_test.dart new file mode 100644 index 000000000000..7ff992230bf6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/order_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Order +void main() { + final instance = OrderBuilder(); + // TODO add properties to the builder and call build() + + group(Order, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // int petId + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/outer_composite_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_composite_test.dart new file mode 100644 index 000000000000..dac257d9a0d6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/outer_composite_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterComposite +void main() { + final instance = OuterCompositeBuilder(); + // TODO add properties to the builder and call build() + + group(OuterComposite, () { + // num myNumber + test('to test the property `myNumber`', () async { + // TODO + }); + + // String myString + test('to test the property `myString`', () async { + // TODO + }); + + // bool myBoolean + test('to test the property `myBoolean`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_default_value_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_default_value_test.dart new file mode 100644 index 000000000000..502c8326be58 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_default_value_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_default_value_test.dart new file mode 100644 index 000000000000..c535fe8ac354 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_test.dart new file mode 100644 index 000000000000..d945bc8c489d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/test/outer_enum_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_test.dart new file mode 100644 index 000000000000..8e11eb02fb8a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/test/outer_object_with_enum_property_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_object_with_enum_property_test.dart new file mode 100644 index 000000000000..d6d763c5d93a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/outer_object_with_enum_property_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterObjectWithEnumProperty +void main() { + final instance = OuterObjectWithEnumPropertyBuilder(); + // TODO add properties to the builder and call build() + + group(OuterObjectWithEnumProperty, () { + // OuterEnumInteger value + test('to test the property `value`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/pasta_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/pasta_test.dart new file mode 100644 index 000000000000..6a3ae338eec2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/pasta_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pasta +void main() { + final instance = PastaBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-http-built_value/test/path_api_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/path_api_test.dart new file mode 100644 index 000000000000..4ffdcc4567be --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/path_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for PathApi +void main() { + final instance = Openapi().getPathApi(); + + group(PathApi, () { + // Test path parameter(s) + // + // Test path parameter(s) + // + //Future testsPathStringPathStringIntegerPathInteger(String pathString, int pathInteger) async + test('test testsPathStringPathStringIntegerPathInteger', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/pet_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/pet_test.dart new file mode 100644 index 000000000000..94089dce62cf --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/pet_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pet +void main() { + final instance = PetBuilder(); + // TODO add properties to the builder and call build() + + group(Pet, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Category category + test('to test the property `category`', () async { + // TODO + }); + + // BuiltList photoUrls + test('to test the property `photoUrls`', () async { + // TODO + }); + + // BuiltList 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/client/echo_api/dart/dart-http-built_value/test/pizza_speziale_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/pizza_speziale_test.dart new file mode 100644 index 000000000000..774320231c9e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/pizza_speziale_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PizzaSpeziale +void main() { + final instance = PizzaSpezialeBuilder(); + // TODO add properties to the builder and call build() + + group(PizzaSpeziale, () { + // String toppings + test('to test the property `toppings`', () 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/client/echo_api/dart/dart-http-built_value/test/pizza_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/pizza_test.dart new file mode 100644 index 000000000000..5c6e1af95a59 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/pizza_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pizza +void main() { + //final instance = PizzaBuilder(); + // TODO add properties to the builder and call build() + + 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/client/echo_api/dart/dart-http-built_value/test/query_api_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/query_api_test.dart new file mode 100644 index 000000000000..fbb29ec74c85 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/query_api_test.dart @@ -0,0 +1,38 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for QueryApi +void main() { + final instance = Openapi().getQueryApi(); + + group(QueryApi, () { + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryIntegerBooleanString({ int integerQuery, bool booleanQuery, String stringQuery }) async + test('test testQueryIntegerBooleanString', () async { + // TODO + }); + + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryStyleFormExplodeTrueArrayString({ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject }) async + test('test testQueryStyleFormExplodeTrueArrayString', () async { + // TODO + }); + + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryStyleFormExplodeTrueObject({ Pet queryObject }) async + test('test testQueryStyleFormExplodeTrueObject', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/read_only_first_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/read_only_first_test.dart new file mode 100644 index 000000000000..550d3d793ec6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/read_only_first_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ReadOnlyFirst +void main() { + final instance = ReadOnlyFirstBuilder(); + // TODO add properties to the builder and call build() + + group(ReadOnlyFirst, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String baz + test('to test the property `baz`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/single_ref_type_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/single_ref_type_test.dart new file mode 100644 index 000000000000..5cd85add393e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/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/client/echo_api/dart/dart-http-built_value/test/special_model_name_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/special_model_name_test.dart new file mode 100644 index 000000000000..08a4592a1ed7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/special_model_name_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SpecialModelName +void main() { + final instance = SpecialModelNameBuilder(); + // TODO add properties to the builder and call build() + + group(SpecialModelName, () { + // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/tag_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/tag_test.dart new file mode 100644 index 000000000000..6f7c63b8f0c2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/tag_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Tag +void main() { + final instance = TagBuilder(); + // TODO add properties to the builder and call build() + + group(Tag, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart new file mode 100644 index 000000000000..2017e0c3d8d1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter +void main() { + final instance = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); + // TODO add properties to the builder and call build() + + group(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, () { + // BuiltList values + test('to test the property `values`', () async { + // TODO + }); + + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/user_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/user_test.dart new file mode 100644 index 000000000000..1e6a1bc23faa --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/test/user_test.dart @@ -0,0 +1,52 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for User +void main() { + final instance = UserBuilder(); + // TODO add properties to the builder and call build() + + group(User, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String username + test('to test the property `username`', () async { + // TODO + }); + + // String firstName + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName + test('to test the property `lastName`', () async { + // TODO + }); + + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // String phone + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus + test('to test the property `userStatus`', () async { + // TODO + }); + + }); +} From d5bbc0762daf0a6b4db18190fa3b0bd80fedcf80 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Mon, 2 Jan 2023 06:31:37 +0200 Subject: [PATCH 17/20] added more configs --- ...dio-echo-server-dio-json_serializable.yaml | 18 ++ ...io-echo-server-http-json_serializable.yaml | 18 ++ .../languages/DartDioClientCodegen.java | 51 +++- .../dart/libraries/dio/api_exports.mustache | 2 + .../resources/dart/libraries/dio/lib.mustache | 13 +- .../dart/libraries/dio/model_exports.mustache | 7 + .../dio/networking/dio/api_client.mustache | 5 +- .../dio}/api_util.mustache | 4 +- .../dio/networking/dio/auth/_exports.mustache | 7 + .../dio}/auth/api_key_auth.mustache | 2 +- .../dio/auth/authentication.mustache} | 1 + .../dio}/auth/basic_auth.mustache | 2 +- .../dio}/auth/bearer_auth.mustache | 2 +- .../{ => networking/dio}/auth/oauth.mustache | 2 +- .../dio/networking/http/api.mustache | 40 +-- .../dio/networking/http/api_client.mustache | 12 +- .../http/api_client_helper.mustache | 251 ++++++++++++++++++ .../networking/http/api_exception.mustache | 23 ++ .../dio/networking/http/api_util.mustache | 76 ++++++ .../networking/http/auth/_exports.mustache | 7 + .../http/auth/api_key_auth.mustache | 32 +++ .../http/auth/authentication.mustache | 6 + .../networking/http/auth/basic_auth.mustache | 18 ++ .../networking/http/auth/bearer_auth.mustache | 42 +++ .../dio/networking/http/auth/oauth.mustache | 17 ++ .../networking/http/operation_header.mustache | 19 ++ .../dart/libraries/dio/pubspec.mustache | 5 +- .../built_value/api/constructor.mustache | 2 +- .../api/constructor.mustache | 2 +- 29 files changed, 615 insertions(+), 71 deletions(-) create mode 100644 bin/configs/dart-dio-echo-server-dio-json_serializable.yaml create mode 100644 bin/configs/dart-dio-echo-server-http-json_serializable.yaml create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/api_exports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/model_exports.mustache rename modules/openapi-generator/src/main/resources/dart/libraries/dio/{serialization/built_value => networking/dio}/api_util.mustache (98%) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/_exports.mustache rename modules/openapi-generator/src/main/resources/dart/libraries/dio/{ => networking/dio}/auth/api_key_auth.mustache (92%) rename modules/openapi-generator/src/main/resources/dart/libraries/dio/{auth/auth.mustache => networking/dio/auth/authentication.mustache} (99%) rename modules/openapi-generator/src/main/resources/dart/libraries/dio/{ => networking/dio}/auth/basic_auth.mustache (94%) rename modules/openapi-generator/src/main/resources/dart/libraries/dio/{ => networking/dio}/auth/bearer_auth.mustache (90%) rename modules/openapi-generator/src/main/resources/dart/libraries/dio/{ => networking/dio}/auth/oauth.mustache (90%) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client_helper.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_exception.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_util.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/_exports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/api_key_auth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/authentication.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/basic_auth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/bearer_auth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/oauth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/operation_header.mustache diff --git a/bin/configs/dart-dio-echo-server-dio-json_serializable.yaml b/bin/configs/dart-dio-echo-server-dio-json_serializable.yaml new file mode 100644 index 000000000000..4f1e21d959f1 --- /dev/null +++ b/bin/configs/dart-dio-echo-server-dio-json_serializable.yaml @@ -0,0 +1,18 @@ +generatorName: dart-dio +outputDir: samples/client/echo_api/dart/dart-dio-json_serializable +inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/echo_api.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" + serializationLibrary: "json_serializable" + networkingLibrary: "dio" + artifactId: echo-api-dart-dio-json_serializable +reservedWordsMappings: + class: "classField" + + diff --git a/bin/configs/dart-dio-echo-server-http-json_serializable.yaml b/bin/configs/dart-dio-echo-server-http-json_serializable.yaml new file mode 100644 index 000000000000..d2aaa4ca7420 --- /dev/null +++ b/bin/configs/dart-dio-echo-server-http-json_serializable.yaml @@ -0,0 +1,18 @@ +generatorName: dart-dio +outputDir: samples/client/echo_api/dart/dart-http-json_serializable +inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/echo_api.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" + serializationLibrary: "json_serializable" + networkingLibrary: "http" + artifactId: echo-api-dart-dio-json_serializable +reservedWordsMappings: + class: "classField" + + 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 f92fb4818e3e..8c039f513c51 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 @@ -232,14 +232,18 @@ public void processOpts() { final String srcFolder = libPath + sourceFolder; supportingFiles.add(new SupportingFile("api_client.mustache", srcFolder, "api.dart")); - - final String authFolder = srcFolder + File.separator + "auth"; - supportingFiles.add(new SupportingFile("auth/api_key_auth.mustache", authFolder, "api_key_auth.dart")); - supportingFiles.add(new SupportingFile("auth/basic_auth.mustache", authFolder, "basic_auth.dart")); - supportingFiles.add(new SupportingFile("auth/bearer_auth.mustache", authFolder, "bearer_auth.dart")); - supportingFiles.add(new SupportingFile("auth/oauth.mustache", authFolder, "oauth.dart")); - supportingFiles.add(new SupportingFile("auth/auth.mustache", authFolder, "auth.dart")); - + + //model exports + supportingFiles.add(new SupportingFile("model_exports.mustache", srcFolder + File.separator + modelPackage(), "_exports.dart")); + //api exports + supportingFiles.add(new SupportingFile("api_exports.mustache", srcFolder + File.separator + apiPackage(), "_exports.dart")); + + /* + * importMapping.put("Date", "package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/date.dart"); + supportingFiles.add(new SupportingFile("serialization/built_value/date.mustache", srcFolder + File.separator + modelPackage(), "date.dart")); + * + */ + configureSerializationLibrary(srcFolder); configureDateLibrary(srcFolder); configureNetworkingLibrary(srcFolder); @@ -271,7 +275,7 @@ private void configureNetworkingLibrary(String srcFolder) { // templates without having to change the main template files. additionalProperties.put("includeNetworkingLibraryTemplate", (Mustache.Lambda) (fragment, writer) -> { MustacheEngineAdapter engine = ((MustacheEngineAdapter) getTemplatingEngine()); - String templateFile = "networking/" + library + "/" + fragment.execute() + ".mustache"; + String templateFile = "networking/" + networkingLibrary + "/" + fragment.execute() + ".mustache"; Template tmpl = engine.getCompiler() .withLoader(name -> engine.findTemplate(templateManager, name)) .defaultValue("") @@ -279,13 +283,39 @@ private void configureNetworkingLibrary(String srcFolder) { fragment.executeTemplate(tmpl, writer); }); + + + } private void configureNetworkingLibraryDio(String srcFolder) { imports.put("MultipartFile", DIO_IMPORT); + + final String authFolder = srcFolder + File.separator + "auth"; + final String authMustacheFolder = "networking/dio/auth"; + supportingFiles.add(new SupportingFile("networking/dio/api_util.mustache", srcFolder, "api_util.dart")); + + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "_exports.mustache", authFolder, "_exports.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "api_key_auth.mustache", authFolder, "api_key_auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "authentication.mustache", authFolder, "auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "basic_auth.mustache", authFolder, "basic_auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "bearer_auth.mustache", authFolder, "bearer_auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "oauth.mustache", authFolder, "oauth.dart")); } + private void configureNetworkingLibraryHttp(String srcFolder) { imports.put("MultipartFile", HTTP_IMPORT); + + final String authFolder = srcFolder + File.separator + "auth"; + final String authMustacheFolder = "networking/http/auth"; + supportingFiles.add(new SupportingFile("networking/http/api_util.mustache", srcFolder, "api_util.dart")); + + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "_exports.mustache", authFolder, "_exports.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "api_key_auth.mustache", authFolder, "api_key_auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "authentication.mustache", authFolder, "auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "basic_auth.mustache", authFolder, "basic_auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "bearer_auth.mustache", authFolder, "bearer_auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + File.separator + "oauth.mustache", authFolder, "oauth.dart")); } private void configureSerializationLibrary(String srcFolder) { @@ -325,8 +355,7 @@ private void configureSerializationLibrary(String srcFolder) { } private void configureSerializationLibraryBuiltValue(String srcFolder) { - supportingFiles.add(new SupportingFile("serialization/built_value/serializers.mustache", srcFolder, "serializers.dart")); - supportingFiles.add(new SupportingFile("serialization/built_value/api_util.mustache", srcFolder, "api_util.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/serializers.mustache", srcFolder, "serializers.dart")); typeMapping.put("Array", "BuiltList"); typeMapping.put("array", "BuiltList"); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_exports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_exports.mustache new file mode 100644 index 000000000000..59ba81a3b42b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_exports.mustache @@ -0,0 +1,2 @@ +{{#apiInfo}}{{#apis}}export '{{classFilename}}.dart'; +{{/apis}}{{/apiInfo}} \ No newline at end of file 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..0739ad99bb08 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 @@ -1,12 +1,7 @@ {{>header}} export 'package:{{pubName}}/{{sourceFolder}}/api.dart'; -export 'package:{{pubName}}/{{sourceFolder}}/auth/api_key_auth.dart'; -export 'package:{{pubName}}/{{sourceFolder}}/auth/basic_auth.dart'; -export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; -{{#useBuiltValue}}export 'package:{{pubName}}/{{sourceFolder}}/serializers.dart'; -{{#useDateLibCore}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/date.dart';{{/useDateLibCore}}{{/useBuiltValue}} +export 'package:{{pubName}}/{{sourceFolder}}/auth/_exports.dart'; +{{#useBuiltValue}}export 'package:{{pubName}}/{{sourceFolder}}/serializers.dart';{{/useBuiltValue}} -{{#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 +export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/_exports.dart'; +export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/_exports.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_exports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_exports.mustache new file mode 100644 index 000000000000..312df1a275d5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_exports.mustache @@ -0,0 +1,7 @@ +{{#models}}{{#model}}export '{{classFilename}}.dart'; +{{/model}}{{/models}} +{{#useBuiltValue}} +{{#useDateLibCore}} +export 'date.dart'; +{{/useDateLibCore}} +{{/useBuiltValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache index 0903a48759e1..a7638b5c9f03 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache @@ -2,10 +2,7 @@ import 'package:dio/dio.dart';{{#useBuiltValue}} import 'package:built_value/serializer.dart'; import 'package:{{pubName}}/{{sourceFolder}}/serializers.dart';{{/useBuiltValue}} -import 'package:{{pubName}}/{{sourceFolder}}/auth/api_key_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/basic_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/bearer_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/_exports.dart'; {{#apiInfo}}{{#apis}}import 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; {{/apis}}{{/apiInfo}} class {{clientName}} { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_util.mustache similarity index 98% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache rename to modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_util.mustache index 45432b0042dc..4de858f4faf7 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_util.mustache @@ -2,9 +2,10 @@ import 'dart:convert'; import 'dart:typed_data'; +import 'package:dio/dio.dart'; +{{#useBuiltValue}} import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; /// Format the given form parameter object into something that Dio can handle. /// Returns primitive or String. @@ -72,3 +73,4 @@ ListParam encodeCollectionQueryParameter( } throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); } +{{/useBuiltValue}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/_exports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/_exports.mustache new file mode 100644 index 000000000000..1f9fc7a36702 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/_exports.mustache @@ -0,0 +1,7 @@ +{{>header}} + +export 'api_key_auth.dart'; +export 'auth.dart'; +export 'basic_auth.dart'; +export 'bearer_auth.dart'; +export 'oauth.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/api_key_auth.mustache similarity index 92% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache rename to modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/api_key_auth.mustache index 5d9da99bd5d8..eb7f64f7df8b 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/api_key_auth.mustache @@ -1,7 +1,7 @@ {{>header}} import 'package:dio/dio.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart'; +import 'auth.dart'; class ApiKeyAuthInterceptor extends AuthInterceptor { final Map apiKeys = {}; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/authentication.mustache similarity index 99% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache rename to modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/authentication.mustache index a266e2384c77..b2135c140c24 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/authentication.mustache @@ -1,6 +1,7 @@ {{>header}} 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 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/basic_auth.mustache similarity index 94% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache rename to modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/basic_auth.mustache index c2a4426937da..002a27a853da 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/basic_auth.mustache @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart'; +import 'auth.dart'; class BasicAuthInfo { final String username; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/bearer_auth.mustache similarity index 90% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache rename to modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/bearer_auth.mustache index b4bce45ca61f..a9bad3f5d54b 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/bearer_auth.mustache @@ -1,6 +1,6 @@ {{>header}} import 'package:dio/dio.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart'; +import 'auth.dart'; class BearerAuthInterceptor extends AuthInterceptor { final Map tokens = {}; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/oauth.mustache similarity index 90% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache rename to modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/oauth.mustache index e5af801f39be..d4218d2a0f3a 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/oauth.mustache @@ -1,6 +1,6 @@ {{>header}} import 'package:dio/dio.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart'; +import 'auth.dart'; class OAuthInterceptor extends AuthInterceptor { final Map tokens = {}; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache index 229d798c04a5..1a0b3e5f9bd3 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache @@ -9,49 +9,25 @@ import 'package:http/http.dart' as http; {{/imports}} class {{classname}} { - + final String _basePath; final http.Client? _client; {{#includeLibraryTemplate}}api/constructor{{/includeLibraryTemplate}} {{#operation}} - /// {{summary}}{{^summary}}{{nickname}}{{/summary}} - /// {{notes}} - /// - /// Parameters: - {{#allParams}} - /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} - {{/allParams}} - /// * [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]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} - /// Throws [DioError] if API call or serialization fails - {{#externalDocs}} - /// {{description}} - /// Also see [{{summary}} Documentation]({{url}}) - {{/externalDocs}} - {{#isDeprecated}} - @Deprecated('This operation has been deprecated') - {{/isDeprecated}} - Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} + +{{>networking/http/operation_header}} + Future<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{nickname}}({ {{#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}} - {{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, + {{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} + Map? headers, }) async { final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{{paramName}}}.toString()){{/pathParams}}; + final _uri = Uri.parse(_basePath + _path); + final _options = Options( method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', {{#isResponseFile}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.mustache index 6c164d95415a..339038287254 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.mustache @@ -2,16 +2,14 @@ import 'package:http/http.dart' as http;{{#useBuiltValue}} import 'package:built_value/serializer.dart'; import 'package:{{pubName}}/{{sourceFolder}}/serializers.dart';{{/useBuiltValue}} -import 'package:{{pubName}}/{{sourceFolder}}/auth/api_key_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/basic_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/bearer_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/_exports.dart'; {{#apiInfo}}{{#apis}}import 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; {{/apis}}{{/apiInfo}} class {{clientName}} { static const String basePath = r'{{{basePath}}}'; final http.Client client; + final String actualBasePath; {{#useBuiltValue}} final Serializers serializers; @@ -21,13 +19,13 @@ class {{clientName}} { Serializers? serializers,{{/useBuiltValue}} String? basePathOverride, }) : {{#useBuiltValue}}this.serializers = serializers ?? standardSerializers,{{/useBuiltValue}} - this.client = client ?? http.Client() { - } + this.client = client ?? http.Client(), + this.actualBasePath = basePathOverride ?? basePath; {{#apiInfo}}{{#apis}} /// Get {{classname}} instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed {{classname}} get{{classname}}() { - return {{classname}}(client{{#useBuiltValue}}, serializers{{/useBuiltValue}}); + return {{classname}}(client{{#useBuiltValue}}, serializers{{/useBuiltValue}}, actualBasePath); }{{/apis}}{{/apiInfo}} } diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client_helper.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client_helper.mustache new file mode 100644 index 000000000000..b340a9745757 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client_helper.mustache @@ -0,0 +1,251 @@ +{{>header}} +{{>part_of}} +class ApiClient { + ApiClient({this.basePath = '{{{basePath}}}', this.authentication,}); + + final String basePath; + final Authentication? authentication; + + var _client = Client(); + final _defaultHeaderMap = {}; + + /// Returns the current HTTP [Client] instance to use in this class. + /// + /// The return value is guaranteed to never be null. + Client get client => _client; + + /// Requests to use a new HTTP [Client] in this class. + set client(Client newClient) { + _client = newClient; + } + + Map get defaultHeaderMap => _defaultHeaderMap; + + void addDefaultHeader(String key, String value) { + _defaultHeaderMap[key] = value; + } + + // We don't use a Map for queryParams. + // If collectionFormat is 'multi', a key might appear multiple times. + Future invokeAPI( + String path, + String method, + List queryParams, + Object? body, + Map headerParams, + Map formParams, + String? contentType, + ) async { + await authentication?.applyToParams(queryParams, headerParams); + + headerParams.addAll(_defaultHeaderMap); + if (contentType != null) { + headerParams['Content-Type'] = contentType; + } + + final urlEncodedQueryParams = queryParams.map((param) => '$param'); + final queryString = urlEncodedQueryParams.isNotEmpty ? '?${urlEncodedQueryParams.join('&')}' : ''; + final uri = Uri.parse('$basePath$path$queryString'); + + try { + // Special case for uploading a single file which isn't a 'multipart/form-data'. + if ( + body is MultipartFile && (contentType == null || + !contentType.toLowerCase().startsWith('multipart/form-data')) + ) { + final request = StreamedRequest(method, uri); + request.headers.addAll(headerParams); + request.contentLength = body.length; + body.finalize().listen( + request.sink.add, + onDone: request.sink.close, + // ignore: avoid_types_on_closure_parameters + onError: (Object error, StackTrace trace) => request.sink.close(), + cancelOnError: true, + ); + final response = await _client.send(request); + return Response.fromStream(response); + } + + if (body is MultipartRequest) { + final request = MultipartRequest(method, uri); + request.fields.addAll(body.fields); + request.files.addAll(body.files); + request.headers.addAll(body.headers); + request.headers.addAll(headerParams); + final response = await _client.send(request); + return Response.fromStream(response); + } + + final msgBody = contentType == 'application/x-www-form-urlencoded' + ? formParams + : await serializeAsync(body); + final nullableHeaderParams = headerParams.isEmpty ? null : headerParams; + + switch(method) { + case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,); + case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,); + case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,); + case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,); + case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,); + case 'GET': return await _client.get(uri, headers: nullableHeaderParams,); + } + } on SocketException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'Socket operation failed: $method $path', + error, + trace, + ); + } on TlsException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'TLS/SSL communication failed: $method $path', + error, + trace, + ); + } on IOException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'I/O operation failed: $method $path', + error, + trace, + ); + } on ClientException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'HTTP connection failed: $method $path', + error, + trace, + ); + } on Exception catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'Exception occurred: $method $path', + error, + trace, + ); + } + + throw ApiException( + HttpStatus.badRequest, + 'Invalid HTTP operation: $method $path', + ); + } +{{#native_serialization}} + + Future deserializeAsync(String json, String targetType, {bool growable = false,}) async => + // ignore: deprecated_member_use_from_same_package + deserialize(json, targetType, growable: growable); + + @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.') + dynamic deserialize(String json, String targetType, {bool growable = false,}) { + // Remove all spaces. Necessary for regular expressions as well. + targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments + + // If the expected target type is String, nothing to do... + return targetType == 'String' + ? json + : _deserialize(jsonDecode(json), targetType, growable: growable); + } +{{/native_serialization}} + + // ignore: deprecated_member_use_from_same_package + Future serializeAsync(Object? value) async => serialize(value); + + @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.') + String serialize(Object? value) => value == null ? '' : json.encode(value); + +{{#native_serialization}} + static dynamic _deserialize(dynamic value, String targetType, {bool growable = false}) { + try { + switch (targetType) { + case 'String': + return value is String ? value : value.toString(); + case 'int': + return value is int ? value : int.parse('$value'); + case 'double': + return value is double ? value : double.parse('$value'); + case 'bool': + if (value is bool) { + return value; + } + final valueString = '$value'.toLowerCase(); + return valueString == 'true' || valueString == '1'; + case 'DateTime': + return value is DateTime ? value : DateTime.tryParse(value); + {{#models}} + {{#model}} + case '{{{classname}}}': + {{#isEnum}} + {{#native_serialization}}return {{{classname}}}TypeTransformer().decode(value);{{/native_serialization}} + {{/isEnum}} + {{^isEnum}} + return {{{classname}}}.fromJson(value); + {{/isEnum}} + {{/model}} + {{/models}} + default: + dynamic match; + if (value is List && (match = _regList.firstMatch(targetType)?.group(1)) != null) { + return value + .map((dynamic v) => _deserialize(v, match, growable: growable,)) + .toList(growable: growable); + } + if (value is Set && (match = _regSet.firstMatch(targetType)?.group(1)) != null) { + return value + .map((dynamic v) => _deserialize(v, match, growable: growable,)) + .toSet(); + } + if (value is Map && (match = _regMap.firstMatch(targetType)?.group(1)) != null) { + return Map.fromIterables( + value.keys.cast(), + value.values.map((dynamic v) => _deserialize(v, match, growable: growable,)), + ); + } + } + } on Exception catch (error, trace) { + throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', error, trace,); + } + throw ApiException(HttpStatus.internalServerError, 'Could not find a suitable class for deserialization',); + } +{{/native_serialization}} +} +{{#native_serialization}} + +/// Primarily intended for use in an isolate. +class DeserializationMessage { + const DeserializationMessage({ + required this.json, + required this.targetType, + this.growable = false, + }); + + /// The JSON value to deserialize. + final String json; + + /// Target type to deserialize to. + final String targetType; + + /// Whether to make deserialized lists or maps growable. + final bool growable; +} + +/// Primarily intended for use in an isolate. +Future deserializeAsync(DeserializationMessage message) async { + // Remove all spaces. Necessary for regular expressions as well. + final targetType = message.targetType.replaceAll(' ', ''); + + // If the expected target type is String, nothing to do... + return targetType == 'String' + ? message.json + : ApiClient._deserialize( + jsonDecode(message.json), + targetType, + growable: message.growable, + ); +} +{{/native_serialization}} + +/// Primarily intended for use in an isolate. +Future serializeAsync(Object? value) async => value == null ? '' : json.encode(value); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_exception.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_exception.mustache new file mode 100644 index 000000000000..aeb7aa9ce226 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_exception.mustache @@ -0,0 +1,23 @@ +{{>header}} +{{>part_of}} +class ApiException implements Exception { + ApiException(this.code, this.message); + + ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace); + + int code = 0; + String? message; + Exception? innerException; + StackTrace? stackTrace; + + @override + String toString() { + if (message == null) { + return 'ApiException'; + } + if (innerException == null) { + return 'ApiException $code: $message'; + } + return 'ApiException $code: $message (Inner exception: $innerException)\n\n$stackTrace'; + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_util.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_util.mustache new file mode 100644 index 000000000000..71a3d7c5fb1b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_util.mustache @@ -0,0 +1,76 @@ +{{>header}} + +import 'package:http/http.dart'; + +const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; +const _dateEpochMarker = 'epoch'; +final _dateFormatter = DateFormat('yyyy-MM-dd'); +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +class QueryParam { + const QueryParam(this.name, this.value); + + final String name; + final String value; + + @override + String toString() => '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}'; +} + +// Ported from the Java version. +Iterable _queryParams(String collectionFormat, String name, dynamic value,) { + // Assertions to run in debug mode only. + assert(name.isNotEmpty, 'Parameter cannot be an empty string.'); + + final params = []; + + if (value is List) { + if (collectionFormat == 'multi') { + return value.map((dynamic v) => QueryParam(name, parameterToString(v)),); + } + + // Default collection format is 'csv'. + if (collectionFormat.isEmpty) { + collectionFormat = 'csv'; // ignore: parameter_assignments + } + + final delimiter = _delimiters[collectionFormat] ?? ','; + + params.add(QueryParam(name, value.map(parameterToString).join(delimiter),)); + } else if (value != null) { + params.add(QueryParam(name, parameterToString(value))); + } + + return params; +} + +/// Format the given parameter object into a [String]. +String parameterToString(dynamic value) { + if (value == null) { + return ''; + } + if (value is DateTime) { + return value.toUtc().toIso8601String(); + } + {{#models}} + {{#model}} + {{#isEnum}} + if (value is {{{classname}}}) { +{{#native_serialization}} return {{{classname}}}TypeTransformer().encode(value).toString();{{/native_serialization}} + } + {{/isEnum}} + {{/model}} + {{/models}} + return value.toString(); +} + +/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' +/// content type. Otherwise, returns the decoded body as decoded by dart:http package. +Future decodeBodyBytes(Response response) async { + final contentType = response.headers['content-type']; + return contentType != null && contentType.toLowerCase().startsWith('application/json') + ? response.bodyBytes.isEmpty ? '' : utf8.decode(response.bodyBytes) + : response.body; +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/_exports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/_exports.mustache new file mode 100644 index 000000000000..1f9fc7a36702 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/_exports.mustache @@ -0,0 +1,7 @@ +{{>header}} + +export 'api_key_auth.dart'; +export 'auth.dart'; +export 'basic_auth.dart'; +export 'bearer_auth.dart'; +export 'oauth.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/api_key_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/api_key_auth.mustache new file mode 100644 index 000000000000..21fcd05f9dde --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/api_key_auth.mustache @@ -0,0 +1,32 @@ +{{>header}} + +import 'auth.dart'; + +class ApiKeyAuth implements Authentication { + ApiKeyAuth(this.location, this.paramName); + + final String location; + final String paramName; + + String apiKeyPrefix = ''; + String apiKey = ''; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey'; + + if (paramValue.isNotEmpty) { + if (location == 'query') { + queryParams.add(QueryParam(paramName, paramValue)); + } else if (location == 'header') { + headerParams[paramName] = paramValue; + } else if (location == 'cookie') { + headerParams.update( + 'Cookie', + (existingCookie) => '$existingCookie; $paramName=$paramValue', + ifAbsent: () => '$paramName=$paramValue', + ); + } + } + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/authentication.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/authentication.mustache new file mode 100644 index 000000000000..d6d1dc3552e5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/authentication.mustache @@ -0,0 +1,6 @@ +{{>header}} +// ignore: one_member_abstracts +abstract class Authentication { + /// Apply authentication settings to header and query params. + Future applyToParams(List queryParams, Map headerParams); +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/basic_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/basic_auth.mustache new file mode 100644 index 000000000000..04236f60db89 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/basic_auth.mustache @@ -0,0 +1,18 @@ +{{>header}} + +import 'auth.dart'; + +class HttpBasicAuth implements Authentication { + HttpBasicAuth({this.username = '', this.password = ''}); + + String username; + String password; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (username.isNotEmpty && password.isNotEmpty) { + final credentials = '$username:$password'; + headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/bearer_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/bearer_auth.mustache new file mode 100644 index 000000000000..8e080a691a7d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/bearer_auth.mustache @@ -0,0 +1,42 @@ +{{>header}} + +import 'auth.dart'; + + +typedef HttpBearerAuthProvider = String Function(); + +class HttpBearerAuth implements Authentication { + HttpBearerAuth(); + + dynamic _accessToken; + + dynamic get accessToken => _accessToken; + + set accessToken(dynamic accessToken) { + if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { + throw ArgumentError('accessToken value must be either a String or a String Function().'); + } + _accessToken = accessToken; + } + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (_accessToken == null) { + return; + } + + String accessToken; + + if (_accessToken is String) { + accessToken = _accessToken; + } else if (_accessToken is HttpBearerAuthProvider) { + accessToken = _accessToken!(); + } else { + return; + } + + if (accessToken.isNotEmpty) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/oauth.mustache new file mode 100644 index 000000000000..979e92948a88 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/oauth.mustache @@ -0,0 +1,17 @@ +{{>header}} + +import 'auth.dart'; + + +class OAuth implements Authentication { + OAuth({this.accessToken = ''}); + + String accessToken; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (accessToken.isNotEmpty) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/operation_header.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/operation_header.mustache new file mode 100644 index 000000000000..67652c422777 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/operation_header.mustache @@ -0,0 +1,19 @@ + /// {{summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{notes}} + /// + /// Parameters: + {{#allParams}} + /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} + {{/allParams}} + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// + /// Throws [DioError] if API call or serialization fails + {{#externalDocs}} + /// {{description}} + /// Also see [{{summary}} Documentation]({{url}}) + {{/externalDocs}} + {{#isDeprecated}} + @Deprecated('This operation has been deprecated') + {{/isDeprecated}} \ 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 7a772156ed6e..bc7408951422 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache @@ -12,11 +12,14 @@ environment: {{/useJsonSerializable}} dependencies: + {{#useDio}} dio: '>=4.0.1 <5.0.0' -{{#useDio}} +{{/useDio}} {{#useHttp}} http: '>=0.13.5 <2.0.0' + intl: '^0.17.0' + meta: '^1.1.8' {{/useHttp}} {{#useBuiltValue}} one_of: '>=1.5.0 <2.0.0' diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache index e823414cc755..4802c14a5a32 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache @@ -1,3 +1,3 @@ final Serializers _serializers; - const {{classname}}(this._dio, this._serializers); \ No newline at end of file + const {{classname}}({{#useHttp}}this._client{{/useHttp}}{{#useDio}}this._dio{{/useDio}}, this._serializers{{#useHttp}}, this._basePath{{/useHttp}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache index a772c3148eaa..0abb62fa7ff6 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache @@ -1 +1 @@ - const {{classname}}(this._dio); \ No newline at end of file + const {{classname}}({{#useDio}}this._dio{{/useDio}}{{#useHttp}}this._client, this._basePath{{/useHttp}}); \ No newline at end of file From fc95ab77113ac8b2ac928cb240fd334a1ebe282c Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Mon, 2 Jan 2023 06:32:25 +0200 Subject: [PATCH 18/20] update samples --- .../.openapi-generator/FILES | 3 + .../dart-dio-built_value/lib/openapi.dart | 78 +---- .../dart-dio-built_value/lib/src/api.dart | 24 +- .../lib/src/api/_exports.dart | 3 + .../lib/src/api/body_api.dart | 14 +- .../lib/src/api/path_api.dart | 14 +- .../lib/src/api/query_api.dart | 44 +-- .../lib/src/api_util.dart | 5 +- .../lib/src/auth/_exports.dart | 9 + .../lib/src/auth/api_key_auth.dart | 6 +- .../lib/src/auth/auth.dart | 3 +- .../lib/src/auth/basic_auth.dart | 11 +- .../lib/src/auth/bearer_auth.dart | 5 +- .../lib/src/auth/oauth.dart | 5 +- .../lib/src/date_serializer.dart | 1 - .../lib/src/model/_exports.dart | 69 +++++ .../model/additional_properties_class.dart | 44 ++- .../lib/src/model/addressable.dart | 16 +- .../lib/src/model/all_of_with_single_ref.dart | 21 +- .../lib/src/model/animal.dart | 56 ++-- .../lib/src/model/api_response.dart | 11 +- .../lib/src/model/apple.dart | 7 +- .../model/array_of_array_of_number_only.dart | 34 ++- .../lib/src/model/array_of_number_only.dart | 19 +- .../lib/src/model/array_test.dart | 27 +- .../lib/src/model/banana.dart | 7 +- .../lib/src/model/bar.dart | 15 +- .../lib/src/model/bar_create.dart | 13 +- .../lib/src/model/bar_ref.dart | 7 +- .../lib/src/model/bar_ref_or_value.dart | 68 +++-- .../lib/src/model/capitalization.dart | 31 +- .../lib/src/model/cat.dart | 16 +- .../lib/src/model/cat_all_of.dart | 15 +- .../lib/src/model/category.dart | 9 +- .../lib/src/model/child.dart | 7 +- .../lib/src/model/class_model.dart | 7 +- .../lib/src/model/deprecated_object.dart | 19 +- .../lib/src/model/dog.dart | 16 +- .../lib/src/model/dog_all_of.dart | 15 +- .../lib/src/model/entity.dart | 113 ++++---- .../lib/src/model/entity_ref.dart | 59 ++-- .../lib/src/model/enum_arrays.dart | 51 ++-- .../lib/src/model/enum_test.dart | 102 ++++--- .../lib/src/model/example.dart | 17 +- .../lib/src/model/example_non_primitive.dart | 34 ++- .../lib/src/model/extensible.dart | 16 +- .../lib/src/model/file_schema_test_class.dart | 26 +- .../lib/src/model/foo.dart | 11 +- .../lib/src/model/foo_ref.dart | 9 +- .../lib/src/model/foo_ref_or_value.dart | 68 +++-- .../lib/src/model/format_test.dart | 33 +-- .../lib/src/model/fruit.dart | 22 +- .../lib/src/model/has_only_read_only.dart | 21 +- .../lib/src/model/health_check_result.dart | 19 +- .../lib/src/model/map_test.dart | 62 ++-- ...rties_and_additional_properties_class.dart | 43 ++- .../lib/src/model/model200_response.dart | 21 +- .../lib/src/model/model_client.dart | 7 +- .../lib/src/model/model_enum_class.dart | 10 +- .../lib/src/model/model_file.dart | 5 +- .../lib/src/model/model_list.dart | 7 +- .../lib/src/model/model_return.dart | 7 +- .../lib/src/model/name.dart | 13 +- .../lib/src/model/nullable_class.dart | 74 +++-- .../lib/src/model/number_only.dart | 7 +- .../model/object_with_deprecated_fields.dart | 32 ++- .../lib/src/model/order.dart | 30 +- .../lib/src/model/outer_composite.dart | 23 +- .../lib/src/model/outer_enum.dart | 4 +- .../src/model/outer_enum_default_value.dart | 13 +- .../lib/src/model/outer_enum_integer.dart | 7 +- .../outer_enum_integer_default_value.dart | 13 +- .../outer_object_with_enum_property.dart | 26 +- .../lib/src/model/pasta.dart | 9 +- .../lib/src/model/pet.dart | 24 +- .../lib/src/model/pizza.dart | 40 +-- .../lib/src/model/pizza_speziale.dart | 19 +- .../lib/src/model/read_only_first.dart | 18 +- .../lib/src/model/single_ref_type.dart | 4 +- .../lib/src/model/special_model_name.dart | 29 +- .../lib/src/model/tag.dart | 9 +- ...e_array_string_query_object_parameter.dart | 47 ++- .../lib/src/model/user.dart | 19 +- .../lib/src/serializers.dart | 24 +- .../dart/dart-dio-built_value/pubspec.yaml | 1 + .../additional_properties_class_test.dart | 1 - .../test/addressable_test.dart | 1 - .../test/all_of_with_single_ref_test.dart | 1 - .../test/animal_test.dart | 1 - .../test/api_response_test.dart | 1 - .../dart-dio-built_value/test/apple_test.dart | 1 - .../array_of_array_of_number_only_test.dart | 1 - .../test/array_of_number_only_test.dart | 1 - .../test/array_test_test.dart | 1 - .../test/banana_test.dart | 1 - .../test/bar_create_test.dart | 1 - .../test/bar_ref_or_value_test.dart | 1 - .../test/bar_ref_test.dart | 1 - .../dart-dio-built_value/test/bar_test.dart | 1 - .../test/body_api_test.dart | 2 - .../test/capitalization_test.dart | 3 +- .../test/cat_all_of_test.dart | 1 - .../dart-dio-built_value/test/cat_test.dart | 1 - .../test/category_test.dart | 1 - .../dart-dio-built_value/test/child_test.dart | 1 - .../test/class_model_test.dart | 1 - .../test/deprecated_object_test.dart | 1 - .../test/dog_all_of_test.dart | 1 - .../dart-dio-built_value/test/dog_test.dart | 1 - .../test/entity_ref_test.dart | 1 - .../test/entity_test.dart | 1 - .../test/enum_arrays_test.dart | 1 - .../test/enum_test_test.dart | 1 - .../test/example_non_primitive_test.dart | 3 +- .../test/example_test.dart | 1 - .../test/extensible_test.dart | 1 - .../test/file_schema_test_class_test.dart | 1 - .../test/foo_ref_or_value_test.dart | 1 - .../test/foo_ref_test.dart | 1 - .../dart-dio-built_value/test/foo_test.dart | 1 - .../test/format_test_test.dart | 1 - .../dart-dio-built_value/test/fruit_test.dart | 1 - .../test/has_only_read_only_test.dart | 1 - .../test/health_check_result_test.dart | 1 - .../test/map_test_test.dart | 1 - ..._and_additional_properties_class_test.dart | 1 - .../test/model200_response_test.dart | 1 - .../test/model_client_test.dart | 1 - .../test/model_enum_class_test.dart | 4 +- .../test/model_file_test.dart | 1 - .../test/model_list_test.dart | 1 - .../test/model_return_test.dart | 1 - .../dart-dio-built_value/test/name_test.dart | 1 - .../test/nullable_class_test.dart | 1 - .../test/number_only_test.dart | 1 - .../object_with_deprecated_fields_test.dart | 1 - .../dart-dio-built_value/test/order_test.dart | 1 - .../test/outer_composite_test.dart | 1 - .../test/outer_enum_default_value_test.dart | 4 +- ...outer_enum_integer_default_value_test.dart | 4 +- .../test/outer_enum_integer_test.dart | 4 +- .../test/outer_enum_test.dart | 4 +- .../outer_object_with_enum_property_test.dart | 1 - .../dart-dio-built_value/test/pasta_test.dart | 1 - .../test/path_api_test.dart | 2 - .../dart-dio-built_value/test/pet_test.dart | 1 - .../test/pizza_speziale_test.dart | 1 - .../dart-dio-built_value/test/pizza_test.dart | 1 - .../test/query_api_test.dart | 2 - .../test/read_only_first_test.dart | 1 - .../test/single_ref_type_test.dart | 4 +- .../test/special_model_name_test.dart | 5 +- .../dart-dio-built_value/test/tag_test.dart | 1 - ...ay_string_query_object_parameter_test.dart | 4 +- .../dart-dio-built_value/test/user_test.dart | 1 - .../dart-dio-json_serializable/.gitignore | 41 +++ .../.openapi-generator-ignore | 23 ++ .../.openapi-generator/FILES | 157 ++++++++++ .../.openapi-generator/VERSION | 1 + .../dart/dart-dio-json_serializable/README.md | 153 ++++++++++ .../analysis_options.yaml | 10 + .../dart-dio-json_serializable/build.yaml | 18 ++ .../doc/AdditionalPropertiesClass.md | 16 ++ .../doc/Addressable.md | 16 ++ .../doc/AllOfWithSingleRef.md | 16 ++ .../dart-dio-json_serializable/doc/Animal.md | 16 ++ .../doc/ApiResponse.md | 17 ++ .../dart-dio-json_serializable/doc/Apple.md | 15 + .../doc/ArrayOfArrayOfNumberOnly.md | 15 + .../doc/ArrayOfNumberOnly.md | 15 + .../doc/ArrayTest.md | 17 ++ .../dart-dio-json_serializable/doc/Banana.md | 15 + .../dart-dio-json_serializable/doc/Bar.md | 22 ++ .../doc/BarCreate.md | 22 ++ .../dart-dio-json_serializable/doc/BarRef.md | 19 ++ .../doc/BarRefOrValue.md | 19 ++ .../dart-dio-json_serializable/doc/BodyApi.md | 57 ++++ .../doc/Capitalization.md | 20 ++ .../dart-dio-json_serializable/doc/Cat.md | 17 ++ .../doc/CatAllOf.md | 15 + .../doc/Category.md | 16 ++ .../dart-dio-json_serializable/doc/Child.md | 15 + .../doc/ClassModel.md | 15 + .../doc/DeprecatedObject.md | 15 + .../dart-dio-json_serializable/doc/Dog.md | 17 ++ .../doc/DogAllOf.md | 15 + .../dart-dio-json_serializable/doc/Entity.md | 19 ++ .../doc/EntityRef.md | 21 ++ .../doc/EnumArrays.md | 16 ++ .../doc/EnumTest.md | 22 ++ .../dart-dio-json_serializable/doc/Example.md | 15 + .../doc/ExampleNonPrimitive.md | 14 + .../doc/Extensible.md | 17 ++ .../doc/FileSchemaTestClass.md | 16 ++ .../dart-dio-json_serializable/doc/Foo.md | 21 ++ .../dart-dio-json_serializable/doc/FooRef.md | 20 ++ .../doc/FooRefOrValue.md | 19 ++ .../doc/FormatTest.md | 30 ++ .../dart-dio-json_serializable/doc/Fruit.md | 17 ++ .../doc/HasOnlyReadOnly.md | 16 ++ .../doc/HealthCheckResult.md | 15 + .../dart-dio-json_serializable/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 + .../dart-dio-json_serializable/doc/Name.md | 18 ++ .../doc/NullableClass.md | 26 ++ .../doc/NumberOnly.md | 15 + .../doc/ObjectWithDeprecatedFields.md | 18 ++ .../dart-dio-json_serializable/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 + .../dart-dio-json_serializable/doc/Pasta.md | 20 ++ .../dart-dio-json_serializable/doc/PathApi.md | 59 ++++ .../dart-dio-json_serializable/doc/Pet.md | 20 ++ .../dart-dio-json_serializable/doc/Pizza.md | 20 ++ .../doc/PizzaSpeziale.md | 20 ++ .../doc/QueryApi.md | 149 ++++++++++ .../doc/ReadOnlyFirst.md | 16 ++ .../doc/SingleRefType.md | 14 + .../doc/SpecialModelName.md | 15 + .../dart-dio-json_serializable/doc/Tag.md | 16 ++ ...lodeTrueArrayStringQueryObjectParameter.md | 15 + .../dart-dio-json_serializable/doc/User.md | 22 ++ .../lib/openapi.dart | 9 + .../lib/src/api.dart | 89 ++++++ .../lib/src/api/_exports.dart | 3 + .../lib/src/api/body_api.dart | 105 +++++++ .../lib/src/api/path_api.dart | 90 ++++++ .../lib/src/api/query_api.dart | 250 ++++++++++++++++ .../lib/src/api_util.dart | 8 + .../lib/src/auth/_exports.dart | 9 + .../lib/src/auth/api_key_auth.dart | 30 ++ .../lib/src/auth/auth.dart | 19 ++ .../lib/src/auth/basic_auth.dart | 42 +++ .../lib/src/auth/bearer_auth.dart | 27 ++ .../lib/src/auth/oauth.dart | 27 ++ .../lib/src/deserialize.dart | 269 ++++++++++++++++++ .../lib/src/model/_exports.dart | 67 +++++ .../model/additional_properties_class.dart | 48 ++++ .../lib/src/model/addressable.dart | 48 ++++ .../lib/src/model/all_of_with_single_ref.dart | 49 ++++ .../lib/src/model/animal.dart | 49 ++++ .../lib/src/model/api_response.dart | 53 ++++ .../lib/src/model/apple.dart | 40 +++ .../model/array_of_array_of_number_only.dart | 43 +++ .../lib/src/model/array_of_number_only.dart | 42 +++ .../lib/src/model/array_test.dart | 58 ++++ .../lib/src/model/banana.dart | 40 +++ .../lib/src/model/bar.dart | 93 ++++++ .../lib/src/model/bar_create.dart | 95 +++++++ .../lib/src/model/bar_ref.dart | 75 +++++ .../lib/src/model/bar_ref_or_value.dart | 75 +++++ .../lib/src/model/capitalization.dart | 75 +++++ .../lib/src/model/cat.dart | 59 ++++ .../lib/src/model/cat_all_of.dart | 41 +++ .../lib/src/model/category.dart | 46 +++ .../lib/src/model/child.dart | 40 +++ .../lib/src/model/class_model.dart | 42 +++ .../lib/src/model/deprecated_object.dart | 41 +++ .../lib/src/model/dog.dart | 59 ++++ .../lib/src/model/dog_all_of.dart | 41 +++ .../lib/src/model/entity.dart | 72 +++++ .../lib/src/model/entity_ref.dart | 87 ++++++ .../lib/src/model/enum_arrays.dart | 66 +++++ .../lib/src/model/enum_test.dart | 134 +++++++++ .../lib/src/model/example.dart | 42 +++ .../lib/src/model/example_non_primitive.dart | 38 +++ .../lib/src/model/extensible.dart | 57 ++++ .../lib/src/model/file_schema_test_class.dart | 49 ++++ .../lib/src/model/foo.dart | 87 ++++++ .../lib/src/model/foo_ref.dart | 81 ++++++ .../lib/src/model/foo_ref_or_value.dart | 75 +++++ .../lib/src/model/format_test.dart | 150 ++++++++++ .../lib/src/model/fruit.dart | 54 ++++ .../lib/src/model/has_only_read_only.dart | 46 +++ .../lib/src/model/health_check_result.dart | 42 +++ .../lib/src/model/map_test.dart | 71 +++++ ...rties_and_additional_properties_class.dart | 56 ++++ .../lib/src/model/model200_response.dart | 48 ++++ .../lib/src/model/model_client.dart | 41 +++ .../lib/src/model/model_enum_class.dart | 17 ++ .../lib/src/model/model_file.dart | 43 +++ .../lib/src/model/model_list.dart | 42 +++ .../lib/src/model/model_return.dart | 42 +++ .../lib/src/model/name.dart | 61 ++++ .../lib/src/model/nullable_class.dart | 121 ++++++++ .../lib/src/model/number_only.dart | 42 +++ .../model/object_with_deprecated_fields.dart | 61 ++++ .../lib/src/model/order.dart | 90 ++++++ .../lib/src/model/outer_composite.dart | 54 ++++ .../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 | 43 +++ .../lib/src/model/pasta.dart | 81 ++++++ .../lib/src/model/pet.dart | 88 ++++++ .../lib/src/model/pizza.dart | 81 ++++++ .../lib/src/model/pizza_speziale.dart | 82 ++++++ .../lib/src/model/read_only_first.dart | 46 +++ .../lib/src/model/single_ref_type.dart | 15 + .../lib/src/model/special_model_name.dart | 47 +++ .../lib/src/model/tag.dart | 45 +++ ...e_array_string_query_object_parameter.dart | 47 +++ .../lib/src/model/user.dart | 86 ++++++ .../dart-dio-json_serializable/pubspec.yaml | 17 ++ .../additional_properties_class_test.dart | 21 ++ .../test/addressable_test.dart | 22 ++ .../test/all_of_with_single_ref_test.dart | 20 ++ .../test/animal_test.dart | 20 ++ .../test/api_response_test.dart | 25 ++ .../test/apple_test.dart | 15 + .../array_of_array_of_number_only_test.dart | 16 ++ .../test/array_of_number_only_test.dart | 15 + .../test/array_test_test.dart | 25 ++ .../test/banana_test.dart | 15 + .../test/bar_create_test.dart | 55 ++++ .../test/bar_ref_or_value_test.dart | 40 +++ .../test/bar_ref_test.dart | 40 +++ .../test/bar_test.dart | 54 ++++ .../test/body_api_test.dart | 18 ++ .../test/capitalization_test.dart | 41 +++ .../test/cat_all_of_test.dart | 15 + .../test/cat_test.dart | 25 ++ .../test/category_test.dart | 20 ++ .../test/child_test.dart | 15 + .../test/class_model_test.dart | 15 + .../test/deprecated_object_test.dart | 15 + .../test/dog_all_of_test.dart | 15 + .../test/dog_test.dart | 25 ++ .../test/entity_ref_test.dart | 52 ++++ .../test/entity_test.dart | 40 +++ .../test/enum_arrays_test.dart | 20 ++ .../test/enum_test_test.dart | 50 ++++ .../test/example_non_primitive_test.dart | 10 + .../test/example_test.dart | 15 + .../test/extensible_test.dart | 28 ++ .../test/file_schema_test_class_test.dart | 20 ++ .../test/foo_ref_or_value_test.dart | 40 +++ .../test/foo_ref_test.dart | 45 +++ .../test/foo_test.dart | 50 ++++ .../test/format_test_test.dart | 92 ++++++ .../test/fruit_test.dart | 25 ++ .../test/has_only_read_only_test.dart | 20 ++ .../test/health_check_result_test.dart | 15 + .../test/map_test_test.dart | 30 ++ ..._and_additional_properties_class_test.dart | 26 ++ .../test/model200_response_test.dart | 20 ++ .../test/model_client_test.dart | 15 + .../test/model_enum_class_test.dart | 7 + .../test/model_file_test.dart | 16 ++ .../test/model_list_test.dart | 15 + .../test/model_return_test.dart | 15 + .../test/name_test.dart | 30 ++ .../test/nullable_class_test.dart | 70 +++++ .../test/number_only_test.dart | 15 + .../object_with_deprecated_fields_test.dart | 31 ++ .../test/order_test.dart | 41 +++ .../test/outer_composite_test.dart | 25 ++ .../test/outer_enum_default_value_test.dart | 7 + ...outer_enum_integer_default_value_test.dart | 7 + .../test/outer_enum_integer_test.dart | 7 + .../test/outer_enum_test.dart | 7 + .../outer_object_with_enum_property_test.dart | 16 ++ .../test/pasta_test.dart | 45 +++ .../test/path_api_test.dart | 18 ++ .../test/pet_test.dart | 41 +++ .../test/pizza_speziale_test.dart | 45 +++ .../test/pizza_test.dart | 45 +++ .../test/query_api_test.dart | 36 +++ .../test/read_only_first_test.dart | 20 ++ .../test/single_ref_type_test.dart | 7 + .../test/special_model_name_test.dart | 17 ++ .../test/tag_test.dart | 20 ++ ...ay_string_query_object_parameter_test.dart | 16 ++ .../test/user_test.dart | 51 ++++ .../.openapi-generator/FILES | 9 +- .../dart-http-built_value/lib/openapi.dart | 78 +---- .../dart-http-built_value/lib/src/api.dart | 7 +- .../lib/src/api/_exports.dart | 3 + .../lib/src/api/body_api.dart | 27 +- .../lib/src/api/path_api.dart | 27 +- .../lib/src/api/query_api.dart | 85 +++--- .../lib/src/api_util.dart | 131 +++++---- .../lib/src/auth/_exports.dart | 9 + .../lib/src/auth/api_key_auth.dart | 8 +- .../auth/{authentication.dart => auth.dart} | 3 +- .../{http_basic_auth.dart => basic_auth.dart} | 11 +- ...http_bearer_auth.dart => bearer_auth.dart} | 12 +- .../lib/src/auth/oauth.dart | 9 +- .../lib/src/date_serializer.dart | 1 - .../lib/src/model/_exports.dart | 69 +++++ .../model/additional_properties_class.dart | 44 ++- .../lib/src/model/addressable.dart | 16 +- .../lib/src/model/all_of_with_single_ref.dart | 21 +- .../lib/src/model/animal.dart | 56 ++-- .../lib/src/model/api_response.dart | 11 +- .../lib/src/model/apple.dart | 7 +- .../model/array_of_array_of_number_only.dart | 34 ++- .../lib/src/model/array_of_number_only.dart | 19 +- .../lib/src/model/array_test.dart | 27 +- .../lib/src/model/banana.dart | 7 +- .../lib/src/model/bar.dart | 15 +- .../lib/src/model/bar_create.dart | 13 +- .../lib/src/model/bar_ref.dart | 7 +- .../lib/src/model/bar_ref_or_value.dart | 68 +++-- .../lib/src/model/capitalization.dart | 31 +- .../lib/src/model/cat.dart | 16 +- .../lib/src/model/cat_all_of.dart | 15 +- .../lib/src/model/category.dart | 9 +- .../lib/src/model/child.dart | 7 +- .../lib/src/model/class_model.dart | 7 +- .../lib/src/model/deprecated_object.dart | 19 +- .../lib/src/model/dog.dart | 16 +- .../lib/src/model/dog_all_of.dart | 15 +- .../lib/src/model/entity.dart | 113 ++++---- .../lib/src/model/entity_ref.dart | 59 ++-- .../lib/src/model/enum_arrays.dart | 51 ++-- .../lib/src/model/enum_test.dart | 102 ++++--- .../lib/src/model/example.dart | 17 +- .../lib/src/model/example_non_primitive.dart | 34 ++- .../lib/src/model/extensible.dart | 16 +- .../lib/src/model/file_schema_test_class.dart | 26 +- .../lib/src/model/foo.dart | 11 +- .../lib/src/model/foo_ref.dart | 9 +- .../lib/src/model/foo_ref_or_value.dart | 68 +++-- .../lib/src/model/format_test.dart | 33 +-- .../lib/src/model/fruit.dart | 22 +- .../lib/src/model/has_only_read_only.dart | 21 +- .../lib/src/model/health_check_result.dart | 19 +- .../lib/src/model/map_test.dart | 62 ++-- ...rties_and_additional_properties_class.dart | 43 ++- .../lib/src/model/model200_response.dart | 21 +- .../lib/src/model/model_client.dart | 7 +- .../lib/src/model/model_enum_class.dart | 10 +- .../lib/src/model/model_file.dart | 5 +- .../lib/src/model/model_list.dart | 7 +- .../lib/src/model/model_return.dart | 7 +- .../lib/src/model/name.dart | 13 +- .../lib/src/model/nullable_class.dart | 74 +++-- .../lib/src/model/number_only.dart | 7 +- .../model/object_with_deprecated_fields.dart | 32 ++- .../lib/src/model/order.dart | 30 +- .../lib/src/model/outer_composite.dart | 23 +- .../lib/src/model/outer_enum.dart | 4 +- .../src/model/outer_enum_default_value.dart | 13 +- .../lib/src/model/outer_enum_integer.dart | 7 +- .../outer_enum_integer_default_value.dart | 13 +- .../outer_object_with_enum_property.dart | 26 +- .../lib/src/model/pasta.dart | 9 +- .../lib/src/model/pet.dart | 24 +- .../lib/src/model/pizza.dart | 40 +-- .../lib/src/model/pizza_speziale.dart | 19 +- .../lib/src/model/read_only_first.dart | 18 +- .../lib/src/model/single_ref_type.dart | 4 +- .../lib/src/model/special_model_name.dart | 29 +- .../lib/src/model/tag.dart | 9 +- ...e_array_string_query_object_parameter.dart | 47 ++- .../lib/src/model/user.dart | 19 +- .../lib/src/serializers.dart | 24 +- .../dart/dart-http-built_value/pubspec.yaml | 3 + .../additional_properties_class_test.dart | 1 - .../test/addressable_test.dart | 1 - .../test/all_of_with_single_ref_test.dart | 1 - .../test/animal_test.dart | 1 - .../test/api_response_test.dart | 1 - .../test/apple_test.dart | 1 - .../array_of_array_of_number_only_test.dart | 1 - .../test/array_of_number_only_test.dart | 1 - .../test/array_test_test.dart | 1 - .../test/banana_test.dart | 1 - .../test/bar_create_test.dart | 1 - .../test/bar_ref_or_value_test.dart | 1 - .../test/bar_ref_test.dart | 1 - .../dart-http-built_value/test/bar_test.dart | 1 - .../test/body_api_test.dart | 2 - .../test/capitalization_test.dart | 3 +- .../test/cat_all_of_test.dart | 1 - .../dart-http-built_value/test/cat_test.dart | 1 - .../test/category_test.dart | 1 - .../test/child_test.dart | 1 - .../test/class_model_test.dart | 1 - .../test/deprecated_object_test.dart | 1 - .../test/dog_all_of_test.dart | 1 - .../dart-http-built_value/test/dog_test.dart | 1 - .../test/entity_ref_test.dart | 1 - .../test/entity_test.dart | 1 - .../test/enum_arrays_test.dart | 1 - .../test/enum_test_test.dart | 1 - .../test/example_non_primitive_test.dart | 3 +- .../test/example_test.dart | 1 - .../test/extensible_test.dart | 1 - .../test/file_schema_test_class_test.dart | 1 - .../test/foo_ref_or_value_test.dart | 1 - .../test/foo_ref_test.dart | 1 - .../dart-http-built_value/test/foo_test.dart | 1 - .../test/format_test_test.dart | 1 - .../test/fruit_test.dart | 1 - .../test/has_only_read_only_test.dart | 1 - .../test/health_check_result_test.dart | 1 - .../test/map_test_test.dart | 1 - ..._and_additional_properties_class_test.dart | 1 - .../test/model200_response_test.dart | 1 - .../test/model_client_test.dart | 1 - .../test/model_enum_class_test.dart | 4 +- .../test/model_file_test.dart | 1 - .../test/model_list_test.dart | 1 - .../test/model_return_test.dart | 1 - .../dart-http-built_value/test/name_test.dart | 1 - .../test/nullable_class_test.dart | 1 - .../test/number_only_test.dart | 1 - .../object_with_deprecated_fields_test.dart | 1 - .../test/order_test.dart | 1 - .../test/outer_composite_test.dart | 1 - .../test/outer_enum_default_value_test.dart | 4 +- ...outer_enum_integer_default_value_test.dart | 4 +- .../test/outer_enum_integer_test.dart | 4 +- .../test/outer_enum_test.dart | 4 +- .../outer_object_with_enum_property_test.dart | 1 - .../test/pasta_test.dart | 1 - .../test/path_api_test.dart | 2 - .../dart-http-built_value/test/pet_test.dart | 1 - .../test/pizza_speziale_test.dart | 1 - .../test/pizza_test.dart | 1 - .../test/query_api_test.dart | 2 - .../test/read_only_first_test.dart | 1 - .../test/single_ref_type_test.dart | 4 +- .../test/special_model_name_test.dart | 5 +- .../dart-http-built_value/test/tag_test.dart | 1 - ...ay_string_query_object_parameter_test.dart | 4 +- .../dart-http-built_value/test/user_test.dart | 1 - .../dart-http-json_serializable/.gitignore | 41 +++ .../.openapi-generator-ignore | 23 ++ .../.openapi-generator/FILES | 157 ++++++++++ .../.openapi-generator/VERSION | 1 + .../dart-http-json_serializable/README.md | 153 ++++++++++ .../analysis_options.yaml | 10 + .../dart-http-json_serializable/build.yaml | 18 ++ .../doc/AdditionalPropertiesClass.md | 16 ++ .../doc/Addressable.md | 16 ++ .../doc/AllOfWithSingleRef.md | 16 ++ .../dart-http-json_serializable/doc/Animal.md | 16 ++ .../doc/ApiResponse.md | 17 ++ .../dart-http-json_serializable/doc/Apple.md | 15 + .../doc/ArrayOfArrayOfNumberOnly.md | 15 + .../doc/ArrayOfNumberOnly.md | 15 + .../doc/ArrayTest.md | 17 ++ .../dart-http-json_serializable/doc/Banana.md | 15 + .../dart-http-json_serializable/doc/Bar.md | 22 ++ .../doc/BarCreate.md | 22 ++ .../dart-http-json_serializable/doc/BarRef.md | 19 ++ .../doc/BarRefOrValue.md | 19 ++ .../doc/BodyApi.md | 57 ++++ .../doc/Capitalization.md | 20 ++ .../dart-http-json_serializable/doc/Cat.md | 17 ++ .../doc/CatAllOf.md | 15 + .../doc/Category.md | 16 ++ .../dart-http-json_serializable/doc/Child.md | 15 + .../doc/ClassModel.md | 15 + .../doc/DeprecatedObject.md | 15 + .../dart-http-json_serializable/doc/Dog.md | 17 ++ .../doc/DogAllOf.md | 15 + .../dart-http-json_serializable/doc/Entity.md | 19 ++ .../doc/EntityRef.md | 21 ++ .../doc/EnumArrays.md | 16 ++ .../doc/EnumTest.md | 22 ++ .../doc/Example.md | 15 + .../doc/ExampleNonPrimitive.md | 14 + .../doc/Extensible.md | 17 ++ .../doc/FileSchemaTestClass.md | 16 ++ .../dart-http-json_serializable/doc/Foo.md | 21 ++ .../dart-http-json_serializable/doc/FooRef.md | 20 ++ .../doc/FooRefOrValue.md | 19 ++ .../doc/FormatTest.md | 30 ++ .../dart-http-json_serializable/doc/Fruit.md | 17 ++ .../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 + .../dart-http-json_serializable/doc/Name.md | 18 ++ .../doc/NullableClass.md | 26 ++ .../doc/NumberOnly.md | 15 + .../doc/ObjectWithDeprecatedFields.md | 18 ++ .../dart-http-json_serializable/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 + .../dart-http-json_serializable/doc/Pasta.md | 20 ++ .../doc/PathApi.md | 59 ++++ .../dart-http-json_serializable/doc/Pet.md | 20 ++ .../dart-http-json_serializable/doc/Pizza.md | 20 ++ .../doc/PizzaSpeziale.md | 20 ++ .../doc/QueryApi.md | 149 ++++++++++ .../doc/ReadOnlyFirst.md | 16 ++ .../doc/SingleRefType.md | 14 + .../doc/SpecialModelName.md | 15 + .../dart-http-json_serializable/doc/Tag.md | 16 ++ ...lodeTrueArrayStringQueryObjectParameter.md | 15 + .../dart-http-json_serializable/doc/User.md | 22 ++ .../lib/openapi.dart | 9 + .../lib/src/api.dart | 39 +++ .../lib/src/api/_exports.dart | 3 + .../lib/src/api/body_api.dart | 100 +++++++ .../lib/src/api/path_api.dart | 85 ++++++ .../lib/src/api/query_api.dart | 233 +++++++++++++++ .../lib/src/api_util.dart | 88 ++++++ .../lib/src/auth/_exports.dart | 9 + .../lib/src/auth/api_key_auth.dart | 37 +++ .../lib/src/auth/auth.dart | 10 + .../lib/src/auth/basic_auth.dart | 24 ++ .../lib/src/auth/bearer_auth.dart | 47 +++ .../lib/src/auth/oauth.dart | 21 ++ .../lib/src/deserialize.dart | 269 ++++++++++++++++++ .../lib/src/model/_exports.dart | 67 +++++ .../model/additional_properties_class.dart | 48 ++++ .../lib/src/model/addressable.dart | 48 ++++ .../lib/src/model/all_of_with_single_ref.dart | 49 ++++ .../lib/src/model/animal.dart | 49 ++++ .../lib/src/model/api_response.dart | 53 ++++ .../lib/src/model/apple.dart | 40 +++ .../model/array_of_array_of_number_only.dart | 43 +++ .../lib/src/model/array_of_number_only.dart | 42 +++ .../lib/src/model/array_test.dart | 58 ++++ .../lib/src/model/banana.dart | 40 +++ .../lib/src/model/bar.dart | 93 ++++++ .../lib/src/model/bar_create.dart | 95 +++++++ .../lib/src/model/bar_ref.dart | 75 +++++ .../lib/src/model/bar_ref_or_value.dart | 75 +++++ .../lib/src/model/capitalization.dart | 75 +++++ .../lib/src/model/cat.dart | 59 ++++ .../lib/src/model/cat_all_of.dart | 41 +++ .../lib/src/model/category.dart | 46 +++ .../lib/src/model/child.dart | 40 +++ .../lib/src/model/class_model.dart | 42 +++ .../lib/src/model/deprecated_object.dart | 41 +++ .../lib/src/model/dog.dart | 59 ++++ .../lib/src/model/dog_all_of.dart | 41 +++ .../lib/src/model/entity.dart | 72 +++++ .../lib/src/model/entity_ref.dart | 87 ++++++ .../lib/src/model/enum_arrays.dart | 66 +++++ .../lib/src/model/enum_test.dart | 134 +++++++++ .../lib/src/model/example.dart | 42 +++ .../lib/src/model/example_non_primitive.dart | 38 +++ .../lib/src/model/extensible.dart | 57 ++++ .../lib/src/model/file_schema_test_class.dart | 49 ++++ .../lib/src/model/foo.dart | 87 ++++++ .../lib/src/model/foo_ref.dart | 81 ++++++ .../lib/src/model/foo_ref_or_value.dart | 75 +++++ .../lib/src/model/format_test.dart | 150 ++++++++++ .../lib/src/model/fruit.dart | 54 ++++ .../lib/src/model/has_only_read_only.dart | 46 +++ .../lib/src/model/health_check_result.dart | 42 +++ .../lib/src/model/map_test.dart | 71 +++++ ...rties_and_additional_properties_class.dart | 56 ++++ .../lib/src/model/model200_response.dart | 48 ++++ .../lib/src/model/model_client.dart | 41 +++ .../lib/src/model/model_enum_class.dart | 17 ++ .../lib/src/model/model_file.dart | 43 +++ .../lib/src/model/model_list.dart | 42 +++ .../lib/src/model/model_return.dart | 42 +++ .../lib/src/model/name.dart | 61 ++++ .../lib/src/model/nullable_class.dart | 121 ++++++++ .../lib/src/model/number_only.dart | 42 +++ .../model/object_with_deprecated_fields.dart | 61 ++++ .../lib/src/model/order.dart | 90 ++++++ .../lib/src/model/outer_composite.dart | 54 ++++ .../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 | 43 +++ .../lib/src/model/pasta.dart | 81 ++++++ .../lib/src/model/pet.dart | 88 ++++++ .../lib/src/model/pizza.dart | 81 ++++++ .../lib/src/model/pizza_speziale.dart | 82 ++++++ .../lib/src/model/read_only_first.dart | 46 +++ .../lib/src/model/single_ref_type.dart | 15 + .../lib/src/model/special_model_name.dart | 47 +++ .../lib/src/model/tag.dart | 45 +++ ...e_array_string_query_object_parameter.dart | 47 +++ .../lib/src/model/user.dart | 86 ++++++ .../dart-http-json_serializable/pubspec.yaml | 19 ++ .../additional_properties_class_test.dart | 21 ++ .../test/addressable_test.dart | 22 ++ .../test/all_of_with_single_ref_test.dart | 20 ++ .../test/animal_test.dart | 20 ++ .../test/api_response_test.dart | 25 ++ .../test/apple_test.dart | 15 + .../array_of_array_of_number_only_test.dart | 16 ++ .../test/array_of_number_only_test.dart | 15 + .../test/array_test_test.dart | 25 ++ .../test/banana_test.dart | 15 + .../test/bar_create_test.dart | 55 ++++ .../test/bar_ref_or_value_test.dart | 40 +++ .../test/bar_ref_test.dart | 40 +++ .../test/bar_test.dart | 54 ++++ .../test/body_api_test.dart | 18 ++ .../test/capitalization_test.dart | 41 +++ .../test/cat_all_of_test.dart | 15 + .../test/cat_test.dart | 25 ++ .../test/category_test.dart | 20 ++ .../test/child_test.dart | 15 + .../test/class_model_test.dart | 15 + .../test/deprecated_object_test.dart | 15 + .../test/dog_all_of_test.dart | 15 + .../test/dog_test.dart | 25 ++ .../test/entity_ref_test.dart | 52 ++++ .../test/entity_test.dart | 40 +++ .../test/enum_arrays_test.dart | 20 ++ .../test/enum_test_test.dart | 50 ++++ .../test/example_non_primitive_test.dart | 10 + .../test/example_test.dart | 15 + .../test/extensible_test.dart | 28 ++ .../test/file_schema_test_class_test.dart | 20 ++ .../test/foo_ref_or_value_test.dart | 40 +++ .../test/foo_ref_test.dart | 45 +++ .../test/foo_test.dart | 50 ++++ .../test/format_test_test.dart | 92 ++++++ .../test/fruit_test.dart | 25 ++ .../test/has_only_read_only_test.dart | 20 ++ .../test/health_check_result_test.dart | 15 + .../test/map_test_test.dart | 30 ++ ..._and_additional_properties_class_test.dart | 26 ++ .../test/model200_response_test.dart | 20 ++ .../test/model_client_test.dart | 15 + .../test/model_enum_class_test.dart | 7 + .../test/model_file_test.dart | 16 ++ .../test/model_list_test.dart | 15 + .../test/model_return_test.dart | 15 + .../test/name_test.dart | 30 ++ .../test/nullable_class_test.dart | 70 +++++ .../test/number_only_test.dart | 15 + .../object_with_deprecated_fields_test.dart | 31 ++ .../test/order_test.dart | 41 +++ .../test/outer_composite_test.dart | 25 ++ .../test/outer_enum_default_value_test.dart | 7 + ...outer_enum_integer_default_value_test.dart | 7 + .../test/outer_enum_integer_test.dart | 7 + .../test/outer_enum_test.dart | 7 + .../outer_object_with_enum_property_test.dart | 16 ++ .../test/pasta_test.dart | 45 +++ .../test/path_api_test.dart | 18 ++ .../test/pet_test.dart | 41 +++ .../test/pizza_speziale_test.dart | 45 +++ .../test/pizza_test.dart | 45 +++ .../test/query_api_test.dart | 36 +++ .../test/read_only_first_test.dart | 20 ++ .../test/single_ref_type_test.dart | 7 + .../test/special_model_name_test.dart | 17 ++ .../test/tag_test.dart | 20 ++ ...ay_string_query_object_parameter_test.dart | 16 ++ .../test/user_test.dart | 51 ++++ .../.openapi-generator/FILES | 2 + .../lib/openapi.dart | 53 +--- .../lib/src/api.dart | 5 +- .../lib/src/auth/_exports.dart | 10 + .../lib/src/auth/api_key_auth.dart | 2 +- .../lib/src/auth/basic_auth.dart | 2 +- .../lib/src/auth/bearer_auth.dart | 2 +- .../lib/src/auth/oauth.dart | 2 +- .../lib/src/model/_exports.dart | 49 ++++ .../.openapi-generator/FILES | 2 + .../petstore_client_lib_fake/lib/openapi.dart | 54 +--- .../petstore_client_lib_fake/lib/src/api.dart | 5 +- .../lib/src/auth/_exports.dart | 10 + .../lib/src/auth/api_key_auth.dart | 2 +- .../lib/src/auth/basic_auth.dart | 2 +- .../lib/src/auth/bearer_auth.dart | 2 +- .../lib/src/auth/oauth.dart | 2 +- .../lib/src/model/_exports.dart | 50 ++++ 788 files changed, 19863 insertions(+), 2037 deletions(-) create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/_exports.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/_exports.dart create mode 100644 samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/_exports.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/.gitignore create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator-ignore create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator/FILES create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator/VERSION create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/README.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/analysis_options.yaml create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/build.yaml create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/AdditionalPropertiesClass.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Addressable.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/AllOfWithSingleRef.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Animal.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ApiResponse.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Apple.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayOfNumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayTest.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Banana.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Bar.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/BarCreate.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/BarRef.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/BarRefOrValue.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/BodyApi.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Capitalization.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Cat.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/CatAllOf.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Category.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Child.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ClassModel.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/DeprecatedObject.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Dog.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/DogAllOf.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Entity.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/EntityRef.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/EnumArrays.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/EnumTest.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Example.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ExampleNonPrimitive.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Extensible.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/FileSchemaTestClass.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Foo.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/FooRef.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/FooRefOrValue.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/FormatTest.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Fruit.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/HasOnlyReadOnly.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/HealthCheckResult.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/MapTest.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Model200Response.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelClient.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelEnumClass.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelFile.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelList.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelReturn.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Name.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/NullableClass.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/NumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ObjectWithDeprecatedFields.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Order.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterComposite.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnum.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumDefaultValue.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumInteger.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterObjectWithEnumProperty.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Pasta.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/PathApi.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Pet.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Pizza.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/PizzaSpeziale.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/QueryApi.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/ReadOnlyFirst.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/SingleRefType.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/SpecialModelName.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/Tag.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/doc/User.md create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/openapi.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/_exports.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/body_api.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/path_api.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/query_api.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api_util.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/_exports.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/api_key_auth.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/auth.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/basic_auth.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/bearer_auth.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/oauth.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/deserialize.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/_exports.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/additional_properties_class.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/addressable.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/all_of_with_single_ref.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/animal.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/api_response.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/apple.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_of_array_of_number_only.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_of_number_only.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/banana.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_create.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_ref.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_ref_or_value.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/capitalization.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/cat.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/cat_all_of.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/category.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/child.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/class_model.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/deprecated_object.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/dog.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/dog_all_of.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/entity.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/entity_ref.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/enum_arrays.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/enum_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example_non_primitive.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/extensible.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/file_schema_test_class.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo_ref.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo_ref_or_value.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/format_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/fruit.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/has_only_read_only.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/health_check_result.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/map_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model200_response.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_client.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_enum_class.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_file.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_list.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_return.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/name.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/nullable_class.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/number_only.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/object_with_deprecated_fields.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/order.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_composite.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_default_value.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_integer.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_integer_default_value.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_object_with_enum_property.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pasta.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pet.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pizza.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pizza_speziale.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/read_only_first.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/single_ref_type.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/special_model_name.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/tag.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/user.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/pubspec.yaml create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/additional_properties_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/addressable_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/all_of_with_single_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/animal_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/api_response_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/apple_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/array_of_array_of_number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/array_of_number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/array_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/banana_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_create_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_ref_or_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/body_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/capitalization_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/cat_all_of_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/cat_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/category_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/child_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/class_model_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/deprecated_object_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/dog_all_of_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/dog_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/entity_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/entity_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/enum_arrays_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/enum_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/example_non_primitive_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/example_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/extensible_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/file_schema_test_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/foo_ref_or_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/foo_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/foo_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/format_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/fruit_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/has_only_read_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/health_check_result_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/map_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/model200_response_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/model_client_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/model_enum_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/model_file_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/model_list_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/model_return_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/name_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/nullable_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/object_with_deprecated_fields_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/order_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_composite_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_default_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_integer_default_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_integer_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_object_with_enum_property_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/pasta_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/path_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/pet_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/pizza_speziale_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/pizza_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/query_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/read_only_first_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/single_ref_type_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/special_model_name_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/tag_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart create mode 100644 samples/client/echo_api/dart/dart-dio-json_serializable/test/user_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/api/_exports.dart create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/_exports.dart rename samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/{authentication.dart => auth.dart} (63%) rename samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/{http_basic_auth.dart => basic_auth.dart} (57%) rename samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/{http_bearer_auth.dart => bearer_auth.dart} (76%) create mode 100644 samples/client/echo_api/dart/dart-http-built_value/lib/src/model/_exports.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/.gitignore create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator-ignore create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator/FILES create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator/VERSION create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/README.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/analysis_options.yaml create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/build.yaml create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/AdditionalPropertiesClass.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Addressable.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/AllOfWithSingleRef.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Animal.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ApiResponse.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Apple.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ArrayOfNumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ArrayTest.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Banana.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Bar.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/BarCreate.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/BarRef.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/BarRefOrValue.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/BodyApi.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Capitalization.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Cat.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/CatAllOf.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Category.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Child.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ClassModel.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/DeprecatedObject.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Dog.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/DogAllOf.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Entity.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/EntityRef.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/EnumArrays.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/EnumTest.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Example.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ExampleNonPrimitive.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Extensible.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/FileSchemaTestClass.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Foo.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/FooRef.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/FooRefOrValue.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/FormatTest.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Fruit.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/HasOnlyReadOnly.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/HealthCheckResult.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/MapTest.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Model200Response.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelClient.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelEnumClass.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelFile.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelList.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelReturn.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Name.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/NullableClass.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/NumberOnly.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ObjectWithDeprecatedFields.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Order.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterComposite.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnum.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumDefaultValue.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumInteger.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterObjectWithEnumProperty.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Pasta.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/PathApi.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Pet.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Pizza.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/PizzaSpeziale.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/QueryApi.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/ReadOnlyFirst.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/SingleRefType.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/SpecialModelName.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/Tag.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/doc/User.md create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/openapi.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/_exports.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/body_api.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/path_api.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/query_api.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api_util.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/_exports.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/api_key_auth.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/auth.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/basic_auth.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/bearer_auth.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/oauth.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/deserialize.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/_exports.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/additional_properties_class.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/addressable.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/all_of_with_single_ref.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/animal.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/api_response.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/apple.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_of_array_of_number_only.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_of_number_only.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/banana.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_create.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_ref.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_ref_or_value.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/capitalization.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/cat.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/cat_all_of.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/category.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/child.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/class_model.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/deprecated_object.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/dog.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/dog_all_of.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/entity.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/entity_ref.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/enum_arrays.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/enum_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example_non_primitive.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/extensible.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/file_schema_test_class.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo_ref.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo_ref_or_value.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/format_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/fruit.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/has_only_read_only.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/health_check_result.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/map_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model200_response.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_client.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_enum_class.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_file.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_list.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_return.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/name.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/nullable_class.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/number_only.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/object_with_deprecated_fields.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/order.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_composite.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_default_value.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_integer.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_integer_default_value.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_object_with_enum_property.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pasta.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pet.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pizza.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pizza_speziale.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/read_only_first.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/single_ref_type.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/special_model_name.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/tag.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/user.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/pubspec.yaml create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/additional_properties_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/addressable_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/all_of_with_single_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/animal_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/api_response_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/apple_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/array_of_array_of_number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/array_of_number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/array_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/banana_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/bar_create_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/bar_ref_or_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/bar_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/bar_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/body_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/capitalization_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/cat_all_of_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/cat_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/category_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/child_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/class_model_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/deprecated_object_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/dog_all_of_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/dog_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/entity_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/entity_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/enum_arrays_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/enum_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/example_non_primitive_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/example_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/extensible_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/file_schema_test_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/foo_ref_or_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/foo_ref_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/foo_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/format_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/fruit_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/has_only_read_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/health_check_result_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/map_test_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/model200_response_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/model_client_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/model_enum_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/model_file_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/model_list_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/model_return_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/name_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/nullable_class_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/number_only_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/object_with_deprecated_fields_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/order_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/outer_composite_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_default_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_integer_default_value_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_integer_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/outer_object_with_enum_property_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/pasta_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/path_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/pet_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/pizza_speziale_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/pizza_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/query_api_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/read_only_first_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/single_ref_type_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/special_model_name_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/tag_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart create mode 100644 samples/client/echo_api/dart/dart-http-json_serializable/test/user_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/_exports.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/_exports.dart diff --git a/samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator/FILES b/samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator/FILES index 803a09c98cbd..eb91ad816446 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator/FILES +++ b/samples/client/echo_api/dart/dart-dio-built_value/.openapi-generator/FILES @@ -73,16 +73,19 @@ doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md doc/User.md lib/openapi.dart lib/src/api.dart +lib/src/api/_exports.dart lib/src/api/body_api.dart lib/src/api/path_api.dart lib/src/api/query_api.dart lib/src/api_util.dart +lib/src/auth/_exports.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/date_serializer.dart +lib/src/model/_exports.dart lib/src/model/additional_properties_class.dart lib/src/model/addressable.dart lib/src/model/all_of_with_single_ref.dart diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/openapi.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/openapi.dart index 0b51813f1c05..0b94909a8fee 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/openapi.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/openapi.dart @@ -3,80 +3,8 @@ // export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; +export 'package:openapi/src/auth/_exports.dart'; export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; -export 'package:openapi/src/api/body_api.dart'; -export 'package:openapi/src/api/path_api.dart'; -export 'package:openapi/src/api/query_api.dart'; - -export 'package:openapi/src/model/additional_properties_class.dart'; -export 'package:openapi/src/model/addressable.dart'; -export 'package:openapi/src/model/all_of_with_single_ref.dart'; -export 'package:openapi/src/model/animal.dart'; -export 'package:openapi/src/model/api_response.dart'; -export 'package:openapi/src/model/apple.dart'; -export 'package:openapi/src/model/array_of_array_of_number_only.dart'; -export 'package:openapi/src/model/array_of_number_only.dart'; -export 'package:openapi/src/model/array_test.dart'; -export 'package:openapi/src/model/banana.dart'; -export 'package:openapi/src/model/bar.dart'; -export 'package:openapi/src/model/bar_create.dart'; -export 'package:openapi/src/model/bar_ref.dart'; -export 'package:openapi/src/model/bar_ref_or_value.dart'; -export 'package:openapi/src/model/capitalization.dart'; -export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; -export 'package:openapi/src/model/category.dart'; -export 'package:openapi/src/model/child.dart'; -export 'package:openapi/src/model/class_model.dart'; -export 'package:openapi/src/model/deprecated_object.dart'; -export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; -export 'package:openapi/src/model/entity.dart'; -export 'package:openapi/src/model/entity_ref.dart'; -export 'package:openapi/src/model/enum_arrays.dart'; -export 'package:openapi/src/model/enum_test.dart'; -export 'package:openapi/src/model/example.dart'; -export 'package:openapi/src/model/example_non_primitive.dart'; -export 'package:openapi/src/model/extensible.dart'; -export 'package:openapi/src/model/file_schema_test_class.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_ref.dart'; -export 'package:openapi/src/model/foo_ref_or_value.dart'; -export 'package:openapi/src/model/format_test.dart'; -export 'package:openapi/src/model/fruit.dart'; -export 'package:openapi/src/model/has_only_read_only.dart'; -export 'package:openapi/src/model/health_check_result.dart'; -export 'package:openapi/src/model/map_test.dart'; -export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -export 'package:openapi/src/model/model200_response.dart'; -export 'package:openapi/src/model/model_client.dart'; -export 'package:openapi/src/model/model_enum_class.dart'; -export 'package:openapi/src/model/model_file.dart'; -export 'package:openapi/src/model/model_list.dart'; -export 'package:openapi/src/model/model_return.dart'; -export 'package:openapi/src/model/name.dart'; -export 'package:openapi/src/model/nullable_class.dart'; -export 'package:openapi/src/model/number_only.dart'; -export 'package:openapi/src/model/object_with_deprecated_fields.dart'; -export 'package:openapi/src/model/order.dart'; -export 'package:openapi/src/model/outer_composite.dart'; -export 'package:openapi/src/model/outer_enum.dart'; -export 'package:openapi/src/model/outer_enum_default_value.dart'; -export 'package:openapi/src/model/outer_enum_integer.dart'; -export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -export 'package:openapi/src/model/outer_object_with_enum_property.dart'; -export 'package:openapi/src/model/pasta.dart'; -export 'package:openapi/src/model/pet.dart'; -export 'package:openapi/src/model/pizza.dart'; -export 'package:openapi/src/model/pizza_speziale.dart'; -export 'package:openapi/src/model/read_only_first.dart'; -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/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; -export 'package:openapi/src/model/user.dart'; +export 'package:openapi/src/api/_exports.dart'; +export 'package:openapi/src/model/_exports.dart'; diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api.dart index 5251ce5189f5..3f0a5bda8d57 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api.dart @@ -5,10 +5,7 @@ import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; import 'package:openapi/src/serializers.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/auth/_exports.dart'; import 'package:openapi/src/api/body_api.dart'; import 'package:openapi/src/api/path_api.dart'; import 'package:openapi/src/api/query_api.dart'; @@ -45,25 +42,36 @@ class Openapi { 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; + (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; + (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); + (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; + (this + .dio + .interceptors + .firstWhere((element) => element is ApiKeyAuthInterceptor) + as ApiKeyAuthInterceptor) + .apiKeys[name] = apiKey; } } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/_exports.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/_exports.dart new file mode 100644 index 000000000000..f06d548e0d23 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/_exports.dart @@ -0,0 +1,3 @@ +export 'body_api.dart'; +export 'path_api.dart'; +export 'query_api.dart'; diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart index 9c86b955a2d9..a0230285c129 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart @@ -10,7 +10,6 @@ import 'package:dio/dio.dart'; import 'package:openapi/src/model/pet.dart'; class BodyApi { - final Dio _dio; final Serializers _serializers; @@ -31,7 +30,7 @@ class BodyApi { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioError] if API call or serialization fails - Future> testEchoBodyPet({ + Future> testEchoBodyPet({ Pet? pet, CancelToken? cancelToken, Map? headers, @@ -58,11 +57,12 @@ class BodyApi { try { const _type = FullType(Pet); - _bodyData = pet == null ? null : _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { + _bodyData = pet == null + ? null + : _serializers.serialize(pet, specifiedType: _type); + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( + requestOptions: _options.compose( _dio.options, _path, ), @@ -88,7 +88,6 @@ class BodyApi { _response.data!, specifiedType: _responseType, ) as Pet; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -109,5 +108,4 @@ class BodyApi { extra: _response.extra, ); } - } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart index 3d009a985a86..28f96bb26f2f 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart @@ -7,9 +7,7 @@ import 'dart:async'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; - class PathApi { - final Dio _dio; final Serializers _serializers; @@ -20,8 +18,8 @@ class PathApi { /// Test path parameter(s) /// /// Parameters: - /// * [pathString] - /// * [pathInteger] + /// * [pathString] + /// * [pathInteger] /// * [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 @@ -31,7 +29,7 @@ class PathApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> testsPathStringPathStringIntegerPathInteger({ + Future> testsPathStringPathStringIntegerPathInteger({ required String pathString, required int pathInteger, CancelToken? cancelToken, @@ -41,7 +39,9 @@ class PathApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/path/string/{path_string}/integer/{path_integer}'.replaceAll('{' r'path_string' '}', pathString.toString()).replaceAll('{' r'path_integer' '}', pathInteger.toString()); + final _path = r'/path/string/{path_string}/integer/{path_integer}' + .replaceAll('{' r'path_string' '}', pathString.toString()) + .replaceAll('{' r'path_integer' '}', pathInteger.toString()); final _options = Options( method: r'GET', headers: { @@ -66,7 +66,6 @@ class PathApi { try { _responseData = _response.data as String; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -87,5 +86,4 @@ class PathApi { extra: _response.extra, ); } - } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart index d51aad8f6dcc..bc37616efdbb 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart @@ -12,7 +12,6 @@ import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; class QueryApi { - final Dio _dio; final Serializers _serializers; @@ -23,9 +22,9 @@ class QueryApi { /// Test query parameter(s) /// /// Parameters: - /// * [integerQuery] - /// * [booleanQuery] - /// * [stringQuery] + /// * [integerQuery] + /// * [booleanQuery] + /// * [stringQuery] /// * [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 @@ -35,7 +34,7 @@ class QueryApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> testQueryIntegerBooleanString({ + Future> testQueryIntegerBooleanString({ int? integerQuery, bool? booleanQuery, String? stringQuery, @@ -60,9 +59,15 @@ class QueryApi { ); final _queryParameters = { - if (integerQuery != null) r'integer_query': encodeQueryParameter(_serializers, integerQuery, const FullType(int)), - if (booleanQuery != null) r'boolean_query': encodeQueryParameter(_serializers, booleanQuery, const FullType(bool)), - if (stringQuery != null) r'string_query': encodeQueryParameter(_serializers, stringQuery, const FullType(String)), + if (integerQuery != null) + r'integer_query': encodeQueryParameter( + _serializers, integerQuery, const FullType(int)), + if (booleanQuery != null) + r'boolean_query': encodeQueryParameter( + _serializers, booleanQuery, const FullType(bool)), + if (stringQuery != null) + r'string_query': encodeQueryParameter( + _serializers, stringQuery, const FullType(String)), }; final _response = await _dio.request( @@ -78,7 +83,6 @@ class QueryApi { try { _responseData = _response.data as String; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -104,7 +108,7 @@ class QueryApi { /// Test query parameter(s) /// /// Parameters: - /// * [queryObject] + /// * [queryObject] /// * [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 @@ -114,7 +118,7 @@ class QueryApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> testQueryStyleFormExplodeTrueArrayString({ + Future> testQueryStyleFormExplodeTrueArrayString({ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? queryObject, CancelToken? cancelToken, Map? headers, @@ -137,7 +141,12 @@ class QueryApi { ); final _queryParameters = { - if (queryObject != null) r'query_object': encodeQueryParameter(_serializers, queryObject, const FullType(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter)), + if (queryObject != null) + r'query_object': encodeQueryParameter( + _serializers, + queryObject, + const FullType( + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter)), }; final _response = await _dio.request( @@ -153,7 +162,6 @@ class QueryApi { try { _responseData = _response.data as String; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -179,7 +187,7 @@ class QueryApi { /// Test query parameter(s) /// /// Parameters: - /// * [queryObject] + /// * [queryObject] /// * [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 @@ -189,7 +197,7 @@ class QueryApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> testQueryStyleFormExplodeTrueObject({ + Future> testQueryStyleFormExplodeTrueObject({ Pet? queryObject, CancelToken? cancelToken, Map? headers, @@ -212,7 +220,9 @@ class QueryApi { ); final _queryParameters = { - if (queryObject != null) r'query_object': encodeQueryParameter(_serializers, queryObject, const FullType(Pet)), + if (queryObject != null) + r'query_object': encodeQueryParameter( + _serializers, queryObject, const FullType(Pet)), }; final _response = await _dio.request( @@ -228,7 +238,6 @@ class QueryApi { try { _responseData = _response.data as String; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -249,5 +258,4 @@ class QueryApi { extra: _response.extra, ); } - } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api_util.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api_util.dart index ed3bb12f25b8..c903dbd2804b 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api_util.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api_util.dart @@ -5,14 +5,15 @@ import 'dart:convert'; import 'dart:typed_data'; +import 'package:dio/dio.dart'; import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; /// Format the given form parameter object into something that Dio can handle. /// Returns primitive or String. /// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { +dynamic encodeFormParameter( + Serializers serializers, dynamic value, FullType type) { if (value == null) { return ''; } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/_exports.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/_exports.dart new file mode 100644 index 000000000000..01c9ad2dfa7e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/_exports.dart @@ -0,0 +1,9 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'api_key_auth.dart'; +export 'auth.dart'; +export 'basic_auth.dart'; +export 'bearer_auth.dart'; +export 'oauth.dart'; diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/api_key_auth.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/api_key_auth.dart index ee16e3f0f92f..c67c514ee94e 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/api_key_auth.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/api_key_auth.dart @@ -2,16 +2,16 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // - import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class ApiKeyAuthInterceptor extends AuthInterceptor { final Map apiKeys = {}; @override void onRequest(RequestOptions options, RequestInterceptorHandler handler) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + 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; diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/auth.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/auth.dart index f7ae9bf3f11e..c6fcca595cb3 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/auth.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/auth.dart @@ -8,7 +8,8 @@ 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) { + 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(); diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/basic_auth.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/basic_auth.dart index b6e6dce04f9c..6cea35ca3665 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/basic_auth.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/basic_auth.dart @@ -5,7 +5,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class BasicAuthInfo { final String username; @@ -22,12 +22,17 @@ class BasicAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + final metadataAuthInfo = getAuthInfo( + options, + (secure) => + (secure['type'] == 'http' && secure['scheme'] == 'basic') || + secure['type'] == 'basic'); for (final info in metadataAuthInfo) { final authName = info['name'] as String; final basicAuthInfo = authInfo[authName]; if (basicAuthInfo != null) { - final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + final basicAuth = + 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; options.headers['Authorization'] = basicAuth; break; } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/bearer_auth.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/bearer_auth.dart index 1d4402b376c0..38729451f23e 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/bearer_auth.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/bearer_auth.dart @@ -3,7 +3,7 @@ // import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class BearerAuthInterceptor extends AuthInterceptor { final Map tokens = {}; @@ -13,7 +13,8 @@ class BearerAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + final authInfo = getAuthInfo(options, + (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); for (final info in authInfo) { final token = tokens[info['name']]; if (token != null) { diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/oauth.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/oauth.dart index 337cf762b0ce..54aa4706ef69 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/oauth.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/auth/oauth.dart @@ -3,7 +3,7 @@ // import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class OAuthInterceptor extends AuthInterceptor { final Map tokens = {}; @@ -13,7 +13,8 @@ class OAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + final authInfo = getAuthInfo(options, + (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); for (final info in authInfo) { final token = tokens[info['name']]; if (token != null) { diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/date_serializer.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/date_serializer.dart index db3c5c437db1..deacc6525d19 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/date_serializer.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/date_serializer.dart @@ -7,7 +7,6 @@ import 'package:built_value/serializer.dart'; import 'package:openapi/src/model/date.dart'; class DateSerializer implements PrimitiveSerializer { - const DateSerializer(); @override diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/_exports.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/_exports.dart new file mode 100644 index 000000000000..d1f1f4450e41 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/_exports.dart @@ -0,0 +1,69 @@ +export 'additional_properties_class.dart'; +export 'addressable.dart'; +export 'all_of_with_single_ref.dart'; +export 'animal.dart'; +export 'api_response.dart'; +export 'apple.dart'; +export 'array_of_array_of_number_only.dart'; +export 'array_of_number_only.dart'; +export 'array_test.dart'; +export 'banana.dart'; +export 'bar.dart'; +export 'bar_create.dart'; +export 'bar_ref.dart'; +export 'bar_ref_or_value.dart'; +export 'capitalization.dart'; +export 'cat.dart'; +export 'cat_all_of.dart'; +export 'category.dart'; +export 'child.dart'; +export 'class_model.dart'; +export 'deprecated_object.dart'; +export 'dog.dart'; +export 'dog_all_of.dart'; +export 'entity.dart'; +export 'entity_ref.dart'; +export 'enum_arrays.dart'; +export 'enum_test.dart'; +export 'example.dart'; +export 'example_non_primitive.dart'; +export 'extensible.dart'; +export 'file_schema_test_class.dart'; +export 'foo.dart'; +export 'foo_ref.dart'; +export 'foo_ref_or_value.dart'; +export 'format_test.dart'; +export 'fruit.dart'; +export 'has_only_read_only.dart'; +export 'health_check_result.dart'; +export 'map_test.dart'; +export 'mixed_properties_and_additional_properties_class.dart'; +export 'model200_response.dart'; +export 'model_client.dart'; +export 'model_enum_class.dart'; +export 'model_file.dart'; +export 'model_list.dart'; +export 'model_return.dart'; +export 'name.dart'; +export 'nullable_class.dart'; +export 'number_only.dart'; +export 'object_with_deprecated_fields.dart'; +export 'order.dart'; +export 'outer_composite.dart'; +export 'outer_enum.dart'; +export 'outer_enum_default_value.dart'; +export 'outer_enum_integer.dart'; +export 'outer_enum_integer_default_value.dart'; +export 'outer_object_with_enum_property.dart'; +export 'pasta.dart'; +export 'pet.dart'; +export 'pizza.dart'; +export 'pizza_speziale.dart'; +export 'read_only_first.dart'; +export 'single_ref_type.dart'; +export 'special_model_name.dart'; +export 'tag.dart'; +export 'test_query_style_form_explode_true_array_string_query_object_parameter.dart'; +export 'user.dart'; + +export 'date.dart'; diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/additional_properties_class.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/additional_properties_class.dart index 3fdac6d5a44f..34022add8e5e 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/additional_properties_class.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/additional_properties_class.dart @@ -12,10 +12,12 @@ part 'additional_properties_class.g.dart'; /// AdditionalPropertiesClass /// /// Properties: -/// * [mapProperty] -/// * [mapOfMapProperty] +/// * [mapProperty] +/// * [mapOfMapProperty] @BuiltValue() -abstract class AdditionalPropertiesClass implements Built { +abstract class AdditionalPropertiesClass + implements + Built { @BuiltValueField(wireName: r'map_property') BuiltMap? get mapProperty; @@ -24,18 +26,25 @@ abstract class AdditionalPropertiesClass implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AdditionalPropertiesClassSerializer(); + static Serializer get serializer => + _$AdditionalPropertiesClassSerializer(); } -class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer { +class _$AdditionalPropertiesClassSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [AdditionalPropertiesClass, _$AdditionalPropertiesClass]; + final Iterable types = const [ + AdditionalPropertiesClass, + _$AdditionalPropertiesClass + ]; @override final String wireName = r'AdditionalPropertiesClass'; @@ -49,14 +58,18 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer; result.mapProperty.replace(valueDes); break; case r'map_of_map_property': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + specifiedType: const FullType(BuiltMap, [ + FullType(String), + FullType(BuiltMap, [FullType(String), FullType(String)]) + ]), ) as BuiltMap>; result.mapOfMapProperty.replace(valueDes); break; @@ -124,4 +143,3 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer { Addressable object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -70,16 +72,19 @@ class _$AddressableSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($Addressable)) as $Addressable; + return serializers.deserialize(serialized, + specifiedType: FullType($Addressable)) as $Addressable; } } /// a concrete implementation of [Addressable], since [Addressable] is not instantiable @BuiltValue(instantiable: true) -abstract class $Addressable implements Addressable, Built<$Addressable, $AddressableBuilder> { +abstract class $Addressable + implements Addressable, Built<$Addressable, $AddressableBuilder> { $Addressable._(); - factory $Addressable([void Function($AddressableBuilder)? updates]) = _$$Addressable; + factory $Addressable([void Function($AddressableBuilder)? updates]) = + _$$Addressable; @BuiltValueHook(initializeBuilder: true) static void _defaults($AddressableBuilder b) => b; @@ -158,4 +163,3 @@ class _$$AddressableSerializer implements PrimitiveSerializer<$Addressable> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/all_of_with_single_ref.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/all_of_with_single_ref.dart index 04f59d360128..cd9f8aaebec8 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/all_of_with_single_ref.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/all_of_with_single_ref.dart @@ -12,10 +12,11 @@ part 'all_of_with_single_ref.g.dart'; /// AllOfWithSingleRef /// /// Properties: -/// * [username] -/// * [singleRefType] +/// * [username] +/// * [singleRefType] @BuiltValue() -abstract class AllOfWithSingleRef implements Built { +abstract class AllOfWithSingleRef + implements Built { @BuiltValueField(wireName: r'username') String? get username; @@ -24,16 +25,19 @@ abstract class AllOfWithSingleRef implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AllOfWithSingleRefSerializer(); + static Serializer get serializer => + _$AllOfWithSingleRefSerializer(); } -class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer { +class _$AllOfWithSingleRefSerializer + implements PrimitiveSerializer { @override final Iterable types = const [AllOfWithSingleRef, _$AllOfWithSingleRef]; @@ -67,7 +71,9 @@ class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer { @@ -95,7 +96,9 @@ class _$AnimalSerializer implements PrimitiveSerializer { if (object is Dog) { return serializers.serialize(object, specifiedType: FullType(Dog))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -106,14 +109,18 @@ class _$AnimalSerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Animal.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'Cat': - return serializers.deserialize(serialized, specifiedType: FullType(Cat)) as Cat; + return serializers.deserialize(serialized, specifiedType: FullType(Cat)) + as Cat; case r'Dog': - return serializers.deserialize(serialized, specifiedType: FullType(Dog)) as Dog; + return serializers.deserialize(serialized, specifiedType: FullType(Dog)) + as Dog; default: - return serializers.deserialize(serialized, specifiedType: FullType($Animal)) as $Animal; + return serializers.deserialize(serialized, + specifiedType: FullType($Animal)) as $Animal; } } } @@ -202,4 +209,3 @@ class _$$AnimalSerializer implements PrimitiveSerializer<$Animal> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/api_response.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/api_response.dart index aadcd792e2bf..14e9ccff7852 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/api_response.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/api_response.dart @@ -11,9 +11,9 @@ part 'api_response.g.dart'; /// ApiResponse /// /// Properties: -/// * [code] -/// * [type] -/// * [message] +/// * [code] +/// * [type] +/// * [message] @BuiltValue() abstract class ApiResponse implements Built { @BuiltValueField(wireName: r'code') @@ -77,7 +77,9 @@ class _$ApiResponseSerializer implements PrimitiveSerializer { ApiResponse object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -141,4 +143,3 @@ class _$ApiResponseSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/apple.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/apple.dart index 02ca94190b96..fa77c28e614c 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/apple.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/apple.dart @@ -11,7 +11,7 @@ part 'apple.g.dart'; /// Apple /// /// Properties: -/// * [kind] +/// * [kind] @BuiltValue() abstract class Apple implements Built { @BuiltValueField(wireName: r'kind') @@ -55,7 +55,9 @@ class _$AppleSerializer implements PrimitiveSerializer { Apple object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$AppleSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_array_of_number_only.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_array_of_number_only.dart index 5bc0982b8ab0..0f51b17b901d 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_array_of_number_only.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/array_of_array_of_number_only.dart @@ -12,26 +12,35 @@ part 'array_of_array_of_number_only.g.dart'; /// ArrayOfArrayOfNumberOnly /// /// Properties: -/// * [arrayArrayNumber] +/// * [arrayArrayNumber] @BuiltValue() -abstract class ArrayOfArrayOfNumberOnly implements Built { +abstract class ArrayOfArrayOfNumberOnly + implements + Built { @BuiltValueField(wireName: r'ArrayArrayNumber') BuiltList>? get arrayArrayNumber; ArrayOfArrayOfNumberOnly._(); - factory ArrayOfArrayOfNumberOnly([void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = _$ArrayOfArrayOfNumberOnly; + factory ArrayOfArrayOfNumberOnly( + [void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = + _$ArrayOfArrayOfNumberOnly; @BuiltValueHook(initializeBuilder: true) static void _defaults(ArrayOfArrayOfNumberOnlyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayOfArrayOfNumberOnlySerializer(); + static Serializer get serializer => + _$ArrayOfArrayOfNumberOnlySerializer(); } -class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { +class _$ArrayOfArrayOfNumberOnlySerializer + implements PrimitiveSerializer { @override - final Iterable types = const [ArrayOfArrayOfNumberOnly, _$ArrayOfArrayOfNumberOnly]; + final Iterable types = const [ + ArrayOfArrayOfNumberOnly, + _$ArrayOfArrayOfNumberOnly + ]; @override final String wireName = r'ArrayOfArrayOfNumberOnly'; @@ -45,7 +54,9 @@ class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer>; result.arrayArrayNumber.replace(valueDes); break; @@ -106,4 +121,3 @@ class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { +abstract class ArrayOfNumberOnly + implements Built { @BuiltValueField(wireName: r'ArrayNumber') BuiltList? get arrayNumber; ArrayOfNumberOnly._(); - factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = _$ArrayOfNumberOnly; + factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = + _$ArrayOfNumberOnly; @BuiltValueHook(initializeBuilder: true) static void _defaults(ArrayOfNumberOnlyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayOfNumberOnlySerializer(); + static Serializer get serializer => + _$ArrayOfNumberOnlySerializer(); } -class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer { +class _$ArrayOfNumberOnlySerializer + implements PrimitiveSerializer { @override final Iterable types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly]; @@ -56,7 +60,9 @@ class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'array_of_string') @@ -61,14 +61,18 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { yield r'array_array_of_integer'; yield serializers.serialize( object.arrayArrayOfInteger, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(int)]) + ]), ); } if (object.arrayArrayOfModel != null) { yield r'array_array_of_model'; yield serializers.serialize( object.arrayArrayOfModel, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(ReadOnlyFirst)]) + ]), ); } } @@ -79,7 +83,9 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { ArrayTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -104,14 +110,18 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { case r'array_array_of_integer': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(int)]) + ]), ) as BuiltList>; result.arrayArrayOfInteger.replace(valueDes); break; case r'array_array_of_model': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(ReadOnlyFirst)]) + ]), ) as BuiltList>; result.arrayArrayOfModel.replace(valueDes); break; @@ -143,4 +153,3 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/banana.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/banana.dart index bf2d632ee114..00c090ee8727 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/banana.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/banana.dart @@ -11,7 +11,7 @@ part 'banana.g.dart'; /// Banana /// /// Properties: -/// * [count] +/// * [count] @BuiltValue() abstract class Banana implements Built { @BuiltValueField(wireName: r'count') @@ -55,7 +55,9 @@ class _$BananaSerializer implements PrimitiveSerializer { Banana object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$BananaSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar.dart index cb769550b4f2..ba6b35ebf7df 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar.dart @@ -13,10 +13,10 @@ part 'bar.g.dart'; /// Bar /// /// Properties: -/// * [id] -/// * [barPropA] -/// * [fooPropB] -/// * [foo] +/// * [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 @@ -37,7 +37,7 @@ abstract class Bar implements Entity, Built { factory Bar([void updates(BarBuilder b)]) = _$Bar; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(BarBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarSerializer(); @@ -117,7 +117,9 @@ class _$BarSerializer implements PrimitiveSerializer { Bar object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -216,4 +218,3 @@ class _$BarSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_create.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_create.dart index 8942b6433f5e..5d726a9957e4 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_create.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_create.dart @@ -13,9 +13,9 @@ part 'bar_create.g.dart'; /// BarCreate /// /// Properties: -/// * [barPropA] -/// * [fooPropB] -/// * [foo] +/// * [barPropA] +/// * [fooPropB] +/// * [foo] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -37,7 +37,7 @@ abstract class BarCreate implements Entity, Built { factory BarCreate([void updates(BarCreateBuilder b)]) = _$BarCreate; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarCreateBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(BarCreateBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarCreateSerializer(); @@ -117,7 +117,9 @@ class _$BarCreateSerializer implements PrimitiveSerializer { BarCreate object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -216,4 +218,3 @@ class _$BarCreateSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref.dart index 2b9d2727a448..f77429fa929b 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref.dart @@ -24,7 +24,7 @@ abstract class BarRef implements EntityRef, Built { factory BarRef([void updates(BarRefBuilder b)]) = _$BarRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarRefBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(BarRefBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarRefSerializer(); @@ -97,7 +97,9 @@ class _$BarRefSerializer implements PrimitiveSerializer { BarRef object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -189,4 +191,3 @@ class _$BarRefSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref_or_value.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref_or_value.dart index 4af61384ab76..eeb993907a02 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref_or_value.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/bar_ref_or_value.dart @@ -20,7 +20,8 @@ part 'bar_ref_or_value.g.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue() -abstract class BarRefOrValue implements Built { +abstract class BarRefOrValue + implements Built { /// One Of [Bar], [BarRef] OneOf get oneOf; @@ -33,36 +34,39 @@ abstract class BarRefOrValue implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$BarRefOrValueSerializer(); + static Serializer get serializer => + _$BarRefOrValueSerializer(); } extension BarRefOrValueDiscriminatorExt on BarRefOrValue { - String? get discriminatorValue { - if (this is Bar) { - return r'Bar'; - } - if (this is BarRef) { - return r'BarRef'; - } - return null; + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; } + if (this is BarRef) { + return r'BarRef'; + } + return null; + } } + extension BarRefOrValueBuilderDiscriminatorExt on BarRefOrValueBuilder { - String? get discriminatorValue { - if (this is BarBuilder) { - return r'Bar'; - } - if (this is BarRefBuilder) { - return r'BarRef'; - } - return null; + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarRefBuilder) { + return r'BarRef'; } + return null; + } } class _$BarRefOrValueSerializer implements PrimitiveSerializer { @@ -76,8 +80,7 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { Serializers serializers, BarRefOrValue object, { FullType specifiedType = FullType.unspecified, - }) sync* { - } + }) sync* {} @override Object serialize( @@ -86,7 +89,8 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; } @override @@ -98,10 +102,15 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { final result = BarRefOrValueBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discIndex = + serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [Bar, BarRef, ]; + final oneOfTypes = [ + Bar, + BarRef, + ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -120,10 +129,13 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { oneOfType = BarRef; break; default: - throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/capitalization.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/capitalization.dart index 75827b9a429e..cbd4bf8cf926 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/capitalization.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/capitalization.dart @@ -11,14 +11,15 @@ part 'capitalization.g.dart'; /// Capitalization /// /// Properties: -/// * [smallCamel] -/// * [capitalCamel] -/// * [smallSnake] -/// * [capitalSnake] -/// * [sCAETHFlowPoints] -/// * [ATT_NAME] - Name of the pet +/// * [smallCamel] +/// * [capitalCamel] +/// * [smallSnake] +/// * [capitalSnake] +/// * [sCAETHFlowPoints] +/// * [ATT_NAME] - Name of the pet @BuiltValue() -abstract class Capitalization implements Built { +abstract class Capitalization + implements Built { @BuiltValueField(wireName: r'smallCamel') String? get smallCamel; @@ -34,22 +35,25 @@ abstract class Capitalization implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CapitalizationSerializer(); + static Serializer get serializer => + _$CapitalizationSerializer(); } -class _$CapitalizationSerializer implements PrimitiveSerializer { +class _$CapitalizationSerializer + implements PrimitiveSerializer { @override final Iterable types = const [Capitalization, _$Capitalization]; @@ -111,7 +115,9 @@ class _$CapitalizationSerializer implements PrimitiveSerializer Capitalization object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -196,4 +202,3 @@ class _$CapitalizationSerializer implements PrimitiveSerializer return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat.dart index 23d19b38b05a..ecc7facb059f 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat.dart @@ -13,9 +13,9 @@ part 'cat.g.dart'; /// Cat /// /// Properties: -/// * [className] -/// * [color] -/// * [declawed] +/// * [className] +/// * [color] +/// * [declawed] @BuiltValue() abstract class Cat implements Animal, CatAllOf, Built { Cat._(); @@ -23,8 +23,9 @@ abstract class Cat implements Animal, CatAllOf, Built { factory Cat([void updates(CatBuilder b)]) = _$Cat; @BuiltValueHook(initializeBuilder: true) - static void _defaults(CatBuilder b) => b..className=b.discriminatorValue - ..color = 'red'; + static void _defaults(CatBuilder b) => b + ..className = b.discriminatorValue + ..color = 'red'; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$CatSerializer(); @@ -69,7 +70,9 @@ class _$CatSerializer implements PrimitiveSerializer { Cat object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -133,4 +136,3 @@ class _$CatSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat_all_of.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat_all_of.dart index 02d9cce0cae1..18fd5b5ec591 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat_all_of.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/cat_all_of.dart @@ -11,9 +11,9 @@ part 'cat_all_of.g.dart'; /// CatAllOf /// /// Properties: -/// * [declawed] +/// * [declawed] @BuiltValue(instantiable: false) -abstract class CatAllOf { +abstract class CatAllOf { @BuiltValueField(wireName: r'declawed') bool? get declawed; @@ -48,7 +48,9 @@ class _$CatAllOfSerializer implements PrimitiveSerializer { CatAllOf object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -57,13 +59,15 @@ class _$CatAllOfSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($CatAllOf)) as $CatAllOf; + return serializers.deserialize(serialized, + specifiedType: FullType($CatAllOf)) as $CatAllOf; } } /// a concrete implementation of [CatAllOf], since [CatAllOf] is not instantiable @BuiltValue(instantiable: true) -abstract class $CatAllOf implements CatAllOf, Built<$CatAllOf, $CatAllOfBuilder> { +abstract class $CatAllOf + implements CatAllOf, Built<$CatAllOf, $CatAllOfBuilder> { $CatAllOf._(); factory $CatAllOf([void Function($CatAllOfBuilder)? updates]) = _$$CatAllOf; @@ -138,4 +142,3 @@ class _$$CatAllOfSerializer implements PrimitiveSerializer<$CatAllOf> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/category.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/category.dart index b2be985a8507..b580e36fc4dc 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/category.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/category.dart @@ -11,8 +11,8 @@ part 'category.g.dart'; /// Category /// /// Properties: -/// * [id] -/// * [name] +/// * [id] +/// * [name] @BuiltValue() abstract class Category implements Built { @BuiltValueField(wireName: r'id') @@ -66,7 +66,9 @@ class _$CategorySerializer implements PrimitiveSerializer { Category object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -123,4 +125,3 @@ class _$CategorySerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/child.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/child.dart index 987b52ca7240..dfc2ceaef1e6 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/child.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/child.dart @@ -11,7 +11,7 @@ part 'child.g.dart'; /// Child /// /// Properties: -/// * [name] +/// * [name] @BuiltValue() abstract class Child implements Built { @BuiltValueField(wireName: r'name') @@ -55,7 +55,9 @@ class _$ChildSerializer implements PrimitiveSerializer { Child object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ChildSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/class_model.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/class_model.dart index 51166943c6cd..74442b2e44ac 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/class_model.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/class_model.dart @@ -11,7 +11,7 @@ part 'class_model.g.dart'; /// Model for testing model with \"_class\" property /// /// Properties: -/// * [classField] +/// * [classField] @BuiltValue() abstract class ClassModel implements Built { @BuiltValueField(wireName: r'_class') @@ -55,7 +55,9 @@ class _$ClassModelSerializer implements PrimitiveSerializer { ClassModel object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ClassModelSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/deprecated_object.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/deprecated_object.dart index 91d0b428e9bb..d4e14dcc76b3 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/deprecated_object.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/deprecated_object.dart @@ -11,24 +11,28 @@ part 'deprecated_object.g.dart'; /// DeprecatedObject /// /// Properties: -/// * [name] +/// * [name] @BuiltValue() -abstract class DeprecatedObject implements Built { +abstract class DeprecatedObject + implements Built { @BuiltValueField(wireName: r'name') String? get name; DeprecatedObject._(); - factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = _$DeprecatedObject; + factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = + _$DeprecatedObject; @BuiltValueHook(initializeBuilder: true) static void _defaults(DeprecatedObjectBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$DeprecatedObjectSerializer(); + static Serializer get serializer => + _$DeprecatedObjectSerializer(); } -class _$DeprecatedObjectSerializer implements PrimitiveSerializer { +class _$DeprecatedObjectSerializer + implements PrimitiveSerializer { @override final Iterable types = const [DeprecatedObject, _$DeprecatedObject]; @@ -55,7 +59,9 @@ class _$DeprecatedObjectSerializer implements PrimitiveSerializer { Dog._(); @@ -23,8 +23,9 @@ abstract class Dog implements Animal, DogAllOf, Built { factory Dog([void updates(DogBuilder b)]) = _$Dog; @BuiltValueHook(initializeBuilder: true) - static void _defaults(DogBuilder b) => b..className=b.discriminatorValue - ..color = 'red'; + static void _defaults(DogBuilder b) => b + ..className = b.discriminatorValue + ..color = 'red'; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$DogSerializer(); @@ -69,7 +70,9 @@ class _$DogSerializer implements PrimitiveSerializer { Dog object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -133,4 +136,3 @@ class _$DogSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog_all_of.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog_all_of.dart index bd52567fa60a..28c95d93dcf2 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog_all_of.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/dog_all_of.dart @@ -11,9 +11,9 @@ part 'dog_all_of.g.dart'; /// DogAllOf /// /// Properties: -/// * [breed] +/// * [breed] @BuiltValue(instantiable: false) -abstract class DogAllOf { +abstract class DogAllOf { @BuiltValueField(wireName: r'breed') String? get breed; @@ -48,7 +48,9 @@ class _$DogAllOfSerializer implements PrimitiveSerializer { DogAllOf object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -57,13 +59,15 @@ class _$DogAllOfSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($DogAllOf)) as $DogAllOf; + return serializers.deserialize(serialized, + specifiedType: FullType($DogAllOf)) as $DogAllOf; } } /// a concrete implementation of [DogAllOf], since [DogAllOf] is not instantiable @BuiltValue(instantiable: true) -abstract class $DogAllOf implements DogAllOf, Built<$DogAllOf, $DogAllOfBuilder> { +abstract class $DogAllOf + implements DogAllOf, Built<$DogAllOf, $DogAllOfBuilder> { $DogAllOf._(); factory $DogAllOf([void Function($DogAllOfBuilder)? updates]) = _$$DogAllOf; @@ -138,4 +142,3 @@ class _$$DogAllOfSerializer implements PrimitiveSerializer<$DogAllOf> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity.dart index 7e27fab47387..56cc04c50eb0 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity.dart @@ -42,50 +42,51 @@ abstract class Entity implements Addressable, Extensible { } extension EntityDiscriminatorExt on Entity { - String? get discriminatorValue { - if (this is Bar) { - return r'Bar'; - } - if (this is BarCreate) { - return r'Bar_Create'; - } - if (this is Foo) { - return r'Foo'; - } - if (this is Pasta) { - return r'Pasta'; - } - if (this is Pizza) { - return r'Pizza'; - } - if (this is PizzaSpeziale) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; } + if (this is BarCreate) { + return r'Bar_Create'; + } + if (this is Foo) { + return r'Foo'; + } + if (this is Pasta) { + return r'Pasta'; + } + if (this is Pizza) { + return r'Pizza'; + } + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; + } } + extension EntityBuilderDiscriminatorExt on EntityBuilder { - String? get discriminatorValue { - if (this is BarBuilder) { - return r'Bar'; - } - if (this is BarCreateBuilder) { - return r'Bar_Create'; - } - if (this is FooBuilder) { - return r'Foo'; - } - if (this is PastaBuilder) { - return r'Pasta'; - } - if (this is PizzaBuilder) { - return r'Pizza'; - } - if (this is PizzaSpezialeBuilder) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; } + if (this is BarCreateBuilder) { + return r'Bar_Create'; + } + if (this is FooBuilder) { + return r'Foo'; + } + if (this is PastaBuilder) { + return r'Pasta'; + } + if (this is PizzaBuilder) { + return r'Pizza'; + } + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; + } } class _$EntitySerializer implements PrimitiveSerializer { @@ -157,9 +158,12 @@ class _$EntitySerializer implements PrimitiveSerializer { return serializers.serialize(object, specifiedType: FullType(Pizza))!; } if (object is PizzaSpeziale) { - return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + return serializers.serialize(object, + specifiedType: FullType(PizzaSpeziale))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -170,22 +174,30 @@ class _$EntitySerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Entity.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'Bar': - return serializers.deserialize(serialized, specifiedType: FullType(Bar)) as Bar; + return serializers.deserialize(serialized, specifiedType: FullType(Bar)) + as Bar; case r'Bar_Create': - return serializers.deserialize(serialized, specifiedType: FullType(BarCreate)) as BarCreate; + return serializers.deserialize(serialized, + specifiedType: FullType(BarCreate)) as BarCreate; case r'Foo': - return serializers.deserialize(serialized, specifiedType: FullType(Foo)) as Foo; + return serializers.deserialize(serialized, specifiedType: FullType(Foo)) + as Foo; case r'Pasta': - return serializers.deserialize(serialized, specifiedType: FullType(Pasta)) as Pasta; + return serializers.deserialize(serialized, + specifiedType: FullType(Pasta)) as Pasta; case r'Pizza': - return serializers.deserialize(serialized, specifiedType: FullType(Pizza)) as Pizza; + return serializers.deserialize(serialized, + specifiedType: FullType(Pizza)) as Pizza; case r'PizzaSpeziale': - return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + return serializers.deserialize(serialized, + specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; default: - return serializers.deserialize(serialized, specifiedType: FullType($Entity)) as $Entity; + return serializers.deserialize(serialized, + specifiedType: FullType($Entity)) as $Entity; } } } @@ -295,4 +307,3 @@ class _$$EntitySerializer implements PrimitiveSerializer<$Entity> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity_ref.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity_ref.dart index 7502c94dd7f3..669bbc6293bf 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity_ref.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/entity_ref.dart @@ -44,26 +44,27 @@ abstract class EntityRef implements Addressable, Extensible { } extension EntityRefDiscriminatorExt on EntityRef { - String? get discriminatorValue { - if (this is BarRef) { - return r'BarRef'; - } - if (this is FooRef) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is BarRef) { + return r'BarRef'; } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } } + extension EntityRefBuilderDiscriminatorExt on EntityRefBuilder { - String? get discriminatorValue { - if (this is BarRefBuilder) { - return r'BarRef'; - } - if (this is FooRefBuilder) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is BarRefBuilder) { + return r'BarRef'; } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; + } } class _$EntityRefSerializer implements PrimitiveSerializer { @@ -139,7 +140,9 @@ class _$EntityRefSerializer implements PrimitiveSerializer { if (object is FooRef) { return serializers.serialize(object, specifiedType: FullType(FooRef))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -149,25 +152,32 @@ class _$EntityRefSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discIndex = + serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'BarRef': - return serializers.deserialize(serialized, specifiedType: FullType(BarRef)) as BarRef; + return serializers.deserialize(serialized, + specifiedType: FullType(BarRef)) as BarRef; case r'FooRef': - return serializers.deserialize(serialized, specifiedType: FullType(FooRef)) as FooRef; + return serializers.deserialize(serialized, + specifiedType: FullType(FooRef)) as FooRef; default: - return serializers.deserialize(serialized, specifiedType: FullType($EntityRef)) as $EntityRef; + return serializers.deserialize(serialized, + specifiedType: FullType($EntityRef)) as $EntityRef; } } } /// a concrete implementation of [EntityRef], since [EntityRef] is not instantiable @BuiltValue(instantiable: true) -abstract class $EntityRef implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { +abstract class $EntityRef + implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { $EntityRef._(); - factory $EntityRef([void Function($EntityRefBuilder)? updates]) = _$$EntityRef; + factory $EntityRef([void Function($EntityRefBuilder)? updates]) = + _$$EntityRef; @BuiltValueHook(initializeBuilder: true) static void _defaults($EntityRefBuilder b) => b; @@ -281,4 +291,3 @@ class _$$EntityRefSerializer implements PrimitiveSerializer<$EntityRef> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_arrays.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_arrays.dart index b79a175e833c..2c8e3e6e4bb8 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_arrays.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_arrays.dart @@ -12,8 +12,8 @@ part 'enum_arrays.g.dart'; /// EnumArrays /// /// Properties: -/// * [justSymbol] -/// * [arrayEnum] +/// * [justSymbol] +/// * [arrayEnum] @BuiltValue() abstract class EnumArrays implements Built { @BuiltValueField(wireName: r'just_symbol') @@ -58,7 +58,8 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { yield r'array_enum'; yield serializers.serialize( object.arrayEnum, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + specifiedType: + const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), ); } } @@ -69,7 +70,9 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { EnumArrays object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -94,7 +97,8 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { case r'array_enum': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + specifiedType: + const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), ) as BuiltList; result.arrayEnum.replace(valueDes); break; @@ -128,36 +132,43 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { } class EnumArraysJustSymbolEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'>=') - static const EnumArraysJustSymbolEnum greaterThanEqual = _$enumArraysJustSymbolEnum_greaterThanEqual; + static const EnumArraysJustSymbolEnum greaterThanEqual = + _$enumArraysJustSymbolEnum_greaterThanEqual; @BuiltValueEnumConst(wireName: r'$') - static const EnumArraysJustSymbolEnum dollar = _$enumArraysJustSymbolEnum_dollar; + static const EnumArraysJustSymbolEnum dollar = + _$enumArraysJustSymbolEnum_dollar; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = _$enumArraysJustSymbolEnum_unknownDefaultOpenApi; + static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = + _$enumArraysJustSymbolEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumArraysJustSymbolEnumSerializer; + static Serializer get serializer => + _$enumArraysJustSymbolEnumSerializer; - const EnumArraysJustSymbolEnum._(String name): super(name); + const EnumArraysJustSymbolEnum._(String name) : super(name); - static BuiltSet get values => _$enumArraysJustSymbolEnumValues; - static EnumArraysJustSymbolEnum valueOf(String name) => _$enumArraysJustSymbolEnumValueOf(name); + static BuiltSet get values => + _$enumArraysJustSymbolEnumValues; + static EnumArraysJustSymbolEnum valueOf(String name) => + _$enumArraysJustSymbolEnumValueOf(name); } class EnumArraysArrayEnumEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'fish') static const EnumArraysArrayEnumEnum fish = _$enumArraysArrayEnumEnum_fish; @BuiltValueEnumConst(wireName: r'crab') static const EnumArraysArrayEnumEnum crab = _$enumArraysArrayEnumEnum_crab; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = _$enumArraysArrayEnumEnum_unknownDefaultOpenApi; + static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = + _$enumArraysArrayEnumEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumArraysArrayEnumEnumSerializer; + static Serializer get serializer => + _$enumArraysArrayEnumEnumSerializer; - const EnumArraysArrayEnumEnum._(String name): super(name); + const EnumArraysArrayEnumEnum._(String name) : super(name); - static BuiltSet get values => _$enumArraysArrayEnumEnumValues; - static EnumArraysArrayEnumEnum valueOf(String name) => _$enumArraysArrayEnumEnumValueOf(name); + static BuiltSet get values => + _$enumArraysArrayEnumEnumValues; + static EnumArraysArrayEnumEnum valueOf(String name) => + _$enumArraysArrayEnumEnumValueOf(name); } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_test.dart index 831f5b9d6d2d..effda132acdd 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/enum_test.dart @@ -16,14 +16,14 @@ part 'enum_test.g.dart'; /// EnumTest /// /// Properties: -/// * [enumString] -/// * [enumStringRequired] -/// * [enumInteger] -/// * [enumNumber] -/// * [outerEnum] -/// * [outerEnumInteger] -/// * [outerEnumDefaultValue] -/// * [outerEnumIntegerDefaultValue] +/// * [enumString] +/// * [enumStringRequired] +/// * [enumInteger] +/// * [enumNumber] +/// * [outerEnum] +/// * [outerEnumInteger] +/// * [outerEnumDefaultValue] +/// * [outerEnumIntegerDefaultValue] @BuiltValue() abstract class EnumTest implements Built { @BuiltValueField(wireName: r'enum_string') @@ -143,7 +143,9 @@ class _$EnumTestSerializer implements PrimitiveSerializer { EnumTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -245,7 +247,6 @@ class _$EnumTestSerializer implements PrimitiveSerializer { } class EnumTestEnumStringEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'UPPER') static const EnumTestEnumStringEnum UPPER = _$enumTestEnumStringEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') @@ -253,66 +254,85 @@ class EnumTestEnumStringEnum extends EnumClass { @BuiltValueEnumConst(wireName: r'') static const EnumTestEnumStringEnum empty = _$enumTestEnumStringEnum_empty; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumTestEnumStringEnum unknownDefaultOpenApi = _$enumTestEnumStringEnum_unknownDefaultOpenApi; + static const EnumTestEnumStringEnum unknownDefaultOpenApi = + _$enumTestEnumStringEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumStringEnumSerializer; + static Serializer get serializer => + _$enumTestEnumStringEnumSerializer; - const EnumTestEnumStringEnum._(String name): super(name); + const EnumTestEnumStringEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumStringEnumValues; - static EnumTestEnumStringEnum valueOf(String name) => _$enumTestEnumStringEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumStringEnumValues; + static EnumTestEnumStringEnum valueOf(String name) => + _$enumTestEnumStringEnumValueOf(name); } class EnumTestEnumStringRequiredEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'UPPER') - static const EnumTestEnumStringRequiredEnum UPPER = _$enumTestEnumStringRequiredEnum_UPPER; + static const EnumTestEnumStringRequiredEnum UPPER = + _$enumTestEnumStringRequiredEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') - static const EnumTestEnumStringRequiredEnum lower = _$enumTestEnumStringRequiredEnum_lower; + static const EnumTestEnumStringRequiredEnum lower = + _$enumTestEnumStringRequiredEnum_lower; @BuiltValueEnumConst(wireName: r'') - static const EnumTestEnumStringRequiredEnum empty = _$enumTestEnumStringRequiredEnum_empty; + static const EnumTestEnumStringRequiredEnum empty = + _$enumTestEnumStringRequiredEnum_empty; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi; + static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = + _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumStringRequiredEnumSerializer; + static Serializer get serializer => + _$enumTestEnumStringRequiredEnumSerializer; - const EnumTestEnumStringRequiredEnum._(String name): super(name); + const EnumTestEnumStringRequiredEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumStringRequiredEnumValues; - static EnumTestEnumStringRequiredEnum valueOf(String name) => _$enumTestEnumStringRequiredEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumStringRequiredEnumValues; + static EnumTestEnumStringRequiredEnum valueOf(String name) => + _$enumTestEnumStringRequiredEnumValueOf(name); } class EnumTestEnumIntegerEnum extends EnumClass { - @BuiltValueEnumConst(wireNumber: 1) - static const EnumTestEnumIntegerEnum number1 = _$enumTestEnumIntegerEnum_number1; + static const EnumTestEnumIntegerEnum number1 = + _$enumTestEnumIntegerEnum_number1; @BuiltValueEnumConst(wireNumber: -1) - static const EnumTestEnumIntegerEnum numberNegative1 = _$enumTestEnumIntegerEnum_numberNegative1; + static const EnumTestEnumIntegerEnum numberNegative1 = + _$enumTestEnumIntegerEnum_numberNegative1; @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) - static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = _$enumTestEnumIntegerEnum_unknownDefaultOpenApi; + static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = + _$enumTestEnumIntegerEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumIntegerEnumSerializer; + static Serializer get serializer => + _$enumTestEnumIntegerEnumSerializer; - const EnumTestEnumIntegerEnum._(String name): super(name); + const EnumTestEnumIntegerEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumIntegerEnumValues; - static EnumTestEnumIntegerEnum valueOf(String name) => _$enumTestEnumIntegerEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumIntegerEnumValues; + static EnumTestEnumIntegerEnum valueOf(String name) => + _$enumTestEnumIntegerEnumValueOf(name); } class EnumTestEnumNumberEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'1.1') - static const EnumTestEnumNumberEnum number1Period1 = _$enumTestEnumNumberEnum_number1Period1; + static const EnumTestEnumNumberEnum number1Period1 = + _$enumTestEnumNumberEnum_number1Period1; @BuiltValueEnumConst(wireName: r'-1.2') - static const EnumTestEnumNumberEnum numberNegative1Period2 = _$enumTestEnumNumberEnum_numberNegative1Period2; + static const EnumTestEnumNumberEnum numberNegative1Period2 = + _$enumTestEnumNumberEnum_numberNegative1Period2; @BuiltValueEnumConst(wireName: r'11184809', fallback: true) - static const EnumTestEnumNumberEnum unknownDefaultOpenApi = _$enumTestEnumNumberEnum_unknownDefaultOpenApi; + static const EnumTestEnumNumberEnum unknownDefaultOpenApi = + _$enumTestEnumNumberEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumNumberEnumSerializer; + static Serializer get serializer => + _$enumTestEnumNumberEnumSerializer; - const EnumTestEnumNumberEnum._(String name): super(name); + const EnumTestEnumNumberEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumNumberEnumValues; - static EnumTestEnumNumberEnum valueOf(String name) => _$enumTestEnumNumberEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumNumberEnumValues; + static EnumTestEnumNumberEnum valueOf(String name) => + _$enumTestEnumNumberEnumValueOf(name); } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example.dart index 799b77e4e178..27d7e939103c 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example.dart @@ -14,7 +14,7 @@ part 'example.g.dart'; /// Example /// /// Properties: -/// * [name] +/// * [name] @BuiltValue() abstract class Example implements Built { /// One Of [Child], [int] @@ -42,8 +42,7 @@ class _$ExampleSerializer implements PrimitiveSerializer { Serializers serializers, Example object, { FullType specifiedType = FullType.unspecified, - }) sync* { - } + }) sync* {} @override Object serialize( @@ -52,7 +51,8 @@ class _$ExampleSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; } @override @@ -63,10 +63,13 @@ class _$ExampleSerializer implements PrimitiveSerializer { }) { final result = ExampleBuilder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [FullType(Child), FullType(int), ]); + final targetType = const FullType(OneOf, [ + FullType(Child), + FullType(int), + ]); oneOfDataSrc = serialized; - result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, + specifiedType: targetType) as OneOf; return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example_non_primitive.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example_non_primitive.dart index b12eea1f234d..6812a9f2fc60 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example_non_primitive.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/example_non_primitive.dart @@ -12,24 +12,31 @@ part 'example_non_primitive.g.dart'; /// ExampleNonPrimitive @BuiltValue() -abstract class ExampleNonPrimitive implements Built { +abstract class ExampleNonPrimitive + implements Built { /// One Of [DateTime], [String], [int], [num] OneOf get oneOf; ExampleNonPrimitive._(); - factory ExampleNonPrimitive([void updates(ExampleNonPrimitiveBuilder b)]) = _$ExampleNonPrimitive; + factory ExampleNonPrimitive([void updates(ExampleNonPrimitiveBuilder b)]) = + _$ExampleNonPrimitive; @BuiltValueHook(initializeBuilder: true) static void _defaults(ExampleNonPrimitiveBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ExampleNonPrimitiveSerializer(); + static Serializer get serializer => + _$ExampleNonPrimitiveSerializer(); } -class _$ExampleNonPrimitiveSerializer implements PrimitiveSerializer { +class _$ExampleNonPrimitiveSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [ExampleNonPrimitive, _$ExampleNonPrimitive]; + final Iterable types = const [ + ExampleNonPrimitive, + _$ExampleNonPrimitive + ]; @override final String wireName = r'ExampleNonPrimitive'; @@ -38,8 +45,7 @@ class _$ExampleNonPrimitiveSerializer implements PrimitiveSerializer { Extensible object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -80,16 +82,19 @@ class _$ExtensibleSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($Extensible)) as $Extensible; + return serializers.deserialize(serialized, + specifiedType: FullType($Extensible)) as $Extensible; } } /// a concrete implementation of [Extensible], since [Extensible] is not instantiable @BuiltValue(instantiable: true) -abstract class $Extensible implements Extensible, Built<$Extensible, $ExtensibleBuilder> { +abstract class $Extensible + implements Extensible, Built<$Extensible, $ExtensibleBuilder> { $Extensible._(); - factory $Extensible([void Function($ExtensibleBuilder)? updates]) = _$$Extensible; + factory $Extensible([void Function($ExtensibleBuilder)? updates]) = + _$$Extensible; @BuiltValueHook(initializeBuilder: true) static void _defaults($ExtensibleBuilder b) => b; @@ -175,4 +180,3 @@ class _$$ExtensibleSerializer implements PrimitiveSerializer<$Extensible> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/file_schema_test_class.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/file_schema_test_class.dart index 5ab41d14f437..e28ed72311d5 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/file_schema_test_class.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/file_schema_test_class.dart @@ -13,10 +13,11 @@ part 'file_schema_test_class.g.dart'; /// FileSchemaTestClass /// /// Properties: -/// * [file] -/// * [files] +/// * [file] +/// * [files] @BuiltValue() -abstract class FileSchemaTestClass implements Built { +abstract class FileSchemaTestClass + implements Built { @BuiltValueField(wireName: r'file') ModelFile? get file; @@ -25,18 +26,24 @@ abstract class FileSchemaTestClass implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FileSchemaTestClassSerializer(); + static Serializer get serializer => + _$FileSchemaTestClassSerializer(); } -class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { +class _$FileSchemaTestClassSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [FileSchemaTestClass, _$FileSchemaTestClass]; + final Iterable types = const [ + FileSchemaTestClass, + _$FileSchemaTestClass + ]; @override final String wireName = r'FileSchemaTestClass'; @@ -68,7 +75,9 @@ class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { factory Foo([void updates(FooBuilder b)]) = _$Foo; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(FooBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooSerializer(); @@ -105,7 +105,9 @@ class _$FooSerializer implements PrimitiveSerializer { Foo object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -197,4 +199,3 @@ class _$FooSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref.dart index 1f77d990f0e8..e62d40ce6b2e 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref.dart @@ -12,7 +12,7 @@ part 'foo_ref.g.dart'; /// FooRef /// /// Properties: -/// * [foorefPropA] +/// * [foorefPropA] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -28,7 +28,7 @@ abstract class FooRef implements EntityRef, Built { factory FooRef([void updates(FooRefBuilder b)]) = _$FooRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooRefBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(FooRefBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooRefSerializer(); @@ -108,7 +108,9 @@ class _$FooRefSerializer implements PrimitiveSerializer { FooRef object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -207,4 +209,3 @@ class _$FooRefSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref_or_value.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref_or_value.dart index af3e4875d9d6..896800fb01f8 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref_or_value.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/foo_ref_or_value.dart @@ -20,7 +20,8 @@ part 'foo_ref_or_value.g.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue() -abstract class FooRefOrValue implements Built { +abstract class FooRefOrValue + implements Built { /// One Of [Foo], [FooRef] OneOf get oneOf; @@ -33,36 +34,39 @@ abstract class FooRefOrValue implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FooRefOrValueSerializer(); + static Serializer get serializer => + _$FooRefOrValueSerializer(); } extension FooRefOrValueDiscriminatorExt on FooRefOrValue { - String? get discriminatorValue { - if (this is Foo) { - return r'Foo'; - } - if (this is FooRef) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is Foo) { + return r'Foo'; } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } } + extension FooRefOrValueBuilderDiscriminatorExt on FooRefOrValueBuilder { - String? get discriminatorValue { - if (this is FooBuilder) { - return r'Foo'; - } - if (this is FooRefBuilder) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is FooBuilder) { + return r'Foo'; + } + if (this is FooRefBuilder) { + return r'FooRef'; } + return null; + } } class _$FooRefOrValueSerializer implements PrimitiveSerializer { @@ -76,8 +80,7 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { Serializers serializers, FooRefOrValue object, { FullType specifiedType = FullType.unspecified, - }) sync* { - } + }) sync* {} @override Object serialize( @@ -86,7 +89,8 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; } @override @@ -98,10 +102,15 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { final result = FooRefOrValueBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discIndex = + serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [Foo, FooRef, ]; + final oneOfTypes = [ + Foo, + FooRef, + ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -120,10 +129,13 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { oneOfType = FooRef; break; default: - throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/format_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/format_test.dart index 33775231476e..771056f35226 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/format_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/format_test.dart @@ -13,20 +13,20 @@ part 'format_test.g.dart'; /// FormatTest /// /// Properties: -/// * [integer] -/// * [int32] -/// * [int64] -/// * [number] -/// * [float] -/// * [double_] -/// * [decimal] -/// * [string] -/// * [byte] -/// * [binary] -/// * [date] -/// * [dateTime] -/// * [uuid] -/// * [password] +/// * [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. @BuiltValue() @@ -216,7 +216,9 @@ class _$FormatTestSerializer implements PrimitiveSerializer { FormatTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -371,4 +373,3 @@ class _$FormatTestSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/fruit.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/fruit.dart index 11f8cfa70501..5c31531d9e55 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/fruit.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/fruit.dart @@ -14,9 +14,9 @@ part 'fruit.g.dart'; /// Fruit /// /// Properties: -/// * [color] -/// * [kind] -/// * [count] +/// * [color] +/// * [kind] +/// * [count] @BuiltValue() abstract class Fruit implements Built { @BuiltValueField(wireName: r'color') @@ -64,8 +64,11 @@ class _$FruitSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); + final result = + _serializeProperties(serializers, object, specifiedType: specifiedType) + .toList(); + result.addAll(serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType)) as Iterable); return result; } @@ -104,7 +107,10 @@ class _$FruitSerializer implements PrimitiveSerializer { }) { final result = FruitBuilder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [FullType(Apple), FullType(Banana), ]); + final targetType = const FullType(OneOf, [ + FullType(Apple), + FullType(Banana), + ]); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -116,8 +122,8 @@ class _$FruitSerializer implements PrimitiveSerializer { result: result, ); oneOfDataSrc = unhandled; - result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, + specifiedType: targetType) as OneOf; return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/has_only_read_only.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/has_only_read_only.dart index 9683985cf198..9d2538bab52a 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/has_only_read_only.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/has_only_read_only.dart @@ -11,10 +11,11 @@ part 'has_only_read_only.g.dart'; /// HasOnlyReadOnly /// /// Properties: -/// * [bar] -/// * [foo] +/// * [bar] +/// * [foo] @BuiltValue() -abstract class HasOnlyReadOnly implements Built { +abstract class HasOnlyReadOnly + implements Built { @BuiltValueField(wireName: r'bar') String? get bar; @@ -23,16 +24,19 @@ abstract class HasOnlyReadOnly implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$HasOnlyReadOnlySerializer(); + static Serializer get serializer => + _$HasOnlyReadOnlySerializer(); } -class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { +class _$HasOnlyReadOnlySerializer + implements PrimitiveSerializer { @override final Iterable types = const [HasOnlyReadOnly, _$HasOnlyReadOnly]; @@ -66,7 +70,9 @@ class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { +abstract class HealthCheckResult + implements Built { @BuiltValueField(wireName: r'NullableMessage') String? get nullableMessage; HealthCheckResult._(); - factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = _$HealthCheckResult; + factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = + _$HealthCheckResult; @BuiltValueHook(initializeBuilder: true) static void _defaults(HealthCheckResultBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$HealthCheckResultSerializer(); + static Serializer get serializer => + _$HealthCheckResultSerializer(); } -class _$HealthCheckResultSerializer implements PrimitiveSerializer { +class _$HealthCheckResultSerializer + implements PrimitiveSerializer { @override final Iterable types = const [HealthCheckResult, _$HealthCheckResult]; @@ -55,7 +59,9 @@ class _$HealthCheckResultSerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'map_map_of_string') @@ -58,28 +58,34 @@ class _$MapTestSerializer implements PrimitiveSerializer { yield r'map_map_of_string'; yield serializers.serialize( object.mapMapOfString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + specifiedType: const FullType(BuiltMap, [ + FullType(String), + FullType(BuiltMap, [FullType(String), FullType(String)]) + ]), ); } if (object.mapOfEnumString != null) { yield r'map_of_enum_string'; yield serializers.serialize( object.mapOfEnumString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + specifiedType: const FullType( + BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), ); } if (object.directMap != null) { yield r'direct_map'; yield serializers.serialize( object.directMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ); } if (object.indirectMap != null) { yield r'indirect_map'; yield serializers.serialize( object.indirectMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ); } } @@ -90,7 +96,9 @@ class _$MapTestSerializer implements PrimitiveSerializer { MapTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -108,28 +116,34 @@ class _$MapTestSerializer implements PrimitiveSerializer { case r'map_map_of_string': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + specifiedType: const FullType(BuiltMap, [ + FullType(String), + FullType(BuiltMap, [FullType(String), FullType(String)]) + ]), ) as BuiltMap>; result.mapMapOfString.replace(valueDes); break; case r'map_of_enum_string': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + specifiedType: const FullType(BuiltMap, + [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), ) as BuiltMap; result.mapOfEnumString.replace(valueDes); break; case r'direct_map': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ) as BuiltMap; result.directMap.replace(valueDes); break; case r'indirect_map': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ) as BuiltMap; result.indirectMap.replace(valueDes); break; @@ -163,19 +177,23 @@ class _$MapTestSerializer implements PrimitiveSerializer { } class MapTestMapOfEnumStringEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'UPPER') - static const MapTestMapOfEnumStringEnum UPPER = _$mapTestMapOfEnumStringEnum_UPPER; + static const MapTestMapOfEnumStringEnum UPPER = + _$mapTestMapOfEnumStringEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') - static const MapTestMapOfEnumStringEnum lower = _$mapTestMapOfEnumStringEnum_lower; + static const MapTestMapOfEnumStringEnum lower = + _$mapTestMapOfEnumStringEnum_lower; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const MapTestMapOfEnumStringEnum unknownDefaultOpenApi = _$mapTestMapOfEnumStringEnum_unknownDefaultOpenApi; + static const MapTestMapOfEnumStringEnum unknownDefaultOpenApi = + _$mapTestMapOfEnumStringEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$mapTestMapOfEnumStringEnumSerializer; + static Serializer get serializer => + _$mapTestMapOfEnumStringEnumSerializer; - const MapTestMapOfEnumStringEnum._(String name): super(name); + const MapTestMapOfEnumStringEnum._(String name) : super(name); - static BuiltSet get values => _$mapTestMapOfEnumStringEnumValues; - static MapTestMapOfEnumStringEnum valueOf(String name) => _$mapTestMapOfEnumStringEnumValueOf(name); + static BuiltSet get values => + _$mapTestMapOfEnumStringEnumValues; + static MapTestMapOfEnumStringEnum valueOf(String name) => + _$mapTestMapOfEnumStringEnumValueOf(name); } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart index 76b5933ae5a7..0d85f7d589aa 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -13,11 +13,14 @@ part 'mixed_properties_and_additional_properties_class.g.dart'; /// MixedPropertiesAndAdditionalPropertiesClass /// /// Properties: -/// * [uuid] -/// * [dateTime] -/// * [map] +/// * [uuid] +/// * [dateTime] +/// * [map] @BuiltValue() -abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built { +abstract class MixedPropertiesAndAdditionalPropertiesClass + implements + Built { @BuiltValueField(wireName: r'uuid') String? get uuid; @@ -29,18 +32,29 @@ abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built b; + static void _defaults(MixedPropertiesAndAdditionalPropertiesClassBuilder b) => + b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); + static Serializer + get serializer => + _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); } -class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements PrimitiveSerializer { +class _$MixedPropertiesAndAdditionalPropertiesClassSerializer + implements + PrimitiveSerializer { @override - final Iterable types = const [MixedPropertiesAndAdditionalPropertiesClass, _$MixedPropertiesAndAdditionalPropertiesClass]; + final Iterable types = const [ + MixedPropertiesAndAdditionalPropertiesClass, + _$MixedPropertiesAndAdditionalPropertiesClass + ]; @override final String wireName = r'MixedPropertiesAndAdditionalPropertiesClass'; @@ -68,7 +82,8 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti yield r'map'; yield serializers.serialize( object.map, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(Animal)]), ); } } @@ -79,7 +94,9 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti MixedPropertiesAndAdditionalPropertiesClass object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -111,7 +128,8 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti case r'map': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(Animal)]), ) as BuiltMap; result.map.replace(valueDes); break; @@ -143,4 +161,3 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model200_response.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model200_response.dart index 0a2cfb4411ac..b9f7146fd0e8 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model200_response.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model200_response.dart @@ -11,10 +11,11 @@ part 'model200_response.g.dart'; /// Model for testing model name starting with number /// /// Properties: -/// * [name] -/// * [classField] +/// * [name] +/// * [classField] @BuiltValue() -abstract class Model200Response implements Built { +abstract class Model200Response + implements Built { @BuiltValueField(wireName: r'name') int? get name; @@ -23,16 +24,19 @@ abstract class Model200Response implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$Model200ResponseSerializer(); + static Serializer get serializer => + _$Model200ResponseSerializer(); } -class _$Model200ResponseSerializer implements PrimitiveSerializer { +class _$Model200ResponseSerializer + implements PrimitiveSerializer { @override final Iterable types = const [Model200Response, _$Model200Response]; @@ -66,7 +70,9 @@ class _$Model200ResponseSerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'client') @@ -55,7 +55,9 @@ class _$ModelClientSerializer implements PrimitiveSerializer { ModelClient object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ModelClientSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_enum_class.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_enum_class.dart index ac609bfd15ad..02835bd779f5 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_enum_class.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_enum_class.dart @@ -10,19 +10,20 @@ import 'package:built_value/serializer.dart'; part 'model_enum_class.g.dart'; class ModelEnumClass extends EnumClass { - @BuiltValueEnumConst(wireName: r'_abc') static const ModelEnumClass abc = _$abc; @BuiltValueEnumConst(wireName: r'-efg') static const ModelEnumClass efg = _$efg; @BuiltValueEnumConst(wireName: r'(xyz)') - static const ModelEnumClass leftParenthesisXyzRightParenthesis = _$leftParenthesisXyzRightParenthesis; + static const ModelEnumClass leftParenthesisXyzRightParenthesis = + _$leftParenthesisXyzRightParenthesis; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) static const ModelEnumClass unknownDefaultOpenApi = _$unknownDefaultOpenApi; - static Serializer get serializer => _$modelEnumClassSerializer; + static Serializer get serializer => + _$modelEnumClassSerializer; - const ModelEnumClass._(String name): super(name); + const ModelEnumClass._(String name) : super(name); static BuiltSet get values => _$values; static ModelEnumClass valueOf(String name) => _$valueOf(name); @@ -35,4 +36,3 @@ class ModelEnumClass extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class ModelEnumClassMixin = Object with _$ModelEnumClassMixin; - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_file.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_file.dart index 2702c21d36f2..a74db4217b29 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_file.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_file.dart @@ -56,7 +56,9 @@ class _$ModelFileSerializer implements PrimitiveSerializer { ModelFile object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -106,4 +108,3 @@ class _$ModelFileSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_list.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_list.dart index 579853258f8e..fbea6fe8232c 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_list.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_list.dart @@ -11,7 +11,7 @@ part 'model_list.g.dart'; /// ModelList /// /// Properties: -/// * [n123list] +/// * [n123list] @BuiltValue() abstract class ModelList implements Built { @BuiltValueField(wireName: r'123-list') @@ -55,7 +55,9 @@ class _$ModelListSerializer implements PrimitiveSerializer { ModelList object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ModelListSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_return.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_return.dart index 45a2f67f8a40..46770cac8e9e 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_return.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/model_return.dart @@ -11,7 +11,7 @@ part 'model_return.g.dart'; /// Model for testing reserved words /// /// Properties: -/// * [return_] +/// * [return_] @BuiltValue() abstract class ModelReturn implements Built { @BuiltValueField(wireName: r'return') @@ -55,7 +55,9 @@ class _$ModelReturnSerializer implements PrimitiveSerializer { ModelReturn object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ModelReturnSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/name.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/name.dart index 10fa99e6a5f7..12531dce5470 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/name.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/name.dart @@ -11,10 +11,10 @@ part 'name.g.dart'; /// Model for testing model name same as property name /// /// Properties: -/// * [name] -/// * [snakeCase] -/// * [property] -/// * [n123number] +/// * [name] +/// * [snakeCase] +/// * [property] +/// * [n123number] @BuiltValue() abstract class Name implements Built { @BuiltValueField(wireName: r'name') @@ -86,7 +86,9 @@ class _$NameSerializer implements PrimitiveSerializer { Name object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -157,4 +159,3 @@ class _$NameSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/nullable_class.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/nullable_class.dart index c993a41303f0..ff124c21bf20 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/nullable_class.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/nullable_class.dart @@ -14,20 +14,21 @@ part 'nullable_class.g.dart'; /// NullableClass /// /// Properties: -/// * [integerProp] -/// * [numberProp] -/// * [booleanProp] -/// * [stringProp] -/// * [dateProp] -/// * [datetimeProp] -/// * [arrayNullableProp] -/// * [arrayAndItemsNullableProp] -/// * [arrayItemsNullable] -/// * [objectNullableProp] -/// * [objectAndItemsNullableProp] -/// * [objectItemsNullable] +/// * [integerProp] +/// * [numberProp] +/// * [booleanProp] +/// * [stringProp] +/// * [dateProp] +/// * [datetimeProp] +/// * [arrayNullableProp] +/// * [arrayAndItemsNullableProp] +/// * [arrayItemsNullable] +/// * [objectNullableProp] +/// * [objectAndItemsNullableProp] +/// * [objectItemsNullable] @BuiltValue() -abstract class NullableClass implements Built { +abstract class NullableClass + implements Built { @BuiltValueField(wireName: r'integer_prop') int? get integerProp; @@ -66,13 +67,15 @@ abstract class NullableClass implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$NullableClassSerializer(); + static Serializer get serializer => + _$NullableClassSerializer(); } class _$NullableClassSerializer implements PrimitiveSerializer { @@ -133,42 +136,48 @@ class _$NullableClassSerializer implements PrimitiveSerializer { yield r'array_nullable_prop'; yield serializers.serialize( object.arrayNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + specifiedType: + const FullType.nullable(BuiltList, [FullType(JsonObject)]), ); } if (object.arrayAndItemsNullableProp != null) { yield r'array_and_items_nullable_prop'; yield serializers.serialize( object.arrayAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: + const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), ); } if (object.arrayItemsNullable != null) { yield r'array_items_nullable'; yield serializers.serialize( object.arrayItemsNullable, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: + const FullType(BuiltList, [FullType.nullable(JsonObject)]), ); } if (object.objectNullableProp != null) { yield r'object_nullable_prop'; yield serializers.serialize( object.objectNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType(JsonObject)]), ); } if (object.objectAndItemsNullableProp != null) { yield r'object_and_items_nullable_prop'; yield serializers.serialize( object.objectAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ); } if (object.objectItemsNullable != null) { yield r'object_items_nullable'; yield serializers.serialize( object.objectItemsNullable, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ); } } @@ -179,7 +188,9 @@ class _$NullableClassSerializer implements PrimitiveSerializer { NullableClass object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -245,7 +256,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + specifiedType: + const FullType.nullable(BuiltList, [FullType(JsonObject)]), ) as BuiltList?; if (valueDes == null) continue; result.arrayNullableProp.replace(valueDes); @@ -253,7 +265,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_and_items_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltList, [FullType.nullable(JsonObject)]), ) as BuiltList?; if (valueDes == null) continue; result.arrayAndItemsNullableProp.replace(valueDes); @@ -261,14 +274,16 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_items_nullable': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: + const FullType(BuiltList, [FullType.nullable(JsonObject)]), ) as BuiltList; result.arrayItemsNullable.replace(valueDes); break; case r'object_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType(JsonObject)]), ) as BuiltMap?; if (valueDes == null) continue; result.objectNullableProp.replace(valueDes); @@ -276,7 +291,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'object_and_items_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ) as BuiltMap?; if (valueDes == null) continue; result.objectAndItemsNullableProp.replace(valueDes); @@ -284,7 +300,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'object_items_nullable': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ) as BuiltMap; result.objectItemsNullable.replace(valueDes); break; @@ -316,4 +333,3 @@ class _$NullableClassSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/number_only.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/number_only.dart index 482a95f3e521..bc854c85003b 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/number_only.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/number_only.dart @@ -11,7 +11,7 @@ part 'number_only.g.dart'; /// NumberOnly /// /// Properties: -/// * [justNumber] +/// * [justNumber] @BuiltValue() abstract class NumberOnly implements Built { @BuiltValueField(wireName: r'JustNumber') @@ -55,7 +55,9 @@ class _$NumberOnlySerializer implements PrimitiveSerializer { NumberOnly object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$NumberOnlySerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/object_with_deprecated_fields.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/object_with_deprecated_fields.dart index 90f4df85934f..de8620fcf22a 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/object_with_deprecated_fields.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/object_with_deprecated_fields.dart @@ -14,12 +14,14 @@ part 'object_with_deprecated_fields.g.dart'; /// ObjectWithDeprecatedFields /// /// Properties: -/// * [uuid] -/// * [id] -/// * [deprecatedRef] -/// * [bars] +/// * [uuid] +/// * [id] +/// * [deprecatedRef] +/// * [bars] @BuiltValue() -abstract class ObjectWithDeprecatedFields implements Built { +abstract class ObjectWithDeprecatedFields + implements + Built { @BuiltValueField(wireName: r'uuid') String? get uuid; @@ -34,18 +36,25 @@ abstract class ObjectWithDeprecatedFields implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ObjectWithDeprecatedFieldsSerializer(); + static Serializer get serializer => + _$ObjectWithDeprecatedFieldsSerializer(); } -class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { +class _$ObjectWithDeprecatedFieldsSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [ObjectWithDeprecatedFields, _$ObjectWithDeprecatedFields]; + final Iterable types = const [ + ObjectWithDeprecatedFields, + _$ObjectWithDeprecatedFields + ]; @override final String wireName = r'ObjectWithDeprecatedFields'; @@ -91,7 +100,9 @@ class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'id') @@ -45,8 +45,7 @@ abstract class Order implements Built { factory Order([void updates(OrderBuilder b)]) = _$Order; @BuiltValueHook(initializeBuilder: true) - static void _defaults(OrderBuilder b) => b - ..complete = false; + static void _defaults(OrderBuilder b) => b..complete = false; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$OrderSerializer(); @@ -114,7 +113,9 @@ class _$OrderSerializer implements PrimitiveSerializer { Order object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -201,25 +202,28 @@ class _$OrderSerializer implements PrimitiveSerializer { } class OrderStatusEnum extends EnumClass { - /// Order Status @BuiltValueEnumConst(wireName: r'placed') static const OrderStatusEnum placed = _$orderStatusEnum_placed; + /// Order Status @BuiltValueEnumConst(wireName: r'approved') static const OrderStatusEnum approved = _$orderStatusEnum_approved; + /// Order Status @BuiltValueEnumConst(wireName: r'delivered') static const OrderStatusEnum delivered = _$orderStatusEnum_delivered; + /// Order Status @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const OrderStatusEnum unknownDefaultOpenApi = _$orderStatusEnum_unknownDefaultOpenApi; + static const OrderStatusEnum unknownDefaultOpenApi = + _$orderStatusEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$orderStatusEnumSerializer; + static Serializer get serializer => + _$orderStatusEnumSerializer; - const OrderStatusEnum._(String name): super(name); + const OrderStatusEnum._(String name) : super(name); static BuiltSet get values => _$orderStatusEnumValues; static OrderStatusEnum valueOf(String name) => _$orderStatusEnumValueOf(name); } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_composite.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_composite.dart index 0d6341cc1299..899262513eb7 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_composite.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_composite.dart @@ -11,11 +11,12 @@ part 'outer_composite.g.dart'; /// OuterComposite /// /// Properties: -/// * [myNumber] -/// * [myString] -/// * [myBoolean] +/// * [myNumber] +/// * [myString] +/// * [myBoolean] @BuiltValue() -abstract class OuterComposite implements Built { +abstract class OuterComposite + implements Built { @BuiltValueField(wireName: r'my_number') num? get myNumber; @@ -27,16 +28,19 @@ abstract class OuterComposite implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OuterCompositeSerializer(); + static Serializer get serializer => + _$OuterCompositeSerializer(); } -class _$OuterCompositeSerializer implements PrimitiveSerializer { +class _$OuterCompositeSerializer + implements PrimitiveSerializer { @override final Iterable types = const [OuterComposite, _$OuterComposite]; @@ -77,7 +81,9 @@ class _$OuterCompositeSerializer implements PrimitiveSerializer OuterComposite object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -141,4 +147,3 @@ class _$OuterCompositeSerializer implements PrimitiveSerializer return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum.dart index 5ad5d8009bdf..bf08d4aa048d 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum.g.dart'; class OuterEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'placed') static const OuterEnum placed = _$placed; @BuiltValueEnumConst(wireName: r'approved') @@ -22,7 +21,7 @@ class OuterEnum extends EnumClass { static Serializer get serializer => _$outerEnumSerializer; - const OuterEnum._(String name): super(name); + const OuterEnum._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnum valueOf(String name) => _$valueOf(name); @@ -35,4 +34,3 @@ class OuterEnum extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class OuterEnumMixin = Object with _$OuterEnumMixin; - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_default_value.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_default_value.dart index 62c3cefe8456..446e5c2fed2d 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_default_value.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_default_value.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_default_value.g.dart'; class OuterEnumDefaultValue extends EnumClass { - @BuiltValueEnumConst(wireName: r'placed') static const OuterEnumDefaultValue placed = _$placed; @BuiltValueEnumConst(wireName: r'approved') @@ -18,11 +17,13 @@ class OuterEnumDefaultValue extends EnumClass { @BuiltValueEnumConst(wireName: r'delivered') static const OuterEnumDefaultValue delivered = _$delivered; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const OuterEnumDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + static const OuterEnumDefaultValue unknownDefaultOpenApi = + _$unknownDefaultOpenApi; - static Serializer get serializer => _$outerEnumDefaultValueSerializer; + static Serializer get serializer => + _$outerEnumDefaultValueSerializer; - const OuterEnumDefaultValue._(String name): super(name); + const OuterEnumDefaultValue._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnumDefaultValue valueOf(String name) => _$valueOf(name); @@ -34,5 +35,5 @@ class OuterEnumDefaultValue extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumDefaultValueMixin = Object with _$OuterEnumDefaultValueMixin; - +abstract class OuterEnumDefaultValueMixin = Object + with _$OuterEnumDefaultValueMixin; diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer.dart index 988b30785d30..d42a7baf5dbd 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_integer.g.dart'; class OuterEnumInteger extends EnumClass { - @BuiltValueEnumConst(wireNumber: 0) static const OuterEnumInteger number0 = _$number0; @BuiltValueEnumConst(wireNumber: 1) @@ -20,9 +19,10 @@ class OuterEnumInteger extends EnumClass { @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) static const OuterEnumInteger unknownDefaultOpenApi = _$unknownDefaultOpenApi; - static Serializer get serializer => _$outerEnumIntegerSerializer; + static Serializer get serializer => + _$outerEnumIntegerSerializer; - const OuterEnumInteger._(String name): super(name); + const OuterEnumInteger._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnumInteger valueOf(String name) => _$valueOf(name); @@ -35,4 +35,3 @@ class OuterEnumInteger extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class OuterEnumIntegerMixin = Object with _$OuterEnumIntegerMixin; - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer_default_value.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer_default_value.dart index 3fe792cedbe9..33b46287a86b 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer_default_value.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_enum_integer_default_value.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_integer_default_value.g.dart'; class OuterEnumIntegerDefaultValue extends EnumClass { - @BuiltValueEnumConst(wireNumber: 0) static const OuterEnumIntegerDefaultValue number0 = _$number0; @BuiltValueEnumConst(wireNumber: 1) @@ -18,11 +17,13 @@ class OuterEnumIntegerDefaultValue extends EnumClass { @BuiltValueEnumConst(wireNumber: 2) static const OuterEnumIntegerDefaultValue number2 = _$number2; @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) - static const OuterEnumIntegerDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + static const OuterEnumIntegerDefaultValue unknownDefaultOpenApi = + _$unknownDefaultOpenApi; - static Serializer get serializer => _$outerEnumIntegerDefaultValueSerializer; + static Serializer get serializer => + _$outerEnumIntegerDefaultValueSerializer; - const OuterEnumIntegerDefaultValue._(String name): super(name); + const OuterEnumIntegerDefaultValue._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnumIntegerDefaultValue valueOf(String name) => _$valueOf(name); @@ -34,5 +35,5 @@ class OuterEnumIntegerDefaultValue extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumIntegerDefaultValueMixin = Object with _$OuterEnumIntegerDefaultValueMixin; - +abstract class OuterEnumIntegerDefaultValueMixin = Object + with _$OuterEnumIntegerDefaultValueMixin; diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_object_with_enum_property.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_object_with_enum_property.dart index 173329856452..43dddcba352f 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_object_with_enum_property.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/outer_object_with_enum_property.dart @@ -12,27 +12,36 @@ part 'outer_object_with_enum_property.g.dart'; /// OuterObjectWithEnumProperty /// /// Properties: -/// * [value] +/// * [value] @BuiltValue() -abstract class OuterObjectWithEnumProperty implements Built { +abstract class OuterObjectWithEnumProperty + implements + Built { @BuiltValueField(wireName: r'value') OuterEnumInteger get value; // enum valueEnum { 0, 1, 2, }; OuterObjectWithEnumProperty._(); - factory OuterObjectWithEnumProperty([void updates(OuterObjectWithEnumPropertyBuilder b)]) = _$OuterObjectWithEnumProperty; + factory OuterObjectWithEnumProperty( + [void updates(OuterObjectWithEnumPropertyBuilder b)]) = + _$OuterObjectWithEnumProperty; @BuiltValueHook(initializeBuilder: true) static void _defaults(OuterObjectWithEnumPropertyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OuterObjectWithEnumPropertySerializer(); + static Serializer get serializer => + _$OuterObjectWithEnumPropertySerializer(); } -class _$OuterObjectWithEnumPropertySerializer implements PrimitiveSerializer { +class _$OuterObjectWithEnumPropertySerializer + implements PrimitiveSerializer { @override - final Iterable types = const [OuterObjectWithEnumProperty, _$OuterObjectWithEnumProperty]; + final Iterable types = const [ + OuterObjectWithEnumProperty, + _$OuterObjectWithEnumProperty + ]; @override final String wireName = r'OuterObjectWithEnumProperty'; @@ -55,7 +64,9 @@ class _$OuterObjectWithEnumPropertySerializer implements PrimitiveSerializer { factory Pasta([void updates(PastaBuilder b)]) = _$Pasta; @BuiltValueHook(initializeBuilder: true) - static void _defaults(PastaBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(PastaBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$PastaSerializer(); @@ -94,7 +94,9 @@ class _$PastaSerializer implements PrimitiveSerializer { Pasta object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -179,4 +181,3 @@ class _$PastaSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pet.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pet.dart index aeb788e8f7ff..6c377470f4a6 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pet.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pet.dart @@ -14,11 +14,11 @@ part 'pet.g.dart'; /// Pet /// /// Properties: -/// * [id] -/// * [name] -/// * [category] -/// * [photoUrls] -/// * [tags] +/// * [id] +/// * [name] +/// * [category] +/// * [photoUrls] +/// * [tags] /// * [status] - pet status in the store @BuiltValue() abstract class Pet implements Built { @@ -111,7 +111,9 @@ class _$PetSerializer implements PrimitiveSerializer { Pet object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -198,25 +200,27 @@ class _$PetSerializer implements PrimitiveSerializer { } class PetStatusEnum extends EnumClass { - /// pet status in the store @BuiltValueEnumConst(wireName: r'available') static const PetStatusEnum available = _$petStatusEnum_available; + /// pet status in the store @BuiltValueEnumConst(wireName: r'pending') static const PetStatusEnum pending = _$petStatusEnum_pending; + /// pet status in the store @BuiltValueEnumConst(wireName: r'sold') static const PetStatusEnum sold = _$petStatusEnum_sold; + /// pet status in the store @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const PetStatusEnum unknownDefaultOpenApi = _$petStatusEnum_unknownDefaultOpenApi; + static const PetStatusEnum unknownDefaultOpenApi = + _$petStatusEnum_unknownDefaultOpenApi; static Serializer get serializer => _$petStatusEnumSerializer; - const PetStatusEnum._(String name): super(name); + const PetStatusEnum._(String name) : super(name); static BuiltSet get values => _$petStatusEnumValues; static PetStatusEnum valueOf(String name) => _$petStatusEnumValueOf(name); } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza.dart index 14c06db06d7e..ca079abe8549 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza.dart @@ -13,7 +13,7 @@ part 'pizza.g.dart'; /// Pizza /// /// Properties: -/// * [pizzaSize] +/// * [pizzaSize] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -35,20 +35,21 @@ abstract class Pizza implements Entity { } extension PizzaDiscriminatorExt on Pizza { - String? get discriminatorValue { - if (this is PizzaSpeziale) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; } + return null; + } } + extension PizzaBuilderDiscriminatorExt on PizzaBuilder { - String? get discriminatorValue { - if (this is PizzaSpezialeBuilder) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; } + return null; + } } class _$PizzaSerializer implements PrimitiveSerializer { @@ -112,9 +113,12 @@ class _$PizzaSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { if (object is PizzaSpeziale) { - return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + return serializers.serialize(object, + specifiedType: FullType(PizzaSpeziale))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -125,12 +129,15 @@ class _$PizzaSerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Pizza.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'PizzaSpeziale': - return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + return serializers.deserialize(serialized, + specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; default: - return serializers.deserialize(serialized, specifiedType: FullType($Pizza)) as $Pizza; + return serializers.deserialize(serialized, + specifiedType: FullType($Pizza)) as $Pizza; } } } @@ -247,4 +254,3 @@ class _$$PizzaSerializer implements PrimitiveSerializer<$Pizza> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza_speziale.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza_speziale.dart index 673052cc8fcf..4c6fd7f38c26 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza_speziale.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/pizza_speziale.dart @@ -12,26 +12,30 @@ part 'pizza_speziale.g.dart'; /// PizzaSpeziale /// /// Properties: -/// * [toppings] +/// * [toppings] /// * [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 @BuiltValue() -abstract class PizzaSpeziale implements Pizza, Built { +abstract class PizzaSpeziale + implements Pizza, Built { @BuiltValueField(wireName: r'toppings') String? get toppings; PizzaSpeziale._(); - factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = _$PizzaSpeziale; + factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = + _$PizzaSpeziale; @BuiltValueHook(initializeBuilder: true) - static void _defaults(PizzaSpezialeBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(PizzaSpezialeBuilder b) => + b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$PizzaSpezialeSerializer(); + static Serializer get serializer => + _$PizzaSpezialeSerializer(); } class _$PizzaSpezialeSerializer implements PrimitiveSerializer { @@ -101,7 +105,9 @@ class _$PizzaSpezialeSerializer implements PrimitiveSerializer { PizzaSpeziale object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -193,4 +199,3 @@ class _$PizzaSpezialeSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/read_only_first.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/read_only_first.dart index b619217ab3cb..b2501901295f 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/read_only_first.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/read_only_first.dart @@ -11,10 +11,11 @@ part 'read_only_first.g.dart'; /// ReadOnlyFirst /// /// Properties: -/// * [bar] -/// * [baz] +/// * [bar] +/// * [baz] @BuiltValue() -abstract class ReadOnlyFirst implements Built { +abstract class ReadOnlyFirst + implements Built { @BuiltValueField(wireName: r'bar') String? get bar; @@ -23,13 +24,15 @@ abstract class ReadOnlyFirst implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ReadOnlyFirstSerializer(); + static Serializer get serializer => + _$ReadOnlyFirstSerializer(); } class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { @@ -66,7 +69,9 @@ class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { ReadOnlyFirst object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -123,4 +128,3 @@ class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/single_ref_type.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/single_ref_type.dart index b51e77292e8e..5324d92a7831 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/single_ref_type.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/single_ref_type.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'single_ref_type.g.dart'; class SingleRefType extends EnumClass { - @BuiltValueEnumConst(wireName: r'admin') static const SingleRefType admin = _$admin; @BuiltValueEnumConst(wireName: r'user') @@ -20,7 +19,7 @@ class SingleRefType extends EnumClass { static Serializer get serializer => _$singleRefTypeSerializer; - const SingleRefType._(String name): super(name); + const SingleRefType._(String name) : super(name); static BuiltSet get values => _$values; static SingleRefType valueOf(String name) => _$valueOf(name); @@ -33,4 +32,3 @@ class SingleRefType extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class SingleRefTypeMixin = Object with _$SingleRefTypeMixin; - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/special_model_name.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/special_model_name.dart index fa860056b45d..c5a18443b89f 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/special_model_name.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/special_model_name.dart @@ -11,24 +11,28 @@ part 'special_model_name.g.dart'; /// SpecialModelName /// /// Properties: -/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] +/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] @BuiltValue() -abstract class SpecialModelName implements Built { +abstract class SpecialModelName + implements Built { @BuiltValueField(wireName: r'$special[property.name]') int? get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; SpecialModelName._(); - factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = _$SpecialModelName; + factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = + _$SpecialModelName; @BuiltValueHook(initializeBuilder: true) static void _defaults(SpecialModelNameBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$SpecialModelNameSerializer(); + static Serializer get serializer => + _$SpecialModelNameSerializer(); } -class _$SpecialModelNameSerializer implements PrimitiveSerializer { +class _$SpecialModelNameSerializer + implements PrimitiveSerializer { @override final Iterable types = const [SpecialModelName, _$SpecialModelName]; @@ -40,10 +44,13 @@ class _$SpecialModelNameSerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'id') @@ -66,7 +66,9 @@ class _$TagSerializer implements PrimitiveSerializer { Tag object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -123,4 +125,3 @@ class _$TagSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart index 62190487b0ce..43cf4b6c0d3f 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart @@ -12,29 +12,49 @@ part 'test_query_style_form_explode_true_array_string_query_object_parameter.g.d /// TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter /// /// Properties: -/// * [values] +/// * [values] @BuiltValue() -abstract class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter implements Built { +abstract class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + implements + Built { @BuiltValueField(wireName: r'values') BuiltList? get values; TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter._(); - factory TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter([void updates(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder b)]) = _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; + factory TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter( + [void updates( + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder + b)]) = + _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; @BuiltValueHook(initializeBuilder: true) - static void _defaults(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder b) => b; + static void _defaults( + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder + b) => + b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer(); + static Serializer< + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter> + get serializer => + _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer(); } -class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer implements PrimitiveSerializer { +class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer + implements + PrimitiveSerializer< + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter> { @override - final Iterable types = const [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter]; + final Iterable types = const [ + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, + _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + ]; @override - final String wireName = r'TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter'; + final String wireName = + r'TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter'; Iterable _serializeProperties( Serializers serializers, @@ -56,7 +76,9 @@ class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer i TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -64,7 +86,8 @@ class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer i Object serialized, { FullType specifiedType = FullType.unspecified, required List serializedList, - required TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder result, + required TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder + result, required List unhandled, }) { for (var i = 0; i < serializedList.length; i += 2) { @@ -92,7 +115,8 @@ class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer i Object serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); + final result = + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -106,4 +130,3 @@ class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer i return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/user.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/user.dart index f7577d7e1ee9..5d10005382ff 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/user.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/model/user.dart @@ -11,13 +11,13 @@ part 'user.g.dart'; /// User /// /// Properties: -/// * [id] -/// * [username] -/// * [firstName] -/// * [lastName] -/// * [email] -/// * [password] -/// * [phone] +/// * [id] +/// * [username] +/// * [firstName] +/// * [lastName] +/// * [email] +/// * [password] +/// * [phone] /// * [userStatus] - User Status @BuiltValue() abstract class User implements Built { @@ -133,7 +133,9 @@ class _$UserSerializer implements PrimitiveSerializer { User object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -232,4 +234,3 @@ class _$UserSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/serializers.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/serializers.dart index c693e7afc032..76baea9bd50a 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/serializers.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/serializers.dart @@ -86,9 +86,11 @@ part 'serializers.g.dart'; @SerializersFor([ AdditionalPropertiesClass, - Addressable,$Addressable, + Addressable, + $Addressable, AllOfWithSingleRef, - Animal,$Animal, + Animal, + $Animal, ApiResponse, Apple, ArrayOfArrayOfNumberOnly, @@ -101,20 +103,25 @@ part 'serializers.g.dart'; BarRefOrValue, Capitalization, Cat, - CatAllOf,$CatAllOf, + CatAllOf, + $CatAllOf, Category, Child, ClassModel, DeprecatedObject, Dog, - DogAllOf,$DogAllOf, - Entity,$Entity, - EntityRef,$EntityRef, + DogAllOf, + $DogAllOf, + Entity, + $Entity, + EntityRef, + $EntityRef, EnumArrays, EnumTest, Example, ExampleNonPrimitive, - Extensible,$Extensible, + Extensible, + $Extensible, FileSchemaTestClass, Foo, FooRef, @@ -144,7 +151,8 @@ part 'serializers.g.dart'; OuterObjectWithEnumProperty, Pasta, Pet, - Pizza,$Pizza, + Pizza, + $Pizza, PizzaSpeziale, ReadOnlyFirst, SingleRefType, diff --git a/samples/client/echo_api/dart/dart-dio-built_value/pubspec.yaml b/samples/client/echo_api/dart/dart-dio-built_value/pubspec.yaml index fb676f65c393..71e321cb7d8d 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/pubspec.yaml +++ b/samples/client/echo_api/dart/dart-dio-built_value/pubspec.yaml @@ -7,6 +7,7 @@ environment: sdk: '>=2.12.0 <3.0.0' dependencies: + dio: '>=4.0.1 <5.0.0' one_of: '>=1.5.0 <2.0.0' one_of_serializer: '>=1.5.0 <2.0.0' diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/additional_properties_class_test.dart index c231e6dc2807..0ee0559d710c 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/additional_properties_class_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/additional_properties_class_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `mapOfMapProperty`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/addressable_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/addressable_test.dart index 696e26e8e549..657f7ee74448 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/addressable_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/addressable_test.dart @@ -18,6 +18,5 @@ void main() { test('to test the property `id`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/all_of_with_single_ref_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/all_of_with_single_ref_test.dart index 64e241a4dce3..a423afab69b0 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/all_of_with_single_ref_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/all_of_with_single_ref_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `singleRefType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/animal_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/animal_test.dart index 39b8b59cdf51..023e09145fe3 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/animal_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/animal_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `color`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/api_response_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/api_response_test.dart index cf1a744cd629..9587579a4ab0 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/api_response_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/api_response_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `message`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/apple_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/apple_test.dart index 1d542169550d..0949f55b7247 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/apple_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/apple_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `kind`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_array_of_number_only_test.dart index a679a6c4223d..ad6d165e3c83 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_array_of_number_only_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_array_of_number_only_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `arrayArrayNumber`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_number_only_test.dart index cc648bc115c5..456681ced455 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_number_only_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/array_of_number_only_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `arrayNumber`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/array_test_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/array_test_test.dart index 210216f224b5..7b89588b2157 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/array_test_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/array_test_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `arrayArrayOfModel`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/banana_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/banana_test.dart index a883acc0a9e8..34f4c1ca36ed 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/banana_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/banana_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `count`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/bar_create_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_create_test.dart index 1bf90151be8b..050dcadfb0f9 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/bar_create_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_create_test.dart @@ -51,6 +51,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_or_value_test.dart index c132ac09943b..a6ceb001ec11 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_or_value_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_or_value_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_test.dart index 9c410b2b5c54..4a31ed0904b5 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_ref_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/bar_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_test.dart index dc6daaa3400d..616f922b5d14 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/bar_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/bar_test.dart @@ -50,6 +50,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/body_api_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/body_api_test.dart index 067b2ca7c7c7..05eedc2d2540 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/body_api_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/body_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for BodyApi void main() { final instance = Openapi().getBodyApi(); @@ -15,6 +14,5 @@ void main() { test('test testEchoBodyPet', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/capitalization_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/capitalization_test.dart index 23e04b0001bb..c1fb9cd73dc7 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/capitalization_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/capitalization_test.dart @@ -32,11 +32,10 @@ void main() { // TODO }); - // Name of the pet + // Name of the pet // String ATT_NAME test('to test the property `ATT_NAME`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/cat_all_of_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/cat_all_of_test.dart index fb7e999bf8d1..b84216c8996d 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/cat_all_of_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/cat_all_of_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `declawed`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/cat_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/cat_test.dart index b8fc252acc60..000e31d7f176 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/cat_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/cat_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `declawed`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/category_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/category_test.dart index de682b2ff15b..ba39a86cfb6a 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/category_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/category_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/child_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/child_test.dart index d40451a84c2c..6c5defb7b228 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/child_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/child_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/class_model_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/class_model_test.dart index 89f1d35e556b..1ca5ccc3a74b 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/class_model_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/class_model_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `classField`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/deprecated_object_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/deprecated_object_test.dart index 98ab991b2b14..298f2d2253b4 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/deprecated_object_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/deprecated_object_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/dog_all_of_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/dog_all_of_test.dart index 7b4f4095dc9f..8d258244accb 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/dog_all_of_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/dog_all_of_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `breed`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/dog_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/dog_test.dart index f57fcdc413df..0d810b3b9fa9 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/dog_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/dog_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `breed`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/entity_ref_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/entity_ref_test.dart index 836289893fb4..ce3ed9868212 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/entity_ref_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/entity_ref_test.dart @@ -48,6 +48,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/entity_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/entity_test.dart index 30429747562d..ca7dd754f98d 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/entity_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/entity_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/enum_arrays_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/enum_arrays_test.dart index 438c36db0745..c0d5de925aec 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/enum_arrays_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/enum_arrays_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `arrayEnum`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/enum_test_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/enum_test_test.dart index b5f3aeb7fbdd..d7dc20b5eb77 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/enum_test_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/enum_test_test.dart @@ -46,6 +46,5 @@ void main() { test('to test the property `outerEnumIntegerDefaultValue`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/example_non_primitive_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/example_non_primitive_test.dart index 93f736780e93..5563d239e355 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/example_non_primitive_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/example_non_primitive_test.dart @@ -6,6 +6,5 @@ void main() { final instance = ExampleNonPrimitiveBuilder(); // TODO add properties to the builder and call build() - group(ExampleNonPrimitive, () { - }); + group(ExampleNonPrimitive, () {}); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/example_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/example_test.dart index ccb35121143e..1150465e7d28 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/example_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/example_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/extensible_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/extensible_test.dart index 75e6211e074b..158df10ac74e 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/extensible_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/extensible_test.dart @@ -24,6 +24,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/file_schema_test_class_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/file_schema_test_class_test.dart index ca8695bd4a47..1ef8cf8861b4 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/file_schema_test_class_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/file_schema_test_class_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `files`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_or_value_test.dart index 029d030e5e35..bcee2f7eaee1 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_or_value_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_or_value_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_test.dart index a1398787bbcb..b28c262c3e22 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_ref_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/foo_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_test.dart index 93a5286e2b45..0b491bb37b68 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/foo_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/foo_test.dart @@ -46,6 +46,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/format_test_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/format_test_test.dart index 558c3aa4b659..3827c02e13ae 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/format_test_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/format_test_test.dart @@ -88,6 +88,5 @@ void main() { test('to test the property `patternWithDigitsAndDelimiter`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/fruit_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/fruit_test.dart index c18790ae9566..26b265ccb93f 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/fruit_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/fruit_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `count`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/has_only_read_only_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/has_only_read_only_test.dart index c34522214751..8b00db3d0711 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/has_only_read_only_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/has_only_read_only_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `foo`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/health_check_result_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/health_check_result_test.dart index fda0c9218217..050e2c9b814f 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/health_check_result_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/health_check_result_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `nullableMessage`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/map_test_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/map_test_test.dart index 56a27610ee5a..56c3d448c6c5 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/map_test_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/map_test_test.dart @@ -26,6 +26,5 @@ void main() { test('to test the property `indirectMap`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/mixed_properties_and_additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/mixed_properties_and_additional_properties_class_test.dart index 85b113387a08..dcaa8d351ae5 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/mixed_properties_and_additional_properties_class_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/mixed_properties_and_additional_properties_class_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `map`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/model200_response_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model200_response_test.dart index 11bac07fafb8..8064eb959a32 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/model200_response_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/model200_response_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `classField`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/model_client_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model_client_test.dart index f494dfd08499..1998f27d715a 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/model_client_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/model_client_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `client`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/model_enum_class_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model_enum_class_test.dart index 03e5855bf004..fa31f816801c 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/model_enum_class_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/model_enum_class_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for ModelEnumClass void main() { - - group(ModelEnumClass, () { - }); + group(ModelEnumClass, () {}); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/model_file_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model_file_test.dart index 4f1397726226..a07c60c5d85d 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/model_file_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/model_file_test.dart @@ -12,6 +12,5 @@ void main() { test('to test the property `sourceURI`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/model_list_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model_list_test.dart index d35e02fe0c9a..0c4e3c45c7a9 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/model_list_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/model_list_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `n123list`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/model_return_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/model_return_test.dart index eedfe7eb281a..b60abdfd6021 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/model_return_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/model_return_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `return_`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/name_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/name_test.dart index 6b2329bb0819..d04e76fef9e0 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/name_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/name_test.dart @@ -26,6 +26,5 @@ void main() { test('to test the property `n123number`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/nullable_class_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/nullable_class_test.dart index 1a6767dbb2ab..32f0eba4fb2e 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/nullable_class_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/nullable_class_test.dart @@ -66,6 +66,5 @@ void main() { test('to test the property `objectItemsNullable`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/number_only_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/number_only_test.dart index 7167d78a4962..7f34d2a5ce60 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/number_only_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/number_only_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `justNumber`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/object_with_deprecated_fields_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/object_with_deprecated_fields_test.dart index 67275d513f56..574970b317ca 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/object_with_deprecated_fields_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/object_with_deprecated_fields_test.dart @@ -26,6 +26,5 @@ void main() { test('to test the property `bars`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/order_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/order_test.dart index 7ff992230bf6..3ed96043d80c 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/order_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/order_test.dart @@ -37,6 +37,5 @@ void main() { test('to test the property `complete`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_composite_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_composite_test.dart index dac257d9a0d6..99a7cb7db596 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_composite_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_composite_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `myBoolean`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_default_value_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_default_value_test.dart index 502c8326be58..a5c83f615194 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_default_value_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_default_value_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumDefaultValue void main() { - - group(OuterEnumDefaultValue, () { - }); + group(OuterEnumDefaultValue, () {}); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_default_value_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_default_value_test.dart index c535fe8ac354..49ebbfcead7f 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_default_value_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_default_value_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumIntegerDefaultValue void main() { - - group(OuterEnumIntegerDefaultValue, () { - }); + group(OuterEnumIntegerDefaultValue, () {}); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_test.dart index d945bc8c489d..3c6b81305c71 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_integer_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumInteger void main() { - - group(OuterEnumInteger, () { - }); + group(OuterEnumInteger, () {}); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_test.dart index 8e11eb02fb8a..4ee10f379d5e 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_enum_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnum void main() { - - group(OuterEnum, () { - }); + group(OuterEnum, () {}); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_object_with_enum_property_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_object_with_enum_property_test.dart index d6d763c5d93a..cb621828cbc0 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/outer_object_with_enum_property_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/outer_object_with_enum_property_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `value`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/pasta_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/pasta_test.dart index 6a3ae338eec2..42de4a90e2fa 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/pasta_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/pasta_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/path_api_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/path_api_test.dart index 4ffdcc4567be..658f714ec35f 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/path_api_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/path_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for PathApi void main() { final instance = Openapi().getPathApi(); @@ -15,6 +14,5 @@ void main() { test('test testsPathStringPathStringIntegerPathInteger', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/pet_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/pet_test.dart index 94089dce62cf..bf61da3114ce 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/pet_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/pet_test.dart @@ -37,6 +37,5 @@ void main() { test('to test the property `status`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_speziale_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_speziale_test.dart index 774320231c9e..c6a78cb12fc7 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_speziale_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_speziale_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_test.dart index 5c6e1af95a59..7e0b87b9ab5a 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/pizza_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/query_api_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/query_api_test.dart index fbb29ec74c85..960e3b243e74 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/query_api_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/query_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for QueryApi void main() { final instance = Openapi().getQueryApi(); @@ -33,6 +32,5 @@ void main() { test('test testQueryStyleFormExplodeTrueObject', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/read_only_first_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/read_only_first_test.dart index 550d3d793ec6..f4652322f2c7 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/read_only_first_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/read_only_first_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `baz`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/single_ref_type_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/single_ref_type_test.dart index 5cd85add393e..2c265f0d24ae 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/single_ref_type_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/single_ref_type_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for SingleRefType void main() { - - group(SingleRefType, () { - }); + group(SingleRefType, () {}); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/special_model_name_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/special_model_name_test.dart index 08a4592a1ed7..f81e03f7188d 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/special_model_name_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/special_model_name_test.dart @@ -8,9 +8,10 @@ void main() { group(SpecialModelName, () { // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket - test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + test( + 'to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', + () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/tag_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/tag_test.dart index 6f7c63b8f0c2..253a283fc867 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/tag_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/tag_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart index 2017e0c3d8d1..e15b28ac90c2 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart @@ -3,7 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter void main() { - final instance = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); + final instance = + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); // TODO add properties to the builder and call build() group(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, () { @@ -11,6 +12,5 @@ void main() { test('to test the property `values`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-built_value/test/user_test.dart b/samples/client/echo_api/dart/dart-dio-built_value/test/user_test.dart index 1e6a1bc23faa..40bef6e6d21c 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/test/user_test.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/test/user_test.dart @@ -47,6 +47,5 @@ void main() { test('to test the property `userStatus`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/.gitignore b/samples/client/echo_api/dart/dart-dio-json_serializable/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/.gitignore @@ -0,0 +1,41 @@ +# See https://dart.dev/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock + +# Don’t commit files and directories created by other development environments. +# For example, if your development environment creates any of the following files, +# consider putting them in a global ignore file: + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator-ignore b/samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator/FILES b/samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator/FILES new file mode 100644 index 000000000000..d866d909b67d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator/FILES @@ -0,0 +1,157 @@ +.gitignore +README.md +analysis_options.yaml +build.yaml +doc/AdditionalPropertiesClass.md +doc/Addressable.md +doc/AllOfWithSingleRef.md +doc/Animal.md +doc/ApiResponse.md +doc/Apple.md +doc/ArrayOfArrayOfNumberOnly.md +doc/ArrayOfNumberOnly.md +doc/ArrayTest.md +doc/Banana.md +doc/Bar.md +doc/BarCreate.md +doc/BarRef.md +doc/BarRefOrValue.md +doc/BodyApi.md +doc/Capitalization.md +doc/Cat.md +doc/CatAllOf.md +doc/Category.md +doc/Child.md +doc/ClassModel.md +doc/DeprecatedObject.md +doc/Dog.md +doc/DogAllOf.md +doc/Entity.md +doc/EntityRef.md +doc/EnumArrays.md +doc/EnumTest.md +doc/Example.md +doc/ExampleNonPrimitive.md +doc/Extensible.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FooRef.md +doc/FooRefOrValue.md +doc/FormatTest.md +doc/Fruit.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/Pasta.md +doc/PathApi.md +doc/Pet.md +doc/Pizza.md +doc/PizzaSpeziale.md +doc/QueryApi.md +doc/ReadOnlyFirst.md +doc/SingleRefType.md +doc/SpecialModelName.md +doc/Tag.md +doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +doc/User.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/_exports.dart +lib/src/api/body_api.dart +lib/src/api/path_api.dart +lib/src/api/query_api.dart +lib/src/api_util.dart +lib/src/auth/_exports.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/deserialize.dart +lib/src/model/_exports.dart +lib/src/model/additional_properties_class.dart +lib/src/model/addressable.dart +lib/src/model/all_of_with_single_ref.dart +lib/src/model/animal.dart +lib/src/model/api_response.dart +lib/src/model/apple.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/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/capitalization.dart +lib/src/model/cat.dart +lib/src/model/cat_all_of.dart +lib/src/model/category.dart +lib/src/model/child.dart +lib/src/model/class_model.dart +lib/src/model/deprecated_object.dart +lib/src/model/dog.dart +lib/src/model/dog_all_of.dart +lib/src/model/entity.dart +lib/src/model/entity_ref.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/example.dart +lib/src/model/example_non_primitive.dart +lib/src/model/extensible.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/foo_ref.dart +lib/src/model/foo_ref_or_value.dart +lib/src/model/format_test.dart +lib/src/model/fruit.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/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/pasta.dart +lib/src/model/pet.dart +lib/src/model/pizza.dart +lib/src/model/pizza_speziale.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_query_style_form_explode_true_array_string_query_object_parameter.dart +lib/src/model/user.dart +pubspec.yaml diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator/VERSION b/samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator/VERSION new file mode 100644 index 000000000000..d6b4ec4aa783 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/README.md b/samples/client/echo_api/dart/dart-dio-json_serializable/README.md new file mode 100644 index 000000000000..ed9a0096600c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/README.md @@ -0,0 +1,153 @@ +# openapi +Echo Server API + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.1.0 +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.12.0 or later OR Flutter 1.26.0 or later +* Dio 4.0.0+ + +## Installation & Usage + +### pub.dev +To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml +```yaml +dependencies: + openapi: 1.0.0 +``` + +### Github +If this Dart package is published to Github, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + git: + url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git + #ref: main +``` + +### Local development +To use the package from your local drive, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + path: /path/to/openapi +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:openapi/openapi.dart'; + + +final api = Openapi().getBodyApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + final response = await api.testEchoBodyPet(pet); + print(response); +} catch on DioError (e) { + print("Exception when calling BodyApi->testEchoBodyPet: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:3000* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*BodyApi*](doc/BodyApi.md) | [**testEchoBodyPet**](doc/BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) +[*PathApi*](doc/PathApi.md) | [**testsPathStringPathStringIntegerPathInteger**](doc/PathApi.md#testspathstringpathstringintegerpathinteger) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryIntegerBooleanString**](doc/QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryStyleFormExplodeTrueArrayString**](doc/QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryStyleFormExplodeTrueObject**](doc/QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) + + +## Documentation For Models + + - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) + - [Addressable](doc/Addressable.md) + - [AllOfWithSingleRef](doc/AllOfWithSingleRef.md) + - [Animal](doc/Animal.md) + - [ApiResponse](doc/ApiResponse.md) + - [Apple](doc/Apple.md) + - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) + - [ArrayTest](doc/ArrayTest.md) + - [Banana](doc/Banana.md) + - [Bar](doc/Bar.md) + - [BarCreate](doc/BarCreate.md) + - [BarRef](doc/BarRef.md) + - [BarRefOrValue](doc/BarRefOrValue.md) + - [Capitalization](doc/Capitalization.md) + - [Cat](doc/Cat.md) + - [CatAllOf](doc/CatAllOf.md) + - [Category](doc/Category.md) + - [Child](doc/Child.md) + - [ClassModel](doc/ClassModel.md) + - [DeprecatedObject](doc/DeprecatedObject.md) + - [Dog](doc/Dog.md) + - [DogAllOf](doc/DogAllOf.md) + - [Entity](doc/Entity.md) + - [EntityRef](doc/EntityRef.md) + - [EnumArrays](doc/EnumArrays.md) + - [EnumTest](doc/EnumTest.md) + - [Example](doc/Example.md) + - [ExampleNonPrimitive](doc/ExampleNonPrimitive.md) + - [Extensible](doc/Extensible.md) + - [FileSchemaTestClass](doc/FileSchemaTestClass.md) + - [Foo](doc/Foo.md) + - [FooRef](doc/FooRef.md) + - [FooRefOrValue](doc/FooRefOrValue.md) + - [FormatTest](doc/FormatTest.md) + - [Fruit](doc/Fruit.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) + - [Pasta](doc/Pasta.md) + - [Pet](doc/Pet.md) + - [Pizza](doc/Pizza.md) + - [PizzaSpeziale](doc/PizzaSpeziale.md) + - [ReadOnlyFirst](doc/ReadOnlyFirst.md) + - [SingleRefType](doc/SingleRefType.md) + - [SpecialModelName](doc/SpecialModelName.md) + - [Tag](doc/Tag.md) + - [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md) + - [User](doc/User.md) + + +## Documentation For Authorization + + All endpoints do not require authorization. + + +## Author + +team@openapitools.org + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/analysis_options.yaml b/samples/client/echo_api/dart/dart-dio-json_serializable/analysis_options.yaml new file mode 100644 index 000000000000..28be8936a4bd --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/analysis_options.yaml @@ -0,0 +1,10 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/build.yaml b/samples/client/echo_api/dart/dart-dio-json_serializable/build.yaml new file mode 100644 index 000000000000..89a4dd6e1c2e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/build.yaml @@ -0,0 +1,18 @@ +targets: + $default: + builders: + json_serializable: + options: + # Options configure how source code is generated for every + # `@JsonSerializable`-annotated class in the package. + # + # The default value for each is listed. + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: true + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/AdditionalPropertiesClass.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..863b8503db83 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/AdditionalPropertiesClass.md @@ -0,0 +1,16 @@ +# openapi.model.AdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **Map<String, String>** | | [optional] +**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Addressable.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Addressable.md new file mode 100644 index 000000000000..0fcd81b80382 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/AllOfWithSingleRef.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4c6f3ab2fe11 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/Animal.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Animal.md new file mode 100644 index 000000000000..415b56e9bc2e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Animal.md @@ -0,0 +1,16 @@ +# openapi.model.Animal + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ApiResponse.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ApiResponse.md new file mode 100644 index 000000000000..7ad5da0f89e4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Apple.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Apple.md new file mode 100644 index 000000000000..c7f711b87cef --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayOfArrayOfNumberOnly.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..e5b9d669a436 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [**List<List<num>>**](List.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayOfNumberOnly.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..fe8e071eb45c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | **List<num>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayTest.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayTest.md new file mode 100644 index 000000000000..8ae11de10022 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ArrayTest.md @@ -0,0 +1,17 @@ +# openapi.model.ArrayTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **List<String>** | | [optional] +**arrayArrayOfInteger** | [**List<List<int>>**](List.md) | | [optional] +**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Banana.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Banana.md new file mode 100644 index 000000000000..bef8a58a4276 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/Bar.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Bar.md new file mode 100644 index 000000000000..4cccc863a489 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/BarCreate.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/BarCreate.md new file mode 100644 index 000000000000..c0b4ba6edc9a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/BarRef.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/BarRef.md new file mode 100644 index 000000000000..949695f4d36f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/BarRef.md @@ -0,0 +1,19 @@ +# openapi.model.BarRef + +## 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/client/echo_api/dart/dart-dio-json_serializable/doc/BarRefOrValue.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/BarRefOrValue.md new file mode 100644 index 000000000000..9dafa2d6b220 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/BarRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.BarRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | +**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/client/echo_api/dart/dart-dio-json_serializable/doc/BodyApi.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/BodyApi.md new file mode 100644 index 000000000000..145854fc8d28 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/BodyApi.md @@ -0,0 +1,57 @@ +# openapi.api.BodyApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testEchoBodyPet**](BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) + + +# **testEchoBodyPet** +> Pet testEchoBodyPet(pet) + +Test body parameter(s) + +Test body parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getBodyApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + final response = api.testEchoBodyPet(pet); + print(response); +} catch on DioError (e) { + print('Exception when calling BodyApi->testEchoBodyPet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +[**Pet**](Pet.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/client/echo_api/dart/dart-dio-json_serializable/doc/Capitalization.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Capitalization.md new file mode 100644 index 000000000000..4a07b4eb820d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Capitalization.md @@ -0,0 +1,20 @@ +# openapi.model.Capitalization + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **String** | | [optional] +**capitalCamel** | **String** | | [optional] +**smallSnake** | **String** | | [optional] +**capitalSnake** | **String** | | [optional] +**sCAETHFlowPoints** | **String** | | [optional] +**ATT_NAME** | **String** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Cat.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Cat.md new file mode 100644 index 000000000000..6552eea4b435 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Cat.md @@ -0,0 +1,17 @@ +# openapi.model.Cat + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/CatAllOf.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/CatAllOf.md new file mode 100644 index 000000000000..36b2ae0e8ab3 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/CatAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.CatAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Category.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Category.md new file mode 100644 index 000000000000..98d0b14be7b1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [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/client/echo_api/dart/dart-dio-json_serializable/doc/Child.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Child.md new file mode 100644 index 000000000000..bed0f2feec12 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/ClassModel.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ClassModel.md new file mode 100644 index 000000000000..9b80d4f71eea --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ClassModel.md @@ -0,0 +1,15 @@ +# openapi.model.ClassModel + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**classField** | **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/client/echo_api/dart/dart-dio-json_serializable/doc/DeprecatedObject.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/DeprecatedObject.md new file mode 100644 index 000000000000..bf2ef67a26fc --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/DeprecatedObject.md @@ -0,0 +1,15 @@ +# openapi.model.DeprecatedObject + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Dog.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Dog.md new file mode 100644 index 000000000000..d36439b767bb --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Dog.md @@ -0,0 +1,17 @@ +# openapi.model.Dog + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/DogAllOf.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/DogAllOf.md new file mode 100644 index 000000000000..97a7c8fba492 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/DogAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.DogAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Entity.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Entity.md new file mode 100644 index 000000000000..5ba2144b44fe --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/EntityRef.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/EntityRef.md new file mode 100644 index 000000000000..80eae55f4145 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/EnumArrays.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/EnumArrays.md new file mode 100644 index 000000000000..1d4fd1363b59 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/EnumArrays.md @@ -0,0 +1,16 @@ +# openapi.model.EnumArrays + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | **String** | | [optional] +**arrayEnum** | **List<String>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/EnumTest.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/EnumTest.md new file mode 100644 index 000000000000..7c24fe2347b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/EnumTest.md @@ -0,0 +1,22 @@ +# openapi.model.EnumTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | **String** | | [optional] +**enumStringRequired** | **String** | | +**enumInteger** | **int** | | [optional] +**enumNumber** | **double** | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Example.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Example.md new file mode 100644 index 000000000000..bf49bb137a60 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/ExampleNonPrimitive.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ExampleNonPrimitive.md new file mode 100644 index 000000000000..2b63a98c6ad9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ExampleNonPrimitive.md @@ -0,0 +1,14 @@ +# openapi.model.ExampleNonPrimitive + +## 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/client/echo_api/dart/dart-dio-json_serializable/doc/Extensible.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Extensible.md new file mode 100644 index 000000000000..7a781e578ea4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/FileSchemaTestClass.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/FileSchemaTestClass.md new file mode 100644 index 000000000000..d14ac319d294 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/FileSchemaTestClass.md @@ -0,0 +1,16 @@ +# openapi.model.FileSchemaTestClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**ModelFile**](ModelFile.md) | | [optional] +**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Foo.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Foo.md new file mode 100644 index 000000000000..2627691fefe5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/FooRef.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/FooRef.md new file mode 100644 index 000000000000..68104b227292 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/FooRef.md @@ -0,0 +1,20 @@ +# openapi.model.FooRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foorefPropA** | **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/client/echo_api/dart/dart-dio-json_serializable/doc/FooRefOrValue.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/FooRefOrValue.md new file mode 100644 index 000000000000..35e9fd114e1d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/FooRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.FooRefOrValue + +## 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/client/echo_api/dart/dart-dio-json_serializable/doc/FormatTest.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/FormatTest.md new file mode 100644 index 000000000000..83b60545eb61 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/FormatTest.md @@ -0,0 +1,30 @@ +# openapi.model.FormatTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**number** | **num** | | +**float** | **double** | | [optional] +**double_** | **double** | | [optional] +**decimal** | **double** | | [optional] +**string** | **String** | | [optional] +**byte** | **String** | | +**binary** | [**MultipartFile**](MultipartFile.md) | | [optional] +**date** | [**DateTime**](DateTime.md) | | +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**uuid** | **String** | | [optional] +**password** | **String** | | +**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Fruit.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Fruit.md new file mode 100644 index 000000000000..5d48cc6e6d38 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/HasOnlyReadOnly.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/HasOnlyReadOnly.md new file mode 100644 index 000000000000..32cae937155d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/HasOnlyReadOnly.md @@ -0,0 +1,16 @@ +# openapi.model.HasOnlyReadOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**foo** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/HealthCheckResult.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/HealthCheckResult.md new file mode 100644 index 000000000000..4d6aeb75d965 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/HealthCheckResult.md @@ -0,0 +1,15 @@ +# openapi.model.HealthCheckResult + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/MapTest.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/MapTest.md new file mode 100644 index 000000000000..197fe780a25a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/MapTest.md @@ -0,0 +1,18 @@ +# openapi.model.MapTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapOfEnumString** | **Map<String, String>** | | [optional] +**directMap** | **Map<String, bool>** | | [optional] +**indirectMap** | **Map<String, bool>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..66d0d39c42be --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# openapi.model.MixedPropertiesAndAdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**map** | [**Map<String, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Model200Response.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Model200Response.md new file mode 100644 index 000000000000..e8b088ca1afa --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Model200Response.md @@ -0,0 +1,16 @@ +# openapi.model.Model200Response + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**classField** | **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/client/echo_api/dart/dart-dio-json_serializable/doc/ModelClient.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelClient.md new file mode 100644 index 000000000000..f7b922f4a398 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelClient.md @@ -0,0 +1,15 @@ +# openapi.model.ModelClient + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelEnumClass.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelEnumClass.md new file mode 100644 index 000000000000..ebaafb44c7f7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelEnumClass.md @@ -0,0 +1,14 @@ +# openapi.model.ModelEnumClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelFile.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelFile.md new file mode 100644 index 000000000000..4be260e93f6e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelFile.md @@ -0,0 +1,15 @@ +# openapi.model.ModelFile + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelList.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelList.md new file mode 100644 index 000000000000..283aa1f6b711 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelList.md @@ -0,0 +1,15 @@ +# openapi.model.ModelList + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**n123list** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelReturn.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelReturn.md new file mode 100644 index 000000000000..bc02df7a3692 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ModelReturn.md @@ -0,0 +1,15 @@ +# openapi.model.ModelReturn + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**return_** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Name.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Name.md new file mode 100644 index 000000000000..25f49ea946b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Name.md @@ -0,0 +1,18 @@ +# openapi.model.Name + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snakeCase** | **int** | | [optional] +**property** | **String** | | [optional] +**n123number** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/NullableClass.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/NullableClass.md new file mode 100644 index 000000000000..70ac1091d417 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/NullableClass.md @@ -0,0 +1,26 @@ +# openapi.model.NullableClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **int** | | [optional] +**numberProp** | **num** | | [optional] +**booleanProp** | **bool** | | [optional] +**stringProp** | **String** | | [optional] +**dateProp** | [**DateTime**](DateTime.md) | | [optional] +**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] +**arrayNullableProp** | **List<Object>** | | [optional] +**arrayAndItemsNullableProp** | **List<Object>** | | [optional] +**arrayItemsNullable** | **List<Object>** | | [optional] +**objectNullableProp** | **Map<String, Object>** | | [optional] +**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] +**objectItemsNullable** | **Map<String, Object>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/NumberOnly.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/NumberOnly.md new file mode 100644 index 000000000000..d8096a3db37a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/NumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.NumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ObjectWithDeprecatedFields.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..e0fa7b908d10 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ObjectWithDeprecatedFields.md @@ -0,0 +1,18 @@ +# openapi.model.ObjectWithDeprecatedFields + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**id** | **num** | | [optional] +**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**bars** | [**List<Bar>**](Bar.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/client/echo_api/dart/dart-dio-json_serializable/doc/Order.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Order.md new file mode 100644 index 000000000000..bde5ffe51a2c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**petId** | **int** | | [optional] +**quantity** | **int** | | [optional] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] +**status** | **String** | Order Status | [optional] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterComposite.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterComposite.md new file mode 100644 index 000000000000..04bab7eff5d1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterComposite.md @@ -0,0 +1,17 @@ +# openapi.model.OuterComposite + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | **num** | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnum.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnum.md new file mode 100644 index 000000000000..af62ad87ab2e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnum.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnum + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumDefaultValue.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..c1bf8b0dec44 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumInteger.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumInteger.md new file mode 100644 index 000000000000..8c80a9e5c85f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumInteger.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumInteger + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumIntegerDefaultValue.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..eb8b55d70249 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumIntegerDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterObjectWithEnumProperty.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..eab2ae8f66b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/OuterObjectWithEnumProperty.md @@ -0,0 +1,15 @@ +# openapi.model.OuterObjectWithEnumProperty + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Pasta.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Pasta.md new file mode 100644 index 000000000000..034ff420d323 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/PathApi.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/PathApi.md new file mode 100644 index 000000000000..ae663a2f7f04 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/PathApi.md @@ -0,0 +1,59 @@ +# openapi.api.PathApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testsPathStringPathStringIntegerPathInteger**](PathApi.md#testspathstringpathstringintegerpathinteger) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s) + + +# **testsPathStringPathStringIntegerPathInteger** +> String testsPathStringPathStringIntegerPathInteger(pathString, pathInteger) + +Test path parameter(s) + +Test path parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getPathApi(); +final String pathString = pathString_example; // String | +final int pathInteger = 56; // int | + +try { + final response = api.testsPathStringPathStringIntegerPathInteger(pathString, pathInteger); + print(response); +} catch on DioError (e) { + print('Exception when calling PathApi->testsPathStringPathStringIntegerPathInteger: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pathString** | **String**| | + **pathInteger** | **int**| | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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/client/echo_api/dart/dart-dio-json_serializable/doc/Pet.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Pet.md new file mode 100644 index 000000000000..80414658dc87 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | +**category** | [**Category**](Category.md) | | [optional] +**photoUrls** | **List<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/client/echo_api/dart/dart-dio-json_serializable/doc/Pizza.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Pizza.md new file mode 100644 index 000000000000..e4b040a6a79c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/PizzaSpeziale.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/PizzaSpeziale.md new file mode 100644 index 000000000000..e1d8434c077d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/PizzaSpeziale.md @@ -0,0 +1,20 @@ +# openapi.model.PizzaSpeziale + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toppings** | **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/client/echo_api/dart/dart-dio-json_serializable/doc/QueryApi.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/QueryApi.md new file mode 100644 index 000000000000..f92f9532a113 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/QueryApi.md @@ -0,0 +1,149 @@ +# openapi.api.QueryApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testQueryIntegerBooleanString**](QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s) +[**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +[**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) + + +# **testQueryIntegerBooleanString** +> String testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final int integerQuery = 56; // int | +final bool booleanQuery = true; // bool | +final String stringQuery = stringQuery_example; // String | + +try { + final response = api.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryIntegerBooleanString: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integerQuery** | **int**| | [optional] + **booleanQuery** | **bool**| | [optional] + **stringQuery** | **String**| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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) + +# **testQueryStyleFormExplodeTrueArrayString** +> String testQueryStyleFormExplodeTrueArrayString(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject = ; // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter | + +try { + final response = api.testQueryStyleFormExplodeTrueArrayString(queryObject); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryStyleFormExplodeTrueArrayString: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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) + +# **testQueryStyleFormExplodeTrueObject** +> String testQueryStyleFormExplodeTrueObject(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final Pet queryObject = ; // Pet | + +try { + final response = api.testQueryStyleFormExplodeTrueObject(queryObject); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryStyleFormExplodeTrueObject: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | [**Pet**](.md)| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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/client/echo_api/dart/dart-dio-json_serializable/doc/ReadOnlyFirst.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ReadOnlyFirst.md new file mode 100644 index 000000000000..8f612e8ba19f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/ReadOnlyFirst.md @@ -0,0 +1,16 @@ +# openapi.model.ReadOnlyFirst + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**baz** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/SingleRefType.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/SingleRefType.md new file mode 100644 index 000000000000..0dc93840cd7f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/doc/SpecialModelName.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/SpecialModelName.md new file mode 100644 index 000000000000..5fcfa98e0b36 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/SpecialModelName.md @@ -0,0 +1,15 @@ +# openapi.model.SpecialModelName + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Tag.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Tag.md new file mode 100644 index 000000000000..c219f987c19c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md new file mode 100644 index 000000000000..8e5541bd1f04 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -0,0 +1,15 @@ +# openapi.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | **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/client/echo_api/dart/dart-dio-json_serializable/doc/User.md b/samples/client/echo_api/dart/dart-dio-json_serializable/doc/User.md new file mode 100644 index 000000000000..fa87e64d8595 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/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/client/echo_api/dart/dart-dio-json_serializable/lib/openapi.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/openapi.dart new file mode 100644 index 000000000000..dfc13b14b46d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/openapi.dart @@ -0,0 +1,9 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:openapi/src/api.dart'; +export 'package:openapi/src/auth/_exports.dart'; + +export 'package:openapi/src/api/_exports.dart'; +export 'package:openapi/src/model/_exports.dart'; diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api.dart new file mode 100644 index 000000000000..3cdbe7c3b75b --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/_exports.dart'; +import 'package:openapi/src/api/body_api.dart'; +import 'package:openapi/src/api/path_api.dart'; +import 'package:openapi/src/api/query_api.dart'; + +class Openapi { + static const String basePath = r'http://localhost:3000'; + + final Dio dio; + Openapi({ + Dio? dio, + String? basePathOverride, + List? interceptors, + }) : this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: 5000, + receiveTimeout: 3000, + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) + as OAuthInterceptor) + .tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) + as BearerAuthInterceptor) + .tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) + as BasicAuthInterceptor) + .authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this + .dio + .interceptors + .firstWhere((element) => element is ApiKeyAuthInterceptor) + as ApiKeyAuthInterceptor) + .apiKeys[name] = apiKey; + } + } + + /// Get BodyApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + BodyApi getBodyApi() { + return BodyApi(dio); + } + + /// Get PathApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + PathApi getPathApi() { + return PathApi(dio); + } + + /// Get QueryApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + QueryApi getQueryApi() { + return QueryApi(dio); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/_exports.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/_exports.dart new file mode 100644 index 000000000000..f06d548e0d23 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/_exports.dart @@ -0,0 +1,3 @@ +export 'body_api.dart'; +export 'path_api.dart'; +export 'query_api.dart'; diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/body_api.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/body_api.dart new file mode 100644 index 000000000000..1fa0654254e6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/body_api.dart @@ -0,0 +1,105 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/pet.dart'; + +class BodyApi { + final Dio _dio; + + const BodyApi(this._dio); + + /// Test body parameter(s) + /// Test body parameter(s) + /// + /// 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] containing a [Response] with a [Pet] as data + /// Throws [DioError] if API call or serialization fails + Future> testEchoBodyPet({ + Pet? pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/echo/body/Pet'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(pet); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Pet _responseData; + + try { + _responseData = + deserialize(_response.data!, 'Pet', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/path_api.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/path_api.dart new file mode 100644 index 000000000000..4a3619f3305c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/path_api.dart @@ -0,0 +1,90 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +class PathApi { + final Dio _dio; + + const PathApi(this._dio); + + /// Test path parameter(s) + /// Test path parameter(s) + /// + /// Parameters: + /// * [pathString] + /// * [pathInteger] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testsPathStringPathStringIntegerPathInteger({ + required String pathString, + required int pathInteger, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/path/string/{path_string}/integer/{path_integer}' + .replaceAll('{' r'path_string' '}', pathString.toString()) + .replaceAll('{' r'path_integer' '}', pathInteger.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, + ); + + String _responseData; + + try { + _responseData = deserialize(_response.data!, 'String', + growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/query_api.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/query_api.dart new file mode 100644 index 000000000000..b32a2e6c7516 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/query_api.dart @@ -0,0 +1,250 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; + +class QueryApi { + final Dio _dio; + + const QueryApi(this._dio); + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [integerQuery] + /// * [booleanQuery] + /// * [stringQuery] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testQueryIntegerBooleanString({ + int? integerQuery, + bool? booleanQuery, + String? stringQuery, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/query/integer/boolean/string'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (integerQuery != null) r'integer_query': integerQuery, + if (booleanQuery != null) r'boolean_query': booleanQuery, + if (stringQuery != null) r'string_query': stringQuery, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String _responseData; + + try { + _responseData = deserialize(_response.data!, 'String', + growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [queryObject] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testQueryStyleFormExplodeTrueArrayString({ + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? queryObject, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/query/style_form/explode_true/array_string'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (queryObject != null) r'query_object': queryObject, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String _responseData; + + try { + _responseData = deserialize(_response.data!, 'String', + growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [queryObject] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> testQueryStyleFormExplodeTrueObject({ + Pet? queryObject, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/query/style_form/explode_true/object'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (queryObject != null) r'query_object': queryObject, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String _responseData; + + try { + _responseData = deserialize(_response.data!, 'String', + growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api_util.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api_util.dart new file mode 100644 index 000000000000..de0c8e46ea32 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api_util.dart @@ -0,0 +1,8 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:dio/dio.dart'; diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/_exports.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/_exports.dart new file mode 100644 index 000000000000..01c9ad2dfa7e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/_exports.dart @@ -0,0 +1,9 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'api_key_auth.dart'; +export 'auth.dart'; +export 'basic_auth.dart'; +export 'bearer_auth.dart'; +export 'oauth.dart'; diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/api_key_auth.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..c67c514ee94e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/api_key_auth.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import '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/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/auth.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/auth.dart new file mode 100644 index 000000000000..c6fcca595cb3 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/auth.dart @@ -0,0 +1,19 @@ +// +// 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/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/basic_auth.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..6cea35ca3665 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/basic_auth.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'auth.dart'; + +class BasicAuthInfo { + final String username; + final String password; + + const BasicAuthInfo(this.username, this.password); +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final metadataAuthInfo = getAuthInfo( + options, + (secure) => + (secure['type'] == 'http' && secure['scheme'] == 'basic') || + secure['type'] == 'basic'); + for (final info in metadataAuthInfo) { + final authName = info['name'] as String; + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = + 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/bearer_auth.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..38729451f23e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/bearer_auth.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'auth.dart'; + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, + (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/oauth.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..54aa4706ef69 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/auth/oauth.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import '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/client/echo_api/dart/dart-dio-json_serializable/lib/src/deserialize.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/deserialize.dart new file mode 100644 index 000000000000..929f58eb4909 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/deserialize.dart @@ -0,0 +1,269 @@ +import 'package:openapi/src/model/additional_properties_class.dart'; +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/all_of_with_single_ref.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/array_of_array_of_number_only.dart'; +import 'package:openapi/src/model/array_of_number_only.dart'; +import 'package:openapi/src/model/array_test.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:openapi/src/model/bar_create.dart'; +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar_ref_or_value.dart'; +import 'package:openapi/src/model/capitalization.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:openapi/src/model/cat_all_of.dart'; +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/child.dart'; +import 'package:openapi/src/model/class_model.dart'; +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/dog.dart'; +import 'package:openapi/src/model/dog_all_of.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:openapi/src/model/enum_arrays.dart'; +import 'package:openapi/src/model/enum_test.dart'; +import 'package:openapi/src/model/example.dart'; +import 'package:openapi/src/model/example_non_primitive.dart'; +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/format_test.dart'; +import 'package:openapi/src/model/fruit.dart'; +import 'package:openapi/src/model/has_only_read_only.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/map_test.dart'; +import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +import 'package:openapi/src/model/model200_response.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_file.dart'; +import 'package:openapi/src/model/model_list.dart'; +import 'package:openapi/src/model/model_return.dart'; +import 'package:openapi/src/model/name.dart'; +import 'package:openapi/src/model/nullable_class.dart'; +import 'package:openapi/src/model/number_only.dart'; +import 'package:openapi/src/model/object_with_deprecated_fields.dart'; +import 'package:openapi/src/model/order.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pasta.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/pizza.dart'; +import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:openapi/src/model/special_model_name.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; +import 'package:openapi/src/model/user.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ReturnType deserialize(dynamic value, String targetType, + {bool growable = true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'AdditionalPropertiesClass': + return AdditionalPropertiesClass.fromJson(value as Map) + as ReturnType; + case 'Addressable': + return Addressable.fromJson(value as Map) as ReturnType; + case 'AllOfWithSingleRef': + return AllOfWithSingleRef.fromJson(value as Map) + as ReturnType; + case 'Animal': + return Animal.fromJson(value as Map) as ReturnType; + case 'ApiResponse': + return ApiResponse.fromJson(value as Map) as ReturnType; + case 'Apple': + return Apple.fromJson(value as Map) as ReturnType; + case 'ArrayOfArrayOfNumberOnly': + return ArrayOfArrayOfNumberOnly.fromJson(value as Map) + as ReturnType; + case 'ArrayOfNumberOnly': + return ArrayOfNumberOnly.fromJson(value as Map) + as ReturnType; + case 'ArrayTest': + return ArrayTest.fromJson(value as Map) as ReturnType; + case 'Banana': + return Banana.fromJson(value as Map) as ReturnType; + case 'Bar': + return Bar.fromJson(value as Map) as ReturnType; + case 'BarCreate': + return BarCreate.fromJson(value as Map) as ReturnType; + case 'BarRef': + return BarRef.fromJson(value as Map) as ReturnType; + case 'BarRefOrValue': + return BarRefOrValue.fromJson(value as Map) + as ReturnType; + case 'Capitalization': + return Capitalization.fromJson(value as Map) + as ReturnType; + case 'Cat': + return Cat.fromJson(value as Map) as ReturnType; + case 'CatAllOf': + return CatAllOf.fromJson(value as Map) as ReturnType; + case 'Category': + return Category.fromJson(value as Map) as ReturnType; + case 'Child': + return Child.fromJson(value as Map) as ReturnType; + case 'ClassModel': + return ClassModel.fromJson(value as Map) as ReturnType; + case 'DeprecatedObject': + return DeprecatedObject.fromJson(value as Map) + as ReturnType; + case 'Dog': + return Dog.fromJson(value as Map) as ReturnType; + case 'DogAllOf': + return DogAllOf.fromJson(value as Map) as ReturnType; + case 'Entity': + return Entity.fromJson(value as Map) as ReturnType; + case 'EntityRef': + return EntityRef.fromJson(value as Map) as ReturnType; + case 'EnumArrays': + return EnumArrays.fromJson(value as Map) as ReturnType; + case 'EnumTest': + return EnumTest.fromJson(value as Map) as ReturnType; + case 'Example': + return Example.fromJson(value as Map) as ReturnType; + case 'ExampleNonPrimitive': + return ExampleNonPrimitive.fromJson(value as Map) + as ReturnType; + case 'Extensible': + return Extensible.fromJson(value as Map) as ReturnType; + case 'FileSchemaTestClass': + return FileSchemaTestClass.fromJson(value as Map) + as ReturnType; + case 'Foo': + return Foo.fromJson(value as Map) as ReturnType; + case 'FooRef': + return FooRef.fromJson(value as Map) as ReturnType; + case 'FooRefOrValue': + return FooRefOrValue.fromJson(value as Map) + as ReturnType; + case 'FormatTest': + return FormatTest.fromJson(value as Map) as ReturnType; + case 'Fruit': + return Fruit.fromJson(value as Map) as ReturnType; + case 'HasOnlyReadOnly': + return HasOnlyReadOnly.fromJson(value as Map) + as ReturnType; + case 'HealthCheckResult': + return HealthCheckResult.fromJson(value as Map) + as ReturnType; + case 'MapTest': + return MapTest.fromJson(value as Map) as ReturnType; + case 'MixedPropertiesAndAdditionalPropertiesClass': + return MixedPropertiesAndAdditionalPropertiesClass.fromJson( + value as Map) as ReturnType; + case 'Model200Response': + return Model200Response.fromJson(value as Map) + as ReturnType; + case 'ModelClient': + return ModelClient.fromJson(value as Map) as ReturnType; + case 'ModelEnumClass': + + case 'ModelFile': + return ModelFile.fromJson(value as Map) as ReturnType; + case 'ModelList': + return ModelList.fromJson(value as Map) as ReturnType; + case 'ModelReturn': + return ModelReturn.fromJson(value as Map) as ReturnType; + case 'Name': + return Name.fromJson(value as Map) as ReturnType; + case 'NullableClass': + return NullableClass.fromJson(value as Map) + as ReturnType; + case 'NumberOnly': + return NumberOnly.fromJson(value as Map) as ReturnType; + case 'ObjectWithDeprecatedFields': + return ObjectWithDeprecatedFields.fromJson(value as Map) + as ReturnType; + case 'Order': + return Order.fromJson(value as Map) as ReturnType; + case 'OuterComposite': + return OuterComposite.fromJson(value as Map) + as ReturnType; + case 'OuterEnum': + + case 'OuterEnumDefaultValue': + + case 'OuterEnumInteger': + + case 'OuterEnumIntegerDefaultValue': + + case 'OuterObjectWithEnumProperty': + return OuterObjectWithEnumProperty.fromJson(value as Map) + as ReturnType; + case 'Pasta': + return Pasta.fromJson(value as Map) as ReturnType; + case 'Pet': + return Pet.fromJson(value as Map) as ReturnType; + case 'Pizza': + return Pizza.fromJson(value as Map) as ReturnType; + case 'PizzaSpeziale': + return PizzaSpeziale.fromJson(value as Map) + as ReturnType; + case 'ReadOnlyFirst': + return ReadOnlyFirst.fromJson(value as Map) + as ReturnType; + case 'SingleRefType': + + case 'SpecialModelName': + return SpecialModelName.fromJson(value as Map) + as ReturnType; + case 'Tag': + return Tag.fromJson(value as Map) as ReturnType; + case 'TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter': + return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + .fromJson(value as Map) as ReturnType; + case 'User': + return User.fromJson(value as Map) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize( + v, targetType, + growable: growable)), + ) as ReturnType; + } + break; + } + throw Exception('Cannot deserialize'); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/_exports.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/_exports.dart new file mode 100644 index 000000000000..43ed998d2fd8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/_exports.dart @@ -0,0 +1,67 @@ +export 'additional_properties_class.dart'; +export 'addressable.dart'; +export 'all_of_with_single_ref.dart'; +export 'animal.dart'; +export 'api_response.dart'; +export 'apple.dart'; +export 'array_of_array_of_number_only.dart'; +export 'array_of_number_only.dart'; +export 'array_test.dart'; +export 'banana.dart'; +export 'bar.dart'; +export 'bar_create.dart'; +export 'bar_ref.dart'; +export 'bar_ref_or_value.dart'; +export 'capitalization.dart'; +export 'cat.dart'; +export 'cat_all_of.dart'; +export 'category.dart'; +export 'child.dart'; +export 'class_model.dart'; +export 'deprecated_object.dart'; +export 'dog.dart'; +export 'dog_all_of.dart'; +export 'entity.dart'; +export 'entity_ref.dart'; +export 'enum_arrays.dart'; +export 'enum_test.dart'; +export 'example.dart'; +export 'example_non_primitive.dart'; +export 'extensible.dart'; +export 'file_schema_test_class.dart'; +export 'foo.dart'; +export 'foo_ref.dart'; +export 'foo_ref_or_value.dart'; +export 'format_test.dart'; +export 'fruit.dart'; +export 'has_only_read_only.dart'; +export 'health_check_result.dart'; +export 'map_test.dart'; +export 'mixed_properties_and_additional_properties_class.dart'; +export 'model200_response.dart'; +export 'model_client.dart'; +export 'model_enum_class.dart'; +export 'model_file.dart'; +export 'model_list.dart'; +export 'model_return.dart'; +export 'name.dart'; +export 'nullable_class.dart'; +export 'number_only.dart'; +export 'object_with_deprecated_fields.dart'; +export 'order.dart'; +export 'outer_composite.dart'; +export 'outer_enum.dart'; +export 'outer_enum_default_value.dart'; +export 'outer_enum_integer.dart'; +export 'outer_enum_integer_default_value.dart'; +export 'outer_object_with_enum_property.dart'; +export 'pasta.dart'; +export 'pet.dart'; +export 'pizza.dart'; +export 'pizza_speziale.dart'; +export 'read_only_first.dart'; +export 'single_ref_type.dart'; +export 'special_model_name.dart'; +export 'tag.dart'; +export 'test_query_style_form_explode_true_array_string_query_object_parameter.dart'; +export 'user.dart'; diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/additional_properties_class.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/additional_properties_class.dart new file mode 100644 index 000000000000..52aae4f3674b --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/additional_properties_class.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'additional_properties_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AdditionalPropertiesClass { + /// Returns a new [AdditionalPropertiesClass] instance. + AdditionalPropertiesClass({ + this.mapProperty, + this.mapOfMapProperty, + }); + + @JsonKey(name: r'map_property', required: false, includeIfNull: false) + final Map? mapProperty; + + @JsonKey(name: r'map_of_map_property', required: false, includeIfNull: false) + final Map>? mapOfMapProperty; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AdditionalPropertiesClass && + other.mapProperty == mapProperty && + other.mapOfMapProperty == mapOfMapProperty; + + @override + int get hashCode => mapProperty.hashCode + mapOfMapProperty.hashCode; + + factory AdditionalPropertiesClass.fromJson(Map json) => + _$AdditionalPropertiesClassFromJson(json); + + Map toJson() => _$AdditionalPropertiesClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/addressable.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/addressable.dart new file mode 100644 index 000000000000..1558e6f5e9dc --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/addressable.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'addressable.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Addressable { + /// Returns a new [Addressable] instance. + Addressable({ + this.href, + this.id, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Addressable && other.href == href && other.id == id; + + @override + int get hashCode => href.hashCode + id.hashCode; + + factory Addressable.fromJson(Map json) => + _$AddressableFromJson(json); + + Map toJson() => _$AddressableToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/all_of_with_single_ref.dart new file mode 100644 index 000000000000..9fec7e666068 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/all_of_with_single_ref.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/single_ref_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'all_of_with_single_ref.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AllOfWithSingleRef { + /// Returns a new [AllOfWithSingleRef] instance. + AllOfWithSingleRef({ + this.username, + this.singleRefType, + }); + + @JsonKey(name: r'username', required: false, includeIfNull: false) + final String? username; + + @JsonKey(name: r'SingleRefType', required: false, includeIfNull: false) + final SingleRefType? singleRefType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AllOfWithSingleRef && + other.username == username && + other.singleRefType == singleRefType; + + @override + int get hashCode => username.hashCode + singleRefType.hashCode; + + factory AllOfWithSingleRef.fromJson(Map json) => + _$AllOfWithSingleRefFromJson(json); + + Map toJson() => _$AllOfWithSingleRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/animal.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/animal.dart new file mode 100644 index 000000000000..464ac70be575 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/animal.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'animal.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Animal { + /// Returns a new [Animal] instance. + Animal({ + required this.className, + this.color = 'red', + }); + + @JsonKey(name: r'className', required: true, includeIfNull: false) + final String className; + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false) + final String? color; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Animal && other.className == className && other.color == color; + + @override + int get hashCode => className.hashCode + color.hashCode; + + factory Animal.fromJson(Map json) => _$AnimalFromJson(json); + + Map toJson() => _$AnimalToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/api_response.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/api_response.dart new file mode 100644 index 000000000000..df7b51101d80 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/api_response.dart @@ -0,0 +1,53 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'api_response.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ApiResponse { + /// Returns a new [ApiResponse] instance. + ApiResponse({ + this.code, + this.type, + this.message, + }); + + @JsonKey(name: r'code', required: false, includeIfNull: false) + final int? code; + + @JsonKey(name: r'type', required: false, includeIfNull: false) + final String? type; + + @JsonKey(name: r'message', required: false, includeIfNull: false) + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ApiResponse && + other.code == code && + other.type == type && + other.message == message; + + @override + int get hashCode => code.hashCode + type.hashCode + message.hashCode; + + factory ApiResponse.fromJson(Map json) => + _$ApiResponseFromJson(json); + + Map toJson() => _$ApiResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/apple.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/apple.dart new file mode 100644 index 000000000000..81be695b9bba --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/apple.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Apple { + /// Returns a new [Apple] instance. + Apple({ + this.kind, + }); + + @JsonKey(name: r'kind', required: false, includeIfNull: false) + final String? kind; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Apple && other.kind == kind; + + @override + int get hashCode => kind.hashCode; + + factory Apple.fromJson(Map json) => _$AppleFromJson(json); + + Map toJson() => _$AppleToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_of_array_of_number_only.dart new file mode 100644 index 000000000000..879bd5274b61 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_of_array_of_number_only.dart @@ -0,0 +1,43 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'array_of_array_of_number_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayOfArrayOfNumberOnly { + /// Returns a new [ArrayOfArrayOfNumberOnly] instance. + ArrayOfArrayOfNumberOnly({ + this.arrayArrayNumber, + }); + + @JsonKey(name: r'ArrayArrayNumber', required: false, includeIfNull: false) + final List>? arrayArrayNumber; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ArrayOfArrayOfNumberOnly && + other.arrayArrayNumber == arrayArrayNumber; + + @override + int get hashCode => arrayArrayNumber.hashCode; + + factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => + _$ArrayOfArrayOfNumberOnlyFromJson(json); + + Map toJson() => _$ArrayOfArrayOfNumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_of_number_only.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_of_number_only.dart new file mode 100644 index 000000000000..a1dea32fe74d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_of_number_only.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'array_of_number_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayOfNumberOnly { + /// Returns a new [ArrayOfNumberOnly] instance. + ArrayOfNumberOnly({ + this.arrayNumber, + }); + + @JsonKey(name: r'ArrayNumber', required: false, includeIfNull: false) + final List? arrayNumber; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ArrayOfNumberOnly && other.arrayNumber == arrayNumber; + + @override + int get hashCode => arrayNumber.hashCode; + + factory ArrayOfNumberOnly.fromJson(Map json) => + _$ArrayOfNumberOnlyFromJson(json); + + Map toJson() => _$ArrayOfNumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_test.dart new file mode 100644 index 000000000000..bc0f83a42051 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/array_test.dart @@ -0,0 +1,58 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'array_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayTest { + /// Returns a new [ArrayTest] instance. + ArrayTest({ + this.arrayOfString, + this.arrayArrayOfInteger, + this.arrayArrayOfModel, + }); + + @JsonKey(name: r'array_of_string', required: false, includeIfNull: false) + final List? arrayOfString; + + @JsonKey( + name: r'array_array_of_integer', required: false, includeIfNull: false) + final List>? arrayArrayOfInteger; + + @JsonKey(name: r'array_array_of_model', required: false, includeIfNull: false) + final List>? arrayArrayOfModel; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ArrayTest && + other.arrayOfString == arrayOfString && + other.arrayArrayOfInteger == arrayArrayOfInteger && + other.arrayArrayOfModel == arrayArrayOfModel; + + @override + int get hashCode => + arrayOfString.hashCode + + arrayArrayOfInteger.hashCode + + arrayArrayOfModel.hashCode; + + factory ArrayTest.fromJson(Map json) => + _$ArrayTestFromJson(json); + + Map toJson() => _$ArrayTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/banana.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/banana.dart new file mode 100644 index 000000000000..41fbfb80acc1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/banana.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'banana.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Banana { + /// Returns a new [Banana] instance. + Banana({ + this.count, + }); + + @JsonKey(name: r'count', required: false, includeIfNull: false) + final num? count; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Banana && other.count == count; + + @override + int get hashCode => count.hashCode; + + factory Banana.fromJson(Map json) => _$BananaFromJson(json); + + Map toJson() => _$BananaToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar.dart new file mode 100644 index 000000000000..39a28a166b7f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar.dart @@ -0,0 +1,93 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Bar { + /// Returns a new [Bar] instance. + Bar({ + required this.id, + this.barPropA, + this.fooPropB, + this.foo, + this.href, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'id', required: true, includeIfNull: false) + final String id; + + @JsonKey(name: r'barPropA', required: false, includeIfNull: false) + final String? barPropA; + + @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) + final String? fooPropB; + + @JsonKey(name: r'foo', required: false, includeIfNull: false) + final FooRefOrValue? foo; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Bar && + other.id == id && + other.barPropA == barPropA && + other.fooPropB == fooPropB && + other.foo == foo && + other.href == href && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + id.hashCode + + barPropA.hashCode + + fooPropB.hashCode + + foo.hashCode + + href.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Bar.fromJson(Map json) => _$BarFromJson(json); + + Map toJson() => _$BarToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_create.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_create.dart new file mode 100644 index 000000000000..69f8c91e9158 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_create.dart @@ -0,0 +1,95 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_create.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarCreate { + /// Returns a new [BarCreate] instance. + BarCreate({ + this.barPropA, + this.fooPropB, + this.foo, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'barPropA', required: false, includeIfNull: false) + final String? barPropA; + + @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) + final String? fooPropB; + + @JsonKey(name: r'foo', required: false, includeIfNull: false) + final FooRefOrValue? foo; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BarCreate && + other.barPropA == barPropA && + other.fooPropB == fooPropB && + other.foo == foo && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + barPropA.hashCode + + fooPropB.hashCode + + foo.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarCreate.fromJson(Map json) => + _$BarCreateFromJson(json); + + Map toJson() => _$BarCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_ref.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_ref.dart new file mode 100644 index 000000000000..441f1475ed91 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_ref.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_ref.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarRef { + /// Returns a new [BarRef] instance. + BarRef({ + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BarRef && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarRef.fromJson(Map json) => _$BarRefFromJson(json); + + Map toJson() => _$BarRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_ref_or_value.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_ref_or_value.dart new file mode 100644 index 000000000000..2a31af86fb87 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/bar_ref_or_value.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_ref_or_value.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarRefOrValue { + /// Returns a new [BarRefOrValue] instance. + BarRefOrValue({ + this.href, + required this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: true, includeIfNull: false) + final String id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BarRefOrValue && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarRefOrValue.fromJson(Map json) => + _$BarRefOrValueFromJson(json); + + Map toJson() => _$BarRefOrValueToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/capitalization.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/capitalization.dart new file mode 100644 index 000000000000..dc4ed957e2a0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/capitalization.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'capitalization.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Capitalization { + /// Returns a new [Capitalization] instance. + Capitalization({ + this.smallCamel, + this.capitalCamel, + this.smallSnake, + this.capitalSnake, + this.sCAETHFlowPoints, + this.ATT_NAME, + }); + + @JsonKey(name: r'smallCamel', required: false, includeIfNull: false) + final String? smallCamel; + + @JsonKey(name: r'CapitalCamel', required: false, includeIfNull: false) + final String? capitalCamel; + + @JsonKey(name: r'small_Snake', required: false, includeIfNull: false) + final String? smallSnake; + + @JsonKey(name: r'Capital_Snake', required: false, includeIfNull: false) + final String? capitalSnake; + + @JsonKey(name: r'SCA_ETH_Flow_Points', required: false, includeIfNull: false) + final String? sCAETHFlowPoints; + + /// Name of the pet + @JsonKey(name: r'ATT_NAME', required: false, includeIfNull: false) + final String? ATT_NAME; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Capitalization && + other.smallCamel == smallCamel && + other.capitalCamel == capitalCamel && + other.smallSnake == smallSnake && + other.capitalSnake == capitalSnake && + other.sCAETHFlowPoints == sCAETHFlowPoints && + other.ATT_NAME == ATT_NAME; + + @override + int get hashCode => + smallCamel.hashCode + + capitalCamel.hashCode + + smallSnake.hashCode + + capitalSnake.hashCode + + sCAETHFlowPoints.hashCode + + ATT_NAME.hashCode; + + factory Capitalization.fromJson(Map json) => + _$CapitalizationFromJson(json); + + Map toJson() => _$CapitalizationToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/cat.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/cat.dart new file mode 100644 index 000000000000..8e0612fb641a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/cat.dart @@ -0,0 +1,59 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'cat.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Cat { + /// Returns a new [Cat] instance. + Cat({ + required this.className, + this.color = 'red', + this.declawed, + }); + + @JsonKey(name: r'className', required: true, includeIfNull: false) + final String className; + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false) + final String? color; + + @JsonKey(name: r'declawed', required: false, includeIfNull: false) + final bool? declawed; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Cat && + other.className == className && + other.color == color && + other.declawed == declawed; + + @override + int get hashCode => className.hashCode + color.hashCode + declawed.hashCode; + + factory Cat.fromJson(Map json) => _$CatFromJson(json); + + Map toJson() => _$CatToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/cat_all_of.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/cat_all_of.dart new file mode 100644 index 000000000000..af380b83994a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/cat_all_of.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'cat_all_of.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class CatAllOf { + /// Returns a new [CatAllOf] instance. + CatAllOf({ + this.declawed, + }); + + @JsonKey(name: r'declawed', required: false, includeIfNull: false) + final bool? declawed; + + @override + bool operator ==(Object other) => + identical(this, other) || other is CatAllOf && other.declawed == declawed; + + @override + int get hashCode => declawed.hashCode; + + factory CatAllOf.fromJson(Map json) => + _$CatAllOfFromJson(json); + + Map toJson() => _$CatAllOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/category.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/category.dart new file mode 100644 index 000000000000..287b7ee8011d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/category.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'category.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Category { + /// Returns a new [Category] instance. + Category({ + this.id, + this.name, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Category && other.id == id && other.name == name; + + @override + int get hashCode => id.hashCode + name.hashCode; + + factory Category.fromJson(Map json) => + _$CategoryFromJson(json); + + Map toJson() => _$CategoryToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/child.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/child.dart new file mode 100644 index 000000000000..c01536e49b2c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/child.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'child.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Child { + /// Returns a new [Child] instance. + Child({ + this.name, + }); + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Child && other.name == name; + + @override + int get hashCode => name.hashCode; + + factory Child.fromJson(Map json) => _$ChildFromJson(json); + + Map toJson() => _$ChildToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/class_model.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/class_model.dart new file mode 100644 index 000000000000..c12e08bda2d7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/class_model.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'class_model.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ClassModel { + /// Returns a new [ClassModel] instance. + ClassModel({ + this.classField, + }); + + @JsonKey(name: r'_class', required: false, includeIfNull: false) + final String? classField; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ClassModel && other.classField == classField; + + @override + int get hashCode => classField.hashCode; + + factory ClassModel.fromJson(Map json) => + _$ClassModelFromJson(json); + + Map toJson() => _$ClassModelToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/deprecated_object.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/deprecated_object.dart new file mode 100644 index 000000000000..5c32ad349f23 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/deprecated_object.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'deprecated_object.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DeprecatedObject { + /// Returns a new [DeprecatedObject] instance. + DeprecatedObject({ + this.name, + }); + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || other is DeprecatedObject && other.name == name; + + @override + int get hashCode => name.hashCode; + + factory DeprecatedObject.fromJson(Map json) => + _$DeprecatedObjectFromJson(json); + + Map toJson() => _$DeprecatedObjectToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/dog.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/dog.dart new file mode 100644 index 000000000000..394340b11eb9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/dog.dart @@ -0,0 +1,59 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'dog.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Dog { + /// Returns a new [Dog] instance. + Dog({ + required this.className, + this.color = 'red', + this.breed, + }); + + @JsonKey(name: r'className', required: true, includeIfNull: false) + final String className; + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false) + final String? color; + + @JsonKey(name: r'breed', required: false, includeIfNull: false) + final String? breed; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Dog && + other.className == className && + other.color == color && + other.breed == breed; + + @override + int get hashCode => className.hashCode + color.hashCode + breed.hashCode; + + factory Dog.fromJson(Map json) => _$DogFromJson(json); + + Map toJson() => _$DogToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/dog_all_of.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/dog_all_of.dart new file mode 100644 index 000000000000..39065be80707 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/dog_all_of.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'dog_all_of.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DogAllOf { + /// Returns a new [DogAllOf] instance. + DogAllOf({ + this.breed, + }); + + @JsonKey(name: r'breed', required: false, includeIfNull: false) + final String? breed; + + @override + bool operator ==(Object other) => + identical(this, other) || other is DogAllOf && other.breed == breed; + + @override + int get hashCode => breed.hashCode; + + factory DogAllOf.fromJson(Map json) => + _$DogAllOfFromJson(json); + + Map toJson() => _$DogAllOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/entity.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/entity.dart new file mode 100644 index 000000000000..9bba5eff8b34 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/entity.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'entity.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Entity { + /// Returns a new [Entity] instance. + Entity({ + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Entity && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Entity.fromJson(Map json) => _$EntityFromJson(json); + + Map toJson() => _$EntityToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/entity_ref.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/entity_ref.dart new file mode 100644 index 000000000000..32901f43eaa9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/entity_ref.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'entity_ref.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EntityRef { + /// Returns a new [EntityRef] instance. + EntityRef({ + this.name, + this.atReferredType, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Name of the related entity. + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + /// The actual type of the target instance when needed for disambiguation. + @JsonKey(name: r'@referredType', required: false, includeIfNull: false) + final String? atReferredType; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is EntityRef && + other.name == name && + other.atReferredType == atReferredType && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + name.hashCode + + atReferredType.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory EntityRef.fromJson(Map json) => + _$EntityRefFromJson(json); + + Map toJson() => _$EntityRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/enum_arrays.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/enum_arrays.dart new file mode 100644 index 000000000000..4a9ce1458928 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/enum_arrays.dart @@ -0,0 +1,66 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'enum_arrays.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EnumArrays { + /// Returns a new [EnumArrays] instance. + EnumArrays({ + this.justSymbol, + this.arrayEnum, + }); + + @JsonKey(name: r'just_symbol', required: false, includeIfNull: false) + final EnumArraysJustSymbolEnum? justSymbol; + + @JsonKey(name: r'array_enum', required: false, includeIfNull: false) + final List? arrayEnum; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is EnumArrays && + other.justSymbol == justSymbol && + other.arrayEnum == arrayEnum; + + @override + int get hashCode => justSymbol.hashCode + arrayEnum.hashCode; + + factory EnumArrays.fromJson(Map json) => + _$EnumArraysFromJson(json); + + Map toJson() => _$EnumArraysToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +enum EnumArraysJustSymbolEnum { + @JsonValue(r'>=') + greaterThanEqual, + @JsonValue(r'$') + dollar, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + +enum EnumArraysArrayEnumEnum { + @JsonValue(r'fish') + fish, + @JsonValue(r'crab') + crab, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/enum_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/enum_test.dart new file mode 100644 index 000000000000..926b40e5977f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/enum_test.dart @@ -0,0 +1,134 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'enum_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EnumTest { + /// Returns a new [EnumTest] instance. + EnumTest({ + this.enumString, + required this.enumStringRequired, + this.enumInteger, + this.enumNumber, + this.outerEnum, + this.outerEnumInteger, + this.outerEnumDefaultValue, + this.outerEnumIntegerDefaultValue, + }); + + @JsonKey(name: r'enum_string', required: false, includeIfNull: false) + final EnumTestEnumStringEnum? enumString; + + @JsonKey(name: r'enum_string_required', required: true, includeIfNull: false) + final EnumTestEnumStringRequiredEnum enumStringRequired; + + @JsonKey(name: r'enum_integer', required: false, includeIfNull: false) + final EnumTestEnumIntegerEnum? enumInteger; + + @JsonKey(name: r'enum_number', required: false, includeIfNull: false) + final EnumTestEnumNumberEnum? enumNumber; + + @JsonKey(name: r'outerEnum', required: false, includeIfNull: false) + final OuterEnum? outerEnum; + + @JsonKey(name: r'outerEnumInteger', required: false, includeIfNull: false) + final OuterEnumInteger? outerEnumInteger; + + @JsonKey( + name: r'outerEnumDefaultValue', required: false, includeIfNull: false) + final OuterEnumDefaultValue? outerEnumDefaultValue; + + @JsonKey( + name: r'outerEnumIntegerDefaultValue', + required: false, + includeIfNull: false) + final OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is EnumTest && + other.enumString == enumString && + other.enumStringRequired == enumStringRequired && + other.enumInteger == enumInteger && + other.enumNumber == enumNumber && + other.outerEnum == outerEnum && + other.outerEnumInteger == outerEnumInteger && + other.outerEnumDefaultValue == outerEnumDefaultValue && + other.outerEnumIntegerDefaultValue == outerEnumIntegerDefaultValue; + + @override + int get hashCode => + enumString.hashCode + + enumStringRequired.hashCode + + enumInteger.hashCode + + enumNumber.hashCode + + (outerEnum == null ? 0 : outerEnum.hashCode) + + outerEnumInteger.hashCode + + outerEnumDefaultValue.hashCode + + outerEnumIntegerDefaultValue.hashCode; + + factory EnumTest.fromJson(Map json) => + _$EnumTestFromJson(json); + + Map toJson() => _$EnumTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +enum EnumTestEnumStringEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'') + empty, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + +enum EnumTestEnumStringRequiredEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'') + empty, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + +enum EnumTestEnumIntegerEnum { + @JsonValue(1) + number1, + @JsonValue(-1) + numberNegative1, + @JsonValue(11184809) + unknownDefaultOpenApi, +} + +enum EnumTestEnumNumberEnum { + @JsonValue('1.1') + number1Period1, + @JsonValue('-1.2') + numberNegative1Period2, + @JsonValue('11184809') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example.dart new file mode 100644 index 000000000000..12ed94125a83 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/child.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'example.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Example { + /// Returns a new [Example] instance. + Example({ + this.name, + }); + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Example && other.name == name; + + @override + int get hashCode => name.hashCode; + + factory Example.fromJson(Map json) => + _$ExampleFromJson(json); + + Map toJson() => _$ExampleToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example_non_primitive.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example_non_primitive.dart new file mode 100644 index 000000000000..daa629ccf6c4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example_non_primitive.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'example_non_primitive.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ExampleNonPrimitive { + /// Returns a new [ExampleNonPrimitive] instance. + ExampleNonPrimitive({ + }); + + @override + bool operator ==(Object other) => identical(this, other) || other is ExampleNonPrimitive && + + @override + int get hashCode => + + factory ExampleNonPrimitive.fromJson(Map json) => _$ExampleNonPrimitiveFromJson(json); + + Map toJson() => _$ExampleNonPrimitiveToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/extensible.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/extensible.dart new file mode 100644 index 000000000000..bad2e3789836 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/extensible.dart @@ -0,0 +1,57 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'extensible.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Extensible { + /// Returns a new [Extensible] instance. + Extensible({ + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Extensible && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + atSchemaLocation.hashCode + atBaseType.hashCode + atType.hashCode; + + factory Extensible.fromJson(Map json) => + _$ExtensibleFromJson(json); + + Map toJson() => _$ExtensibleToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/file_schema_test_class.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/file_schema_test_class.dart new file mode 100644 index 000000000000..3da04204b0b2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/file_schema_test_class.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/model_file.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'file_schema_test_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FileSchemaTestClass { + /// Returns a new [FileSchemaTestClass] instance. + FileSchemaTestClass({ + this.file, + this.files, + }); + + @JsonKey(name: r'file', required: false, includeIfNull: false) + final ModelFile? file; + + @JsonKey(name: r'files', required: false, includeIfNull: false) + final List? files; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FileSchemaTestClass && + other.file == file && + other.files == files; + + @override + int get hashCode => file.hashCode + files.hashCode; + + factory FileSchemaTestClass.fromJson(Map json) => + _$FileSchemaTestClassFromJson(json); + + Map toJson() => _$FileSchemaTestClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo.dart new file mode 100644 index 000000000000..5fbd0e3f800a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Foo { + /// Returns a new [Foo] instance. + Foo({ + this.fooPropA, + this.fooPropB, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'fooPropA', required: false, includeIfNull: false) + final String? fooPropA; + + @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) + final String? fooPropB; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Foo && + other.fooPropA == fooPropA && + other.fooPropB == fooPropB && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + fooPropA.hashCode + + fooPropB.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Foo.fromJson(Map json) => _$FooFromJson(json); + + Map toJson() => _$FooToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo_ref.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo_ref.dart new file mode 100644 index 000000000000..1e0ec166fb66 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo_ref.dart @@ -0,0 +1,81 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo_ref.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FooRef { + /// Returns a new [FooRef] instance. + FooRef({ + this.foorefPropA, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'foorefPropA', required: false, includeIfNull: false) + final String? foorefPropA; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FooRef && + other.foorefPropA == foorefPropA && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + foorefPropA.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory FooRef.fromJson(Map json) => _$FooRefFromJson(json); + + Map toJson() => _$FooRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo_ref_or_value.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo_ref_or_value.dart new file mode 100644 index 000000000000..f71d4b51f73e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/foo_ref_or_value.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo_ref_or_value.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FooRefOrValue { + /// Returns a new [FooRefOrValue] instance. + FooRefOrValue({ + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FooRefOrValue && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory FooRefOrValue.fromJson(Map json) => + _$FooRefOrValueFromJson(json); + + Map toJson() => _$FooRefOrValueToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/format_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/format_test.dart new file mode 100644 index 000000000000..f036a62c2df5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/format_test.dart @@ -0,0 +1,150 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:dio/dio.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'format_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FormatTest { + /// Returns a new [FormatTest] instance. + FormatTest({ + this.integer, + this.int32, + this.int64, + required this.number, + this.float, + this.double_, + this.decimal, + this.string, + required this.byte, + this.binary, + required this.date, + this.dateTime, + this.uuid, + required this.password, + this.patternWithDigits, + this.patternWithDigitsAndDelimiter, + }); + + // minimum: 10 + // maximum: 100 + @JsonKey(name: r'integer', required: false, includeIfNull: false) + final int? integer; + + // minimum: 20 + // maximum: 200 + @JsonKey(name: r'int32', required: false, includeIfNull: false) + final int? int32; + + @JsonKey(name: r'int64', required: false, includeIfNull: false) + final int? int64; + + // minimum: 32.1 + // maximum: 543.2 + @JsonKey(name: r'number', required: true, includeIfNull: false) + final num number; + + // minimum: 54.3 + // maximum: 987.6 + @JsonKey(name: r'float', required: false, includeIfNull: false) + final double? float; + + // minimum: 67.8 + // maximum: 123.4 + @JsonKey(name: r'double', required: false, includeIfNull: false) + final double? double_; + + @JsonKey(name: r'decimal', required: false, includeIfNull: false) + final double? decimal; + + @JsonKey(name: r'string', required: false, includeIfNull: false) + final String? string; + + @JsonKey(name: r'byte', required: true, includeIfNull: false) + final String byte; + + @JsonKey(ignore: true) + final MultipartFile? binary; + + @JsonKey(name: r'date', required: true, includeIfNull: false) + final DateTime date; + + @JsonKey(name: r'dateTime', required: false, includeIfNull: false) + final DateTime? dateTime; + + @JsonKey(name: r'uuid', required: false, includeIfNull: false) + final String? uuid; + + @JsonKey(name: r'password', required: true, includeIfNull: false) + final String password; + + /// A string that is a 10 digit number. Can have leading zeros. + @JsonKey(name: r'pattern_with_digits', required: false, includeIfNull: false) + final String? patternWithDigits; + + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + @JsonKey( + name: r'pattern_with_digits_and_delimiter', + required: false, + includeIfNull: false) + final String? patternWithDigitsAndDelimiter; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FormatTest && + other.integer == integer && + other.int32 == int32 && + other.int64 == int64 && + other.number == number && + other.float == float && + other.double_ == double_ && + other.decimal == decimal && + other.string == string && + other.byte == byte && + other.binary == binary && + other.date == date && + other.dateTime == dateTime && + other.uuid == uuid && + other.password == password && + other.patternWithDigits == patternWithDigits && + other.patternWithDigitsAndDelimiter == patternWithDigitsAndDelimiter; + + @override + int get hashCode => + integer.hashCode + + int32.hashCode + + int64.hashCode + + number.hashCode + + float.hashCode + + double_.hashCode + + decimal.hashCode + + string.hashCode + + byte.hashCode + + binary.hashCode + + date.hashCode + + dateTime.hashCode + + uuid.hashCode + + password.hashCode + + patternWithDigits.hashCode + + patternWithDigitsAndDelimiter.hashCode; + + factory FormatTest.fromJson(Map json) => + _$FormatTestFromJson(json); + + Map toJson() => _$FormatTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/fruit.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/fruit.dart new file mode 100644 index 000000000000..ecbad5014c05 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/fruit.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Fruit { + /// Returns a new [Fruit] instance. + Fruit({ + this.color, + this.kind, + this.count, + }); + + @JsonKey(name: r'color', required: false, includeIfNull: false) + final String? color; + + @JsonKey(name: r'kind', required: false, includeIfNull: false) + final String? kind; + + @JsonKey(name: r'count', required: false, includeIfNull: false) + final num? count; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Fruit && + other.color == color && + other.kind == kind && + other.count == count; + + @override + int get hashCode => color.hashCode + kind.hashCode + count.hashCode; + + factory Fruit.fromJson(Map json) => _$FruitFromJson(json); + + Map toJson() => _$FruitToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/has_only_read_only.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/has_only_read_only.dart new file mode 100644 index 000000000000..ed6a55c59d03 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/has_only_read_only.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'has_only_read_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HasOnlyReadOnly { + /// Returns a new [HasOnlyReadOnly] instance. + HasOnlyReadOnly({ + this.bar, + this.foo, + }); + + @JsonKey(name: r'bar', required: false, includeIfNull: false) + final String? bar; + + @JsonKey(name: r'foo', required: false, includeIfNull: false) + final String? foo; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is HasOnlyReadOnly && other.bar == bar && other.foo == foo; + + @override + int get hashCode => bar.hashCode + foo.hashCode; + + factory HasOnlyReadOnly.fromJson(Map json) => + _$HasOnlyReadOnlyFromJson(json); + + Map toJson() => _$HasOnlyReadOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/health_check_result.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/health_check_result.dart new file mode 100644 index 000000000000..e14245b733fe --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/health_check_result.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'health_check_result.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HealthCheckResult { + /// Returns a new [HealthCheckResult] instance. + HealthCheckResult({ + this.nullableMessage, + }); + + @JsonKey(name: r'NullableMessage', required: false, includeIfNull: false) + final String? nullableMessage; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is HealthCheckResult && other.nullableMessage == nullableMessage; + + @override + int get hashCode => (nullableMessage == null ? 0 : nullableMessage.hashCode); + + factory HealthCheckResult.fromJson(Map json) => + _$HealthCheckResultFromJson(json); + + Map toJson() => _$HealthCheckResultToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/map_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/map_test.dart new file mode 100644 index 000000000000..68f69e6ab300 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/map_test.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'map_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MapTest { + /// Returns a new [MapTest] instance. + MapTest({ + this.mapMapOfString, + this.mapOfEnumString, + this.directMap, + this.indirectMap, + }); + + @JsonKey(name: r'map_map_of_string', required: false, includeIfNull: false) + final Map>? mapMapOfString; + + @JsonKey(name: r'map_of_enum_string', required: false, includeIfNull: false) + final Map? mapOfEnumString; + + @JsonKey(name: r'direct_map', required: false, includeIfNull: false) + final Map? directMap; + + @JsonKey(name: r'indirect_map', required: false, includeIfNull: false) + final Map? indirectMap; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MapTest && + other.mapMapOfString == mapMapOfString && + other.mapOfEnumString == mapOfEnumString && + other.directMap == directMap && + other.indirectMap == indirectMap; + + @override + int get hashCode => + mapMapOfString.hashCode + + mapOfEnumString.hashCode + + directMap.hashCode + + indirectMap.hashCode; + + factory MapTest.fromJson(Map json) => + _$MapTestFromJson(json); + + Map toJson() => _$MapTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +enum MapTestMapOfEnumStringEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart new file mode 100644 index 000000000000..7045930e1616 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'mixed_properties_and_additional_properties_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MixedPropertiesAndAdditionalPropertiesClass { + /// Returns a new [MixedPropertiesAndAdditionalPropertiesClass] instance. + MixedPropertiesAndAdditionalPropertiesClass({ + this.uuid, + this.dateTime, + this.map, + }); + + @JsonKey(name: r'uuid', required: false, includeIfNull: false) + final String? uuid; + + @JsonKey(name: r'dateTime', required: false, includeIfNull: false) + final DateTime? dateTime; + + @JsonKey(name: r'map', required: false, includeIfNull: false) + final Map? map; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MixedPropertiesAndAdditionalPropertiesClass && + other.uuid == uuid && + other.dateTime == dateTime && + other.map == map; + + @override + int get hashCode => uuid.hashCode + dateTime.hashCode + map.hashCode; + + factory MixedPropertiesAndAdditionalPropertiesClass.fromJson( + Map json) => + _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); + + Map toJson() => + _$MixedPropertiesAndAdditionalPropertiesClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model200_response.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model200_response.dart new file mode 100644 index 000000000000..a95d30009c5d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model200_response.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model200_response.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Model200Response { + /// Returns a new [Model200Response] instance. + Model200Response({ + this.name, + this.classField, + }); + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final int? name; + + @JsonKey(name: r'class', required: false, includeIfNull: false) + final String? classField; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Model200Response && + other.name == name && + other.classField == classField; + + @override + int get hashCode => name.hashCode + classField.hashCode; + + factory Model200Response.fromJson(Map json) => + _$Model200ResponseFromJson(json); + + Map toJson() => _$Model200ResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_client.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_client.dart new file mode 100644 index 000000000000..420ab5a1f4dd --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_client.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_client.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelClient { + /// Returns a new [ModelClient] instance. + ModelClient({ + this.client, + }); + + @JsonKey(name: r'client', required: false, includeIfNull: false) + final String? client; + + @override + bool operator ==(Object other) => + identical(this, other) || other is ModelClient && other.client == client; + + @override + int get hashCode => client.hashCode; + + factory ModelClient.fromJson(Map json) => + _$ModelClientFromJson(json); + + Map toJson() => _$ModelClientToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_enum_class.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_enum_class.dart new file mode 100644 index 000000000000..67b79a2a5c9a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_enum_class.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum ModelEnumClass { + @JsonValue(r'_abc') + abc, + @JsonValue(r'-efg') + efg, + @JsonValue(r'(xyz)') + leftParenthesisXyzRightParenthesis, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_file.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_file.dart new file mode 100644 index 000000000000..24ab5b777009 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_file.dart @@ -0,0 +1,43 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_file.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelFile { + /// Returns a new [ModelFile] instance. + ModelFile({ + this.sourceURI, + }); + + /// Test capitalization + @JsonKey(name: r'sourceURI', required: false, includeIfNull: false) + final String? sourceURI; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModelFile && other.sourceURI == sourceURI; + + @override + int get hashCode => sourceURI.hashCode; + + factory ModelFile.fromJson(Map json) => + _$ModelFileFromJson(json); + + Map toJson() => _$ModelFileToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_list.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_list.dart new file mode 100644 index 000000000000..b2d3f190af9e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_list.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_list.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelList { + /// Returns a new [ModelList] instance. + ModelList({ + this.n123list, + }); + + @JsonKey(name: r'123-list', required: false, includeIfNull: false) + final String? n123list; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModelList && other.n123list == n123list; + + @override + int get hashCode => n123list.hashCode; + + factory ModelList.fromJson(Map json) => + _$ModelListFromJson(json); + + Map toJson() => _$ModelListToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_return.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_return.dart new file mode 100644 index 000000000000..1d2547c95628 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/model_return.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_return.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelReturn { + /// Returns a new [ModelReturn] instance. + ModelReturn({ + this.return_, + }); + + @JsonKey(name: r'return', required: false, includeIfNull: false) + final int? return_; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModelReturn && other.return_ == return_; + + @override + int get hashCode => return_.hashCode; + + factory ModelReturn.fromJson(Map json) => + _$ModelReturnFromJson(json); + + Map toJson() => _$ModelReturnToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/name.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/name.dart new file mode 100644 index 000000000000..0aad5dcc0480 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/name.dart @@ -0,0 +1,61 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'name.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Name { + /// Returns a new [Name] instance. + Name({ + required this.name, + this.snakeCase, + this.property, + this.n123number, + }); + + @JsonKey(name: r'name', required: true, includeIfNull: false) + final int name; + + @JsonKey(name: r'snake_case', required: false, includeIfNull: false) + final int? snakeCase; + + @JsonKey(name: r'property', required: false, includeIfNull: false) + final String? property; + + @JsonKey(name: r'123Number', required: false, includeIfNull: false) + final int? n123number; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Name && + other.name == name && + other.snakeCase == snakeCase && + other.property == property && + other.n123number == n123number; + + @override + int get hashCode => + name.hashCode + + snakeCase.hashCode + + property.hashCode + + n123number.hashCode; + + factory Name.fromJson(Map json) => _$NameFromJson(json); + + Map toJson() => _$NameToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/nullable_class.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/nullable_class.dart new file mode 100644 index 000000000000..66e3f84395b6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/nullable_class.dart @@ -0,0 +1,121 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'nullable_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NullableClass { + /// Returns a new [NullableClass] instance. + NullableClass({ + this.integerProp, + this.numberProp, + this.booleanProp, + this.stringProp, + this.dateProp, + this.datetimeProp, + this.arrayNullableProp, + this.arrayAndItemsNullableProp, + this.arrayItemsNullable, + this.objectNullableProp, + this.objectAndItemsNullableProp, + this.objectItemsNullable, + }); + + @JsonKey(name: r'integer_prop', required: false, includeIfNull: false) + final int? integerProp; + + @JsonKey(name: r'number_prop', required: false, includeIfNull: false) + final num? numberProp; + + @JsonKey(name: r'boolean_prop', required: false, includeIfNull: false) + final bool? booleanProp; + + @JsonKey(name: r'string_prop', required: false, includeIfNull: false) + final String? stringProp; + + @JsonKey(name: r'date_prop', required: false, includeIfNull: false) + final DateTime? dateProp; + + @JsonKey(name: r'datetime_prop', required: false, includeIfNull: false) + final DateTime? datetimeProp; + + @JsonKey(name: r'array_nullable_prop', required: false, includeIfNull: false) + final List? arrayNullableProp; + + @JsonKey( + name: r'array_and_items_nullable_prop', + required: false, + includeIfNull: false) + final List? arrayAndItemsNullableProp; + + @JsonKey(name: r'array_items_nullable', required: false, includeIfNull: false) + final List? arrayItemsNullable; + + @JsonKey(name: r'object_nullable_prop', required: false, includeIfNull: false) + final Map? objectNullableProp; + + @JsonKey( + name: r'object_and_items_nullable_prop', + required: false, + includeIfNull: false) + final Map? objectAndItemsNullableProp; + + @JsonKey( + name: r'object_items_nullable', required: false, includeIfNull: false) + final Map? objectItemsNullable; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NullableClass && + other.integerProp == integerProp && + other.numberProp == numberProp && + other.booleanProp == booleanProp && + other.stringProp == stringProp && + other.dateProp == dateProp && + other.datetimeProp == datetimeProp && + other.arrayNullableProp == arrayNullableProp && + other.arrayAndItemsNullableProp == arrayAndItemsNullableProp && + other.arrayItemsNullable == arrayItemsNullable && + other.objectNullableProp == objectNullableProp && + other.objectAndItemsNullableProp == objectAndItemsNullableProp && + other.objectItemsNullable == objectItemsNullable; + + @override + int get hashCode => + (integerProp == null ? 0 : integerProp.hashCode) + + (numberProp == null ? 0 : numberProp.hashCode) + + (booleanProp == null ? 0 : booleanProp.hashCode) + + (stringProp == null ? 0 : stringProp.hashCode) + + (dateProp == null ? 0 : dateProp.hashCode) + + (datetimeProp == null ? 0 : datetimeProp.hashCode) + + (arrayNullableProp == null ? 0 : arrayNullableProp.hashCode) + + (arrayAndItemsNullableProp == null + ? 0 + : arrayAndItemsNullableProp.hashCode) + + arrayItemsNullable.hashCode + + (objectNullableProp == null ? 0 : objectNullableProp.hashCode) + + (objectAndItemsNullableProp == null + ? 0 + : objectAndItemsNullableProp.hashCode) + + objectItemsNullable.hashCode; + + factory NullableClass.fromJson(Map json) => + _$NullableClassFromJson(json); + + Map toJson() => _$NullableClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/number_only.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/number_only.dart new file mode 100644 index 000000000000..75022ee68437 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/number_only.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'number_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NumberOnly { + /// Returns a new [NumberOnly] instance. + NumberOnly({ + this.justNumber, + }); + + @JsonKey(name: r'JustNumber', required: false, includeIfNull: false) + final num? justNumber; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NumberOnly && other.justNumber == justNumber; + + @override + int get hashCode => justNumber.hashCode; + + factory NumberOnly.fromJson(Map json) => + _$NumberOnlyFromJson(json); + + Map toJson() => _$NumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/object_with_deprecated_fields.dart new file mode 100644 index 000000000000..77865e64e421 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/object_with_deprecated_fields.dart @@ -0,0 +1,61 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'object_with_deprecated_fields.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ObjectWithDeprecatedFields { + /// Returns a new [ObjectWithDeprecatedFields] instance. + ObjectWithDeprecatedFields({ + this.uuid, + this.id, + this.deprecatedRef, + this.bars, + }); + + @JsonKey(name: r'uuid', required: false, includeIfNull: false) + final String? uuid; + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final num? id; + + @JsonKey(name: r'deprecatedRef', required: false, includeIfNull: false) + final DeprecatedObject? deprecatedRef; + + @JsonKey(name: r'bars', required: false, includeIfNull: false) + final List? bars; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ObjectWithDeprecatedFields && + other.uuid == uuid && + other.id == id && + other.deprecatedRef == deprecatedRef && + other.bars == bars; + + @override + int get hashCode => + uuid.hashCode + id.hashCode + deprecatedRef.hashCode + bars.hashCode; + + factory ObjectWithDeprecatedFields.fromJson(Map json) => + _$ObjectWithDeprecatedFieldsFromJson(json); + + Map toJson() => _$ObjectWithDeprecatedFieldsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/order.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/order.dart new file mode 100644 index 000000000000..e5bcbae3225e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/order.dart @@ -0,0 +1,90 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'order.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Order { + /// Returns a new [Order] instance. + Order({ + this.id, + this.petId, + this.quantity, + this.shipDate, + this.status, + this.complete = false, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'petId', required: false, includeIfNull: false) + final int? petId; + + @JsonKey(name: r'quantity', required: false, includeIfNull: false) + final int? quantity; + + @JsonKey(name: r'shipDate', required: false, includeIfNull: false) + final DateTime? shipDate; + + /// Order Status + @JsonKey(name: r'status', required: false, includeIfNull: false) + final OrderStatusEnum? status; + + @JsonKey( + defaultValue: false, + name: r'complete', + required: false, + includeIfNull: false) + final bool? complete; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Order && + other.id == id && + other.petId == petId && + other.quantity == quantity && + other.shipDate == shipDate && + other.status == status && + other.complete == complete; + + @override + int get hashCode => + id.hashCode + + petId.hashCode + + quantity.hashCode + + shipDate.hashCode + + status.hashCode + + complete.hashCode; + + factory Order.fromJson(Map json) => _$OrderFromJson(json); + + Map toJson() => _$OrderToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +/// Order Status +enum OrderStatusEnum { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_composite.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_composite.dart new file mode 100644 index 000000000000..df6d371f533f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_composite.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'outer_composite.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OuterComposite { + /// Returns a new [OuterComposite] instance. + OuterComposite({ + this.myNumber, + this.myString, + this.myBoolean, + }); + + @JsonKey(name: r'my_number', required: false, includeIfNull: false) + final num? myNumber; + + @JsonKey(name: r'my_string', required: false, includeIfNull: false) + final String? myString; + + @JsonKey(name: r'my_boolean', required: false, includeIfNull: false) + final bool? myBoolean; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OuterComposite && + other.myNumber == myNumber && + other.myString == myString && + other.myBoolean == myBoolean; + + @override + int get hashCode => + myNumber.hashCode + myString.hashCode + myBoolean.hashCode; + + factory OuterComposite.fromJson(Map json) => + _$OuterCompositeFromJson(json); + + Map toJson() => _$OuterCompositeToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum.dart new file mode 100644 index 000000000000..2d1326c259bf --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum OuterEnum { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_default_value.dart new file mode 100644 index 000000000000..45919f099158 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_default_value.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum OuterEnumDefaultValue { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_integer.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_integer.dart new file mode 100644 index 000000000000..b91ca3455678 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_integer.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum OuterEnumInteger { + @JsonValue(0) + number0, + @JsonValue(1) + number1, + @JsonValue(2) + number2, + @JsonValue(11184809) + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_integer_default_value.dart new file mode 100644 index 000000000000..799321b37c85 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_enum_integer_default_value.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum OuterEnumIntegerDefaultValue { + @JsonValue(0) + number0, + @JsonValue(1) + number1, + @JsonValue(2) + number2, + @JsonValue(11184809) + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_object_with_enum_property.dart new file mode 100644 index 000000000000..7620543d1f4a --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/outer_object_with_enum_property.dart @@ -0,0 +1,43 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'outer_object_with_enum_property.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OuterObjectWithEnumProperty { + /// Returns a new [OuterObjectWithEnumProperty] instance. + OuterObjectWithEnumProperty({ + required this.value, + }); + + @JsonKey(name: r'value', required: true, includeIfNull: false) + final OuterEnumInteger value; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OuterObjectWithEnumProperty && other.value == value; + + @override + int get hashCode => value.hashCode; + + factory OuterObjectWithEnumProperty.fromJson(Map json) => + _$OuterObjectWithEnumPropertyFromJson(json); + + Map toJson() => _$OuterObjectWithEnumPropertyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pasta.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pasta.dart new file mode 100644 index 000000000000..816d59814caf --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pasta.dart @@ -0,0 +1,81 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pasta.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pasta { + /// Returns a new [Pasta] instance. + Pasta({ + this.vendor, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'vendor', required: false, includeIfNull: false) + final String? vendor; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Pasta && + other.vendor == vendor && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + vendor.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Pasta.fromJson(Map json) => _$PastaFromJson(json); + + Map toJson() => _$PastaToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pet.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pet.dart new file mode 100644 index 000000000000..58cdc030d017 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pet.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pet.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pet { + /// Returns a new [Pet] instance. + Pet({ + this.id, + required this.name, + this.category, + required this.photoUrls, + this.tags, + this.status, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'name', required: true, includeIfNull: false) + final String name; + + @JsonKey(name: r'category', required: false, includeIfNull: false) + final Category? category; + + @JsonKey(name: r'photoUrls', required: true, includeIfNull: false) + final List photoUrls; + + @JsonKey(name: r'tags', required: false, includeIfNull: false) + final List? tags; + + /// pet status in the store + @JsonKey(name: r'status', required: false, includeIfNull: false) + final PetStatusEnum? status; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Pet && + other.id == id && + other.name == name && + other.category == category && + other.photoUrls == photoUrls && + other.tags == tags && + other.status == status; + + @override + int get hashCode => + id.hashCode + + name.hashCode + + category.hashCode + + photoUrls.hashCode + + tags.hashCode + + status.hashCode; + + factory Pet.fromJson(Map json) => _$PetFromJson(json); + + Map toJson() => _$PetToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +/// pet status in the store +enum PetStatusEnum { + @JsonValue(r'available') + available, + @JsonValue(r'pending') + pending, + @JsonValue(r'sold') + sold, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pizza.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pizza.dart new file mode 100644 index 000000000000..32d80d992a50 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pizza.dart @@ -0,0 +1,81 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pizza.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pizza { + /// Returns a new [Pizza] instance. + Pizza({ + this.pizzaSize, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'pizzaSize', required: false, includeIfNull: false) + final num? pizzaSize; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Pizza && + other.pizzaSize == pizzaSize && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + pizzaSize.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Pizza.fromJson(Map json) => _$PizzaFromJson(json); + + Map toJson() => _$PizzaToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pizza_speziale.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pizza_speziale.dart new file mode 100644 index 000000000000..07d031e8c289 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/pizza_speziale.dart @@ -0,0 +1,82 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/pizza.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pizza_speziale.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PizzaSpeziale { + /// Returns a new [PizzaSpeziale] instance. + PizzaSpeziale({ + this.toppings, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'toppings', required: false, includeIfNull: false) + final String? toppings; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PizzaSpeziale && + other.toppings == toppings && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + toppings.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory PizzaSpeziale.fromJson(Map json) => + _$PizzaSpezialeFromJson(json); + + Map toJson() => _$PizzaSpezialeToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/read_only_first.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/read_only_first.dart new file mode 100644 index 000000000000..38c57afbafd8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/read_only_first.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'read_only_first.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ReadOnlyFirst { + /// Returns a new [ReadOnlyFirst] instance. + ReadOnlyFirst({ + this.bar, + this.baz, + }); + + @JsonKey(name: r'bar', required: false, includeIfNull: false) + final String? bar; + + @JsonKey(name: r'baz', required: false, includeIfNull: false) + final String? baz; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ReadOnlyFirst && other.bar == bar && other.baz == baz; + + @override + int get hashCode => bar.hashCode + baz.hashCode; + + factory ReadOnlyFirst.fromJson(Map json) => + _$ReadOnlyFirstFromJson(json); + + Map toJson() => _$ReadOnlyFirstToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/single_ref_type.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/single_ref_type.dart new file mode 100644 index 000000000000..783d766acc82 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/single_ref_type.dart @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum SingleRefType { + @JsonValue(r'admin') + admin, + @JsonValue(r'user') + user, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/special_model_name.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/special_model_name.dart new file mode 100644 index 000000000000..fe1029818a7f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/special_model_name.dart @@ -0,0 +1,47 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'special_model_name.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class SpecialModelName { + /// Returns a new [SpecialModelName] instance. + SpecialModelName({ + this.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, + }); + + @JsonKey( + name: r'$special[property.name]', required: false, includeIfNull: false) + final int? dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SpecialModelName && + other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + @override + int get hashCode => + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + .hashCode; + + factory SpecialModelName.fromJson(Map json) => + _$SpecialModelNameFromJson(json); + + Map toJson() => _$SpecialModelNameToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/tag.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/tag.dart new file mode 100644 index 000000000000..e1c5a2c8cc1c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/tag.dart @@ -0,0 +1,45 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'tag.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Tag { + /// Returns a new [Tag] instance. + Tag({ + this.id, + this.name, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Tag && other.id == id && other.name == name; + + @override + int get hashCode => id.hashCode + name.hashCode; + + factory Tag.fromJson(Map json) => _$TagFromJson(json); + + Map toJson() => _$TagToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart new file mode 100644 index 000000000000..cbea21d55960 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart @@ -0,0 +1,47 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'test_query_style_form_explode_true_array_string_query_object_parameter.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { + /// Returns a new [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter] instance. + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter({ + this.values, + }); + + @JsonKey(name: r'values', required: false, includeIfNull: false) + final List? values; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter && + other.values == values; + + @override + int get hashCode => values.hashCode; + + factory TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.fromJson( + Map json) => + _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterFromJson( + json); + + Map toJson() => + _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterToJson( + this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/user.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/user.dart new file mode 100644 index 000000000000..f1da4cd38cab --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/user.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'user.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class User { + /// Returns a new [User] instance. + User({ + this.id, + this.username, + this.firstName, + this.lastName, + this.email, + this.password, + this.phone, + this.userStatus, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'username', required: false, includeIfNull: false) + final String? username; + + @JsonKey(name: r'firstName', required: false, includeIfNull: false) + final String? firstName; + + @JsonKey(name: r'lastName', required: false, includeIfNull: false) + final String? lastName; + + @JsonKey(name: r'email', required: false, includeIfNull: false) + final String? email; + + @JsonKey(name: r'password', required: false, includeIfNull: false) + final String? password; + + @JsonKey(name: r'phone', required: false, includeIfNull: false) + final String? phone; + + /// User Status + @JsonKey(name: r'userStatus', required: false, includeIfNull: false) + final int? userStatus; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is User && + other.id == id && + other.username == username && + other.firstName == firstName && + other.lastName == lastName && + other.email == email && + other.password == password && + other.phone == phone && + other.userStatus == userStatus; + + @override + int get hashCode => + id.hashCode + + username.hashCode + + firstName.hashCode + + lastName.hashCode + + email.hashCode + + password.hashCode + + phone.hashCode + + userStatus.hashCode; + + factory User.fromJson(Map json) => _$UserFromJson(json); + + Map toJson() => _$UserToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/pubspec.yaml b/samples/client/echo_api/dart/dart-dio-json_serializable/pubspec.yaml new file mode 100644 index 000000000000..7d77ea38b02e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/pubspec.yaml @@ -0,0 +1,17 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '>=2.14.0 <3.0.0' + +dependencies: + + dio: '>=4.0.1 <5.0.0' + json_annotation: '^4.4.0' + +dev_dependencies: + build_runner: any + json_serializable: '^6.1.5' + test: ^1.16.0 diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/additional_properties_class_test.dart new file mode 100644 index 000000000000..28348e7fc36e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/additional_properties_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AdditionalPropertiesClass +void main() { + final 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/client/echo_api/dart/dart-dio-json_serializable/test/addressable_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/addressable_test.dart new file mode 100644 index 000000000000..00e1b6eba940 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/addressable_test.dart @@ -0,0 +1,22 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/all_of_with_single_ref_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/all_of_with_single_ref_test.dart new file mode 100644 index 000000000000..92cbebda26cf --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/all_of_with_single_ref_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/animal_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/animal_test.dart new file mode 100644 index 000000000000..d5464a4278b1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/animal_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/api_response_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/api_response_test.dart new file mode 100644 index 000000000000..3132ef4e8a51 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/api_response_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/apple_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/apple_test.dart new file mode 100644 index 000000000000..1c2c2037cd06 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/apple_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/array_of_array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/array_of_array_of_number_only_test.dart new file mode 100644 index 000000000000..f844a1cd920d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/array_of_array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfArrayOfNumberOnly +void main() { + final 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/client/echo_api/dart/dart-dio-json_serializable/test/array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/array_of_number_only_test.dart new file mode 100644 index 000000000000..b547bb1728d8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/array_of_number_only_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/array_test_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/array_test_test.dart new file mode 100644 index 000000000000..83b1fee56fb0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/array_test_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/banana_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/banana_test.dart new file mode 100644 index 000000000000..d5b0a6def843 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/banana_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/bar_create_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_create_test.dart new file mode 100644 index 000000000000..0833036690d6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_create_test.dart @@ -0,0 +1,55 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/bar_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_ref_or_value_test.dart new file mode 100644 index 000000000000..3088b2f6cd4e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_ref_or_value_test.dart @@ -0,0 +1,40 @@ +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, () { + // 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/client/echo_api/dart/dart-dio-json_serializable/test/bar_ref_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_ref_test.dart new file mode 100644 index 000000000000..080a462d0be6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_ref_test.dart @@ -0,0 +1,40 @@ +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, () { + // 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/client/echo_api/dart/dart-dio-json_serializable/test/bar_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_test.dart new file mode 100644 index 000000000000..80bcd0c8227c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/bar_test.dart @@ -0,0 +1,54 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/body_api_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/body_api_test.dart new file mode 100644 index 000000000000..05eedc2d2540 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/body_api_test.dart @@ -0,0 +1,18 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +/// tests for BodyApi +void main() { + final instance = Openapi().getBodyApi(); + + group(BodyApi, () { + // Test body parameter(s) + // + // Test body parameter(s) + // + //Future testEchoBodyPet({ Pet pet }) async + test('test testEchoBodyPet', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/capitalization_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/capitalization_test.dart new file mode 100644 index 000000000000..6d1094e22d0d --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/capitalization_test.dart @@ -0,0 +1,41 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/cat_all_of_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/cat_all_of_test.dart new file mode 100644 index 000000000000..c9df8b953a81 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/cat_all_of_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for CatAllOf +void main() { + final CatAllOf? instance = /* CatAllOf(...) */ null; + // TODO add properties to the entity + + group(CatAllOf, () { + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/cat_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/cat_test.dart new file mode 100644 index 000000000000..28e5faaeb1cd --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/cat_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/category_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/category_test.dart new file mode 100644 index 000000000000..d4e1abb4179c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/category_test.dart @@ -0,0 +1,20 @@ +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 + test('to test the property `name`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/child_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/child_test.dart new file mode 100644 index 000000000000..48eac97bfd9c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/child_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/class_model_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/class_model_test.dart new file mode 100644 index 000000000000..66305bae33e5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/class_model_test.dart @@ -0,0 +1,15 @@ +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 classField + test('to test the property `classField`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/deprecated_object_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/deprecated_object_test.dart new file mode 100644 index 000000000000..8668a44a0158 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/deprecated_object_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/dog_all_of_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/dog_all_of_test.dart new file mode 100644 index 000000000000..ca5f74f20fbe --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/dog_all_of_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DogAllOf +void main() { + final DogAllOf? instance = /* DogAllOf(...) */ null; + // TODO add properties to the entity + + group(DogAllOf, () { + // String breed + test('to test the property `breed`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/dog_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/dog_test.dart new file mode 100644 index 000000000000..611f2a3fdc6f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/dog_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/entity_ref_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/entity_ref_test.dart new file mode 100644 index 000000000000..6f3bf3393abc --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/entity_ref_test.dart @@ -0,0 +1,52 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/entity_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/entity_test.dart new file mode 100644 index 000000000000..72563a81a3e5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/entity_test.dart @@ -0,0 +1,40 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/enum_arrays_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/enum_arrays_test.dart new file mode 100644 index 000000000000..5c12838ce848 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/enum_arrays_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/enum_test_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/enum_test_test.dart new file mode 100644 index 000000000000..40083505d1c0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/enum_test_test.dart @@ -0,0 +1,50 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/example_non_primitive_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/example_non_primitive_test.dart new file mode 100644 index 000000000000..dbc2c1fcae41 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/example_non_primitive_test.dart @@ -0,0 +1,10 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ExampleNonPrimitive +void main() { + final ExampleNonPrimitive? instance = /* ExampleNonPrimitive(...) */ null; + // TODO add properties to the entity + + group(ExampleNonPrimitive, () {}); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/example_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/example_test.dart new file mode 100644 index 000000000000..8c5b7ba11746 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/example_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/extensible_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/extensible_test.dart new file mode 100644 index 000000000000..821bd1b142fa --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/extensible_test.dart @@ -0,0 +1,28 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/file_schema_test_class_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/file_schema_test_class_test.dart new file mode 100644 index 000000000000..14d7c2120cd9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/file_schema_test_class_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/foo_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/foo_ref_or_value_test.dart new file mode 100644 index 000000000000..e5c101940aa0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/foo_ref_or_value_test.dart @@ -0,0 +1,40 @@ +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, () { + // 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/client/echo_api/dart/dart-dio-json_serializable/test/foo_ref_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/foo_ref_test.dart new file mode 100644 index 000000000000..fe14a0965722 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/foo_ref_test.dart @@ -0,0 +1,45 @@ +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 + }); + + // 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/client/echo_api/dart/dart-dio-json_serializable/test/foo_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/foo_test.dart new file mode 100644 index 000000000000..42b4149f85b6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/foo_test.dart @@ -0,0 +1,50 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/format_test_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/format_test_test.dart new file mode 100644 index 000000000000..93bb4ba3ca97 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/format_test_test.dart @@ -0,0 +1,92 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/fruit_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/fruit_test.dart new file mode 100644 index 000000000000..e376b1d49990 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/fruit_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/has_only_read_only_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/has_only_read_only_test.dart new file mode 100644 index 000000000000..5b33d9ca7457 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/has_only_read_only_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/health_check_result_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/health_check_result_test.dart new file mode 100644 index 000000000000..adc423fde5d8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/health_check_result_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/map_test_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/map_test_test.dart new file mode 100644 index 000000000000..e6efc4c58af7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/map_test_test.dart @@ -0,0 +1,30 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart new file mode 100644 index 000000000000..4f4ed38bff17 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MixedPropertiesAndAdditionalPropertiesClass +void main() { + final 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/client/echo_api/dart/dart-dio-json_serializable/test/model200_response_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model200_response_test.dart new file mode 100644 index 000000000000..217772fc7626 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model200_response_test.dart @@ -0,0 +1,20 @@ +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 classField + test('to test the property `classField`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_client_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_client_test.dart new file mode 100644 index 000000000000..5ea0a93ab265 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_client_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/model_enum_class_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_enum_class_test.dart new file mode 100644 index 000000000000..fa31f816801c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_enum_class_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelEnumClass +void main() { + group(ModelEnumClass, () {}); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_file_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_file_test.dart new file mode 100644 index 000000000000..cfc5be5ba117 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_file_test.dart @@ -0,0 +1,16 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/model_list_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_list_test.dart new file mode 100644 index 000000000000..a4ff05980ee6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_list_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/model_return_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_return_test.dart new file mode 100644 index 000000000000..2f97f6cf6ed7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/model_return_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/name_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/name_test.dart new file mode 100644 index 000000000000..036c3d07845c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/name_test.dart @@ -0,0 +1,30 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/nullable_class_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/nullable_class_test.dart new file mode 100644 index 000000000000..b5b320cae68b --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/nullable_class_test.dart @@ -0,0 +1,70 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/number_only_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/number_only_test.dart new file mode 100644 index 000000000000..6764fbc7a8c5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/number_only_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/object_with_deprecated_fields_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/object_with_deprecated_fields_test.dart new file mode 100644 index 000000000000..dd0c27df02a3 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/object_with_deprecated_fields_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ObjectWithDeprecatedFields +void main() { + final 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/client/echo_api/dart/dart-dio-json_serializable/test/order_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/order_test.dart new file mode 100644 index 000000000000..8d5cbc6a9df5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/order_test.dart @@ -0,0 +1,41 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/outer_composite_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_composite_test.dart new file mode 100644 index 000000000000..5d675fe37618 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_composite_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_default_value_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_default_value_test.dart new file mode 100644 index 000000000000..a5c83f615194 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_default_value_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumDefaultValue +void main() { + group(OuterEnumDefaultValue, () {}); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_integer_default_value_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_integer_default_value_test.dart new file mode 100644 index 000000000000..49ebbfcead7f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_integer_default_value_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumIntegerDefaultValue +void main() { + group(OuterEnumIntegerDefaultValue, () {}); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_integer_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_integer_test.dart new file mode 100644 index 000000000000..3c6b81305c71 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_integer_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumInteger +void main() { + group(OuterEnumInteger, () {}); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_test.dart new file mode 100644 index 000000000000..4ee10f379d5e --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_enum_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnum +void main() { + group(OuterEnum, () {}); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_object_with_enum_property_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_object_with_enum_property_test.dart new file mode 100644 index 000000000000..c658fed371ec --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/outer_object_with_enum_property_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterObjectWithEnumProperty +void main() { + final 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/client/echo_api/dart/dart-dio-json_serializable/test/pasta_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/pasta_test.dart new file mode 100644 index 000000000000..98ba6325ac09 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/pasta_test.dart @@ -0,0 +1,45 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/path_api_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/path_api_test.dart new file mode 100644 index 000000000000..658f714ec35f --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/path_api_test.dart @@ -0,0 +1,18 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +/// tests for PathApi +void main() { + final instance = Openapi().getPathApi(); + + group(PathApi, () { + // Test path parameter(s) + // + // Test path parameter(s) + // + //Future testsPathStringPathStringIntegerPathInteger(String pathString, int pathInteger) async + test('test testsPathStringPathStringIntegerPathInteger', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/pet_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/pet_test.dart new file mode 100644 index 000000000000..fdfc9dbd062c --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/pet_test.dart @@ -0,0 +1,41 @@ +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 + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Category category + test('to test the property `category`', () async { + // TODO + }); + + // List 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/client/echo_api/dart/dart-dio-json_serializable/test/pizza_speziale_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/pizza_speziale_test.dart new file mode 100644 index 000000000000..002deb101bfc --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/pizza_speziale_test.dart @@ -0,0 +1,45 @@ +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 + }); + + // 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/client/echo_api/dart/dart-dio-json_serializable/test/pizza_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/pizza_test.dart new file mode 100644 index 000000000000..ea886dcc3a49 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/pizza_test.dart @@ -0,0 +1,45 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/query_api_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/query_api_test.dart new file mode 100644 index 000000000000..960e3b243e74 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/query_api_test.dart @@ -0,0 +1,36 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +/// tests for QueryApi +void main() { + final instance = Openapi().getQueryApi(); + + group(QueryApi, () { + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryIntegerBooleanString({ int integerQuery, bool booleanQuery, String stringQuery }) async + test('test testQueryIntegerBooleanString', () async { + // TODO + }); + + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryStyleFormExplodeTrueArrayString({ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject }) async + test('test testQueryStyleFormExplodeTrueArrayString', () async { + // TODO + }); + + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryStyleFormExplodeTrueObject({ Pet queryObject }) async + test('test testQueryStyleFormExplodeTrueObject', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/read_only_first_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/read_only_first_test.dart new file mode 100644 index 000000000000..4f4d9d207593 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/read_only_first_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/single_ref_type_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/single_ref_type_test.dart new file mode 100644 index 000000000000..2c265f0d24ae --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/single_ref_type_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SingleRefType +void main() { + group(SingleRefType, () {}); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/special_model_name_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/special_model_name_test.dart new file mode 100644 index 000000000000..3a6043c9054b --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/special_model_name_test.dart @@ -0,0 +1,17 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/tag_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/tag_test.dart new file mode 100644 index 000000000000..df95f3461fd9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/tag_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-dio-json_serializable/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart new file mode 100644 index 000000000000..882e416d1958 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter +void main() { + final TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? + instance = /* TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(...) */ null; + // TODO add properties to the entity + + group(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, () { + // List values + test('to test the property `values`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/test/user_test.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/test/user_test.dart new file mode 100644 index 000000000000..fc1bb1cea555 --- /dev/null +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/test/user_test.dart @@ -0,0 +1,51 @@ +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 + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-http-built_value/.openapi-generator/FILES b/samples/client/echo_api/dart/dart-http-built_value/.openapi-generator/FILES index 0c1bfee18ae8..eb91ad816446 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/.openapi-generator/FILES +++ b/samples/client/echo_api/dart/dart-http-built_value/.openapi-generator/FILES @@ -73,16 +73,19 @@ doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md doc/User.md lib/openapi.dart lib/src/api.dart +lib/src/api/_exports.dart lib/src/api/body_api.dart lib/src/api/path_api.dart lib/src/api/query_api.dart lib/src/api_util.dart +lib/src/auth/_exports.dart lib/src/auth/api_key_auth.dart -lib/src/auth/authentication.dart -lib/src/auth/http_basic_auth.dart -lib/src/auth/http_bearer_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/date_serializer.dart +lib/src/model/_exports.dart lib/src/model/additional_properties_class.dart lib/src/model/addressable.dart lib/src/model/all_of_with_single_ref.dart diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/openapi.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/openapi.dart index 0b51813f1c05..0b94909a8fee 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/openapi.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/openapi.dart @@ -3,80 +3,8 @@ // export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; +export 'package:openapi/src/auth/_exports.dart'; export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; -export 'package:openapi/src/api/body_api.dart'; -export 'package:openapi/src/api/path_api.dart'; -export 'package:openapi/src/api/query_api.dart'; - -export 'package:openapi/src/model/additional_properties_class.dart'; -export 'package:openapi/src/model/addressable.dart'; -export 'package:openapi/src/model/all_of_with_single_ref.dart'; -export 'package:openapi/src/model/animal.dart'; -export 'package:openapi/src/model/api_response.dart'; -export 'package:openapi/src/model/apple.dart'; -export 'package:openapi/src/model/array_of_array_of_number_only.dart'; -export 'package:openapi/src/model/array_of_number_only.dart'; -export 'package:openapi/src/model/array_test.dart'; -export 'package:openapi/src/model/banana.dart'; -export 'package:openapi/src/model/bar.dart'; -export 'package:openapi/src/model/bar_create.dart'; -export 'package:openapi/src/model/bar_ref.dart'; -export 'package:openapi/src/model/bar_ref_or_value.dart'; -export 'package:openapi/src/model/capitalization.dart'; -export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; -export 'package:openapi/src/model/category.dart'; -export 'package:openapi/src/model/child.dart'; -export 'package:openapi/src/model/class_model.dart'; -export 'package:openapi/src/model/deprecated_object.dart'; -export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; -export 'package:openapi/src/model/entity.dart'; -export 'package:openapi/src/model/entity_ref.dart'; -export 'package:openapi/src/model/enum_arrays.dart'; -export 'package:openapi/src/model/enum_test.dart'; -export 'package:openapi/src/model/example.dart'; -export 'package:openapi/src/model/example_non_primitive.dart'; -export 'package:openapi/src/model/extensible.dart'; -export 'package:openapi/src/model/file_schema_test_class.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_ref.dart'; -export 'package:openapi/src/model/foo_ref_or_value.dart'; -export 'package:openapi/src/model/format_test.dart'; -export 'package:openapi/src/model/fruit.dart'; -export 'package:openapi/src/model/has_only_read_only.dart'; -export 'package:openapi/src/model/health_check_result.dart'; -export 'package:openapi/src/model/map_test.dart'; -export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -export 'package:openapi/src/model/model200_response.dart'; -export 'package:openapi/src/model/model_client.dart'; -export 'package:openapi/src/model/model_enum_class.dart'; -export 'package:openapi/src/model/model_file.dart'; -export 'package:openapi/src/model/model_list.dart'; -export 'package:openapi/src/model/model_return.dart'; -export 'package:openapi/src/model/name.dart'; -export 'package:openapi/src/model/nullable_class.dart'; -export 'package:openapi/src/model/number_only.dart'; -export 'package:openapi/src/model/object_with_deprecated_fields.dart'; -export 'package:openapi/src/model/order.dart'; -export 'package:openapi/src/model/outer_composite.dart'; -export 'package:openapi/src/model/outer_enum.dart'; -export 'package:openapi/src/model/outer_enum_default_value.dart'; -export 'package:openapi/src/model/outer_enum_integer.dart'; -export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -export 'package:openapi/src/model/outer_object_with_enum_property.dart'; -export 'package:openapi/src/model/pasta.dart'; -export 'package:openapi/src/model/pet.dart'; -export 'package:openapi/src/model/pizza.dart'; -export 'package:openapi/src/model/pizza_speziale.dart'; -export 'package:openapi/src/model/read_only_first.dart'; -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/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; -export 'package:openapi/src/model/user.dart'; +export 'package:openapi/src/api/_exports.dart'; +export 'package:openapi/src/model/_exports.dart'; diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart index a44ff57958c2..ca1372a6c2b4 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart @@ -5,11 +5,7 @@ import 'package:http/http.dart' as http; import 'package:built_value/serializer.dart'; import 'package:openapi/src/serializers.dart'; -import 'package:openapi/src/auth/api_key_auth.dart'; -import 'package:openapi/src/auth/authentication.dart'; -import 'package:openapi/src/auth/http_basic_auth.dart'; -import 'package:openapi/src/auth/http_bearer_auth.dart'; -import 'package:openapi/src/auth/oauth.dart'; +import 'package:openapi/src/auth/_exports.dart'; import 'package:openapi/src/api/body_api.dart'; import 'package:openapi/src/api/path_api.dart'; import 'package:openapi/src/api/query_api.dart'; @@ -28,7 +24,6 @@ class Openapi { }) : this.serializers = serializers ?? standardSerializers, this.client = client ?? http.Client(), this.actualBasePath = basePathOverride ?? basePath; - /// Get BodyApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/_exports.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/_exports.dart new file mode 100644 index 000000000000..f06d548e0d23 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/_exports.dart @@ -0,0 +1,3 @@ +export 'body_api.dart'; +export 'path_api.dart'; +export 'query_api.dart'; diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart index 5f0544fde2b5..273f5663a648 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart @@ -24,23 +24,17 @@ class BodyApi { /// * [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] containing a [Response] with a [Pet] as data /// Throws [DioError] if API call or serialization fails - Future> testEchoBodyPet({ + + Future testEchoBodyPet({ Pet? pet, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, + Map? headers, }) async { final _path = r'/echo/body/Pet'; + final _uri = Uri.parse(_basePath + _path); + final _options = Options( method: r'POST', headers: { @@ -58,11 +52,12 @@ class BodyApi { try { const _type = FullType(Pet); - _bodyData = pet == null ? null : _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { + _bodyData = pet == null + ? null + : _serializers.serialize(pet, specifiedType: _type); + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( + requestOptions: _options.compose( _dio.options, _path, ), @@ -88,7 +83,6 @@ class BodyApi { _response.data!, specifiedType: _responseType, ) as Pet; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -109,5 +103,4 @@ class BodyApi { extra: _response.extra, ); } - } diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart index 53cfeacb3125..337279dd7dfe 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart @@ -7,7 +7,6 @@ import 'dart:async'; import 'package:built_value/serializer.dart'; import 'package:http/http.dart' as http; - class PathApi { final String _basePath; final http.Client? _client; @@ -20,28 +19,24 @@ class PathApi { /// Test path parameter(s) /// /// Parameters: - /// * [pathString] - /// * [pathInteger] + /// * [pathString] + /// * [pathInteger] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// - /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> testsPathStringPathStringIntegerPathInteger({ + + Future testsPathStringPathStringIntegerPathInteger({ required String pathString, required int pathInteger, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, + Map? headers, }) async { - final _path = r'/path/string/{path_string}/integer/{path_integer}'.replaceAll('{' r'path_string' '}', pathString.toString()).replaceAll('{' r'path_integer' '}', pathInteger.toString()); + final _path = r'/path/string/{path_string}/integer/{path_integer}' + .replaceAll('{' r'path_string' '}', pathString.toString()) + .replaceAll('{' r'path_integer' '}', pathInteger.toString()); + final _uri = Uri.parse(_basePath + _path); + final _options = Options( method: r'GET', headers: { @@ -66,7 +61,6 @@ class PathApi { try { _responseData = _response.data as String; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -87,5 +81,4 @@ class PathApi { extra: _response.extra, ); } - } diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart index 9153f71a847e..5da1563a9e87 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart @@ -23,30 +23,24 @@ class QueryApi { /// Test query parameter(s) /// /// Parameters: - /// * [integerQuery] - /// * [booleanQuery] - /// * [stringQuery] + /// * [integerQuery] + /// * [booleanQuery] + /// * [stringQuery] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// - /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> testQueryIntegerBooleanString({ + + Future testQueryIntegerBooleanString({ int? integerQuery, bool? booleanQuery, String? stringQuery, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, + Map? headers, }) async { final _path = r'/query/integer/boolean/string'; + final _uri = Uri.parse(_basePath + _path); + final _options = Options( method: r'GET', headers: { @@ -60,9 +54,15 @@ class QueryApi { ); final _queryParameters = { - if (integerQuery != null) r'integer_query': encodeQueryParameter(_serializers, integerQuery, const FullType(int)), - if (booleanQuery != null) r'boolean_query': encodeQueryParameter(_serializers, booleanQuery, const FullType(bool)), - if (stringQuery != null) r'string_query': encodeQueryParameter(_serializers, stringQuery, const FullType(String)), + if (integerQuery != null) + r'integer_query': encodeQueryParameter( + _serializers, integerQuery, const FullType(int)), + if (booleanQuery != null) + r'boolean_query': encodeQueryParameter( + _serializers, booleanQuery, const FullType(bool)), + if (stringQuery != null) + r'string_query': encodeQueryParameter( + _serializers, stringQuery, const FullType(String)), }; final _response = await _dio.request( @@ -78,7 +78,6 @@ class QueryApi { try { _responseData = _response.data as String; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -104,26 +103,20 @@ class QueryApi { /// Test query parameter(s) /// /// Parameters: - /// * [queryObject] + /// * [queryObject] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// - /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> testQueryStyleFormExplodeTrueArrayString({ + + Future testQueryStyleFormExplodeTrueArrayString({ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? queryObject, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, + Map? headers, }) async { final _path = r'/query/style_form/explode_true/array_string'; + final _uri = Uri.parse(_basePath + _path); + final _options = Options( method: r'GET', headers: { @@ -137,7 +130,12 @@ class QueryApi { ); final _queryParameters = { - if (queryObject != null) r'query_object': encodeQueryParameter(_serializers, queryObject, const FullType(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter)), + if (queryObject != null) + r'query_object': encodeQueryParameter( + _serializers, + queryObject, + const FullType( + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter)), }; final _response = await _dio.request( @@ -153,7 +151,6 @@ class QueryApi { try { _responseData = _response.data as String; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -179,26 +176,20 @@ class QueryApi { /// Test query parameter(s) /// /// Parameters: - /// * [queryObject] + /// * [queryObject] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// - /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> testQueryStyleFormExplodeTrueObject({ + + Future testQueryStyleFormExplodeTrueObject({ Pet? queryObject, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, + Map? headers, }) async { final _path = r'/query/style_form/explode_true/object'; + final _uri = Uri.parse(_basePath + _path); + final _options = Options( method: r'GET', headers: { @@ -212,7 +203,9 @@ class QueryApi { ); final _queryParameters = { - if (queryObject != null) r'query_object': encodeQueryParameter(_serializers, queryObject, const FullType(Pet)), + if (queryObject != null) + r'query_object': encodeQueryParameter( + _serializers, queryObject, const FullType(Pet)), }; final _response = await _dio.request( @@ -228,7 +221,6 @@ class QueryApi { try { _responseData = _response.data as String; - } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -249,5 +241,4 @@ class QueryApi { extra: _response.extra, ); } - } diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart index ed3bb12f25b8..38448f5b5e53 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart @@ -2,76 +2,87 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:convert'; -import 'dart:typed_data'; +import 'package:http/http.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; +const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; +const _dateEpochMarker = 'epoch'; +final _dateFormatter = DateFormat('yyyy-MM-dd'); +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); +class QueryParam { + const QueryParam(this.name, this.value); + + final String name; + final String value; + + @override + String toString() => + '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}'; } -dynamic encodeQueryParameter( - Serializers serializers, +// Ported from the Java version. +Iterable _queryParams( + String collectionFormat, + String name, dynamic value, - FullType type, ) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; + // Assertions to run in debug mode only. + assert(name.isNotEmpty, 'Parameter cannot be an empty string.'); + + final params = []; + + if (value is List) { + if (collectionFormat == 'multi') { + return value.map( + (dynamic v) => QueryParam(name, parameterToString(v)), + ); + } + + // Default collection format is 'csv'. + if (collectionFormat.isEmpty) { + collectionFormat = 'csv'; // ignore: parameter_assignments + } + + final delimiter = _delimiters[collectionFormat] ?? ','; + + params.add(QueryParam( + name, + value.map(parameterToString).join(delimiter), + )); + } else if (value != null) { + params.add(QueryParam(name, parameterToString(value))); } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { + + return params; +} + +/// Format the given parameter object into a [String]. +String parameterToString(dynamic value) { + if (value == null) { return ''; } - if (serialized is String) { - return serialized; + if (value is DateTime) { + return value.toUtc().toIso8601String(); } - return serialized; + if (value is ModelEnumClass) {} + if (value is OuterEnum) {} + if (value is OuterEnumDefaultValue) {} + if (value is OuterEnumInteger) {} + if (value is OuterEnumIntegerDefaultValue) {} + if (value is SingleRefType) {} + return value.toString(); } -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' +/// content type. Otherwise, returns the decoded body as decoded by dart:http package. +Future decodeBodyBytes(Response response) async { + final contentType = response.headers['content-type']; + return contentType != null && + contentType.toLowerCase().startsWith('application/json') + ? response.bodyBytes.isEmpty + ? '' + : utf8.decode(response.bodyBytes) + : response.body; } diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/_exports.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/_exports.dart new file mode 100644 index 000000000000..01c9ad2dfa7e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/_exports.dart @@ -0,0 +1,9 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'api_key_auth.dart'; +export 'auth.dart'; +export 'basic_auth.dart'; +export 'bearer_auth.dart'; +export 'oauth.dart'; diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart index 13f1d0ad300e..efff2af616a5 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart @@ -2,8 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // - -import 'authentication.dart'; +import 'auth.dart'; class ApiKeyAuth implements Authentication { ApiKeyAuth(this.location, this.paramName); @@ -15,7 +14,10 @@ class ApiKeyAuth implements Authentication { String apiKey = ''; @override - Future applyToParams(List queryParams, Map headerParams,) async { + Future applyToParams( + List queryParams, + Map headerParams, + ) async { final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey'; if (paramValue.isNotEmpty) { diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/authentication.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/auth.dart similarity index 63% rename from samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/authentication.dart rename to samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/auth.dart index 352222256cb5..320391a37f1c 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/authentication.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/auth.dart @@ -5,5 +5,6 @@ // ignore: one_member_abstracts abstract class Authentication { /// Apply authentication settings to header and query params. - Future applyToParams(List queryParams, Map headerParams); + Future applyToParams( + List queryParams, Map headerParams); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_basic_auth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/basic_auth.dart similarity index 57% rename from samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_basic_auth.dart rename to samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/basic_auth.dart index da801f677dad..9977aca31f69 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_basic_auth.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/basic_auth.dart @@ -2,8 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // - -import 'authentication.dart'; +import 'auth.dart'; class HttpBasicAuth implements Authentication { HttpBasicAuth({this.username = '', this.password = ''}); @@ -12,10 +11,14 @@ class HttpBasicAuth implements Authentication { String password; @override - Future applyToParams(List queryParams, Map headerParams,) async { + Future applyToParams( + List queryParams, + Map headerParams, + ) async { if (username.isNotEmpty && password.isNotEmpty) { final credentials = '$username:$password'; - headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; + headerParams['Authorization'] = + 'Basic ${base64.encode(utf8.encode(credentials))}'; } } } diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_bearer_auth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/bearer_auth.dart similarity index 76% rename from samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_bearer_auth.dart rename to samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/bearer_auth.dart index ec12948a0d3f..26df17824f20 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/http_bearer_auth.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/bearer_auth.dart @@ -2,9 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // - -import 'authentication.dart'; - +import 'auth.dart'; typedef HttpBearerAuthProvider = String Function(); @@ -17,13 +15,17 @@ class HttpBearerAuth implements Authentication { set accessToken(dynamic accessToken) { if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { - throw ArgumentError('accessToken value must be either a String or a String Function().'); + throw ArgumentError( + 'accessToken value must be either a String or a String Function().'); } _accessToken = accessToken; } @override - Future applyToParams(List queryParams, Map headerParams,) async { + Future applyToParams( + List queryParams, + Map headerParams, + ) async { if (_accessToken == null) { return; } diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart index e915e2cd55ca..2bfe87455779 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart @@ -2,9 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // - -import 'authentication.dart'; - +import 'auth.dart'; class OAuth implements Authentication { OAuth({this.accessToken = ''}); @@ -12,7 +10,10 @@ class OAuth implements Authentication { String accessToken; @override - Future applyToParams(List queryParams, Map headerParams,) async { + Future applyToParams( + List queryParams, + Map headerParams, + ) async { if (accessToken.isNotEmpty) { headerParams['Authorization'] = 'Bearer $accessToken'; } diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/date_serializer.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/date_serializer.dart index db3c5c437db1..deacc6525d19 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/date_serializer.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/date_serializer.dart @@ -7,7 +7,6 @@ import 'package:built_value/serializer.dart'; import 'package:openapi/src/model/date.dart'; class DateSerializer implements PrimitiveSerializer { - const DateSerializer(); @override diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/_exports.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/_exports.dart new file mode 100644 index 000000000000..d1f1f4450e41 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/_exports.dart @@ -0,0 +1,69 @@ +export 'additional_properties_class.dart'; +export 'addressable.dart'; +export 'all_of_with_single_ref.dart'; +export 'animal.dart'; +export 'api_response.dart'; +export 'apple.dart'; +export 'array_of_array_of_number_only.dart'; +export 'array_of_number_only.dart'; +export 'array_test.dart'; +export 'banana.dart'; +export 'bar.dart'; +export 'bar_create.dart'; +export 'bar_ref.dart'; +export 'bar_ref_or_value.dart'; +export 'capitalization.dart'; +export 'cat.dart'; +export 'cat_all_of.dart'; +export 'category.dart'; +export 'child.dart'; +export 'class_model.dart'; +export 'deprecated_object.dart'; +export 'dog.dart'; +export 'dog_all_of.dart'; +export 'entity.dart'; +export 'entity_ref.dart'; +export 'enum_arrays.dart'; +export 'enum_test.dart'; +export 'example.dart'; +export 'example_non_primitive.dart'; +export 'extensible.dart'; +export 'file_schema_test_class.dart'; +export 'foo.dart'; +export 'foo_ref.dart'; +export 'foo_ref_or_value.dart'; +export 'format_test.dart'; +export 'fruit.dart'; +export 'has_only_read_only.dart'; +export 'health_check_result.dart'; +export 'map_test.dart'; +export 'mixed_properties_and_additional_properties_class.dart'; +export 'model200_response.dart'; +export 'model_client.dart'; +export 'model_enum_class.dart'; +export 'model_file.dart'; +export 'model_list.dart'; +export 'model_return.dart'; +export 'name.dart'; +export 'nullable_class.dart'; +export 'number_only.dart'; +export 'object_with_deprecated_fields.dart'; +export 'order.dart'; +export 'outer_composite.dart'; +export 'outer_enum.dart'; +export 'outer_enum_default_value.dart'; +export 'outer_enum_integer.dart'; +export 'outer_enum_integer_default_value.dart'; +export 'outer_object_with_enum_property.dart'; +export 'pasta.dart'; +export 'pet.dart'; +export 'pizza.dart'; +export 'pizza_speziale.dart'; +export 'read_only_first.dart'; +export 'single_ref_type.dart'; +export 'special_model_name.dart'; +export 'tag.dart'; +export 'test_query_style_form_explode_true_array_string_query_object_parameter.dart'; +export 'user.dart'; + +export 'date.dart'; diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/additional_properties_class.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/additional_properties_class.dart index 3fdac6d5a44f..34022add8e5e 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/additional_properties_class.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/additional_properties_class.dart @@ -12,10 +12,12 @@ part 'additional_properties_class.g.dart'; /// AdditionalPropertiesClass /// /// Properties: -/// * [mapProperty] -/// * [mapOfMapProperty] +/// * [mapProperty] +/// * [mapOfMapProperty] @BuiltValue() -abstract class AdditionalPropertiesClass implements Built { +abstract class AdditionalPropertiesClass + implements + Built { @BuiltValueField(wireName: r'map_property') BuiltMap? get mapProperty; @@ -24,18 +26,25 @@ abstract class AdditionalPropertiesClass implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AdditionalPropertiesClassSerializer(); + static Serializer get serializer => + _$AdditionalPropertiesClassSerializer(); } -class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer { +class _$AdditionalPropertiesClassSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [AdditionalPropertiesClass, _$AdditionalPropertiesClass]; + final Iterable types = const [ + AdditionalPropertiesClass, + _$AdditionalPropertiesClass + ]; @override final String wireName = r'AdditionalPropertiesClass'; @@ -49,14 +58,18 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer; result.mapProperty.replace(valueDes); break; case r'map_of_map_property': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + specifiedType: const FullType(BuiltMap, [ + FullType(String), + FullType(BuiltMap, [FullType(String), FullType(String)]) + ]), ) as BuiltMap>; result.mapOfMapProperty.replace(valueDes); break; @@ -124,4 +143,3 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer { Addressable object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -70,16 +72,19 @@ class _$AddressableSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($Addressable)) as $Addressable; + return serializers.deserialize(serialized, + specifiedType: FullType($Addressable)) as $Addressable; } } /// a concrete implementation of [Addressable], since [Addressable] is not instantiable @BuiltValue(instantiable: true) -abstract class $Addressable implements Addressable, Built<$Addressable, $AddressableBuilder> { +abstract class $Addressable + implements Addressable, Built<$Addressable, $AddressableBuilder> { $Addressable._(); - factory $Addressable([void Function($AddressableBuilder)? updates]) = _$$Addressable; + factory $Addressable([void Function($AddressableBuilder)? updates]) = + _$$Addressable; @BuiltValueHook(initializeBuilder: true) static void _defaults($AddressableBuilder b) => b; @@ -158,4 +163,3 @@ class _$$AddressableSerializer implements PrimitiveSerializer<$Addressable> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/all_of_with_single_ref.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/all_of_with_single_ref.dart index 04f59d360128..cd9f8aaebec8 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/all_of_with_single_ref.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/all_of_with_single_ref.dart @@ -12,10 +12,11 @@ part 'all_of_with_single_ref.g.dart'; /// AllOfWithSingleRef /// /// Properties: -/// * [username] -/// * [singleRefType] +/// * [username] +/// * [singleRefType] @BuiltValue() -abstract class AllOfWithSingleRef implements Built { +abstract class AllOfWithSingleRef + implements Built { @BuiltValueField(wireName: r'username') String? get username; @@ -24,16 +25,19 @@ abstract class AllOfWithSingleRef implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AllOfWithSingleRefSerializer(); + static Serializer get serializer => + _$AllOfWithSingleRefSerializer(); } -class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer { +class _$AllOfWithSingleRefSerializer + implements PrimitiveSerializer { @override final Iterable types = const [AllOfWithSingleRef, _$AllOfWithSingleRef]; @@ -67,7 +71,9 @@ class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer { @@ -95,7 +96,9 @@ class _$AnimalSerializer implements PrimitiveSerializer { if (object is Dog) { return serializers.serialize(object, specifiedType: FullType(Dog))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -106,14 +109,18 @@ class _$AnimalSerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Animal.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'Cat': - return serializers.deserialize(serialized, specifiedType: FullType(Cat)) as Cat; + return serializers.deserialize(serialized, specifiedType: FullType(Cat)) + as Cat; case r'Dog': - return serializers.deserialize(serialized, specifiedType: FullType(Dog)) as Dog; + return serializers.deserialize(serialized, specifiedType: FullType(Dog)) + as Dog; default: - return serializers.deserialize(serialized, specifiedType: FullType($Animal)) as $Animal; + return serializers.deserialize(serialized, + specifiedType: FullType($Animal)) as $Animal; } } } @@ -202,4 +209,3 @@ class _$$AnimalSerializer implements PrimitiveSerializer<$Animal> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/api_response.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/api_response.dart index aadcd792e2bf..14e9ccff7852 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/api_response.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/api_response.dart @@ -11,9 +11,9 @@ part 'api_response.g.dart'; /// ApiResponse /// /// Properties: -/// * [code] -/// * [type] -/// * [message] +/// * [code] +/// * [type] +/// * [message] @BuiltValue() abstract class ApiResponse implements Built { @BuiltValueField(wireName: r'code') @@ -77,7 +77,9 @@ class _$ApiResponseSerializer implements PrimitiveSerializer { ApiResponse object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -141,4 +143,3 @@ class _$ApiResponseSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/apple.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/apple.dart index 02ca94190b96..fa77c28e614c 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/apple.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/apple.dart @@ -11,7 +11,7 @@ part 'apple.g.dart'; /// Apple /// /// Properties: -/// * [kind] +/// * [kind] @BuiltValue() abstract class Apple implements Built { @BuiltValueField(wireName: r'kind') @@ -55,7 +55,9 @@ class _$AppleSerializer implements PrimitiveSerializer { Apple object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$AppleSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_array_of_number_only.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_array_of_number_only.dart index 5bc0982b8ab0..0f51b17b901d 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_array_of_number_only.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/array_of_array_of_number_only.dart @@ -12,26 +12,35 @@ part 'array_of_array_of_number_only.g.dart'; /// ArrayOfArrayOfNumberOnly /// /// Properties: -/// * [arrayArrayNumber] +/// * [arrayArrayNumber] @BuiltValue() -abstract class ArrayOfArrayOfNumberOnly implements Built { +abstract class ArrayOfArrayOfNumberOnly + implements + Built { @BuiltValueField(wireName: r'ArrayArrayNumber') BuiltList>? get arrayArrayNumber; ArrayOfArrayOfNumberOnly._(); - factory ArrayOfArrayOfNumberOnly([void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = _$ArrayOfArrayOfNumberOnly; + factory ArrayOfArrayOfNumberOnly( + [void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = + _$ArrayOfArrayOfNumberOnly; @BuiltValueHook(initializeBuilder: true) static void _defaults(ArrayOfArrayOfNumberOnlyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayOfArrayOfNumberOnlySerializer(); + static Serializer get serializer => + _$ArrayOfArrayOfNumberOnlySerializer(); } -class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { +class _$ArrayOfArrayOfNumberOnlySerializer + implements PrimitiveSerializer { @override - final Iterable types = const [ArrayOfArrayOfNumberOnly, _$ArrayOfArrayOfNumberOnly]; + final Iterable types = const [ + ArrayOfArrayOfNumberOnly, + _$ArrayOfArrayOfNumberOnly + ]; @override final String wireName = r'ArrayOfArrayOfNumberOnly'; @@ -45,7 +54,9 @@ class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer>; result.arrayArrayNumber.replace(valueDes); break; @@ -106,4 +121,3 @@ class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { +abstract class ArrayOfNumberOnly + implements Built { @BuiltValueField(wireName: r'ArrayNumber') BuiltList? get arrayNumber; ArrayOfNumberOnly._(); - factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = _$ArrayOfNumberOnly; + factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = + _$ArrayOfNumberOnly; @BuiltValueHook(initializeBuilder: true) static void _defaults(ArrayOfNumberOnlyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayOfNumberOnlySerializer(); + static Serializer get serializer => + _$ArrayOfNumberOnlySerializer(); } -class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer { +class _$ArrayOfNumberOnlySerializer + implements PrimitiveSerializer { @override final Iterable types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly]; @@ -56,7 +60,9 @@ class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'array_of_string') @@ -61,14 +61,18 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { yield r'array_array_of_integer'; yield serializers.serialize( object.arrayArrayOfInteger, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(int)]) + ]), ); } if (object.arrayArrayOfModel != null) { yield r'array_array_of_model'; yield serializers.serialize( object.arrayArrayOfModel, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(ReadOnlyFirst)]) + ]), ); } } @@ -79,7 +83,9 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { ArrayTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -104,14 +110,18 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { case r'array_array_of_integer': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(int)]) + ]), ) as BuiltList>; result.arrayArrayOfInteger.replace(valueDes); break; case r'array_array_of_model': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(ReadOnlyFirst)]) + ]), ) as BuiltList>; result.arrayArrayOfModel.replace(valueDes); break; @@ -143,4 +153,3 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/banana.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/banana.dart index bf2d632ee114..00c090ee8727 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/banana.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/banana.dart @@ -11,7 +11,7 @@ part 'banana.g.dart'; /// Banana /// /// Properties: -/// * [count] +/// * [count] @BuiltValue() abstract class Banana implements Built { @BuiltValueField(wireName: r'count') @@ -55,7 +55,9 @@ class _$BananaSerializer implements PrimitiveSerializer { Banana object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$BananaSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar.dart index cb769550b4f2..ba6b35ebf7df 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar.dart @@ -13,10 +13,10 @@ part 'bar.g.dart'; /// Bar /// /// Properties: -/// * [id] -/// * [barPropA] -/// * [fooPropB] -/// * [foo] +/// * [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 @@ -37,7 +37,7 @@ abstract class Bar implements Entity, Built { factory Bar([void updates(BarBuilder b)]) = _$Bar; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(BarBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarSerializer(); @@ -117,7 +117,9 @@ class _$BarSerializer implements PrimitiveSerializer { Bar object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -216,4 +218,3 @@ class _$BarSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_create.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_create.dart index 8942b6433f5e..5d726a9957e4 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_create.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_create.dart @@ -13,9 +13,9 @@ part 'bar_create.g.dart'; /// BarCreate /// /// Properties: -/// * [barPropA] -/// * [fooPropB] -/// * [foo] +/// * [barPropA] +/// * [fooPropB] +/// * [foo] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -37,7 +37,7 @@ abstract class BarCreate implements Entity, Built { factory BarCreate([void updates(BarCreateBuilder b)]) = _$BarCreate; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarCreateBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(BarCreateBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarCreateSerializer(); @@ -117,7 +117,9 @@ class _$BarCreateSerializer implements PrimitiveSerializer { BarCreate object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -216,4 +218,3 @@ class _$BarCreateSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref.dart index 2b9d2727a448..f77429fa929b 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref.dart @@ -24,7 +24,7 @@ abstract class BarRef implements EntityRef, Built { factory BarRef([void updates(BarRefBuilder b)]) = _$BarRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarRefBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(BarRefBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarRefSerializer(); @@ -97,7 +97,9 @@ class _$BarRefSerializer implements PrimitiveSerializer { BarRef object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -189,4 +191,3 @@ class _$BarRefSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref_or_value.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref_or_value.dart index 4af61384ab76..eeb993907a02 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref_or_value.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/bar_ref_or_value.dart @@ -20,7 +20,8 @@ part 'bar_ref_or_value.g.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue() -abstract class BarRefOrValue implements Built { +abstract class BarRefOrValue + implements Built { /// One Of [Bar], [BarRef] OneOf get oneOf; @@ -33,36 +34,39 @@ abstract class BarRefOrValue implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$BarRefOrValueSerializer(); + static Serializer get serializer => + _$BarRefOrValueSerializer(); } extension BarRefOrValueDiscriminatorExt on BarRefOrValue { - String? get discriminatorValue { - if (this is Bar) { - return r'Bar'; - } - if (this is BarRef) { - return r'BarRef'; - } - return null; + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; } + if (this is BarRef) { + return r'BarRef'; + } + return null; + } } + extension BarRefOrValueBuilderDiscriminatorExt on BarRefOrValueBuilder { - String? get discriminatorValue { - if (this is BarBuilder) { - return r'Bar'; - } - if (this is BarRefBuilder) { - return r'BarRef'; - } - return null; + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarRefBuilder) { + return r'BarRef'; } + return null; + } } class _$BarRefOrValueSerializer implements PrimitiveSerializer { @@ -76,8 +80,7 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { Serializers serializers, BarRefOrValue object, { FullType specifiedType = FullType.unspecified, - }) sync* { - } + }) sync* {} @override Object serialize( @@ -86,7 +89,8 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; } @override @@ -98,10 +102,15 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { final result = BarRefOrValueBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discIndex = + serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [Bar, BarRef, ]; + final oneOfTypes = [ + Bar, + BarRef, + ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -120,10 +129,13 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { oneOfType = BarRef; break; default: - throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/capitalization.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/capitalization.dart index 75827b9a429e..cbd4bf8cf926 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/capitalization.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/capitalization.dart @@ -11,14 +11,15 @@ part 'capitalization.g.dart'; /// Capitalization /// /// Properties: -/// * [smallCamel] -/// * [capitalCamel] -/// * [smallSnake] -/// * [capitalSnake] -/// * [sCAETHFlowPoints] -/// * [ATT_NAME] - Name of the pet +/// * [smallCamel] +/// * [capitalCamel] +/// * [smallSnake] +/// * [capitalSnake] +/// * [sCAETHFlowPoints] +/// * [ATT_NAME] - Name of the pet @BuiltValue() -abstract class Capitalization implements Built { +abstract class Capitalization + implements Built { @BuiltValueField(wireName: r'smallCamel') String? get smallCamel; @@ -34,22 +35,25 @@ abstract class Capitalization implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CapitalizationSerializer(); + static Serializer get serializer => + _$CapitalizationSerializer(); } -class _$CapitalizationSerializer implements PrimitiveSerializer { +class _$CapitalizationSerializer + implements PrimitiveSerializer { @override final Iterable types = const [Capitalization, _$Capitalization]; @@ -111,7 +115,9 @@ class _$CapitalizationSerializer implements PrimitiveSerializer Capitalization object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -196,4 +202,3 @@ class _$CapitalizationSerializer implements PrimitiveSerializer return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat.dart index 23d19b38b05a..ecc7facb059f 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat.dart @@ -13,9 +13,9 @@ part 'cat.g.dart'; /// Cat /// /// Properties: -/// * [className] -/// * [color] -/// * [declawed] +/// * [className] +/// * [color] +/// * [declawed] @BuiltValue() abstract class Cat implements Animal, CatAllOf, Built { Cat._(); @@ -23,8 +23,9 @@ abstract class Cat implements Animal, CatAllOf, Built { factory Cat([void updates(CatBuilder b)]) = _$Cat; @BuiltValueHook(initializeBuilder: true) - static void _defaults(CatBuilder b) => b..className=b.discriminatorValue - ..color = 'red'; + static void _defaults(CatBuilder b) => b + ..className = b.discriminatorValue + ..color = 'red'; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$CatSerializer(); @@ -69,7 +70,9 @@ class _$CatSerializer implements PrimitiveSerializer { Cat object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -133,4 +136,3 @@ class _$CatSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat_all_of.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat_all_of.dart index 02d9cce0cae1..18fd5b5ec591 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat_all_of.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/cat_all_of.dart @@ -11,9 +11,9 @@ part 'cat_all_of.g.dart'; /// CatAllOf /// /// Properties: -/// * [declawed] +/// * [declawed] @BuiltValue(instantiable: false) -abstract class CatAllOf { +abstract class CatAllOf { @BuiltValueField(wireName: r'declawed') bool? get declawed; @@ -48,7 +48,9 @@ class _$CatAllOfSerializer implements PrimitiveSerializer { CatAllOf object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -57,13 +59,15 @@ class _$CatAllOfSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($CatAllOf)) as $CatAllOf; + return serializers.deserialize(serialized, + specifiedType: FullType($CatAllOf)) as $CatAllOf; } } /// a concrete implementation of [CatAllOf], since [CatAllOf] is not instantiable @BuiltValue(instantiable: true) -abstract class $CatAllOf implements CatAllOf, Built<$CatAllOf, $CatAllOfBuilder> { +abstract class $CatAllOf + implements CatAllOf, Built<$CatAllOf, $CatAllOfBuilder> { $CatAllOf._(); factory $CatAllOf([void Function($CatAllOfBuilder)? updates]) = _$$CatAllOf; @@ -138,4 +142,3 @@ class _$$CatAllOfSerializer implements PrimitiveSerializer<$CatAllOf> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/category.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/category.dart index b2be985a8507..b580e36fc4dc 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/category.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/category.dart @@ -11,8 +11,8 @@ part 'category.g.dart'; /// Category /// /// Properties: -/// * [id] -/// * [name] +/// * [id] +/// * [name] @BuiltValue() abstract class Category implements Built { @BuiltValueField(wireName: r'id') @@ -66,7 +66,9 @@ class _$CategorySerializer implements PrimitiveSerializer { Category object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -123,4 +125,3 @@ class _$CategorySerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/child.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/child.dart index 987b52ca7240..dfc2ceaef1e6 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/child.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/child.dart @@ -11,7 +11,7 @@ part 'child.g.dart'; /// Child /// /// Properties: -/// * [name] +/// * [name] @BuiltValue() abstract class Child implements Built { @BuiltValueField(wireName: r'name') @@ -55,7 +55,9 @@ class _$ChildSerializer implements PrimitiveSerializer { Child object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ChildSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/class_model.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/class_model.dart index 51166943c6cd..74442b2e44ac 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/class_model.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/class_model.dart @@ -11,7 +11,7 @@ part 'class_model.g.dart'; /// Model for testing model with \"_class\" property /// /// Properties: -/// * [classField] +/// * [classField] @BuiltValue() abstract class ClassModel implements Built { @BuiltValueField(wireName: r'_class') @@ -55,7 +55,9 @@ class _$ClassModelSerializer implements PrimitiveSerializer { ClassModel object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ClassModelSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/deprecated_object.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/deprecated_object.dart index 91d0b428e9bb..d4e14dcc76b3 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/deprecated_object.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/deprecated_object.dart @@ -11,24 +11,28 @@ part 'deprecated_object.g.dart'; /// DeprecatedObject /// /// Properties: -/// * [name] +/// * [name] @BuiltValue() -abstract class DeprecatedObject implements Built { +abstract class DeprecatedObject + implements Built { @BuiltValueField(wireName: r'name') String? get name; DeprecatedObject._(); - factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = _$DeprecatedObject; + factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = + _$DeprecatedObject; @BuiltValueHook(initializeBuilder: true) static void _defaults(DeprecatedObjectBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$DeprecatedObjectSerializer(); + static Serializer get serializer => + _$DeprecatedObjectSerializer(); } -class _$DeprecatedObjectSerializer implements PrimitiveSerializer { +class _$DeprecatedObjectSerializer + implements PrimitiveSerializer { @override final Iterable types = const [DeprecatedObject, _$DeprecatedObject]; @@ -55,7 +59,9 @@ class _$DeprecatedObjectSerializer implements PrimitiveSerializer { Dog._(); @@ -23,8 +23,9 @@ abstract class Dog implements Animal, DogAllOf, Built { factory Dog([void updates(DogBuilder b)]) = _$Dog; @BuiltValueHook(initializeBuilder: true) - static void _defaults(DogBuilder b) => b..className=b.discriminatorValue - ..color = 'red'; + static void _defaults(DogBuilder b) => b + ..className = b.discriminatorValue + ..color = 'red'; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$DogSerializer(); @@ -69,7 +70,9 @@ class _$DogSerializer implements PrimitiveSerializer { Dog object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -133,4 +136,3 @@ class _$DogSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog_all_of.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog_all_of.dart index bd52567fa60a..28c95d93dcf2 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog_all_of.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/dog_all_of.dart @@ -11,9 +11,9 @@ part 'dog_all_of.g.dart'; /// DogAllOf /// /// Properties: -/// * [breed] +/// * [breed] @BuiltValue(instantiable: false) -abstract class DogAllOf { +abstract class DogAllOf { @BuiltValueField(wireName: r'breed') String? get breed; @@ -48,7 +48,9 @@ class _$DogAllOfSerializer implements PrimitiveSerializer { DogAllOf object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -57,13 +59,15 @@ class _$DogAllOfSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($DogAllOf)) as $DogAllOf; + return serializers.deserialize(serialized, + specifiedType: FullType($DogAllOf)) as $DogAllOf; } } /// a concrete implementation of [DogAllOf], since [DogAllOf] is not instantiable @BuiltValue(instantiable: true) -abstract class $DogAllOf implements DogAllOf, Built<$DogAllOf, $DogAllOfBuilder> { +abstract class $DogAllOf + implements DogAllOf, Built<$DogAllOf, $DogAllOfBuilder> { $DogAllOf._(); factory $DogAllOf([void Function($DogAllOfBuilder)? updates]) = _$$DogAllOf; @@ -138,4 +142,3 @@ class _$$DogAllOfSerializer implements PrimitiveSerializer<$DogAllOf> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity.dart index 7e27fab47387..56cc04c50eb0 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity.dart @@ -42,50 +42,51 @@ abstract class Entity implements Addressable, Extensible { } extension EntityDiscriminatorExt on Entity { - String? get discriminatorValue { - if (this is Bar) { - return r'Bar'; - } - if (this is BarCreate) { - return r'Bar_Create'; - } - if (this is Foo) { - return r'Foo'; - } - if (this is Pasta) { - return r'Pasta'; - } - if (this is Pizza) { - return r'Pizza'; - } - if (this is PizzaSpeziale) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; } + if (this is BarCreate) { + return r'Bar_Create'; + } + if (this is Foo) { + return r'Foo'; + } + if (this is Pasta) { + return r'Pasta'; + } + if (this is Pizza) { + return r'Pizza'; + } + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; + } } + extension EntityBuilderDiscriminatorExt on EntityBuilder { - String? get discriminatorValue { - if (this is BarBuilder) { - return r'Bar'; - } - if (this is BarCreateBuilder) { - return r'Bar_Create'; - } - if (this is FooBuilder) { - return r'Foo'; - } - if (this is PastaBuilder) { - return r'Pasta'; - } - if (this is PizzaBuilder) { - return r'Pizza'; - } - if (this is PizzaSpezialeBuilder) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; } + if (this is BarCreateBuilder) { + return r'Bar_Create'; + } + if (this is FooBuilder) { + return r'Foo'; + } + if (this is PastaBuilder) { + return r'Pasta'; + } + if (this is PizzaBuilder) { + return r'Pizza'; + } + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; + } } class _$EntitySerializer implements PrimitiveSerializer { @@ -157,9 +158,12 @@ class _$EntitySerializer implements PrimitiveSerializer { return serializers.serialize(object, specifiedType: FullType(Pizza))!; } if (object is PizzaSpeziale) { - return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + return serializers.serialize(object, + specifiedType: FullType(PizzaSpeziale))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -170,22 +174,30 @@ class _$EntitySerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Entity.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'Bar': - return serializers.deserialize(serialized, specifiedType: FullType(Bar)) as Bar; + return serializers.deserialize(serialized, specifiedType: FullType(Bar)) + as Bar; case r'Bar_Create': - return serializers.deserialize(serialized, specifiedType: FullType(BarCreate)) as BarCreate; + return serializers.deserialize(serialized, + specifiedType: FullType(BarCreate)) as BarCreate; case r'Foo': - return serializers.deserialize(serialized, specifiedType: FullType(Foo)) as Foo; + return serializers.deserialize(serialized, specifiedType: FullType(Foo)) + as Foo; case r'Pasta': - return serializers.deserialize(serialized, specifiedType: FullType(Pasta)) as Pasta; + return serializers.deserialize(serialized, + specifiedType: FullType(Pasta)) as Pasta; case r'Pizza': - return serializers.deserialize(serialized, specifiedType: FullType(Pizza)) as Pizza; + return serializers.deserialize(serialized, + specifiedType: FullType(Pizza)) as Pizza; case r'PizzaSpeziale': - return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + return serializers.deserialize(serialized, + specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; default: - return serializers.deserialize(serialized, specifiedType: FullType($Entity)) as $Entity; + return serializers.deserialize(serialized, + specifiedType: FullType($Entity)) as $Entity; } } } @@ -295,4 +307,3 @@ class _$$EntitySerializer implements PrimitiveSerializer<$Entity> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity_ref.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity_ref.dart index 7502c94dd7f3..669bbc6293bf 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity_ref.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/entity_ref.dart @@ -44,26 +44,27 @@ abstract class EntityRef implements Addressable, Extensible { } extension EntityRefDiscriminatorExt on EntityRef { - String? get discriminatorValue { - if (this is BarRef) { - return r'BarRef'; - } - if (this is FooRef) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is BarRef) { + return r'BarRef'; } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } } + extension EntityRefBuilderDiscriminatorExt on EntityRefBuilder { - String? get discriminatorValue { - if (this is BarRefBuilder) { - return r'BarRef'; - } - if (this is FooRefBuilder) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is BarRefBuilder) { + return r'BarRef'; } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; + } } class _$EntityRefSerializer implements PrimitiveSerializer { @@ -139,7 +140,9 @@ class _$EntityRefSerializer implements PrimitiveSerializer { if (object is FooRef) { return serializers.serialize(object, specifiedType: FullType(FooRef))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -149,25 +152,32 @@ class _$EntityRefSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discIndex = + serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'BarRef': - return serializers.deserialize(serialized, specifiedType: FullType(BarRef)) as BarRef; + return serializers.deserialize(serialized, + specifiedType: FullType(BarRef)) as BarRef; case r'FooRef': - return serializers.deserialize(serialized, specifiedType: FullType(FooRef)) as FooRef; + return serializers.deserialize(serialized, + specifiedType: FullType(FooRef)) as FooRef; default: - return serializers.deserialize(serialized, specifiedType: FullType($EntityRef)) as $EntityRef; + return serializers.deserialize(serialized, + specifiedType: FullType($EntityRef)) as $EntityRef; } } } /// a concrete implementation of [EntityRef], since [EntityRef] is not instantiable @BuiltValue(instantiable: true) -abstract class $EntityRef implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { +abstract class $EntityRef + implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { $EntityRef._(); - factory $EntityRef([void Function($EntityRefBuilder)? updates]) = _$$EntityRef; + factory $EntityRef([void Function($EntityRefBuilder)? updates]) = + _$$EntityRef; @BuiltValueHook(initializeBuilder: true) static void _defaults($EntityRefBuilder b) => b; @@ -281,4 +291,3 @@ class _$$EntityRefSerializer implements PrimitiveSerializer<$EntityRef> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_arrays.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_arrays.dart index b79a175e833c..2c8e3e6e4bb8 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_arrays.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_arrays.dart @@ -12,8 +12,8 @@ part 'enum_arrays.g.dart'; /// EnumArrays /// /// Properties: -/// * [justSymbol] -/// * [arrayEnum] +/// * [justSymbol] +/// * [arrayEnum] @BuiltValue() abstract class EnumArrays implements Built { @BuiltValueField(wireName: r'just_symbol') @@ -58,7 +58,8 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { yield r'array_enum'; yield serializers.serialize( object.arrayEnum, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + specifiedType: + const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), ); } } @@ -69,7 +70,9 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { EnumArrays object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -94,7 +97,8 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { case r'array_enum': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + specifiedType: + const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), ) as BuiltList; result.arrayEnum.replace(valueDes); break; @@ -128,36 +132,43 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { } class EnumArraysJustSymbolEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'>=') - static const EnumArraysJustSymbolEnum greaterThanEqual = _$enumArraysJustSymbolEnum_greaterThanEqual; + static const EnumArraysJustSymbolEnum greaterThanEqual = + _$enumArraysJustSymbolEnum_greaterThanEqual; @BuiltValueEnumConst(wireName: r'$') - static const EnumArraysJustSymbolEnum dollar = _$enumArraysJustSymbolEnum_dollar; + static const EnumArraysJustSymbolEnum dollar = + _$enumArraysJustSymbolEnum_dollar; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = _$enumArraysJustSymbolEnum_unknownDefaultOpenApi; + static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = + _$enumArraysJustSymbolEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumArraysJustSymbolEnumSerializer; + static Serializer get serializer => + _$enumArraysJustSymbolEnumSerializer; - const EnumArraysJustSymbolEnum._(String name): super(name); + const EnumArraysJustSymbolEnum._(String name) : super(name); - static BuiltSet get values => _$enumArraysJustSymbolEnumValues; - static EnumArraysJustSymbolEnum valueOf(String name) => _$enumArraysJustSymbolEnumValueOf(name); + static BuiltSet get values => + _$enumArraysJustSymbolEnumValues; + static EnumArraysJustSymbolEnum valueOf(String name) => + _$enumArraysJustSymbolEnumValueOf(name); } class EnumArraysArrayEnumEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'fish') static const EnumArraysArrayEnumEnum fish = _$enumArraysArrayEnumEnum_fish; @BuiltValueEnumConst(wireName: r'crab') static const EnumArraysArrayEnumEnum crab = _$enumArraysArrayEnumEnum_crab; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = _$enumArraysArrayEnumEnum_unknownDefaultOpenApi; + static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = + _$enumArraysArrayEnumEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumArraysArrayEnumEnumSerializer; + static Serializer get serializer => + _$enumArraysArrayEnumEnumSerializer; - const EnumArraysArrayEnumEnum._(String name): super(name); + const EnumArraysArrayEnumEnum._(String name) : super(name); - static BuiltSet get values => _$enumArraysArrayEnumEnumValues; - static EnumArraysArrayEnumEnum valueOf(String name) => _$enumArraysArrayEnumEnumValueOf(name); + static BuiltSet get values => + _$enumArraysArrayEnumEnumValues; + static EnumArraysArrayEnumEnum valueOf(String name) => + _$enumArraysArrayEnumEnumValueOf(name); } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_test.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_test.dart index 831f5b9d6d2d..effda132acdd 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/enum_test.dart @@ -16,14 +16,14 @@ part 'enum_test.g.dart'; /// EnumTest /// /// Properties: -/// * [enumString] -/// * [enumStringRequired] -/// * [enumInteger] -/// * [enumNumber] -/// * [outerEnum] -/// * [outerEnumInteger] -/// * [outerEnumDefaultValue] -/// * [outerEnumIntegerDefaultValue] +/// * [enumString] +/// * [enumStringRequired] +/// * [enumInteger] +/// * [enumNumber] +/// * [outerEnum] +/// * [outerEnumInteger] +/// * [outerEnumDefaultValue] +/// * [outerEnumIntegerDefaultValue] @BuiltValue() abstract class EnumTest implements Built { @BuiltValueField(wireName: r'enum_string') @@ -143,7 +143,9 @@ class _$EnumTestSerializer implements PrimitiveSerializer { EnumTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -245,7 +247,6 @@ class _$EnumTestSerializer implements PrimitiveSerializer { } class EnumTestEnumStringEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'UPPER') static const EnumTestEnumStringEnum UPPER = _$enumTestEnumStringEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') @@ -253,66 +254,85 @@ class EnumTestEnumStringEnum extends EnumClass { @BuiltValueEnumConst(wireName: r'') static const EnumTestEnumStringEnum empty = _$enumTestEnumStringEnum_empty; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumTestEnumStringEnum unknownDefaultOpenApi = _$enumTestEnumStringEnum_unknownDefaultOpenApi; + static const EnumTestEnumStringEnum unknownDefaultOpenApi = + _$enumTestEnumStringEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumStringEnumSerializer; + static Serializer get serializer => + _$enumTestEnumStringEnumSerializer; - const EnumTestEnumStringEnum._(String name): super(name); + const EnumTestEnumStringEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumStringEnumValues; - static EnumTestEnumStringEnum valueOf(String name) => _$enumTestEnumStringEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumStringEnumValues; + static EnumTestEnumStringEnum valueOf(String name) => + _$enumTestEnumStringEnumValueOf(name); } class EnumTestEnumStringRequiredEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'UPPER') - static const EnumTestEnumStringRequiredEnum UPPER = _$enumTestEnumStringRequiredEnum_UPPER; + static const EnumTestEnumStringRequiredEnum UPPER = + _$enumTestEnumStringRequiredEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') - static const EnumTestEnumStringRequiredEnum lower = _$enumTestEnumStringRequiredEnum_lower; + static const EnumTestEnumStringRequiredEnum lower = + _$enumTestEnumStringRequiredEnum_lower; @BuiltValueEnumConst(wireName: r'') - static const EnumTestEnumStringRequiredEnum empty = _$enumTestEnumStringRequiredEnum_empty; + static const EnumTestEnumStringRequiredEnum empty = + _$enumTestEnumStringRequiredEnum_empty; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi; + static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = + _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumStringRequiredEnumSerializer; + static Serializer get serializer => + _$enumTestEnumStringRequiredEnumSerializer; - const EnumTestEnumStringRequiredEnum._(String name): super(name); + const EnumTestEnumStringRequiredEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumStringRequiredEnumValues; - static EnumTestEnumStringRequiredEnum valueOf(String name) => _$enumTestEnumStringRequiredEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumStringRequiredEnumValues; + static EnumTestEnumStringRequiredEnum valueOf(String name) => + _$enumTestEnumStringRequiredEnumValueOf(name); } class EnumTestEnumIntegerEnum extends EnumClass { - @BuiltValueEnumConst(wireNumber: 1) - static const EnumTestEnumIntegerEnum number1 = _$enumTestEnumIntegerEnum_number1; + static const EnumTestEnumIntegerEnum number1 = + _$enumTestEnumIntegerEnum_number1; @BuiltValueEnumConst(wireNumber: -1) - static const EnumTestEnumIntegerEnum numberNegative1 = _$enumTestEnumIntegerEnum_numberNegative1; + static const EnumTestEnumIntegerEnum numberNegative1 = + _$enumTestEnumIntegerEnum_numberNegative1; @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) - static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = _$enumTestEnumIntegerEnum_unknownDefaultOpenApi; + static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = + _$enumTestEnumIntegerEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumIntegerEnumSerializer; + static Serializer get serializer => + _$enumTestEnumIntegerEnumSerializer; - const EnumTestEnumIntegerEnum._(String name): super(name); + const EnumTestEnumIntegerEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumIntegerEnumValues; - static EnumTestEnumIntegerEnum valueOf(String name) => _$enumTestEnumIntegerEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumIntegerEnumValues; + static EnumTestEnumIntegerEnum valueOf(String name) => + _$enumTestEnumIntegerEnumValueOf(name); } class EnumTestEnumNumberEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'1.1') - static const EnumTestEnumNumberEnum number1Period1 = _$enumTestEnumNumberEnum_number1Period1; + static const EnumTestEnumNumberEnum number1Period1 = + _$enumTestEnumNumberEnum_number1Period1; @BuiltValueEnumConst(wireName: r'-1.2') - static const EnumTestEnumNumberEnum numberNegative1Period2 = _$enumTestEnumNumberEnum_numberNegative1Period2; + static const EnumTestEnumNumberEnum numberNegative1Period2 = + _$enumTestEnumNumberEnum_numberNegative1Period2; @BuiltValueEnumConst(wireName: r'11184809', fallback: true) - static const EnumTestEnumNumberEnum unknownDefaultOpenApi = _$enumTestEnumNumberEnum_unknownDefaultOpenApi; + static const EnumTestEnumNumberEnum unknownDefaultOpenApi = + _$enumTestEnumNumberEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumNumberEnumSerializer; + static Serializer get serializer => + _$enumTestEnumNumberEnumSerializer; - const EnumTestEnumNumberEnum._(String name): super(name); + const EnumTestEnumNumberEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumNumberEnumValues; - static EnumTestEnumNumberEnum valueOf(String name) => _$enumTestEnumNumberEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumNumberEnumValues; + static EnumTestEnumNumberEnum valueOf(String name) => + _$enumTestEnumNumberEnumValueOf(name); } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example.dart index 799b77e4e178..27d7e939103c 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example.dart @@ -14,7 +14,7 @@ part 'example.g.dart'; /// Example /// /// Properties: -/// * [name] +/// * [name] @BuiltValue() abstract class Example implements Built { /// One Of [Child], [int] @@ -42,8 +42,7 @@ class _$ExampleSerializer implements PrimitiveSerializer { Serializers serializers, Example object, { FullType specifiedType = FullType.unspecified, - }) sync* { - } + }) sync* {} @override Object serialize( @@ -52,7 +51,8 @@ class _$ExampleSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; } @override @@ -63,10 +63,13 @@ class _$ExampleSerializer implements PrimitiveSerializer { }) { final result = ExampleBuilder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [FullType(Child), FullType(int), ]); + final targetType = const FullType(OneOf, [ + FullType(Child), + FullType(int), + ]); oneOfDataSrc = serialized; - result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, + specifiedType: targetType) as OneOf; return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example_non_primitive.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example_non_primitive.dart index b12eea1f234d..6812a9f2fc60 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example_non_primitive.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/example_non_primitive.dart @@ -12,24 +12,31 @@ part 'example_non_primitive.g.dart'; /// ExampleNonPrimitive @BuiltValue() -abstract class ExampleNonPrimitive implements Built { +abstract class ExampleNonPrimitive + implements Built { /// One Of [DateTime], [String], [int], [num] OneOf get oneOf; ExampleNonPrimitive._(); - factory ExampleNonPrimitive([void updates(ExampleNonPrimitiveBuilder b)]) = _$ExampleNonPrimitive; + factory ExampleNonPrimitive([void updates(ExampleNonPrimitiveBuilder b)]) = + _$ExampleNonPrimitive; @BuiltValueHook(initializeBuilder: true) static void _defaults(ExampleNonPrimitiveBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ExampleNonPrimitiveSerializer(); + static Serializer get serializer => + _$ExampleNonPrimitiveSerializer(); } -class _$ExampleNonPrimitiveSerializer implements PrimitiveSerializer { +class _$ExampleNonPrimitiveSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [ExampleNonPrimitive, _$ExampleNonPrimitive]; + final Iterable types = const [ + ExampleNonPrimitive, + _$ExampleNonPrimitive + ]; @override final String wireName = r'ExampleNonPrimitive'; @@ -38,8 +45,7 @@ class _$ExampleNonPrimitiveSerializer implements PrimitiveSerializer { Extensible object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -80,16 +82,19 @@ class _$ExtensibleSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($Extensible)) as $Extensible; + return serializers.deserialize(serialized, + specifiedType: FullType($Extensible)) as $Extensible; } } /// a concrete implementation of [Extensible], since [Extensible] is not instantiable @BuiltValue(instantiable: true) -abstract class $Extensible implements Extensible, Built<$Extensible, $ExtensibleBuilder> { +abstract class $Extensible + implements Extensible, Built<$Extensible, $ExtensibleBuilder> { $Extensible._(); - factory $Extensible([void Function($ExtensibleBuilder)? updates]) = _$$Extensible; + factory $Extensible([void Function($ExtensibleBuilder)? updates]) = + _$$Extensible; @BuiltValueHook(initializeBuilder: true) static void _defaults($ExtensibleBuilder b) => b; @@ -175,4 +180,3 @@ class _$$ExtensibleSerializer implements PrimitiveSerializer<$Extensible> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/file_schema_test_class.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/file_schema_test_class.dart index 5ab41d14f437..e28ed72311d5 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/file_schema_test_class.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/file_schema_test_class.dart @@ -13,10 +13,11 @@ part 'file_schema_test_class.g.dart'; /// FileSchemaTestClass /// /// Properties: -/// * [file] -/// * [files] +/// * [file] +/// * [files] @BuiltValue() -abstract class FileSchemaTestClass implements Built { +abstract class FileSchemaTestClass + implements Built { @BuiltValueField(wireName: r'file') ModelFile? get file; @@ -25,18 +26,24 @@ abstract class FileSchemaTestClass implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FileSchemaTestClassSerializer(); + static Serializer get serializer => + _$FileSchemaTestClassSerializer(); } -class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { +class _$FileSchemaTestClassSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [FileSchemaTestClass, _$FileSchemaTestClass]; + final Iterable types = const [ + FileSchemaTestClass, + _$FileSchemaTestClass + ]; @override final String wireName = r'FileSchemaTestClass'; @@ -68,7 +75,9 @@ class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { factory Foo([void updates(FooBuilder b)]) = _$Foo; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(FooBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooSerializer(); @@ -105,7 +105,9 @@ class _$FooSerializer implements PrimitiveSerializer { Foo object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -197,4 +199,3 @@ class _$FooSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref.dart index 1f77d990f0e8..e62d40ce6b2e 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref.dart @@ -12,7 +12,7 @@ part 'foo_ref.g.dart'; /// FooRef /// /// Properties: -/// * [foorefPropA] +/// * [foorefPropA] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -28,7 +28,7 @@ abstract class FooRef implements EntityRef, Built { factory FooRef([void updates(FooRefBuilder b)]) = _$FooRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooRefBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(FooRefBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooRefSerializer(); @@ -108,7 +108,9 @@ class _$FooRefSerializer implements PrimitiveSerializer { FooRef object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -207,4 +209,3 @@ class _$FooRefSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref_or_value.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref_or_value.dart index af3e4875d9d6..896800fb01f8 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref_or_value.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/foo_ref_or_value.dart @@ -20,7 +20,8 @@ part 'foo_ref_or_value.g.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue() -abstract class FooRefOrValue implements Built { +abstract class FooRefOrValue + implements Built { /// One Of [Foo], [FooRef] OneOf get oneOf; @@ -33,36 +34,39 @@ abstract class FooRefOrValue implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FooRefOrValueSerializer(); + static Serializer get serializer => + _$FooRefOrValueSerializer(); } extension FooRefOrValueDiscriminatorExt on FooRefOrValue { - String? get discriminatorValue { - if (this is Foo) { - return r'Foo'; - } - if (this is FooRef) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is Foo) { + return r'Foo'; } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } } + extension FooRefOrValueBuilderDiscriminatorExt on FooRefOrValueBuilder { - String? get discriminatorValue { - if (this is FooBuilder) { - return r'Foo'; - } - if (this is FooRefBuilder) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is FooBuilder) { + return r'Foo'; + } + if (this is FooRefBuilder) { + return r'FooRef'; } + return null; + } } class _$FooRefOrValueSerializer implements PrimitiveSerializer { @@ -76,8 +80,7 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { Serializers serializers, FooRefOrValue object, { FullType specifiedType = FullType.unspecified, - }) sync* { - } + }) sync* {} @override Object serialize( @@ -86,7 +89,8 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; } @override @@ -98,10 +102,15 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { final result = FooRefOrValueBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discIndex = + serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [Foo, FooRef, ]; + final oneOfTypes = [ + Foo, + FooRef, + ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -120,10 +129,13 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { oneOfType = FooRef; break; default: - throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/format_test.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/format_test.dart index 33775231476e..771056f35226 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/format_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/format_test.dart @@ -13,20 +13,20 @@ part 'format_test.g.dart'; /// FormatTest /// /// Properties: -/// * [integer] -/// * [int32] -/// * [int64] -/// * [number] -/// * [float] -/// * [double_] -/// * [decimal] -/// * [string] -/// * [byte] -/// * [binary] -/// * [date] -/// * [dateTime] -/// * [uuid] -/// * [password] +/// * [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. @BuiltValue() @@ -216,7 +216,9 @@ class _$FormatTestSerializer implements PrimitiveSerializer { FormatTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -371,4 +373,3 @@ class _$FormatTestSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/fruit.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/fruit.dart index 11f8cfa70501..5c31531d9e55 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/fruit.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/fruit.dart @@ -14,9 +14,9 @@ part 'fruit.g.dart'; /// Fruit /// /// Properties: -/// * [color] -/// * [kind] -/// * [count] +/// * [color] +/// * [kind] +/// * [count] @BuiltValue() abstract class Fruit implements Built { @BuiltValueField(wireName: r'color') @@ -64,8 +64,11 @@ class _$FruitSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); + final result = + _serializeProperties(serializers, object, specifiedType: specifiedType) + .toList(); + result.addAll(serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType)) as Iterable); return result; } @@ -104,7 +107,10 @@ class _$FruitSerializer implements PrimitiveSerializer { }) { final result = FruitBuilder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [FullType(Apple), FullType(Banana), ]); + final targetType = const FullType(OneOf, [ + FullType(Apple), + FullType(Banana), + ]); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -116,8 +122,8 @@ class _$FruitSerializer implements PrimitiveSerializer { result: result, ); oneOfDataSrc = unhandled; - result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, + specifiedType: targetType) as OneOf; return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/has_only_read_only.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/has_only_read_only.dart index 9683985cf198..9d2538bab52a 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/has_only_read_only.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/has_only_read_only.dart @@ -11,10 +11,11 @@ part 'has_only_read_only.g.dart'; /// HasOnlyReadOnly /// /// Properties: -/// * [bar] -/// * [foo] +/// * [bar] +/// * [foo] @BuiltValue() -abstract class HasOnlyReadOnly implements Built { +abstract class HasOnlyReadOnly + implements Built { @BuiltValueField(wireName: r'bar') String? get bar; @@ -23,16 +24,19 @@ abstract class HasOnlyReadOnly implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$HasOnlyReadOnlySerializer(); + static Serializer get serializer => + _$HasOnlyReadOnlySerializer(); } -class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { +class _$HasOnlyReadOnlySerializer + implements PrimitiveSerializer { @override final Iterable types = const [HasOnlyReadOnly, _$HasOnlyReadOnly]; @@ -66,7 +70,9 @@ class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { +abstract class HealthCheckResult + implements Built { @BuiltValueField(wireName: r'NullableMessage') String? get nullableMessage; HealthCheckResult._(); - factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = _$HealthCheckResult; + factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = + _$HealthCheckResult; @BuiltValueHook(initializeBuilder: true) static void _defaults(HealthCheckResultBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$HealthCheckResultSerializer(); + static Serializer get serializer => + _$HealthCheckResultSerializer(); } -class _$HealthCheckResultSerializer implements PrimitiveSerializer { +class _$HealthCheckResultSerializer + implements PrimitiveSerializer { @override final Iterable types = const [HealthCheckResult, _$HealthCheckResult]; @@ -55,7 +59,9 @@ class _$HealthCheckResultSerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'map_map_of_string') @@ -58,28 +58,34 @@ class _$MapTestSerializer implements PrimitiveSerializer { yield r'map_map_of_string'; yield serializers.serialize( object.mapMapOfString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + specifiedType: const FullType(BuiltMap, [ + FullType(String), + FullType(BuiltMap, [FullType(String), FullType(String)]) + ]), ); } if (object.mapOfEnumString != null) { yield r'map_of_enum_string'; yield serializers.serialize( object.mapOfEnumString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + specifiedType: const FullType( + BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), ); } if (object.directMap != null) { yield r'direct_map'; yield serializers.serialize( object.directMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ); } if (object.indirectMap != null) { yield r'indirect_map'; yield serializers.serialize( object.indirectMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ); } } @@ -90,7 +96,9 @@ class _$MapTestSerializer implements PrimitiveSerializer { MapTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -108,28 +116,34 @@ class _$MapTestSerializer implements PrimitiveSerializer { case r'map_map_of_string': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + specifiedType: const FullType(BuiltMap, [ + FullType(String), + FullType(BuiltMap, [FullType(String), FullType(String)]) + ]), ) as BuiltMap>; result.mapMapOfString.replace(valueDes); break; case r'map_of_enum_string': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + specifiedType: const FullType(BuiltMap, + [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), ) as BuiltMap; result.mapOfEnumString.replace(valueDes); break; case r'direct_map': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ) as BuiltMap; result.directMap.replace(valueDes); break; case r'indirect_map': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ) as BuiltMap; result.indirectMap.replace(valueDes); break; @@ -163,19 +177,23 @@ class _$MapTestSerializer implements PrimitiveSerializer { } class MapTestMapOfEnumStringEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'UPPER') - static const MapTestMapOfEnumStringEnum UPPER = _$mapTestMapOfEnumStringEnum_UPPER; + static const MapTestMapOfEnumStringEnum UPPER = + _$mapTestMapOfEnumStringEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') - static const MapTestMapOfEnumStringEnum lower = _$mapTestMapOfEnumStringEnum_lower; + static const MapTestMapOfEnumStringEnum lower = + _$mapTestMapOfEnumStringEnum_lower; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const MapTestMapOfEnumStringEnum unknownDefaultOpenApi = _$mapTestMapOfEnumStringEnum_unknownDefaultOpenApi; + static const MapTestMapOfEnumStringEnum unknownDefaultOpenApi = + _$mapTestMapOfEnumStringEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$mapTestMapOfEnumStringEnumSerializer; + static Serializer get serializer => + _$mapTestMapOfEnumStringEnumSerializer; - const MapTestMapOfEnumStringEnum._(String name): super(name); + const MapTestMapOfEnumStringEnum._(String name) : super(name); - static BuiltSet get values => _$mapTestMapOfEnumStringEnumValues; - static MapTestMapOfEnumStringEnum valueOf(String name) => _$mapTestMapOfEnumStringEnumValueOf(name); + static BuiltSet get values => + _$mapTestMapOfEnumStringEnumValues; + static MapTestMapOfEnumStringEnum valueOf(String name) => + _$mapTestMapOfEnumStringEnumValueOf(name); } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart index 76b5933ae5a7..0d85f7d589aa 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -13,11 +13,14 @@ part 'mixed_properties_and_additional_properties_class.g.dart'; /// MixedPropertiesAndAdditionalPropertiesClass /// /// Properties: -/// * [uuid] -/// * [dateTime] -/// * [map] +/// * [uuid] +/// * [dateTime] +/// * [map] @BuiltValue() -abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built { +abstract class MixedPropertiesAndAdditionalPropertiesClass + implements + Built { @BuiltValueField(wireName: r'uuid') String? get uuid; @@ -29,18 +32,29 @@ abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built b; + static void _defaults(MixedPropertiesAndAdditionalPropertiesClassBuilder b) => + b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); + static Serializer + get serializer => + _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); } -class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements PrimitiveSerializer { +class _$MixedPropertiesAndAdditionalPropertiesClassSerializer + implements + PrimitiveSerializer { @override - final Iterable types = const [MixedPropertiesAndAdditionalPropertiesClass, _$MixedPropertiesAndAdditionalPropertiesClass]; + final Iterable types = const [ + MixedPropertiesAndAdditionalPropertiesClass, + _$MixedPropertiesAndAdditionalPropertiesClass + ]; @override final String wireName = r'MixedPropertiesAndAdditionalPropertiesClass'; @@ -68,7 +82,8 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti yield r'map'; yield serializers.serialize( object.map, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(Animal)]), ); } } @@ -79,7 +94,9 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti MixedPropertiesAndAdditionalPropertiesClass object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -111,7 +128,8 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti case r'map': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(Animal)]), ) as BuiltMap; result.map.replace(valueDes); break; @@ -143,4 +161,3 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model200_response.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model200_response.dart index 0a2cfb4411ac..b9f7146fd0e8 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model200_response.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model200_response.dart @@ -11,10 +11,11 @@ part 'model200_response.g.dart'; /// Model for testing model name starting with number /// /// Properties: -/// * [name] -/// * [classField] +/// * [name] +/// * [classField] @BuiltValue() -abstract class Model200Response implements Built { +abstract class Model200Response + implements Built { @BuiltValueField(wireName: r'name') int? get name; @@ -23,16 +24,19 @@ abstract class Model200Response implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$Model200ResponseSerializer(); + static Serializer get serializer => + _$Model200ResponseSerializer(); } -class _$Model200ResponseSerializer implements PrimitiveSerializer { +class _$Model200ResponseSerializer + implements PrimitiveSerializer { @override final Iterable types = const [Model200Response, _$Model200Response]; @@ -66,7 +70,9 @@ class _$Model200ResponseSerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'client') @@ -55,7 +55,9 @@ class _$ModelClientSerializer implements PrimitiveSerializer { ModelClient object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ModelClientSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_enum_class.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_enum_class.dart index ac609bfd15ad..02835bd779f5 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_enum_class.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_enum_class.dart @@ -10,19 +10,20 @@ import 'package:built_value/serializer.dart'; part 'model_enum_class.g.dart'; class ModelEnumClass extends EnumClass { - @BuiltValueEnumConst(wireName: r'_abc') static const ModelEnumClass abc = _$abc; @BuiltValueEnumConst(wireName: r'-efg') static const ModelEnumClass efg = _$efg; @BuiltValueEnumConst(wireName: r'(xyz)') - static const ModelEnumClass leftParenthesisXyzRightParenthesis = _$leftParenthesisXyzRightParenthesis; + static const ModelEnumClass leftParenthesisXyzRightParenthesis = + _$leftParenthesisXyzRightParenthesis; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) static const ModelEnumClass unknownDefaultOpenApi = _$unknownDefaultOpenApi; - static Serializer get serializer => _$modelEnumClassSerializer; + static Serializer get serializer => + _$modelEnumClassSerializer; - const ModelEnumClass._(String name): super(name); + const ModelEnumClass._(String name) : super(name); static BuiltSet get values => _$values; static ModelEnumClass valueOf(String name) => _$valueOf(name); @@ -35,4 +36,3 @@ class ModelEnumClass extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class ModelEnumClassMixin = Object with _$ModelEnumClassMixin; - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_file.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_file.dart index 2702c21d36f2..a74db4217b29 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_file.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_file.dart @@ -56,7 +56,9 @@ class _$ModelFileSerializer implements PrimitiveSerializer { ModelFile object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -106,4 +108,3 @@ class _$ModelFileSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_list.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_list.dart index 579853258f8e..fbea6fe8232c 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_list.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_list.dart @@ -11,7 +11,7 @@ part 'model_list.g.dart'; /// ModelList /// /// Properties: -/// * [n123list] +/// * [n123list] @BuiltValue() abstract class ModelList implements Built { @BuiltValueField(wireName: r'123-list') @@ -55,7 +55,9 @@ class _$ModelListSerializer implements PrimitiveSerializer { ModelList object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ModelListSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_return.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_return.dart index 45a2f67f8a40..46770cac8e9e 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_return.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/model_return.dart @@ -11,7 +11,7 @@ part 'model_return.g.dart'; /// Model for testing reserved words /// /// Properties: -/// * [return_] +/// * [return_] @BuiltValue() abstract class ModelReturn implements Built { @BuiltValueField(wireName: r'return') @@ -55,7 +55,9 @@ class _$ModelReturnSerializer implements PrimitiveSerializer { ModelReturn object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ModelReturnSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/name.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/name.dart index 10fa99e6a5f7..12531dce5470 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/name.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/name.dart @@ -11,10 +11,10 @@ part 'name.g.dart'; /// Model for testing model name same as property name /// /// Properties: -/// * [name] -/// * [snakeCase] -/// * [property] -/// * [n123number] +/// * [name] +/// * [snakeCase] +/// * [property] +/// * [n123number] @BuiltValue() abstract class Name implements Built { @BuiltValueField(wireName: r'name') @@ -86,7 +86,9 @@ class _$NameSerializer implements PrimitiveSerializer { Name object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -157,4 +159,3 @@ class _$NameSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/nullable_class.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/nullable_class.dart index c993a41303f0..ff124c21bf20 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/nullable_class.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/nullable_class.dart @@ -14,20 +14,21 @@ part 'nullable_class.g.dart'; /// NullableClass /// /// Properties: -/// * [integerProp] -/// * [numberProp] -/// * [booleanProp] -/// * [stringProp] -/// * [dateProp] -/// * [datetimeProp] -/// * [arrayNullableProp] -/// * [arrayAndItemsNullableProp] -/// * [arrayItemsNullable] -/// * [objectNullableProp] -/// * [objectAndItemsNullableProp] -/// * [objectItemsNullable] +/// * [integerProp] +/// * [numberProp] +/// * [booleanProp] +/// * [stringProp] +/// * [dateProp] +/// * [datetimeProp] +/// * [arrayNullableProp] +/// * [arrayAndItemsNullableProp] +/// * [arrayItemsNullable] +/// * [objectNullableProp] +/// * [objectAndItemsNullableProp] +/// * [objectItemsNullable] @BuiltValue() -abstract class NullableClass implements Built { +abstract class NullableClass + implements Built { @BuiltValueField(wireName: r'integer_prop') int? get integerProp; @@ -66,13 +67,15 @@ abstract class NullableClass implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$NullableClassSerializer(); + static Serializer get serializer => + _$NullableClassSerializer(); } class _$NullableClassSerializer implements PrimitiveSerializer { @@ -133,42 +136,48 @@ class _$NullableClassSerializer implements PrimitiveSerializer { yield r'array_nullable_prop'; yield serializers.serialize( object.arrayNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + specifiedType: + const FullType.nullable(BuiltList, [FullType(JsonObject)]), ); } if (object.arrayAndItemsNullableProp != null) { yield r'array_and_items_nullable_prop'; yield serializers.serialize( object.arrayAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: + const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), ); } if (object.arrayItemsNullable != null) { yield r'array_items_nullable'; yield serializers.serialize( object.arrayItemsNullable, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: + const FullType(BuiltList, [FullType.nullable(JsonObject)]), ); } if (object.objectNullableProp != null) { yield r'object_nullable_prop'; yield serializers.serialize( object.objectNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType(JsonObject)]), ); } if (object.objectAndItemsNullableProp != null) { yield r'object_and_items_nullable_prop'; yield serializers.serialize( object.objectAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ); } if (object.objectItemsNullable != null) { yield r'object_items_nullable'; yield serializers.serialize( object.objectItemsNullable, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ); } } @@ -179,7 +188,9 @@ class _$NullableClassSerializer implements PrimitiveSerializer { NullableClass object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -245,7 +256,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + specifiedType: + const FullType.nullable(BuiltList, [FullType(JsonObject)]), ) as BuiltList?; if (valueDes == null) continue; result.arrayNullableProp.replace(valueDes); @@ -253,7 +265,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_and_items_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltList, [FullType.nullable(JsonObject)]), ) as BuiltList?; if (valueDes == null) continue; result.arrayAndItemsNullableProp.replace(valueDes); @@ -261,14 +274,16 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_items_nullable': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: + const FullType(BuiltList, [FullType.nullable(JsonObject)]), ) as BuiltList; result.arrayItemsNullable.replace(valueDes); break; case r'object_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType(JsonObject)]), ) as BuiltMap?; if (valueDes == null) continue; result.objectNullableProp.replace(valueDes); @@ -276,7 +291,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'object_and_items_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ) as BuiltMap?; if (valueDes == null) continue; result.objectAndItemsNullableProp.replace(valueDes); @@ -284,7 +300,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'object_items_nullable': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ) as BuiltMap; result.objectItemsNullable.replace(valueDes); break; @@ -316,4 +333,3 @@ class _$NullableClassSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/number_only.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/number_only.dart index 482a95f3e521..bc854c85003b 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/number_only.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/number_only.dart @@ -11,7 +11,7 @@ part 'number_only.g.dart'; /// NumberOnly /// /// Properties: -/// * [justNumber] +/// * [justNumber] @BuiltValue() abstract class NumberOnly implements Built { @BuiltValueField(wireName: r'JustNumber') @@ -55,7 +55,9 @@ class _$NumberOnlySerializer implements PrimitiveSerializer { NumberOnly object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$NumberOnlySerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/object_with_deprecated_fields.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/object_with_deprecated_fields.dart index 90f4df85934f..de8620fcf22a 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/object_with_deprecated_fields.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/object_with_deprecated_fields.dart @@ -14,12 +14,14 @@ part 'object_with_deprecated_fields.g.dart'; /// ObjectWithDeprecatedFields /// /// Properties: -/// * [uuid] -/// * [id] -/// * [deprecatedRef] -/// * [bars] +/// * [uuid] +/// * [id] +/// * [deprecatedRef] +/// * [bars] @BuiltValue() -abstract class ObjectWithDeprecatedFields implements Built { +abstract class ObjectWithDeprecatedFields + implements + Built { @BuiltValueField(wireName: r'uuid') String? get uuid; @@ -34,18 +36,25 @@ abstract class ObjectWithDeprecatedFields implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ObjectWithDeprecatedFieldsSerializer(); + static Serializer get serializer => + _$ObjectWithDeprecatedFieldsSerializer(); } -class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { +class _$ObjectWithDeprecatedFieldsSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [ObjectWithDeprecatedFields, _$ObjectWithDeprecatedFields]; + final Iterable types = const [ + ObjectWithDeprecatedFields, + _$ObjectWithDeprecatedFields + ]; @override final String wireName = r'ObjectWithDeprecatedFields'; @@ -91,7 +100,9 @@ class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'id') @@ -45,8 +45,7 @@ abstract class Order implements Built { factory Order([void updates(OrderBuilder b)]) = _$Order; @BuiltValueHook(initializeBuilder: true) - static void _defaults(OrderBuilder b) => b - ..complete = false; + static void _defaults(OrderBuilder b) => b..complete = false; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$OrderSerializer(); @@ -114,7 +113,9 @@ class _$OrderSerializer implements PrimitiveSerializer { Order object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -201,25 +202,28 @@ class _$OrderSerializer implements PrimitiveSerializer { } class OrderStatusEnum extends EnumClass { - /// Order Status @BuiltValueEnumConst(wireName: r'placed') static const OrderStatusEnum placed = _$orderStatusEnum_placed; + /// Order Status @BuiltValueEnumConst(wireName: r'approved') static const OrderStatusEnum approved = _$orderStatusEnum_approved; + /// Order Status @BuiltValueEnumConst(wireName: r'delivered') static const OrderStatusEnum delivered = _$orderStatusEnum_delivered; + /// Order Status @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const OrderStatusEnum unknownDefaultOpenApi = _$orderStatusEnum_unknownDefaultOpenApi; + static const OrderStatusEnum unknownDefaultOpenApi = + _$orderStatusEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$orderStatusEnumSerializer; + static Serializer get serializer => + _$orderStatusEnumSerializer; - const OrderStatusEnum._(String name): super(name); + const OrderStatusEnum._(String name) : super(name); static BuiltSet get values => _$orderStatusEnumValues; static OrderStatusEnum valueOf(String name) => _$orderStatusEnumValueOf(name); } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_composite.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_composite.dart index 0d6341cc1299..899262513eb7 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_composite.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_composite.dart @@ -11,11 +11,12 @@ part 'outer_composite.g.dart'; /// OuterComposite /// /// Properties: -/// * [myNumber] -/// * [myString] -/// * [myBoolean] +/// * [myNumber] +/// * [myString] +/// * [myBoolean] @BuiltValue() -abstract class OuterComposite implements Built { +abstract class OuterComposite + implements Built { @BuiltValueField(wireName: r'my_number') num? get myNumber; @@ -27,16 +28,19 @@ abstract class OuterComposite implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OuterCompositeSerializer(); + static Serializer get serializer => + _$OuterCompositeSerializer(); } -class _$OuterCompositeSerializer implements PrimitiveSerializer { +class _$OuterCompositeSerializer + implements PrimitiveSerializer { @override final Iterable types = const [OuterComposite, _$OuterComposite]; @@ -77,7 +81,9 @@ class _$OuterCompositeSerializer implements PrimitiveSerializer OuterComposite object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -141,4 +147,3 @@ class _$OuterCompositeSerializer implements PrimitiveSerializer return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum.dart index 5ad5d8009bdf..bf08d4aa048d 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum.g.dart'; class OuterEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'placed') static const OuterEnum placed = _$placed; @BuiltValueEnumConst(wireName: r'approved') @@ -22,7 +21,7 @@ class OuterEnum extends EnumClass { static Serializer get serializer => _$outerEnumSerializer; - const OuterEnum._(String name): super(name); + const OuterEnum._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnum valueOf(String name) => _$valueOf(name); @@ -35,4 +34,3 @@ class OuterEnum extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class OuterEnumMixin = Object with _$OuterEnumMixin; - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_default_value.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_default_value.dart index 62c3cefe8456..446e5c2fed2d 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_default_value.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_default_value.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_default_value.g.dart'; class OuterEnumDefaultValue extends EnumClass { - @BuiltValueEnumConst(wireName: r'placed') static const OuterEnumDefaultValue placed = _$placed; @BuiltValueEnumConst(wireName: r'approved') @@ -18,11 +17,13 @@ class OuterEnumDefaultValue extends EnumClass { @BuiltValueEnumConst(wireName: r'delivered') static const OuterEnumDefaultValue delivered = _$delivered; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const OuterEnumDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + static const OuterEnumDefaultValue unknownDefaultOpenApi = + _$unknownDefaultOpenApi; - static Serializer get serializer => _$outerEnumDefaultValueSerializer; + static Serializer get serializer => + _$outerEnumDefaultValueSerializer; - const OuterEnumDefaultValue._(String name): super(name); + const OuterEnumDefaultValue._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnumDefaultValue valueOf(String name) => _$valueOf(name); @@ -34,5 +35,5 @@ class OuterEnumDefaultValue extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumDefaultValueMixin = Object with _$OuterEnumDefaultValueMixin; - +abstract class OuterEnumDefaultValueMixin = Object + with _$OuterEnumDefaultValueMixin; diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer.dart index 988b30785d30..d42a7baf5dbd 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_integer.g.dart'; class OuterEnumInteger extends EnumClass { - @BuiltValueEnumConst(wireNumber: 0) static const OuterEnumInteger number0 = _$number0; @BuiltValueEnumConst(wireNumber: 1) @@ -20,9 +19,10 @@ class OuterEnumInteger extends EnumClass { @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) static const OuterEnumInteger unknownDefaultOpenApi = _$unknownDefaultOpenApi; - static Serializer get serializer => _$outerEnumIntegerSerializer; + static Serializer get serializer => + _$outerEnumIntegerSerializer; - const OuterEnumInteger._(String name): super(name); + const OuterEnumInteger._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnumInteger valueOf(String name) => _$valueOf(name); @@ -35,4 +35,3 @@ class OuterEnumInteger extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class OuterEnumIntegerMixin = Object with _$OuterEnumIntegerMixin; - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer_default_value.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer_default_value.dart index 3fe792cedbe9..33b46287a86b 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer_default_value.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_enum_integer_default_value.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_integer_default_value.g.dart'; class OuterEnumIntegerDefaultValue extends EnumClass { - @BuiltValueEnumConst(wireNumber: 0) static const OuterEnumIntegerDefaultValue number0 = _$number0; @BuiltValueEnumConst(wireNumber: 1) @@ -18,11 +17,13 @@ class OuterEnumIntegerDefaultValue extends EnumClass { @BuiltValueEnumConst(wireNumber: 2) static const OuterEnumIntegerDefaultValue number2 = _$number2; @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) - static const OuterEnumIntegerDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + static const OuterEnumIntegerDefaultValue unknownDefaultOpenApi = + _$unknownDefaultOpenApi; - static Serializer get serializer => _$outerEnumIntegerDefaultValueSerializer; + static Serializer get serializer => + _$outerEnumIntegerDefaultValueSerializer; - const OuterEnumIntegerDefaultValue._(String name): super(name); + const OuterEnumIntegerDefaultValue._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnumIntegerDefaultValue valueOf(String name) => _$valueOf(name); @@ -34,5 +35,5 @@ class OuterEnumIntegerDefaultValue extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumIntegerDefaultValueMixin = Object with _$OuterEnumIntegerDefaultValueMixin; - +abstract class OuterEnumIntegerDefaultValueMixin = Object + with _$OuterEnumIntegerDefaultValueMixin; diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_object_with_enum_property.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_object_with_enum_property.dart index 173329856452..43dddcba352f 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_object_with_enum_property.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/outer_object_with_enum_property.dart @@ -12,27 +12,36 @@ part 'outer_object_with_enum_property.g.dart'; /// OuterObjectWithEnumProperty /// /// Properties: -/// * [value] +/// * [value] @BuiltValue() -abstract class OuterObjectWithEnumProperty implements Built { +abstract class OuterObjectWithEnumProperty + implements + Built { @BuiltValueField(wireName: r'value') OuterEnumInteger get value; // enum valueEnum { 0, 1, 2, }; OuterObjectWithEnumProperty._(); - factory OuterObjectWithEnumProperty([void updates(OuterObjectWithEnumPropertyBuilder b)]) = _$OuterObjectWithEnumProperty; + factory OuterObjectWithEnumProperty( + [void updates(OuterObjectWithEnumPropertyBuilder b)]) = + _$OuterObjectWithEnumProperty; @BuiltValueHook(initializeBuilder: true) static void _defaults(OuterObjectWithEnumPropertyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OuterObjectWithEnumPropertySerializer(); + static Serializer get serializer => + _$OuterObjectWithEnumPropertySerializer(); } -class _$OuterObjectWithEnumPropertySerializer implements PrimitiveSerializer { +class _$OuterObjectWithEnumPropertySerializer + implements PrimitiveSerializer { @override - final Iterable types = const [OuterObjectWithEnumProperty, _$OuterObjectWithEnumProperty]; + final Iterable types = const [ + OuterObjectWithEnumProperty, + _$OuterObjectWithEnumProperty + ]; @override final String wireName = r'OuterObjectWithEnumProperty'; @@ -55,7 +64,9 @@ class _$OuterObjectWithEnumPropertySerializer implements PrimitiveSerializer { factory Pasta([void updates(PastaBuilder b)]) = _$Pasta; @BuiltValueHook(initializeBuilder: true) - static void _defaults(PastaBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(PastaBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$PastaSerializer(); @@ -94,7 +94,9 @@ class _$PastaSerializer implements PrimitiveSerializer { Pasta object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -179,4 +181,3 @@ class _$PastaSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pet.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pet.dart index aeb788e8f7ff..6c377470f4a6 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pet.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pet.dart @@ -14,11 +14,11 @@ part 'pet.g.dart'; /// Pet /// /// Properties: -/// * [id] -/// * [name] -/// * [category] -/// * [photoUrls] -/// * [tags] +/// * [id] +/// * [name] +/// * [category] +/// * [photoUrls] +/// * [tags] /// * [status] - pet status in the store @BuiltValue() abstract class Pet implements Built { @@ -111,7 +111,9 @@ class _$PetSerializer implements PrimitiveSerializer { Pet object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -198,25 +200,27 @@ class _$PetSerializer implements PrimitiveSerializer { } class PetStatusEnum extends EnumClass { - /// pet status in the store @BuiltValueEnumConst(wireName: r'available') static const PetStatusEnum available = _$petStatusEnum_available; + /// pet status in the store @BuiltValueEnumConst(wireName: r'pending') static const PetStatusEnum pending = _$petStatusEnum_pending; + /// pet status in the store @BuiltValueEnumConst(wireName: r'sold') static const PetStatusEnum sold = _$petStatusEnum_sold; + /// pet status in the store @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const PetStatusEnum unknownDefaultOpenApi = _$petStatusEnum_unknownDefaultOpenApi; + static const PetStatusEnum unknownDefaultOpenApi = + _$petStatusEnum_unknownDefaultOpenApi; static Serializer get serializer => _$petStatusEnumSerializer; - const PetStatusEnum._(String name): super(name); + const PetStatusEnum._(String name) : super(name); static BuiltSet get values => _$petStatusEnumValues; static PetStatusEnum valueOf(String name) => _$petStatusEnumValueOf(name); } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza.dart index 14c06db06d7e..ca079abe8549 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza.dart @@ -13,7 +13,7 @@ part 'pizza.g.dart'; /// Pizza /// /// Properties: -/// * [pizzaSize] +/// * [pizzaSize] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -35,20 +35,21 @@ abstract class Pizza implements Entity { } extension PizzaDiscriminatorExt on Pizza { - String? get discriminatorValue { - if (this is PizzaSpeziale) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; } + return null; + } } + extension PizzaBuilderDiscriminatorExt on PizzaBuilder { - String? get discriminatorValue { - if (this is PizzaSpezialeBuilder) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; } + return null; + } } class _$PizzaSerializer implements PrimitiveSerializer { @@ -112,9 +113,12 @@ class _$PizzaSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { if (object is PizzaSpeziale) { - return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + return serializers.serialize(object, + specifiedType: FullType(PizzaSpeziale))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -125,12 +129,15 @@ class _$PizzaSerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Pizza.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'PizzaSpeziale': - return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + return serializers.deserialize(serialized, + specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; default: - return serializers.deserialize(serialized, specifiedType: FullType($Pizza)) as $Pizza; + return serializers.deserialize(serialized, + specifiedType: FullType($Pizza)) as $Pizza; } } } @@ -247,4 +254,3 @@ class _$$PizzaSerializer implements PrimitiveSerializer<$Pizza> { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza_speziale.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza_speziale.dart index 673052cc8fcf..4c6fd7f38c26 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza_speziale.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/pizza_speziale.dart @@ -12,26 +12,30 @@ part 'pizza_speziale.g.dart'; /// PizzaSpeziale /// /// Properties: -/// * [toppings] +/// * [toppings] /// * [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 @BuiltValue() -abstract class PizzaSpeziale implements Pizza, Built { +abstract class PizzaSpeziale + implements Pizza, Built { @BuiltValueField(wireName: r'toppings') String? get toppings; PizzaSpeziale._(); - factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = _$PizzaSpeziale; + factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = + _$PizzaSpeziale; @BuiltValueHook(initializeBuilder: true) - static void _defaults(PizzaSpezialeBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(PizzaSpezialeBuilder b) => + b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$PizzaSpezialeSerializer(); + static Serializer get serializer => + _$PizzaSpezialeSerializer(); } class _$PizzaSpezialeSerializer implements PrimitiveSerializer { @@ -101,7 +105,9 @@ class _$PizzaSpezialeSerializer implements PrimitiveSerializer { PizzaSpeziale object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -193,4 +199,3 @@ class _$PizzaSpezialeSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/read_only_first.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/read_only_first.dart index b619217ab3cb..b2501901295f 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/read_only_first.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/read_only_first.dart @@ -11,10 +11,11 @@ part 'read_only_first.g.dart'; /// ReadOnlyFirst /// /// Properties: -/// * [bar] -/// * [baz] +/// * [bar] +/// * [baz] @BuiltValue() -abstract class ReadOnlyFirst implements Built { +abstract class ReadOnlyFirst + implements Built { @BuiltValueField(wireName: r'bar') String? get bar; @@ -23,13 +24,15 @@ abstract class ReadOnlyFirst implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ReadOnlyFirstSerializer(); + static Serializer get serializer => + _$ReadOnlyFirstSerializer(); } class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { @@ -66,7 +69,9 @@ class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { ReadOnlyFirst object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -123,4 +128,3 @@ class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/single_ref_type.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/single_ref_type.dart index b51e77292e8e..5324d92a7831 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/single_ref_type.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/single_ref_type.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'single_ref_type.g.dart'; class SingleRefType extends EnumClass { - @BuiltValueEnumConst(wireName: r'admin') static const SingleRefType admin = _$admin; @BuiltValueEnumConst(wireName: r'user') @@ -20,7 +19,7 @@ class SingleRefType extends EnumClass { static Serializer get serializer => _$singleRefTypeSerializer; - const SingleRefType._(String name): super(name); + const SingleRefType._(String name) : super(name); static BuiltSet get values => _$values; static SingleRefType valueOf(String name) => _$valueOf(name); @@ -33,4 +32,3 @@ class SingleRefType extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class SingleRefTypeMixin = Object with _$SingleRefTypeMixin; - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/special_model_name.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/special_model_name.dart index fa860056b45d..c5a18443b89f 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/special_model_name.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/special_model_name.dart @@ -11,24 +11,28 @@ part 'special_model_name.g.dart'; /// SpecialModelName /// /// Properties: -/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] +/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] @BuiltValue() -abstract class SpecialModelName implements Built { +abstract class SpecialModelName + implements Built { @BuiltValueField(wireName: r'$special[property.name]') int? get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; SpecialModelName._(); - factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = _$SpecialModelName; + factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = + _$SpecialModelName; @BuiltValueHook(initializeBuilder: true) static void _defaults(SpecialModelNameBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$SpecialModelNameSerializer(); + static Serializer get serializer => + _$SpecialModelNameSerializer(); } -class _$SpecialModelNameSerializer implements PrimitiveSerializer { +class _$SpecialModelNameSerializer + implements PrimitiveSerializer { @override final Iterable types = const [SpecialModelName, _$SpecialModelName]; @@ -40,10 +44,13 @@ class _$SpecialModelNameSerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'id') @@ -66,7 +66,9 @@ class _$TagSerializer implements PrimitiveSerializer { Tag object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -123,4 +125,3 @@ class _$TagSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart index 62190487b0ce..43cf4b6c0d3f 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart @@ -12,29 +12,49 @@ part 'test_query_style_form_explode_true_array_string_query_object_parameter.g.d /// TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter /// /// Properties: -/// * [values] +/// * [values] @BuiltValue() -abstract class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter implements Built { +abstract class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + implements + Built { @BuiltValueField(wireName: r'values') BuiltList? get values; TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter._(); - factory TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter([void updates(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder b)]) = _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; + factory TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter( + [void updates( + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder + b)]) = + _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; @BuiltValueHook(initializeBuilder: true) - static void _defaults(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder b) => b; + static void _defaults( + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder + b) => + b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer(); + static Serializer< + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter> + get serializer => + _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer(); } -class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer implements PrimitiveSerializer { +class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer + implements + PrimitiveSerializer< + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter> { @override - final Iterable types = const [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter]; + final Iterable types = const [ + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, + _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + ]; @override - final String wireName = r'TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter'; + final String wireName = + r'TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter'; Iterable _serializeProperties( Serializers serializers, @@ -56,7 +76,9 @@ class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer i TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -64,7 +86,8 @@ class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer i Object serialized, { FullType specifiedType = FullType.unspecified, required List serializedList, - required TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder result, + required TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder + result, required List unhandled, }) { for (var i = 0; i < serializedList.length; i += 2) { @@ -92,7 +115,8 @@ class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer i Object serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); + final result = + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -106,4 +130,3 @@ class _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterSerializer i return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/user.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/user.dart index f7577d7e1ee9..5d10005382ff 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/user.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/model/user.dart @@ -11,13 +11,13 @@ part 'user.g.dart'; /// User /// /// Properties: -/// * [id] -/// * [username] -/// * [firstName] -/// * [lastName] -/// * [email] -/// * [password] -/// * [phone] +/// * [id] +/// * [username] +/// * [firstName] +/// * [lastName] +/// * [email] +/// * [password] +/// * [phone] /// * [userStatus] - User Status @BuiltValue() abstract class User implements Built { @@ -133,7 +133,9 @@ class _$UserSerializer implements PrimitiveSerializer { User object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -232,4 +234,3 @@ class _$UserSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/serializers.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/serializers.dart index c693e7afc032..76baea9bd50a 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/serializers.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/serializers.dart @@ -86,9 +86,11 @@ part 'serializers.g.dart'; @SerializersFor([ AdditionalPropertiesClass, - Addressable,$Addressable, + Addressable, + $Addressable, AllOfWithSingleRef, - Animal,$Animal, + Animal, + $Animal, ApiResponse, Apple, ArrayOfArrayOfNumberOnly, @@ -101,20 +103,25 @@ part 'serializers.g.dart'; BarRefOrValue, Capitalization, Cat, - CatAllOf,$CatAllOf, + CatAllOf, + $CatAllOf, Category, Child, ClassModel, DeprecatedObject, Dog, - DogAllOf,$DogAllOf, - Entity,$Entity, - EntityRef,$EntityRef, + DogAllOf, + $DogAllOf, + Entity, + $Entity, + EntityRef, + $EntityRef, EnumArrays, EnumTest, Example, ExampleNonPrimitive, - Extensible,$Extensible, + Extensible, + $Extensible, FileSchemaTestClass, Foo, FooRef, @@ -144,7 +151,8 @@ part 'serializers.g.dart'; OuterObjectWithEnumProperty, Pasta, Pet, - Pizza,$Pizza, + Pizza, + $Pizza, PizzaSpeziale, ReadOnlyFirst, SingleRefType, diff --git a/samples/client/echo_api/dart/dart-http-built_value/pubspec.yaml b/samples/client/echo_api/dart/dart-http-built_value/pubspec.yaml index cf19769cab8f..87b8cd162271 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/pubspec.yaml +++ b/samples/client/echo_api/dart/dart-http-built_value/pubspec.yaml @@ -7,7 +7,10 @@ environment: sdk: '>=2.12.0 <3.0.0' dependencies: + http: '>=0.13.5 <2.0.0' + intl: '^0.17.0' + meta: '^1.1.8' one_of: '>=1.5.0 <2.0.0' one_of_serializer: '>=1.5.0 <2.0.0' built_value: '>=8.4.0 <9.0.0' diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/additional_properties_class_test.dart index c231e6dc2807..0ee0559d710c 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/additional_properties_class_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/additional_properties_class_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `mapOfMapProperty`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/addressable_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/addressable_test.dart index 696e26e8e549..657f7ee74448 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/addressable_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/addressable_test.dart @@ -18,6 +18,5 @@ void main() { test('to test the property `id`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/all_of_with_single_ref_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/all_of_with_single_ref_test.dart index 64e241a4dce3..a423afab69b0 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/all_of_with_single_ref_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/all_of_with_single_ref_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `singleRefType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/animal_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/animal_test.dart index 39b8b59cdf51..023e09145fe3 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/animal_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/animal_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `color`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/api_response_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/api_response_test.dart index cf1a744cd629..9587579a4ab0 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/api_response_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/api_response_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `message`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/apple_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/apple_test.dart index 1d542169550d..0949f55b7247 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/apple_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/apple_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `kind`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/array_of_array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/array_of_array_of_number_only_test.dart index a679a6c4223d..ad6d165e3c83 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/array_of_array_of_number_only_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/array_of_array_of_number_only_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `arrayArrayNumber`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/array_of_number_only_test.dart index cc648bc115c5..456681ced455 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/array_of_number_only_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/array_of_number_only_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `arrayNumber`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/array_test_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/array_test_test.dart index 210216f224b5..7b89588b2157 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/array_test_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/array_test_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `arrayArrayOfModel`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/banana_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/banana_test.dart index a883acc0a9e8..34f4c1ca36ed 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/banana_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/banana_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `count`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/bar_create_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/bar_create_test.dart index 1bf90151be8b..050dcadfb0f9 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/bar_create_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/bar_create_test.dart @@ -51,6 +51,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_or_value_test.dart index c132ac09943b..a6ceb001ec11 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_or_value_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_or_value_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_test.dart index 9c410b2b5c54..4a31ed0904b5 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/bar_ref_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/bar_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/bar_test.dart index dc6daaa3400d..616f922b5d14 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/bar_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/bar_test.dart @@ -50,6 +50,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/body_api_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/body_api_test.dart index 067b2ca7c7c7..05eedc2d2540 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/body_api_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/body_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for BodyApi void main() { final instance = Openapi().getBodyApi(); @@ -15,6 +14,5 @@ void main() { test('test testEchoBodyPet', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/capitalization_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/capitalization_test.dart index 23e04b0001bb..c1fb9cd73dc7 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/capitalization_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/capitalization_test.dart @@ -32,11 +32,10 @@ void main() { // TODO }); - // Name of the pet + // Name of the pet // String ATT_NAME test('to test the property `ATT_NAME`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/cat_all_of_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/cat_all_of_test.dart index fb7e999bf8d1..b84216c8996d 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/cat_all_of_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/cat_all_of_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `declawed`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/cat_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/cat_test.dart index b8fc252acc60..000e31d7f176 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/cat_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/cat_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `declawed`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/category_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/category_test.dart index de682b2ff15b..ba39a86cfb6a 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/category_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/category_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/child_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/child_test.dart index d40451a84c2c..6c5defb7b228 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/child_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/child_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/class_model_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/class_model_test.dart index 89f1d35e556b..1ca5ccc3a74b 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/class_model_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/class_model_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `classField`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/deprecated_object_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/deprecated_object_test.dart index 98ab991b2b14..298f2d2253b4 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/deprecated_object_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/deprecated_object_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/dog_all_of_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/dog_all_of_test.dart index 7b4f4095dc9f..8d258244accb 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/dog_all_of_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/dog_all_of_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `breed`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/dog_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/dog_test.dart index f57fcdc413df..0d810b3b9fa9 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/dog_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/dog_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `breed`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/entity_ref_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/entity_ref_test.dart index 836289893fb4..ce3ed9868212 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/entity_ref_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/entity_ref_test.dart @@ -48,6 +48,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/entity_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/entity_test.dart index 30429747562d..ca7dd754f98d 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/entity_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/entity_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/enum_arrays_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/enum_arrays_test.dart index 438c36db0745..c0d5de925aec 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/enum_arrays_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/enum_arrays_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `arrayEnum`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/enum_test_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/enum_test_test.dart index b5f3aeb7fbdd..d7dc20b5eb77 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/enum_test_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/enum_test_test.dart @@ -46,6 +46,5 @@ void main() { test('to test the property `outerEnumIntegerDefaultValue`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/example_non_primitive_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/example_non_primitive_test.dart index 93f736780e93..5563d239e355 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/example_non_primitive_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/example_non_primitive_test.dart @@ -6,6 +6,5 @@ void main() { final instance = ExampleNonPrimitiveBuilder(); // TODO add properties to the builder and call build() - group(ExampleNonPrimitive, () { - }); + group(ExampleNonPrimitive, () {}); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/example_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/example_test.dart index ccb35121143e..1150465e7d28 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/example_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/example_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/extensible_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/extensible_test.dart index 75e6211e074b..158df10ac74e 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/extensible_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/extensible_test.dart @@ -24,6 +24,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/file_schema_test_class_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/file_schema_test_class_test.dart index ca8695bd4a47..1ef8cf8861b4 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/file_schema_test_class_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/file_schema_test_class_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `files`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_or_value_test.dart index 029d030e5e35..bcee2f7eaee1 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_or_value_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_or_value_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_test.dart index a1398787bbcb..b28c262c3e22 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/foo_ref_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/foo_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/foo_test.dart index 93a5286e2b45..0b491bb37b68 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/foo_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/foo_test.dart @@ -46,6 +46,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/format_test_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/format_test_test.dart index 558c3aa4b659..3827c02e13ae 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/format_test_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/format_test_test.dart @@ -88,6 +88,5 @@ void main() { test('to test the property `patternWithDigitsAndDelimiter`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/fruit_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/fruit_test.dart index c18790ae9566..26b265ccb93f 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/fruit_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/fruit_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `count`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/has_only_read_only_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/has_only_read_only_test.dart index c34522214751..8b00db3d0711 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/has_only_read_only_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/has_only_read_only_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `foo`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/health_check_result_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/health_check_result_test.dart index fda0c9218217..050e2c9b814f 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/health_check_result_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/health_check_result_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `nullableMessage`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/map_test_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/map_test_test.dart index 56a27610ee5a..56c3d448c6c5 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/map_test_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/map_test_test.dart @@ -26,6 +26,5 @@ void main() { test('to test the property `indirectMap`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/mixed_properties_and_additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/mixed_properties_and_additional_properties_class_test.dart index 85b113387a08..dcaa8d351ae5 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/mixed_properties_and_additional_properties_class_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/mixed_properties_and_additional_properties_class_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `map`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/model200_response_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model200_response_test.dart index 11bac07fafb8..8064eb959a32 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/model200_response_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/model200_response_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `classField`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/model_client_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model_client_test.dart index f494dfd08499..1998f27d715a 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/model_client_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/model_client_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `client`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/model_enum_class_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model_enum_class_test.dart index 03e5855bf004..fa31f816801c 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/model_enum_class_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/model_enum_class_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for ModelEnumClass void main() { - - group(ModelEnumClass, () { - }); + group(ModelEnumClass, () {}); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/model_file_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model_file_test.dart index 4f1397726226..a07c60c5d85d 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/model_file_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/model_file_test.dart @@ -12,6 +12,5 @@ void main() { test('to test the property `sourceURI`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/model_list_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model_list_test.dart index d35e02fe0c9a..0c4e3c45c7a9 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/model_list_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/model_list_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `n123list`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/model_return_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/model_return_test.dart index eedfe7eb281a..b60abdfd6021 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/model_return_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/model_return_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `return_`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/name_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/name_test.dart index 6b2329bb0819..d04e76fef9e0 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/name_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/name_test.dart @@ -26,6 +26,5 @@ void main() { test('to test the property `n123number`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/nullable_class_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/nullable_class_test.dart index 1a6767dbb2ab..32f0eba4fb2e 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/nullable_class_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/nullable_class_test.dart @@ -66,6 +66,5 @@ void main() { test('to test the property `objectItemsNullable`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/number_only_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/number_only_test.dart index 7167d78a4962..7f34d2a5ce60 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/number_only_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/number_only_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `justNumber`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/object_with_deprecated_fields_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/object_with_deprecated_fields_test.dart index 67275d513f56..574970b317ca 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/object_with_deprecated_fields_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/object_with_deprecated_fields_test.dart @@ -26,6 +26,5 @@ void main() { test('to test the property `bars`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/order_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/order_test.dart index 7ff992230bf6..3ed96043d80c 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/order_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/order_test.dart @@ -37,6 +37,5 @@ void main() { test('to test the property `complete`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/outer_composite_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_composite_test.dart index dac257d9a0d6..99a7cb7db596 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/outer_composite_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/outer_composite_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `myBoolean`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_default_value_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_default_value_test.dart index 502c8326be58..a5c83f615194 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_default_value_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_default_value_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumDefaultValue void main() { - - group(OuterEnumDefaultValue, () { - }); + group(OuterEnumDefaultValue, () {}); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_default_value_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_default_value_test.dart index c535fe8ac354..49ebbfcead7f 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_default_value_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_default_value_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumIntegerDefaultValue void main() { - - group(OuterEnumIntegerDefaultValue, () { - }); + group(OuterEnumIntegerDefaultValue, () {}); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_test.dart index d945bc8c489d..3c6b81305c71 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_integer_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumInteger void main() { - - group(OuterEnumInteger, () { - }); + group(OuterEnumInteger, () {}); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_test.dart index 8e11eb02fb8a..4ee10f379d5e 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/outer_enum_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnum void main() { - - group(OuterEnum, () { - }); + group(OuterEnum, () {}); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/outer_object_with_enum_property_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/outer_object_with_enum_property_test.dart index d6d763c5d93a..cb621828cbc0 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/outer_object_with_enum_property_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/outer_object_with_enum_property_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `value`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/pasta_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/pasta_test.dart index 6a3ae338eec2..42de4a90e2fa 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/pasta_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/pasta_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/path_api_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/path_api_test.dart index 4ffdcc4567be..658f714ec35f 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/path_api_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/path_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for PathApi void main() { final instance = Openapi().getPathApi(); @@ -15,6 +14,5 @@ void main() { test('test testsPathStringPathStringIntegerPathInteger', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/pet_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/pet_test.dart index 94089dce62cf..bf61da3114ce 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/pet_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/pet_test.dart @@ -37,6 +37,5 @@ void main() { test('to test the property `status`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/pizza_speziale_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/pizza_speziale_test.dart index 774320231c9e..c6a78cb12fc7 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/pizza_speziale_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/pizza_speziale_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/pizza_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/pizza_test.dart index 5c6e1af95a59..7e0b87b9ab5a 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/pizza_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/pizza_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/query_api_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/query_api_test.dart index fbb29ec74c85..960e3b243e74 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/query_api_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/query_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for QueryApi void main() { final instance = Openapi().getQueryApi(); @@ -33,6 +32,5 @@ void main() { test('test testQueryStyleFormExplodeTrueObject', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/read_only_first_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/read_only_first_test.dart index 550d3d793ec6..f4652322f2c7 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/read_only_first_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/read_only_first_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `baz`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/single_ref_type_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/single_ref_type_test.dart index 5cd85add393e..2c265f0d24ae 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/single_ref_type_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/single_ref_type_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for SingleRefType void main() { - - group(SingleRefType, () { - }); + group(SingleRefType, () {}); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/special_model_name_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/special_model_name_test.dart index 08a4592a1ed7..f81e03f7188d 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/special_model_name_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/special_model_name_test.dart @@ -8,9 +8,10 @@ void main() { group(SpecialModelName, () { // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket - test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + test( + 'to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', + () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/tag_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/tag_test.dart index 6f7c63b8f0c2..253a283fc867 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/tag_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/tag_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart index 2017e0c3d8d1..e15b28ac90c2 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart @@ -3,7 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter void main() { - final instance = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); + final instance = + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterBuilder(); // TODO add properties to the builder and call build() group(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, () { @@ -11,6 +12,5 @@ void main() { test('to test the property `values`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-built_value/test/user_test.dart b/samples/client/echo_api/dart/dart-http-built_value/test/user_test.dart index 1e6a1bc23faa..40bef6e6d21c 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/test/user_test.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/test/user_test.dart @@ -47,6 +47,5 @@ void main() { test('to test the property `userStatus`', () async { // TODO }); - }); } diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/.gitignore b/samples/client/echo_api/dart/dart-http-json_serializable/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/.gitignore @@ -0,0 +1,41 @@ +# See https://dart.dev/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock + +# Don’t commit files and directories created by other development environments. +# For example, if your development environment creates any of the following files, +# consider putting them in a global ignore file: + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator-ignore b/samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator/FILES b/samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator/FILES new file mode 100644 index 000000000000..d866d909b67d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator/FILES @@ -0,0 +1,157 @@ +.gitignore +README.md +analysis_options.yaml +build.yaml +doc/AdditionalPropertiesClass.md +doc/Addressable.md +doc/AllOfWithSingleRef.md +doc/Animal.md +doc/ApiResponse.md +doc/Apple.md +doc/ArrayOfArrayOfNumberOnly.md +doc/ArrayOfNumberOnly.md +doc/ArrayTest.md +doc/Banana.md +doc/Bar.md +doc/BarCreate.md +doc/BarRef.md +doc/BarRefOrValue.md +doc/BodyApi.md +doc/Capitalization.md +doc/Cat.md +doc/CatAllOf.md +doc/Category.md +doc/Child.md +doc/ClassModel.md +doc/DeprecatedObject.md +doc/Dog.md +doc/DogAllOf.md +doc/Entity.md +doc/EntityRef.md +doc/EnumArrays.md +doc/EnumTest.md +doc/Example.md +doc/ExampleNonPrimitive.md +doc/Extensible.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FooRef.md +doc/FooRefOrValue.md +doc/FormatTest.md +doc/Fruit.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/Pasta.md +doc/PathApi.md +doc/Pet.md +doc/Pizza.md +doc/PizzaSpeziale.md +doc/QueryApi.md +doc/ReadOnlyFirst.md +doc/SingleRefType.md +doc/SpecialModelName.md +doc/Tag.md +doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +doc/User.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/_exports.dart +lib/src/api/body_api.dart +lib/src/api/path_api.dart +lib/src/api/query_api.dart +lib/src/api_util.dart +lib/src/auth/_exports.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/deserialize.dart +lib/src/model/_exports.dart +lib/src/model/additional_properties_class.dart +lib/src/model/addressable.dart +lib/src/model/all_of_with_single_ref.dart +lib/src/model/animal.dart +lib/src/model/api_response.dart +lib/src/model/apple.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/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/capitalization.dart +lib/src/model/cat.dart +lib/src/model/cat_all_of.dart +lib/src/model/category.dart +lib/src/model/child.dart +lib/src/model/class_model.dart +lib/src/model/deprecated_object.dart +lib/src/model/dog.dart +lib/src/model/dog_all_of.dart +lib/src/model/entity.dart +lib/src/model/entity_ref.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/example.dart +lib/src/model/example_non_primitive.dart +lib/src/model/extensible.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/foo_ref.dart +lib/src/model/foo_ref_or_value.dart +lib/src/model/format_test.dart +lib/src/model/fruit.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/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/pasta.dart +lib/src/model/pet.dart +lib/src/model/pizza.dart +lib/src/model/pizza_speziale.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_query_style_form_explode_true_array_string_query_object_parameter.dart +lib/src/model/user.dart +pubspec.yaml diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator/VERSION b/samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator/VERSION new file mode 100644 index 000000000000..d6b4ec4aa783 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/README.md b/samples/client/echo_api/dart/dart-http-json_serializable/README.md new file mode 100644 index 000000000000..83dce6ed3339 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/README.md @@ -0,0 +1,153 @@ +# openapi +Echo Server API + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.1.0 +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.12.0 or later OR Flutter 1.26.0 or later +* http 0.13.5+ + +## 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().getBodyApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + final response = await api.testEchoBodyPet(pet); + print(response); +} catch on DioError (e) { + print("Exception when calling BodyApi->testEchoBodyPet: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:3000* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*BodyApi*](doc/BodyApi.md) | [**testEchoBodyPet**](doc/BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) +[*PathApi*](doc/PathApi.md) | [**testsPathStringPathStringIntegerPathInteger**](doc/PathApi.md#testspathstringpathstringintegerpathinteger) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryIntegerBooleanString**](doc/QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryStyleFormExplodeTrueArrayString**](doc/QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +[*QueryApi*](doc/QueryApi.md) | [**testQueryStyleFormExplodeTrueObject**](doc/QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) + + +## Documentation For Models + + - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) + - [Addressable](doc/Addressable.md) + - [AllOfWithSingleRef](doc/AllOfWithSingleRef.md) + - [Animal](doc/Animal.md) + - [ApiResponse](doc/ApiResponse.md) + - [Apple](doc/Apple.md) + - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) + - [ArrayTest](doc/ArrayTest.md) + - [Banana](doc/Banana.md) + - [Bar](doc/Bar.md) + - [BarCreate](doc/BarCreate.md) + - [BarRef](doc/BarRef.md) + - [BarRefOrValue](doc/BarRefOrValue.md) + - [Capitalization](doc/Capitalization.md) + - [Cat](doc/Cat.md) + - [CatAllOf](doc/CatAllOf.md) + - [Category](doc/Category.md) + - [Child](doc/Child.md) + - [ClassModel](doc/ClassModel.md) + - [DeprecatedObject](doc/DeprecatedObject.md) + - [Dog](doc/Dog.md) + - [DogAllOf](doc/DogAllOf.md) + - [Entity](doc/Entity.md) + - [EntityRef](doc/EntityRef.md) + - [EnumArrays](doc/EnumArrays.md) + - [EnumTest](doc/EnumTest.md) + - [Example](doc/Example.md) + - [ExampleNonPrimitive](doc/ExampleNonPrimitive.md) + - [Extensible](doc/Extensible.md) + - [FileSchemaTestClass](doc/FileSchemaTestClass.md) + - [Foo](doc/Foo.md) + - [FooRef](doc/FooRef.md) + - [FooRefOrValue](doc/FooRefOrValue.md) + - [FormatTest](doc/FormatTest.md) + - [Fruit](doc/Fruit.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) + - [Pasta](doc/Pasta.md) + - [Pet](doc/Pet.md) + - [Pizza](doc/Pizza.md) + - [PizzaSpeziale](doc/PizzaSpeziale.md) + - [ReadOnlyFirst](doc/ReadOnlyFirst.md) + - [SingleRefType](doc/SingleRefType.md) + - [SpecialModelName](doc/SpecialModelName.md) + - [Tag](doc/Tag.md) + - [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md) + - [User](doc/User.md) + + +## Documentation For Authorization + + All endpoints do not require authorization. + + +## Author + +team@openapitools.org + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/analysis_options.yaml b/samples/client/echo_api/dart/dart-http-json_serializable/analysis_options.yaml new file mode 100644 index 000000000000..28be8936a4bd --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/analysis_options.yaml @@ -0,0 +1,10 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/build.yaml b/samples/client/echo_api/dart/dart-http-json_serializable/build.yaml new file mode 100644 index 000000000000..89a4dd6e1c2e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/build.yaml @@ -0,0 +1,18 @@ +targets: + $default: + builders: + json_serializable: + options: + # Options configure how source code is generated for every + # `@JsonSerializable`-annotated class in the package. + # + # The default value for each is listed. + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: true + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/AdditionalPropertiesClass.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..863b8503db83 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/AdditionalPropertiesClass.md @@ -0,0 +1,16 @@ +# openapi.model.AdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **Map<String, String>** | | [optional] +**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Addressable.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Addressable.md new file mode 100644 index 000000000000..0fcd81b80382 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/AllOfWithSingleRef.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4c6f3ab2fe11 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/Animal.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Animal.md new file mode 100644 index 000000000000..415b56e9bc2e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Animal.md @@ -0,0 +1,16 @@ +# openapi.model.Animal + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/ApiResponse.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ApiResponse.md new file mode 100644 index 000000000000..7ad5da0f89e4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Apple.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Apple.md new file mode 100644 index 000000000000..c7f711b87cef --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/ArrayOfArrayOfNumberOnly.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..e5b9d669a436 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [**List<List<num>>**](List.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/ArrayOfNumberOnly.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..fe8e071eb45c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | **List<num>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/ArrayTest.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ArrayTest.md new file mode 100644 index 000000000000..8ae11de10022 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ArrayTest.md @@ -0,0 +1,17 @@ +# openapi.model.ArrayTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **List<String>** | | [optional] +**arrayArrayOfInteger** | [**List<List<int>>**](List.md) | | [optional] +**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Banana.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Banana.md new file mode 100644 index 000000000000..bef8a58a4276 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/Bar.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Bar.md new file mode 100644 index 000000000000..4cccc863a489 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/BarCreate.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/BarCreate.md new file mode 100644 index 000000000000..c0b4ba6edc9a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/BarRef.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/BarRef.md new file mode 100644 index 000000000000..949695f4d36f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/BarRef.md @@ -0,0 +1,19 @@ +# openapi.model.BarRef + +## 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/client/echo_api/dart/dart-http-json_serializable/doc/BarRefOrValue.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/BarRefOrValue.md new file mode 100644 index 000000000000..9dafa2d6b220 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/BarRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.BarRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | +**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/client/echo_api/dart/dart-http-json_serializable/doc/BodyApi.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/BodyApi.md new file mode 100644 index 000000000000..145854fc8d28 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/BodyApi.md @@ -0,0 +1,57 @@ +# openapi.api.BodyApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testEchoBodyPet**](BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) + + +# **testEchoBodyPet** +> Pet testEchoBodyPet(pet) + +Test body parameter(s) + +Test body parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getBodyApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + final response = api.testEchoBodyPet(pet); + print(response); +} catch on DioError (e) { + print('Exception when calling BodyApi->testEchoBodyPet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +[**Pet**](Pet.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/client/echo_api/dart/dart-http-json_serializable/doc/Capitalization.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Capitalization.md new file mode 100644 index 000000000000..4a07b4eb820d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Capitalization.md @@ -0,0 +1,20 @@ +# openapi.model.Capitalization + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **String** | | [optional] +**capitalCamel** | **String** | | [optional] +**smallSnake** | **String** | | [optional] +**capitalSnake** | **String** | | [optional] +**sCAETHFlowPoints** | **String** | | [optional] +**ATT_NAME** | **String** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Cat.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Cat.md new file mode 100644 index 000000000000..6552eea4b435 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Cat.md @@ -0,0 +1,17 @@ +# openapi.model.Cat + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/CatAllOf.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/CatAllOf.md new file mode 100644 index 000000000000..36b2ae0e8ab3 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/CatAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.CatAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Category.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Category.md new file mode 100644 index 000000000000..98d0b14be7b1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [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/client/echo_api/dart/dart-http-json_serializable/doc/Child.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Child.md new file mode 100644 index 000000000000..bed0f2feec12 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/ClassModel.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ClassModel.md new file mode 100644 index 000000000000..9b80d4f71eea --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ClassModel.md @@ -0,0 +1,15 @@ +# openapi.model.ClassModel + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**classField** | **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/client/echo_api/dart/dart-http-json_serializable/doc/DeprecatedObject.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/DeprecatedObject.md new file mode 100644 index 000000000000..bf2ef67a26fc --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/DeprecatedObject.md @@ -0,0 +1,15 @@ +# openapi.model.DeprecatedObject + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Dog.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Dog.md new file mode 100644 index 000000000000..d36439b767bb --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Dog.md @@ -0,0 +1,17 @@ +# openapi.model.Dog + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/DogAllOf.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/DogAllOf.md new file mode 100644 index 000000000000..97a7c8fba492 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/DogAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.DogAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Entity.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Entity.md new file mode 100644 index 000000000000..5ba2144b44fe --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/EntityRef.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/EntityRef.md new file mode 100644 index 000000000000..80eae55f4145 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/EnumArrays.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/EnumArrays.md new file mode 100644 index 000000000000..1d4fd1363b59 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/EnumArrays.md @@ -0,0 +1,16 @@ +# openapi.model.EnumArrays + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | **String** | | [optional] +**arrayEnum** | **List<String>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/EnumTest.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/EnumTest.md new file mode 100644 index 000000000000..7c24fe2347b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/EnumTest.md @@ -0,0 +1,22 @@ +# openapi.model.EnumTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | **String** | | [optional] +**enumStringRequired** | **String** | | +**enumInteger** | **int** | | [optional] +**enumNumber** | **double** | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Example.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Example.md new file mode 100644 index 000000000000..bf49bb137a60 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/ExampleNonPrimitive.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ExampleNonPrimitive.md new file mode 100644 index 000000000000..2b63a98c6ad9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ExampleNonPrimitive.md @@ -0,0 +1,14 @@ +# openapi.model.ExampleNonPrimitive + +## 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/client/echo_api/dart/dart-http-json_serializable/doc/Extensible.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Extensible.md new file mode 100644 index 000000000000..7a781e578ea4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/FileSchemaTestClass.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/FileSchemaTestClass.md new file mode 100644 index 000000000000..d14ac319d294 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/FileSchemaTestClass.md @@ -0,0 +1,16 @@ +# openapi.model.FileSchemaTestClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**ModelFile**](ModelFile.md) | | [optional] +**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Foo.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Foo.md new file mode 100644 index 000000000000..2627691fefe5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/FooRef.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/FooRef.md new file mode 100644 index 000000000000..68104b227292 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/FooRef.md @@ -0,0 +1,20 @@ +# openapi.model.FooRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foorefPropA** | **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/client/echo_api/dart/dart-http-json_serializable/doc/FooRefOrValue.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/FooRefOrValue.md new file mode 100644 index 000000000000..35e9fd114e1d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/FooRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.FooRefOrValue + +## 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/client/echo_api/dart/dart-http-json_serializable/doc/FormatTest.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/FormatTest.md new file mode 100644 index 000000000000..83b60545eb61 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/FormatTest.md @@ -0,0 +1,30 @@ +# openapi.model.FormatTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**number** | **num** | | +**float** | **double** | | [optional] +**double_** | **double** | | [optional] +**decimal** | **double** | | [optional] +**string** | **String** | | [optional] +**byte** | **String** | | +**binary** | [**MultipartFile**](MultipartFile.md) | | [optional] +**date** | [**DateTime**](DateTime.md) | | +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**uuid** | **String** | | [optional] +**password** | **String** | | +**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Fruit.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Fruit.md new file mode 100644 index 000000000000..5d48cc6e6d38 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/HasOnlyReadOnly.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/HasOnlyReadOnly.md new file mode 100644 index 000000000000..32cae937155d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/HasOnlyReadOnly.md @@ -0,0 +1,16 @@ +# openapi.model.HasOnlyReadOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**foo** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/HealthCheckResult.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/HealthCheckResult.md new file mode 100644 index 000000000000..4d6aeb75d965 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/HealthCheckResult.md @@ -0,0 +1,15 @@ +# openapi.model.HealthCheckResult + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/MapTest.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/MapTest.md new file mode 100644 index 000000000000..197fe780a25a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/MapTest.md @@ -0,0 +1,18 @@ +# openapi.model.MapTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapOfEnumString** | **Map<String, String>** | | [optional] +**directMap** | **Map<String, bool>** | | [optional] +**indirectMap** | **Map<String, bool>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..66d0d39c42be --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# openapi.model.MixedPropertiesAndAdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**map** | [**Map<String, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Model200Response.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Model200Response.md new file mode 100644 index 000000000000..e8b088ca1afa --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Model200Response.md @@ -0,0 +1,16 @@ +# openapi.model.Model200Response + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**classField** | **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/client/echo_api/dart/dart-http-json_serializable/doc/ModelClient.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelClient.md new file mode 100644 index 000000000000..f7b922f4a398 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelClient.md @@ -0,0 +1,15 @@ +# openapi.model.ModelClient + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelEnumClass.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelEnumClass.md new file mode 100644 index 000000000000..ebaafb44c7f7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelEnumClass.md @@ -0,0 +1,14 @@ +# openapi.model.ModelEnumClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelFile.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelFile.md new file mode 100644 index 000000000000..4be260e93f6e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelFile.md @@ -0,0 +1,15 @@ +# openapi.model.ModelFile + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelList.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelList.md new file mode 100644 index 000000000000..283aa1f6b711 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelList.md @@ -0,0 +1,15 @@ +# openapi.model.ModelList + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**n123list** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelReturn.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelReturn.md new file mode 100644 index 000000000000..bc02df7a3692 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ModelReturn.md @@ -0,0 +1,15 @@ +# openapi.model.ModelReturn + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**return_** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Name.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Name.md new file mode 100644 index 000000000000..25f49ea946b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Name.md @@ -0,0 +1,18 @@ +# openapi.model.Name + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snakeCase** | **int** | | [optional] +**property** | **String** | | [optional] +**n123number** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/NullableClass.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/NullableClass.md new file mode 100644 index 000000000000..70ac1091d417 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/NullableClass.md @@ -0,0 +1,26 @@ +# openapi.model.NullableClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **int** | | [optional] +**numberProp** | **num** | | [optional] +**booleanProp** | **bool** | | [optional] +**stringProp** | **String** | | [optional] +**dateProp** | [**DateTime**](DateTime.md) | | [optional] +**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] +**arrayNullableProp** | **List<Object>** | | [optional] +**arrayAndItemsNullableProp** | **List<Object>** | | [optional] +**arrayItemsNullable** | **List<Object>** | | [optional] +**objectNullableProp** | **Map<String, Object>** | | [optional] +**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] +**objectItemsNullable** | **Map<String, Object>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/NumberOnly.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/NumberOnly.md new file mode 100644 index 000000000000..d8096a3db37a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/NumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.NumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/ObjectWithDeprecatedFields.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..e0fa7b908d10 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ObjectWithDeprecatedFields.md @@ -0,0 +1,18 @@ +# openapi.model.ObjectWithDeprecatedFields + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**id** | **num** | | [optional] +**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**bars** | [**List<Bar>**](Bar.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/client/echo_api/dart/dart-http-json_serializable/doc/Order.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Order.md new file mode 100644 index 000000000000..bde5ffe51a2c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**petId** | **int** | | [optional] +**quantity** | **int** | | [optional] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] +**status** | **String** | Order Status | [optional] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterComposite.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterComposite.md new file mode 100644 index 000000000000..04bab7eff5d1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterComposite.md @@ -0,0 +1,17 @@ +# openapi.model.OuterComposite + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | **num** | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnum.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnum.md new file mode 100644 index 000000000000..af62ad87ab2e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnum.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnum + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumDefaultValue.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..c1bf8b0dec44 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumInteger.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumInteger.md new file mode 100644 index 000000000000..8c80a9e5c85f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumInteger.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumInteger + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumIntegerDefaultValue.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..eb8b55d70249 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumIntegerDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterObjectWithEnumProperty.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..eab2ae8f66b4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/OuterObjectWithEnumProperty.md @@ -0,0 +1,15 @@ +# openapi.model.OuterObjectWithEnumProperty + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Pasta.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Pasta.md new file mode 100644 index 000000000000..034ff420d323 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/PathApi.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/PathApi.md new file mode 100644 index 000000000000..ae663a2f7f04 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/PathApi.md @@ -0,0 +1,59 @@ +# openapi.api.PathApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testsPathStringPathStringIntegerPathInteger**](PathApi.md#testspathstringpathstringintegerpathinteger) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s) + + +# **testsPathStringPathStringIntegerPathInteger** +> String testsPathStringPathStringIntegerPathInteger(pathString, pathInteger) + +Test path parameter(s) + +Test path parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getPathApi(); +final String pathString = pathString_example; // String | +final int pathInteger = 56; // int | + +try { + final response = api.testsPathStringPathStringIntegerPathInteger(pathString, pathInteger); + print(response); +} catch on DioError (e) { + print('Exception when calling PathApi->testsPathStringPathStringIntegerPathInteger: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pathString** | **String**| | + **pathInteger** | **int**| | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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/client/echo_api/dart/dart-http-json_serializable/doc/Pet.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Pet.md new file mode 100644 index 000000000000..80414658dc87 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | +**category** | [**Category**](Category.md) | | [optional] +**photoUrls** | **List<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/client/echo_api/dart/dart-http-json_serializable/doc/Pizza.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Pizza.md new file mode 100644 index 000000000000..e4b040a6a79c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/PizzaSpeziale.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/PizzaSpeziale.md new file mode 100644 index 000000000000..e1d8434c077d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/PizzaSpeziale.md @@ -0,0 +1,20 @@ +# openapi.model.PizzaSpeziale + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toppings** | **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/client/echo_api/dart/dart-http-json_serializable/doc/QueryApi.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/QueryApi.md new file mode 100644 index 000000000000..f92f9532a113 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/QueryApi.md @@ -0,0 +1,149 @@ +# openapi.api.QueryApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testQueryIntegerBooleanString**](QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s) +[**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +[**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) + + +# **testQueryIntegerBooleanString** +> String testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final int integerQuery = 56; // int | +final bool booleanQuery = true; // bool | +final String stringQuery = stringQuery_example; // String | + +try { + final response = api.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryIntegerBooleanString: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integerQuery** | **int**| | [optional] + **booleanQuery** | **bool**| | [optional] + **stringQuery** | **String**| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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) + +# **testQueryStyleFormExplodeTrueArrayString** +> String testQueryStyleFormExplodeTrueArrayString(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject = ; // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter | + +try { + final response = api.testQueryStyleFormExplodeTrueArrayString(queryObject); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryStyleFormExplodeTrueArrayString: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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) + +# **testQueryStyleFormExplodeTrueObject** +> String testQueryStyleFormExplodeTrueObject(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getQueryApi(); +final Pet queryObject = ; // Pet | + +try { + final response = api.testQueryStyleFormExplodeTrueObject(queryObject); + print(response); +} catch on DioError (e) { + print('Exception when calling QueryApi->testQueryStyleFormExplodeTrueObject: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | [**Pet**](.md)| | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +[[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/client/echo_api/dart/dart-http-json_serializable/doc/ReadOnlyFirst.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ReadOnlyFirst.md new file mode 100644 index 000000000000..8f612e8ba19f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/ReadOnlyFirst.md @@ -0,0 +1,16 @@ +# openapi.model.ReadOnlyFirst + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**baz** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/SingleRefType.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/SingleRefType.md new file mode 100644 index 000000000000..0dc93840cd7f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/doc/SpecialModelName.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/SpecialModelName.md new file mode 100644 index 000000000000..5fcfa98e0b36 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/SpecialModelName.md @@ -0,0 +1,15 @@ +# openapi.model.SpecialModelName + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/Tag.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Tag.md new file mode 100644 index 000000000000..c219f987c19c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md new file mode 100644 index 000000000000..8e5541bd1f04 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/doc/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -0,0 +1,15 @@ +# openapi.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | **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/client/echo_api/dart/dart-http-json_serializable/doc/User.md b/samples/client/echo_api/dart/dart-http-json_serializable/doc/User.md new file mode 100644 index 000000000000..fa87e64d8595 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/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/client/echo_api/dart/dart-http-json_serializable/lib/openapi.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/openapi.dart new file mode 100644 index 000000000000..dfc13b14b46d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/openapi.dart @@ -0,0 +1,9 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:openapi/src/api.dart'; +export 'package:openapi/src/auth/_exports.dart'; + +export 'package:openapi/src/api/_exports.dart'; +export 'package:openapi/src/model/_exports.dart'; diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api.dart new file mode 100644 index 000000000000..084a1ba51364 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api.dart @@ -0,0 +1,39 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:http/http.dart' as http; +import 'package:openapi/src/auth/_exports.dart'; +import 'package:openapi/src/api/body_api.dart'; +import 'package:openapi/src/api/path_api.dart'; +import 'package:openapi/src/api/query_api.dart'; + +class Openapi { + static const String basePath = r'http://localhost:3000'; + + final http.Client client; + final String actualBasePath; + Openapi({ + http.Client? client, + String? basePathOverride, + }) : this.client = client ?? http.Client(), + this.actualBasePath = basePathOverride ?? basePath; + + /// Get BodyApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + BodyApi getBodyApi() { + return BodyApi(client, actualBasePath); + } + + /// Get PathApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + PathApi getPathApi() { + return PathApi(client, actualBasePath); + } + + /// Get QueryApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + QueryApi getQueryApi() { + return QueryApi(client, actualBasePath); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/_exports.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/_exports.dart new file mode 100644 index 000000000000..f06d548e0d23 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/_exports.dart @@ -0,0 +1,3 @@ +export 'body_api.dart'; +export 'path_api.dart'; +export 'query_api.dart'; diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/body_api.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/body_api.dart new file mode 100644 index 000000000000..7b3053ae3495 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/body_api.dart @@ -0,0 +1,100 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:http/http.dart' as http; + +import 'package:openapi/src/model/pet.dart'; + +class BodyApi { + final String _basePath; + final http.Client? _client; + + const BodyApi(this._client, this._basePath); + + /// Test body parameter(s) + /// Test body parameter(s) + /// + /// 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 + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// + /// Throws [DioError] if API call or serialization fails + + Future testEchoBodyPet({ + Pet? pet, + Map? headers, + }) async { + final _path = r'/echo/body/Pet'; + final _uri = Uri.parse(_basePath + _path); + + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(pet); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Pet _responseData; + + try { + _responseData = + deserialize(_response.data!, 'Pet', growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/path_api.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/path_api.dart new file mode 100644 index 000000000000..94c828e0c315 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/path_api.dart @@ -0,0 +1,85 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:http/http.dart' as http; + +class PathApi { + final String _basePath; + final http.Client? _client; + + const PathApi(this._client, this._basePath); + + /// Test path parameter(s) + /// Test path parameter(s) + /// + /// Parameters: + /// * [pathString] + /// * [pathInteger] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// + /// Throws [DioError] if API call or serialization fails + + Future testsPathStringPathStringIntegerPathInteger({ + required String pathString, + required int pathInteger, + Map? headers, + }) async { + final _path = r'/path/string/{path_string}/integer/{path_integer}' + .replaceAll('{' r'path_string' '}', pathString.toString()) + .replaceAll('{' r'path_integer' '}', pathInteger.toString()); + final _uri = Uri.parse(_basePath + _path); + + 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, + ); + + String _responseData; + + try { + _responseData = deserialize(_response.data!, 'String', + growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/query_api.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/query_api.dart new file mode 100644 index 000000000000..df891b425f3b --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/query_api.dart @@ -0,0 +1,233 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:http/http.dart' as http; + +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; + +class QueryApi { + final String _basePath; + final http.Client? _client; + + const QueryApi(this._client, this._basePath); + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [integerQuery] + /// * [booleanQuery] + /// * [stringQuery] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// + /// Throws [DioError] if API call or serialization fails + + Future testQueryIntegerBooleanString({ + int? integerQuery, + bool? booleanQuery, + String? stringQuery, + Map? headers, + }) async { + final _path = r'/query/integer/boolean/string'; + final _uri = Uri.parse(_basePath + _path); + + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (integerQuery != null) r'integer_query': integerQuery, + if (booleanQuery != null) r'boolean_query': booleanQuery, + if (stringQuery != null) r'string_query': stringQuery, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String _responseData; + + try { + _responseData = deserialize(_response.data!, 'String', + growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [queryObject] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// + /// Throws [DioError] if API call or serialization fails + + Future testQueryStyleFormExplodeTrueArrayString({ + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? queryObject, + Map? headers, + }) async { + final _path = r'/query/style_form/explode_true/array_string'; + final _uri = Uri.parse(_basePath + _path); + + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (queryObject != null) r'query_object': queryObject, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String _responseData; + + try { + _responseData = deserialize(_response.data!, 'String', + growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Test query parameter(s) + /// Test query parameter(s) + /// + /// Parameters: + /// * [queryObject] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// + /// Throws [DioError] if API call or serialization fails + + Future testQueryStyleFormExplodeTrueObject({ + Pet? queryObject, + Map? headers, + }) async { + final _path = r'/query/style_form/explode_true/object'; + final _uri = Uri.parse(_basePath + _path); + + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (queryObject != null) r'query_object': queryObject, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String _responseData; + + try { + _responseData = deserialize(_response.data!, 'String', + growable: true); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.other, + error: error, + )..stackTrace = stackTrace; + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api_util.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api_util.dart new file mode 100644 index 000000000000..38448f5b5e53 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api_util.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:http/http.dart'; + +const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; +const _dateEpochMarker = 'epoch'; +final _dateFormatter = DateFormat('yyyy-MM-dd'); +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +class QueryParam { + const QueryParam(this.name, this.value); + + final String name; + final String value; + + @override + String toString() => + '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}'; +} + +// Ported from the Java version. +Iterable _queryParams( + String collectionFormat, + String name, + dynamic value, +) { + // Assertions to run in debug mode only. + assert(name.isNotEmpty, 'Parameter cannot be an empty string.'); + + final params = []; + + if (value is List) { + if (collectionFormat == 'multi') { + return value.map( + (dynamic v) => QueryParam(name, parameterToString(v)), + ); + } + + // Default collection format is 'csv'. + if (collectionFormat.isEmpty) { + collectionFormat = 'csv'; // ignore: parameter_assignments + } + + final delimiter = _delimiters[collectionFormat] ?? ','; + + params.add(QueryParam( + name, + value.map(parameterToString).join(delimiter), + )); + } else if (value != null) { + params.add(QueryParam(name, parameterToString(value))); + } + + return params; +} + +/// Format the given parameter object into a [String]. +String parameterToString(dynamic value) { + if (value == null) { + return ''; + } + if (value is DateTime) { + return value.toUtc().toIso8601String(); + } + if (value is ModelEnumClass) {} + if (value is OuterEnum) {} + if (value is OuterEnumDefaultValue) {} + if (value is OuterEnumInteger) {} + if (value is OuterEnumIntegerDefaultValue) {} + if (value is SingleRefType) {} + return value.toString(); +} + +/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' +/// content type. Otherwise, returns the decoded body as decoded by dart:http package. +Future decodeBodyBytes(Response response) async { + final contentType = response.headers['content-type']; + return contentType != null && + contentType.toLowerCase().startsWith('application/json') + ? response.bodyBytes.isEmpty + ? '' + : utf8.decode(response.bodyBytes) + : response.body; +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/_exports.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/_exports.dart new file mode 100644 index 000000000000..01c9ad2dfa7e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/_exports.dart @@ -0,0 +1,9 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'api_key_auth.dart'; +export 'auth.dart'; +export 'basic_auth.dart'; +export 'bearer_auth.dart'; +export 'oauth.dart'; diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/api_key_auth.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..efff2af616a5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/api_key_auth.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'auth.dart'; + +class ApiKeyAuth implements Authentication { + ApiKeyAuth(this.location, this.paramName); + + final String location; + final String paramName; + + String apiKeyPrefix = ''; + String apiKey = ''; + + @override + Future applyToParams( + List queryParams, + Map headerParams, + ) async { + final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey'; + + if (paramValue.isNotEmpty) { + if (location == 'query') { + queryParams.add(QueryParam(paramName, paramValue)); + } else if (location == 'header') { + headerParams[paramName] = paramValue; + } else if (location == 'cookie') { + headerParams.update( + 'Cookie', + (existingCookie) => '$existingCookie; $paramName=$paramValue', + ifAbsent: () => '$paramName=$paramValue', + ); + } + } + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/auth.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/auth.dart new file mode 100644 index 000000000000..320391a37f1c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/auth.dart @@ -0,0 +1,10 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore: one_member_abstracts +abstract class Authentication { + /// Apply authentication settings to header and query params. + Future applyToParams( + List queryParams, Map headerParams); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/basic_auth.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..9977aca31f69 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/basic_auth.dart @@ -0,0 +1,24 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'auth.dart'; + +class HttpBasicAuth implements Authentication { + HttpBasicAuth({this.username = '', this.password = ''}); + + String username; + String password; + + @override + Future applyToParams( + List queryParams, + Map headerParams, + ) async { + if (username.isNotEmpty && password.isNotEmpty) { + final credentials = '$username:$password'; + headerParams['Authorization'] = + 'Basic ${base64.encode(utf8.encode(credentials))}'; + } + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/bearer_auth.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..26df17824f20 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/bearer_auth.dart @@ -0,0 +1,47 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'auth.dart'; + +typedef HttpBearerAuthProvider = String Function(); + +class HttpBearerAuth implements Authentication { + HttpBearerAuth(); + + dynamic _accessToken; + + dynamic get accessToken => _accessToken; + + set accessToken(dynamic accessToken) { + if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { + throw ArgumentError( + 'accessToken value must be either a String or a String Function().'); + } + _accessToken = accessToken; + } + + @override + Future applyToParams( + List queryParams, + Map headerParams, + ) async { + if (_accessToken == null) { + return; + } + + String accessToken; + + if (_accessToken is String) { + accessToken = _accessToken; + } else if (_accessToken is HttpBearerAuthProvider) { + accessToken = _accessToken!(); + } else { + return; + } + + if (accessToken.isNotEmpty) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/oauth.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..2bfe87455779 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/oauth.dart @@ -0,0 +1,21 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'auth.dart'; + +class OAuth implements Authentication { + OAuth({this.accessToken = ''}); + + String accessToken; + + @override + Future applyToParams( + List queryParams, + Map headerParams, + ) async { + if (accessToken.isNotEmpty) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/deserialize.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/deserialize.dart new file mode 100644 index 000000000000..929f58eb4909 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/deserialize.dart @@ -0,0 +1,269 @@ +import 'package:openapi/src/model/additional_properties_class.dart'; +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/all_of_with_single_ref.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/array_of_array_of_number_only.dart'; +import 'package:openapi/src/model/array_of_number_only.dart'; +import 'package:openapi/src/model/array_test.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:openapi/src/model/bar_create.dart'; +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar_ref_or_value.dart'; +import 'package:openapi/src/model/capitalization.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:openapi/src/model/cat_all_of.dart'; +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/child.dart'; +import 'package:openapi/src/model/class_model.dart'; +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/dog.dart'; +import 'package:openapi/src/model/dog_all_of.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:openapi/src/model/enum_arrays.dart'; +import 'package:openapi/src/model/enum_test.dart'; +import 'package:openapi/src/model/example.dart'; +import 'package:openapi/src/model/example_non_primitive.dart'; +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/format_test.dart'; +import 'package:openapi/src/model/fruit.dart'; +import 'package:openapi/src/model/has_only_read_only.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/map_test.dart'; +import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +import 'package:openapi/src/model/model200_response.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_file.dart'; +import 'package:openapi/src/model/model_list.dart'; +import 'package:openapi/src/model/model_return.dart'; +import 'package:openapi/src/model/name.dart'; +import 'package:openapi/src/model/nullable_class.dart'; +import 'package:openapi/src/model/number_only.dart'; +import 'package:openapi/src/model/object_with_deprecated_fields.dart'; +import 'package:openapi/src/model/order.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pasta.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/pizza.dart'; +import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:openapi/src/model/special_model_name.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; +import 'package:openapi/src/model/user.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ReturnType deserialize(dynamic value, String targetType, + {bool growable = true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'AdditionalPropertiesClass': + return AdditionalPropertiesClass.fromJson(value as Map) + as ReturnType; + case 'Addressable': + return Addressable.fromJson(value as Map) as ReturnType; + case 'AllOfWithSingleRef': + return AllOfWithSingleRef.fromJson(value as Map) + as ReturnType; + case 'Animal': + return Animal.fromJson(value as Map) as ReturnType; + case 'ApiResponse': + return ApiResponse.fromJson(value as Map) as ReturnType; + case 'Apple': + return Apple.fromJson(value as Map) as ReturnType; + case 'ArrayOfArrayOfNumberOnly': + return ArrayOfArrayOfNumberOnly.fromJson(value as Map) + as ReturnType; + case 'ArrayOfNumberOnly': + return ArrayOfNumberOnly.fromJson(value as Map) + as ReturnType; + case 'ArrayTest': + return ArrayTest.fromJson(value as Map) as ReturnType; + case 'Banana': + return Banana.fromJson(value as Map) as ReturnType; + case 'Bar': + return Bar.fromJson(value as Map) as ReturnType; + case 'BarCreate': + return BarCreate.fromJson(value as Map) as ReturnType; + case 'BarRef': + return BarRef.fromJson(value as Map) as ReturnType; + case 'BarRefOrValue': + return BarRefOrValue.fromJson(value as Map) + as ReturnType; + case 'Capitalization': + return Capitalization.fromJson(value as Map) + as ReturnType; + case 'Cat': + return Cat.fromJson(value as Map) as ReturnType; + case 'CatAllOf': + return CatAllOf.fromJson(value as Map) as ReturnType; + case 'Category': + return Category.fromJson(value as Map) as ReturnType; + case 'Child': + return Child.fromJson(value as Map) as ReturnType; + case 'ClassModel': + return ClassModel.fromJson(value as Map) as ReturnType; + case 'DeprecatedObject': + return DeprecatedObject.fromJson(value as Map) + as ReturnType; + case 'Dog': + return Dog.fromJson(value as Map) as ReturnType; + case 'DogAllOf': + return DogAllOf.fromJson(value as Map) as ReturnType; + case 'Entity': + return Entity.fromJson(value as Map) as ReturnType; + case 'EntityRef': + return EntityRef.fromJson(value as Map) as ReturnType; + case 'EnumArrays': + return EnumArrays.fromJson(value as Map) as ReturnType; + case 'EnumTest': + return EnumTest.fromJson(value as Map) as ReturnType; + case 'Example': + return Example.fromJson(value as Map) as ReturnType; + case 'ExampleNonPrimitive': + return ExampleNonPrimitive.fromJson(value as Map) + as ReturnType; + case 'Extensible': + return Extensible.fromJson(value as Map) as ReturnType; + case 'FileSchemaTestClass': + return FileSchemaTestClass.fromJson(value as Map) + as ReturnType; + case 'Foo': + return Foo.fromJson(value as Map) as ReturnType; + case 'FooRef': + return FooRef.fromJson(value as Map) as ReturnType; + case 'FooRefOrValue': + return FooRefOrValue.fromJson(value as Map) + as ReturnType; + case 'FormatTest': + return FormatTest.fromJson(value as Map) as ReturnType; + case 'Fruit': + return Fruit.fromJson(value as Map) as ReturnType; + case 'HasOnlyReadOnly': + return HasOnlyReadOnly.fromJson(value as Map) + as ReturnType; + case 'HealthCheckResult': + return HealthCheckResult.fromJson(value as Map) + as ReturnType; + case 'MapTest': + return MapTest.fromJson(value as Map) as ReturnType; + case 'MixedPropertiesAndAdditionalPropertiesClass': + return MixedPropertiesAndAdditionalPropertiesClass.fromJson( + value as Map) as ReturnType; + case 'Model200Response': + return Model200Response.fromJson(value as Map) + as ReturnType; + case 'ModelClient': + return ModelClient.fromJson(value as Map) as ReturnType; + case 'ModelEnumClass': + + case 'ModelFile': + return ModelFile.fromJson(value as Map) as ReturnType; + case 'ModelList': + return ModelList.fromJson(value as Map) as ReturnType; + case 'ModelReturn': + return ModelReturn.fromJson(value as Map) as ReturnType; + case 'Name': + return Name.fromJson(value as Map) as ReturnType; + case 'NullableClass': + return NullableClass.fromJson(value as Map) + as ReturnType; + case 'NumberOnly': + return NumberOnly.fromJson(value as Map) as ReturnType; + case 'ObjectWithDeprecatedFields': + return ObjectWithDeprecatedFields.fromJson(value as Map) + as ReturnType; + case 'Order': + return Order.fromJson(value as Map) as ReturnType; + case 'OuterComposite': + return OuterComposite.fromJson(value as Map) + as ReturnType; + case 'OuterEnum': + + case 'OuterEnumDefaultValue': + + case 'OuterEnumInteger': + + case 'OuterEnumIntegerDefaultValue': + + case 'OuterObjectWithEnumProperty': + return OuterObjectWithEnumProperty.fromJson(value as Map) + as ReturnType; + case 'Pasta': + return Pasta.fromJson(value as Map) as ReturnType; + case 'Pet': + return Pet.fromJson(value as Map) as ReturnType; + case 'Pizza': + return Pizza.fromJson(value as Map) as ReturnType; + case 'PizzaSpeziale': + return PizzaSpeziale.fromJson(value as Map) + as ReturnType; + case 'ReadOnlyFirst': + return ReadOnlyFirst.fromJson(value as Map) + as ReturnType; + case 'SingleRefType': + + case 'SpecialModelName': + return SpecialModelName.fromJson(value as Map) + as ReturnType; + case 'Tag': + return Tag.fromJson(value as Map) as ReturnType; + case 'TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter': + return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + .fromJson(value as Map) as ReturnType; + case 'User': + return User.fromJson(value as Map) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize( + v, targetType, + growable: growable)), + ) as ReturnType; + } + break; + } + throw Exception('Cannot deserialize'); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/_exports.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/_exports.dart new file mode 100644 index 000000000000..43ed998d2fd8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/_exports.dart @@ -0,0 +1,67 @@ +export 'additional_properties_class.dart'; +export 'addressable.dart'; +export 'all_of_with_single_ref.dart'; +export 'animal.dart'; +export 'api_response.dart'; +export 'apple.dart'; +export 'array_of_array_of_number_only.dart'; +export 'array_of_number_only.dart'; +export 'array_test.dart'; +export 'banana.dart'; +export 'bar.dart'; +export 'bar_create.dart'; +export 'bar_ref.dart'; +export 'bar_ref_or_value.dart'; +export 'capitalization.dart'; +export 'cat.dart'; +export 'cat_all_of.dart'; +export 'category.dart'; +export 'child.dart'; +export 'class_model.dart'; +export 'deprecated_object.dart'; +export 'dog.dart'; +export 'dog_all_of.dart'; +export 'entity.dart'; +export 'entity_ref.dart'; +export 'enum_arrays.dart'; +export 'enum_test.dart'; +export 'example.dart'; +export 'example_non_primitive.dart'; +export 'extensible.dart'; +export 'file_schema_test_class.dart'; +export 'foo.dart'; +export 'foo_ref.dart'; +export 'foo_ref_or_value.dart'; +export 'format_test.dart'; +export 'fruit.dart'; +export 'has_only_read_only.dart'; +export 'health_check_result.dart'; +export 'map_test.dart'; +export 'mixed_properties_and_additional_properties_class.dart'; +export 'model200_response.dart'; +export 'model_client.dart'; +export 'model_enum_class.dart'; +export 'model_file.dart'; +export 'model_list.dart'; +export 'model_return.dart'; +export 'name.dart'; +export 'nullable_class.dart'; +export 'number_only.dart'; +export 'object_with_deprecated_fields.dart'; +export 'order.dart'; +export 'outer_composite.dart'; +export 'outer_enum.dart'; +export 'outer_enum_default_value.dart'; +export 'outer_enum_integer.dart'; +export 'outer_enum_integer_default_value.dart'; +export 'outer_object_with_enum_property.dart'; +export 'pasta.dart'; +export 'pet.dart'; +export 'pizza.dart'; +export 'pizza_speziale.dart'; +export 'read_only_first.dart'; +export 'single_ref_type.dart'; +export 'special_model_name.dart'; +export 'tag.dart'; +export 'test_query_style_form_explode_true_array_string_query_object_parameter.dart'; +export 'user.dart'; diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/additional_properties_class.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/additional_properties_class.dart new file mode 100644 index 000000000000..52aae4f3674b --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/additional_properties_class.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'additional_properties_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AdditionalPropertiesClass { + /// Returns a new [AdditionalPropertiesClass] instance. + AdditionalPropertiesClass({ + this.mapProperty, + this.mapOfMapProperty, + }); + + @JsonKey(name: r'map_property', required: false, includeIfNull: false) + final Map? mapProperty; + + @JsonKey(name: r'map_of_map_property', required: false, includeIfNull: false) + final Map>? mapOfMapProperty; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AdditionalPropertiesClass && + other.mapProperty == mapProperty && + other.mapOfMapProperty == mapOfMapProperty; + + @override + int get hashCode => mapProperty.hashCode + mapOfMapProperty.hashCode; + + factory AdditionalPropertiesClass.fromJson(Map json) => + _$AdditionalPropertiesClassFromJson(json); + + Map toJson() => _$AdditionalPropertiesClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/addressable.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/addressable.dart new file mode 100644 index 000000000000..1558e6f5e9dc --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/addressable.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'addressable.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Addressable { + /// Returns a new [Addressable] instance. + Addressable({ + this.href, + this.id, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Addressable && other.href == href && other.id == id; + + @override + int get hashCode => href.hashCode + id.hashCode; + + factory Addressable.fromJson(Map json) => + _$AddressableFromJson(json); + + Map toJson() => _$AddressableToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/all_of_with_single_ref.dart new file mode 100644 index 000000000000..9fec7e666068 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/all_of_with_single_ref.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/single_ref_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'all_of_with_single_ref.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AllOfWithSingleRef { + /// Returns a new [AllOfWithSingleRef] instance. + AllOfWithSingleRef({ + this.username, + this.singleRefType, + }); + + @JsonKey(name: r'username', required: false, includeIfNull: false) + final String? username; + + @JsonKey(name: r'SingleRefType', required: false, includeIfNull: false) + final SingleRefType? singleRefType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AllOfWithSingleRef && + other.username == username && + other.singleRefType == singleRefType; + + @override + int get hashCode => username.hashCode + singleRefType.hashCode; + + factory AllOfWithSingleRef.fromJson(Map json) => + _$AllOfWithSingleRefFromJson(json); + + Map toJson() => _$AllOfWithSingleRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/animal.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/animal.dart new file mode 100644 index 000000000000..464ac70be575 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/animal.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'animal.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Animal { + /// Returns a new [Animal] instance. + Animal({ + required this.className, + this.color = 'red', + }); + + @JsonKey(name: r'className', required: true, includeIfNull: false) + final String className; + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false) + final String? color; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Animal && other.className == className && other.color == color; + + @override + int get hashCode => className.hashCode + color.hashCode; + + factory Animal.fromJson(Map json) => _$AnimalFromJson(json); + + Map toJson() => _$AnimalToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/api_response.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/api_response.dart new file mode 100644 index 000000000000..df7b51101d80 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/api_response.dart @@ -0,0 +1,53 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'api_response.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ApiResponse { + /// Returns a new [ApiResponse] instance. + ApiResponse({ + this.code, + this.type, + this.message, + }); + + @JsonKey(name: r'code', required: false, includeIfNull: false) + final int? code; + + @JsonKey(name: r'type', required: false, includeIfNull: false) + final String? type; + + @JsonKey(name: r'message', required: false, includeIfNull: false) + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ApiResponse && + other.code == code && + other.type == type && + other.message == message; + + @override + int get hashCode => code.hashCode + type.hashCode + message.hashCode; + + factory ApiResponse.fromJson(Map json) => + _$ApiResponseFromJson(json); + + Map toJson() => _$ApiResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/apple.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/apple.dart new file mode 100644 index 000000000000..81be695b9bba --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/apple.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Apple { + /// Returns a new [Apple] instance. + Apple({ + this.kind, + }); + + @JsonKey(name: r'kind', required: false, includeIfNull: false) + final String? kind; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Apple && other.kind == kind; + + @override + int get hashCode => kind.hashCode; + + factory Apple.fromJson(Map json) => _$AppleFromJson(json); + + Map toJson() => _$AppleToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_of_array_of_number_only.dart new file mode 100644 index 000000000000..879bd5274b61 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_of_array_of_number_only.dart @@ -0,0 +1,43 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'array_of_array_of_number_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayOfArrayOfNumberOnly { + /// Returns a new [ArrayOfArrayOfNumberOnly] instance. + ArrayOfArrayOfNumberOnly({ + this.arrayArrayNumber, + }); + + @JsonKey(name: r'ArrayArrayNumber', required: false, includeIfNull: false) + final List>? arrayArrayNumber; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ArrayOfArrayOfNumberOnly && + other.arrayArrayNumber == arrayArrayNumber; + + @override + int get hashCode => arrayArrayNumber.hashCode; + + factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => + _$ArrayOfArrayOfNumberOnlyFromJson(json); + + Map toJson() => _$ArrayOfArrayOfNumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_of_number_only.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_of_number_only.dart new file mode 100644 index 000000000000..a1dea32fe74d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_of_number_only.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'array_of_number_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayOfNumberOnly { + /// Returns a new [ArrayOfNumberOnly] instance. + ArrayOfNumberOnly({ + this.arrayNumber, + }); + + @JsonKey(name: r'ArrayNumber', required: false, includeIfNull: false) + final List? arrayNumber; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ArrayOfNumberOnly && other.arrayNumber == arrayNumber; + + @override + int get hashCode => arrayNumber.hashCode; + + factory ArrayOfNumberOnly.fromJson(Map json) => + _$ArrayOfNumberOnlyFromJson(json); + + Map toJson() => _$ArrayOfNumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_test.dart new file mode 100644 index 000000000000..bc0f83a42051 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/array_test.dart @@ -0,0 +1,58 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'array_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayTest { + /// Returns a new [ArrayTest] instance. + ArrayTest({ + this.arrayOfString, + this.arrayArrayOfInteger, + this.arrayArrayOfModel, + }); + + @JsonKey(name: r'array_of_string', required: false, includeIfNull: false) + final List? arrayOfString; + + @JsonKey( + name: r'array_array_of_integer', required: false, includeIfNull: false) + final List>? arrayArrayOfInteger; + + @JsonKey(name: r'array_array_of_model', required: false, includeIfNull: false) + final List>? arrayArrayOfModel; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ArrayTest && + other.arrayOfString == arrayOfString && + other.arrayArrayOfInteger == arrayArrayOfInteger && + other.arrayArrayOfModel == arrayArrayOfModel; + + @override + int get hashCode => + arrayOfString.hashCode + + arrayArrayOfInteger.hashCode + + arrayArrayOfModel.hashCode; + + factory ArrayTest.fromJson(Map json) => + _$ArrayTestFromJson(json); + + Map toJson() => _$ArrayTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/banana.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/banana.dart new file mode 100644 index 000000000000..41fbfb80acc1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/banana.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'banana.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Banana { + /// Returns a new [Banana] instance. + Banana({ + this.count, + }); + + @JsonKey(name: r'count', required: false, includeIfNull: false) + final num? count; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Banana && other.count == count; + + @override + int get hashCode => count.hashCode; + + factory Banana.fromJson(Map json) => _$BananaFromJson(json); + + Map toJson() => _$BananaToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar.dart new file mode 100644 index 000000000000..39a28a166b7f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar.dart @@ -0,0 +1,93 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Bar { + /// Returns a new [Bar] instance. + Bar({ + required this.id, + this.barPropA, + this.fooPropB, + this.foo, + this.href, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'id', required: true, includeIfNull: false) + final String id; + + @JsonKey(name: r'barPropA', required: false, includeIfNull: false) + final String? barPropA; + + @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) + final String? fooPropB; + + @JsonKey(name: r'foo', required: false, includeIfNull: false) + final FooRefOrValue? foo; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Bar && + other.id == id && + other.barPropA == barPropA && + other.fooPropB == fooPropB && + other.foo == foo && + other.href == href && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + id.hashCode + + barPropA.hashCode + + fooPropB.hashCode + + foo.hashCode + + href.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Bar.fromJson(Map json) => _$BarFromJson(json); + + Map toJson() => _$BarToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_create.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_create.dart new file mode 100644 index 000000000000..69f8c91e9158 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_create.dart @@ -0,0 +1,95 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_create.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarCreate { + /// Returns a new [BarCreate] instance. + BarCreate({ + this.barPropA, + this.fooPropB, + this.foo, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'barPropA', required: false, includeIfNull: false) + final String? barPropA; + + @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) + final String? fooPropB; + + @JsonKey(name: r'foo', required: false, includeIfNull: false) + final FooRefOrValue? foo; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BarCreate && + other.barPropA == barPropA && + other.fooPropB == fooPropB && + other.foo == foo && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + barPropA.hashCode + + fooPropB.hashCode + + foo.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarCreate.fromJson(Map json) => + _$BarCreateFromJson(json); + + Map toJson() => _$BarCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_ref.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_ref.dart new file mode 100644 index 000000000000..441f1475ed91 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_ref.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_ref.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarRef { + /// Returns a new [BarRef] instance. + BarRef({ + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BarRef && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarRef.fromJson(Map json) => _$BarRefFromJson(json); + + Map toJson() => _$BarRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_ref_or_value.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_ref_or_value.dart new file mode 100644 index 000000000000..2a31af86fb87 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/bar_ref_or_value.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_ref_or_value.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarRefOrValue { + /// Returns a new [BarRefOrValue] instance. + BarRefOrValue({ + this.href, + required this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: true, includeIfNull: false) + final String id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BarRefOrValue && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarRefOrValue.fromJson(Map json) => + _$BarRefOrValueFromJson(json); + + Map toJson() => _$BarRefOrValueToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/capitalization.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/capitalization.dart new file mode 100644 index 000000000000..dc4ed957e2a0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/capitalization.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'capitalization.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Capitalization { + /// Returns a new [Capitalization] instance. + Capitalization({ + this.smallCamel, + this.capitalCamel, + this.smallSnake, + this.capitalSnake, + this.sCAETHFlowPoints, + this.ATT_NAME, + }); + + @JsonKey(name: r'smallCamel', required: false, includeIfNull: false) + final String? smallCamel; + + @JsonKey(name: r'CapitalCamel', required: false, includeIfNull: false) + final String? capitalCamel; + + @JsonKey(name: r'small_Snake', required: false, includeIfNull: false) + final String? smallSnake; + + @JsonKey(name: r'Capital_Snake', required: false, includeIfNull: false) + final String? capitalSnake; + + @JsonKey(name: r'SCA_ETH_Flow_Points', required: false, includeIfNull: false) + final String? sCAETHFlowPoints; + + /// Name of the pet + @JsonKey(name: r'ATT_NAME', required: false, includeIfNull: false) + final String? ATT_NAME; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Capitalization && + other.smallCamel == smallCamel && + other.capitalCamel == capitalCamel && + other.smallSnake == smallSnake && + other.capitalSnake == capitalSnake && + other.sCAETHFlowPoints == sCAETHFlowPoints && + other.ATT_NAME == ATT_NAME; + + @override + int get hashCode => + smallCamel.hashCode + + capitalCamel.hashCode + + smallSnake.hashCode + + capitalSnake.hashCode + + sCAETHFlowPoints.hashCode + + ATT_NAME.hashCode; + + factory Capitalization.fromJson(Map json) => + _$CapitalizationFromJson(json); + + Map toJson() => _$CapitalizationToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/cat.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/cat.dart new file mode 100644 index 000000000000..8e0612fb641a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/cat.dart @@ -0,0 +1,59 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'cat.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Cat { + /// Returns a new [Cat] instance. + Cat({ + required this.className, + this.color = 'red', + this.declawed, + }); + + @JsonKey(name: r'className', required: true, includeIfNull: false) + final String className; + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false) + final String? color; + + @JsonKey(name: r'declawed', required: false, includeIfNull: false) + final bool? declawed; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Cat && + other.className == className && + other.color == color && + other.declawed == declawed; + + @override + int get hashCode => className.hashCode + color.hashCode + declawed.hashCode; + + factory Cat.fromJson(Map json) => _$CatFromJson(json); + + Map toJson() => _$CatToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/cat_all_of.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/cat_all_of.dart new file mode 100644 index 000000000000..af380b83994a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/cat_all_of.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'cat_all_of.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class CatAllOf { + /// Returns a new [CatAllOf] instance. + CatAllOf({ + this.declawed, + }); + + @JsonKey(name: r'declawed', required: false, includeIfNull: false) + final bool? declawed; + + @override + bool operator ==(Object other) => + identical(this, other) || other is CatAllOf && other.declawed == declawed; + + @override + int get hashCode => declawed.hashCode; + + factory CatAllOf.fromJson(Map json) => + _$CatAllOfFromJson(json); + + Map toJson() => _$CatAllOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/category.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/category.dart new file mode 100644 index 000000000000..287b7ee8011d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/category.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'category.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Category { + /// Returns a new [Category] instance. + Category({ + this.id, + this.name, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Category && other.id == id && other.name == name; + + @override + int get hashCode => id.hashCode + name.hashCode; + + factory Category.fromJson(Map json) => + _$CategoryFromJson(json); + + Map toJson() => _$CategoryToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/child.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/child.dart new file mode 100644 index 000000000000..c01536e49b2c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/child.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'child.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Child { + /// Returns a new [Child] instance. + Child({ + this.name, + }); + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Child && other.name == name; + + @override + int get hashCode => name.hashCode; + + factory Child.fromJson(Map json) => _$ChildFromJson(json); + + Map toJson() => _$ChildToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/class_model.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/class_model.dart new file mode 100644 index 000000000000..c12e08bda2d7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/class_model.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'class_model.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ClassModel { + /// Returns a new [ClassModel] instance. + ClassModel({ + this.classField, + }); + + @JsonKey(name: r'_class', required: false, includeIfNull: false) + final String? classField; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ClassModel && other.classField == classField; + + @override + int get hashCode => classField.hashCode; + + factory ClassModel.fromJson(Map json) => + _$ClassModelFromJson(json); + + Map toJson() => _$ClassModelToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/deprecated_object.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/deprecated_object.dart new file mode 100644 index 000000000000..5c32ad349f23 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/deprecated_object.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'deprecated_object.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DeprecatedObject { + /// Returns a new [DeprecatedObject] instance. + DeprecatedObject({ + this.name, + }); + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || other is DeprecatedObject && other.name == name; + + @override + int get hashCode => name.hashCode; + + factory DeprecatedObject.fromJson(Map json) => + _$DeprecatedObjectFromJson(json); + + Map toJson() => _$DeprecatedObjectToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/dog.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/dog.dart new file mode 100644 index 000000000000..394340b11eb9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/dog.dart @@ -0,0 +1,59 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'dog.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Dog { + /// Returns a new [Dog] instance. + Dog({ + required this.className, + this.color = 'red', + this.breed, + }); + + @JsonKey(name: r'className', required: true, includeIfNull: false) + final String className; + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false) + final String? color; + + @JsonKey(name: r'breed', required: false, includeIfNull: false) + final String? breed; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Dog && + other.className == className && + other.color == color && + other.breed == breed; + + @override + int get hashCode => className.hashCode + color.hashCode + breed.hashCode; + + factory Dog.fromJson(Map json) => _$DogFromJson(json); + + Map toJson() => _$DogToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/dog_all_of.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/dog_all_of.dart new file mode 100644 index 000000000000..39065be80707 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/dog_all_of.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'dog_all_of.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DogAllOf { + /// Returns a new [DogAllOf] instance. + DogAllOf({ + this.breed, + }); + + @JsonKey(name: r'breed', required: false, includeIfNull: false) + final String? breed; + + @override + bool operator ==(Object other) => + identical(this, other) || other is DogAllOf && other.breed == breed; + + @override + int get hashCode => breed.hashCode; + + factory DogAllOf.fromJson(Map json) => + _$DogAllOfFromJson(json); + + Map toJson() => _$DogAllOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/entity.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/entity.dart new file mode 100644 index 000000000000..9bba5eff8b34 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/entity.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'entity.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Entity { + /// Returns a new [Entity] instance. + Entity({ + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Entity && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Entity.fromJson(Map json) => _$EntityFromJson(json); + + Map toJson() => _$EntityToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/entity_ref.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/entity_ref.dart new file mode 100644 index 000000000000..32901f43eaa9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/entity_ref.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'entity_ref.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EntityRef { + /// Returns a new [EntityRef] instance. + EntityRef({ + this.name, + this.atReferredType, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Name of the related entity. + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + /// The actual type of the target instance when needed for disambiguation. + @JsonKey(name: r'@referredType', required: false, includeIfNull: false) + final String? atReferredType; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is EntityRef && + other.name == name && + other.atReferredType == atReferredType && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + name.hashCode + + atReferredType.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory EntityRef.fromJson(Map json) => + _$EntityRefFromJson(json); + + Map toJson() => _$EntityRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/enum_arrays.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/enum_arrays.dart new file mode 100644 index 000000000000..4a9ce1458928 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/enum_arrays.dart @@ -0,0 +1,66 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'enum_arrays.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EnumArrays { + /// Returns a new [EnumArrays] instance. + EnumArrays({ + this.justSymbol, + this.arrayEnum, + }); + + @JsonKey(name: r'just_symbol', required: false, includeIfNull: false) + final EnumArraysJustSymbolEnum? justSymbol; + + @JsonKey(name: r'array_enum', required: false, includeIfNull: false) + final List? arrayEnum; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is EnumArrays && + other.justSymbol == justSymbol && + other.arrayEnum == arrayEnum; + + @override + int get hashCode => justSymbol.hashCode + arrayEnum.hashCode; + + factory EnumArrays.fromJson(Map json) => + _$EnumArraysFromJson(json); + + Map toJson() => _$EnumArraysToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +enum EnumArraysJustSymbolEnum { + @JsonValue(r'>=') + greaterThanEqual, + @JsonValue(r'$') + dollar, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + +enum EnumArraysArrayEnumEnum { + @JsonValue(r'fish') + fish, + @JsonValue(r'crab') + crab, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/enum_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/enum_test.dart new file mode 100644 index 000000000000..926b40e5977f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/enum_test.dart @@ -0,0 +1,134 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'enum_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EnumTest { + /// Returns a new [EnumTest] instance. + EnumTest({ + this.enumString, + required this.enumStringRequired, + this.enumInteger, + this.enumNumber, + this.outerEnum, + this.outerEnumInteger, + this.outerEnumDefaultValue, + this.outerEnumIntegerDefaultValue, + }); + + @JsonKey(name: r'enum_string', required: false, includeIfNull: false) + final EnumTestEnumStringEnum? enumString; + + @JsonKey(name: r'enum_string_required', required: true, includeIfNull: false) + final EnumTestEnumStringRequiredEnum enumStringRequired; + + @JsonKey(name: r'enum_integer', required: false, includeIfNull: false) + final EnumTestEnumIntegerEnum? enumInteger; + + @JsonKey(name: r'enum_number', required: false, includeIfNull: false) + final EnumTestEnumNumberEnum? enumNumber; + + @JsonKey(name: r'outerEnum', required: false, includeIfNull: false) + final OuterEnum? outerEnum; + + @JsonKey(name: r'outerEnumInteger', required: false, includeIfNull: false) + final OuterEnumInteger? outerEnumInteger; + + @JsonKey( + name: r'outerEnumDefaultValue', required: false, includeIfNull: false) + final OuterEnumDefaultValue? outerEnumDefaultValue; + + @JsonKey( + name: r'outerEnumIntegerDefaultValue', + required: false, + includeIfNull: false) + final OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is EnumTest && + other.enumString == enumString && + other.enumStringRequired == enumStringRequired && + other.enumInteger == enumInteger && + other.enumNumber == enumNumber && + other.outerEnum == outerEnum && + other.outerEnumInteger == outerEnumInteger && + other.outerEnumDefaultValue == outerEnumDefaultValue && + other.outerEnumIntegerDefaultValue == outerEnumIntegerDefaultValue; + + @override + int get hashCode => + enumString.hashCode + + enumStringRequired.hashCode + + enumInteger.hashCode + + enumNumber.hashCode + + (outerEnum == null ? 0 : outerEnum.hashCode) + + outerEnumInteger.hashCode + + outerEnumDefaultValue.hashCode + + outerEnumIntegerDefaultValue.hashCode; + + factory EnumTest.fromJson(Map json) => + _$EnumTestFromJson(json); + + Map toJson() => _$EnumTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +enum EnumTestEnumStringEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'') + empty, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + +enum EnumTestEnumStringRequiredEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'') + empty, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + +enum EnumTestEnumIntegerEnum { + @JsonValue(1) + number1, + @JsonValue(-1) + numberNegative1, + @JsonValue(11184809) + unknownDefaultOpenApi, +} + +enum EnumTestEnumNumberEnum { + @JsonValue('1.1') + number1Period1, + @JsonValue('-1.2') + numberNegative1Period2, + @JsonValue('11184809') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example.dart new file mode 100644 index 000000000000..12ed94125a83 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/child.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'example.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Example { + /// Returns a new [Example] instance. + Example({ + this.name, + }); + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Example && other.name == name; + + @override + int get hashCode => name.hashCode; + + factory Example.fromJson(Map json) => + _$ExampleFromJson(json); + + Map toJson() => _$ExampleToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example_non_primitive.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example_non_primitive.dart new file mode 100644 index 000000000000..daa629ccf6c4 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example_non_primitive.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'example_non_primitive.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ExampleNonPrimitive { + /// Returns a new [ExampleNonPrimitive] instance. + ExampleNonPrimitive({ + }); + + @override + bool operator ==(Object other) => identical(this, other) || other is ExampleNonPrimitive && + + @override + int get hashCode => + + factory ExampleNonPrimitive.fromJson(Map json) => _$ExampleNonPrimitiveFromJson(json); + + Map toJson() => _$ExampleNonPrimitiveToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/extensible.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/extensible.dart new file mode 100644 index 000000000000..bad2e3789836 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/extensible.dart @@ -0,0 +1,57 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'extensible.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Extensible { + /// Returns a new [Extensible] instance. + Extensible({ + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Extensible && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + atSchemaLocation.hashCode + atBaseType.hashCode + atType.hashCode; + + factory Extensible.fromJson(Map json) => + _$ExtensibleFromJson(json); + + Map toJson() => _$ExtensibleToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/file_schema_test_class.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/file_schema_test_class.dart new file mode 100644 index 000000000000..3da04204b0b2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/file_schema_test_class.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/model_file.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'file_schema_test_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FileSchemaTestClass { + /// Returns a new [FileSchemaTestClass] instance. + FileSchemaTestClass({ + this.file, + this.files, + }); + + @JsonKey(name: r'file', required: false, includeIfNull: false) + final ModelFile? file; + + @JsonKey(name: r'files', required: false, includeIfNull: false) + final List? files; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FileSchemaTestClass && + other.file == file && + other.files == files; + + @override + int get hashCode => file.hashCode + files.hashCode; + + factory FileSchemaTestClass.fromJson(Map json) => + _$FileSchemaTestClassFromJson(json); + + Map toJson() => _$FileSchemaTestClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo.dart new file mode 100644 index 000000000000..5fbd0e3f800a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Foo { + /// Returns a new [Foo] instance. + Foo({ + this.fooPropA, + this.fooPropB, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'fooPropA', required: false, includeIfNull: false) + final String? fooPropA; + + @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) + final String? fooPropB; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Foo && + other.fooPropA == fooPropA && + other.fooPropB == fooPropB && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + fooPropA.hashCode + + fooPropB.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Foo.fromJson(Map json) => _$FooFromJson(json); + + Map toJson() => _$FooToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo_ref.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo_ref.dart new file mode 100644 index 000000000000..1e0ec166fb66 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo_ref.dart @@ -0,0 +1,81 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo_ref.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FooRef { + /// Returns a new [FooRef] instance. + FooRef({ + this.foorefPropA, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'foorefPropA', required: false, includeIfNull: false) + final String? foorefPropA; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FooRef && + other.foorefPropA == foorefPropA && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + foorefPropA.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory FooRef.fromJson(Map json) => _$FooRefFromJson(json); + + Map toJson() => _$FooRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo_ref_or_value.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo_ref_or_value.dart new file mode 100644 index 000000000000..f71d4b51f73e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/foo_ref_or_value.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo_ref_or_value.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FooRefOrValue { + /// Returns a new [FooRefOrValue] instance. + FooRefOrValue({ + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FooRefOrValue && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory FooRefOrValue.fromJson(Map json) => + _$FooRefOrValueFromJson(json); + + Map toJson() => _$FooRefOrValueToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/format_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/format_test.dart new file mode 100644 index 000000000000..ef85b6dc3ff2 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/format_test.dart @@ -0,0 +1,150 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:http/http.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'format_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FormatTest { + /// Returns a new [FormatTest] instance. + FormatTest({ + this.integer, + this.int32, + this.int64, + required this.number, + this.float, + this.double_, + this.decimal, + this.string, + required this.byte, + this.binary, + required this.date, + this.dateTime, + this.uuid, + required this.password, + this.patternWithDigits, + this.patternWithDigitsAndDelimiter, + }); + + // minimum: 10 + // maximum: 100 + @JsonKey(name: r'integer', required: false, includeIfNull: false) + final int? integer; + + // minimum: 20 + // maximum: 200 + @JsonKey(name: r'int32', required: false, includeIfNull: false) + final int? int32; + + @JsonKey(name: r'int64', required: false, includeIfNull: false) + final int? int64; + + // minimum: 32.1 + // maximum: 543.2 + @JsonKey(name: r'number', required: true, includeIfNull: false) + final num number; + + // minimum: 54.3 + // maximum: 987.6 + @JsonKey(name: r'float', required: false, includeIfNull: false) + final double? float; + + // minimum: 67.8 + // maximum: 123.4 + @JsonKey(name: r'double', required: false, includeIfNull: false) + final double? double_; + + @JsonKey(name: r'decimal', required: false, includeIfNull: false) + final double? decimal; + + @JsonKey(name: r'string', required: false, includeIfNull: false) + final String? string; + + @JsonKey(name: r'byte', required: true, includeIfNull: false) + final String byte; + + @JsonKey(ignore: true) + final MultipartFile? binary; + + @JsonKey(name: r'date', required: true, includeIfNull: false) + final DateTime date; + + @JsonKey(name: r'dateTime', required: false, includeIfNull: false) + final DateTime? dateTime; + + @JsonKey(name: r'uuid', required: false, includeIfNull: false) + final String? uuid; + + @JsonKey(name: r'password', required: true, includeIfNull: false) + final String password; + + /// A string that is a 10 digit number. Can have leading zeros. + @JsonKey(name: r'pattern_with_digits', required: false, includeIfNull: false) + final String? patternWithDigits; + + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + @JsonKey( + name: r'pattern_with_digits_and_delimiter', + required: false, + includeIfNull: false) + final String? patternWithDigitsAndDelimiter; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FormatTest && + other.integer == integer && + other.int32 == int32 && + other.int64 == int64 && + other.number == number && + other.float == float && + other.double_ == double_ && + other.decimal == decimal && + other.string == string && + other.byte == byte && + other.binary == binary && + other.date == date && + other.dateTime == dateTime && + other.uuid == uuid && + other.password == password && + other.patternWithDigits == patternWithDigits && + other.patternWithDigitsAndDelimiter == patternWithDigitsAndDelimiter; + + @override + int get hashCode => + integer.hashCode + + int32.hashCode + + int64.hashCode + + number.hashCode + + float.hashCode + + double_.hashCode + + decimal.hashCode + + string.hashCode + + byte.hashCode + + binary.hashCode + + date.hashCode + + dateTime.hashCode + + uuid.hashCode + + password.hashCode + + patternWithDigits.hashCode + + patternWithDigitsAndDelimiter.hashCode; + + factory FormatTest.fromJson(Map json) => + _$FormatTestFromJson(json); + + Map toJson() => _$FormatTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/fruit.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/fruit.dart new file mode 100644 index 000000000000..ecbad5014c05 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/fruit.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Fruit { + /// Returns a new [Fruit] instance. + Fruit({ + this.color, + this.kind, + this.count, + }); + + @JsonKey(name: r'color', required: false, includeIfNull: false) + final String? color; + + @JsonKey(name: r'kind', required: false, includeIfNull: false) + final String? kind; + + @JsonKey(name: r'count', required: false, includeIfNull: false) + final num? count; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Fruit && + other.color == color && + other.kind == kind && + other.count == count; + + @override + int get hashCode => color.hashCode + kind.hashCode + count.hashCode; + + factory Fruit.fromJson(Map json) => _$FruitFromJson(json); + + Map toJson() => _$FruitToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/has_only_read_only.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/has_only_read_only.dart new file mode 100644 index 000000000000..ed6a55c59d03 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/has_only_read_only.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'has_only_read_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HasOnlyReadOnly { + /// Returns a new [HasOnlyReadOnly] instance. + HasOnlyReadOnly({ + this.bar, + this.foo, + }); + + @JsonKey(name: r'bar', required: false, includeIfNull: false) + final String? bar; + + @JsonKey(name: r'foo', required: false, includeIfNull: false) + final String? foo; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is HasOnlyReadOnly && other.bar == bar && other.foo == foo; + + @override + int get hashCode => bar.hashCode + foo.hashCode; + + factory HasOnlyReadOnly.fromJson(Map json) => + _$HasOnlyReadOnlyFromJson(json); + + Map toJson() => _$HasOnlyReadOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/health_check_result.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/health_check_result.dart new file mode 100644 index 000000000000..e14245b733fe --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/health_check_result.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'health_check_result.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HealthCheckResult { + /// Returns a new [HealthCheckResult] instance. + HealthCheckResult({ + this.nullableMessage, + }); + + @JsonKey(name: r'NullableMessage', required: false, includeIfNull: false) + final String? nullableMessage; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is HealthCheckResult && other.nullableMessage == nullableMessage; + + @override + int get hashCode => (nullableMessage == null ? 0 : nullableMessage.hashCode); + + factory HealthCheckResult.fromJson(Map json) => + _$HealthCheckResultFromJson(json); + + Map toJson() => _$HealthCheckResultToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/map_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/map_test.dart new file mode 100644 index 000000000000..68f69e6ab300 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/map_test.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'map_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MapTest { + /// Returns a new [MapTest] instance. + MapTest({ + this.mapMapOfString, + this.mapOfEnumString, + this.directMap, + this.indirectMap, + }); + + @JsonKey(name: r'map_map_of_string', required: false, includeIfNull: false) + final Map>? mapMapOfString; + + @JsonKey(name: r'map_of_enum_string', required: false, includeIfNull: false) + final Map? mapOfEnumString; + + @JsonKey(name: r'direct_map', required: false, includeIfNull: false) + final Map? directMap; + + @JsonKey(name: r'indirect_map', required: false, includeIfNull: false) + final Map? indirectMap; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MapTest && + other.mapMapOfString == mapMapOfString && + other.mapOfEnumString == mapOfEnumString && + other.directMap == directMap && + other.indirectMap == indirectMap; + + @override + int get hashCode => + mapMapOfString.hashCode + + mapOfEnumString.hashCode + + directMap.hashCode + + indirectMap.hashCode; + + factory MapTest.fromJson(Map json) => + _$MapTestFromJson(json); + + Map toJson() => _$MapTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +enum MapTestMapOfEnumStringEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart new file mode 100644 index 000000000000..7045930e1616 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'mixed_properties_and_additional_properties_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MixedPropertiesAndAdditionalPropertiesClass { + /// Returns a new [MixedPropertiesAndAdditionalPropertiesClass] instance. + MixedPropertiesAndAdditionalPropertiesClass({ + this.uuid, + this.dateTime, + this.map, + }); + + @JsonKey(name: r'uuid', required: false, includeIfNull: false) + final String? uuid; + + @JsonKey(name: r'dateTime', required: false, includeIfNull: false) + final DateTime? dateTime; + + @JsonKey(name: r'map', required: false, includeIfNull: false) + final Map? map; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MixedPropertiesAndAdditionalPropertiesClass && + other.uuid == uuid && + other.dateTime == dateTime && + other.map == map; + + @override + int get hashCode => uuid.hashCode + dateTime.hashCode + map.hashCode; + + factory MixedPropertiesAndAdditionalPropertiesClass.fromJson( + Map json) => + _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); + + Map toJson() => + _$MixedPropertiesAndAdditionalPropertiesClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model200_response.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model200_response.dart new file mode 100644 index 000000000000..a95d30009c5d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model200_response.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model200_response.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Model200Response { + /// Returns a new [Model200Response] instance. + Model200Response({ + this.name, + this.classField, + }); + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final int? name; + + @JsonKey(name: r'class', required: false, includeIfNull: false) + final String? classField; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Model200Response && + other.name == name && + other.classField == classField; + + @override + int get hashCode => name.hashCode + classField.hashCode; + + factory Model200Response.fromJson(Map json) => + _$Model200ResponseFromJson(json); + + Map toJson() => _$Model200ResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_client.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_client.dart new file mode 100644 index 000000000000..420ab5a1f4dd --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_client.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_client.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelClient { + /// Returns a new [ModelClient] instance. + ModelClient({ + this.client, + }); + + @JsonKey(name: r'client', required: false, includeIfNull: false) + final String? client; + + @override + bool operator ==(Object other) => + identical(this, other) || other is ModelClient && other.client == client; + + @override + int get hashCode => client.hashCode; + + factory ModelClient.fromJson(Map json) => + _$ModelClientFromJson(json); + + Map toJson() => _$ModelClientToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_enum_class.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_enum_class.dart new file mode 100644 index 000000000000..67b79a2a5c9a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_enum_class.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum ModelEnumClass { + @JsonValue(r'_abc') + abc, + @JsonValue(r'-efg') + efg, + @JsonValue(r'(xyz)') + leftParenthesisXyzRightParenthesis, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_file.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_file.dart new file mode 100644 index 000000000000..24ab5b777009 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_file.dart @@ -0,0 +1,43 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_file.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelFile { + /// Returns a new [ModelFile] instance. + ModelFile({ + this.sourceURI, + }); + + /// Test capitalization + @JsonKey(name: r'sourceURI', required: false, includeIfNull: false) + final String? sourceURI; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModelFile && other.sourceURI == sourceURI; + + @override + int get hashCode => sourceURI.hashCode; + + factory ModelFile.fromJson(Map json) => + _$ModelFileFromJson(json); + + Map toJson() => _$ModelFileToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_list.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_list.dart new file mode 100644 index 000000000000..b2d3f190af9e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_list.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_list.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelList { + /// Returns a new [ModelList] instance. + ModelList({ + this.n123list, + }); + + @JsonKey(name: r'123-list', required: false, includeIfNull: false) + final String? n123list; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModelList && other.n123list == n123list; + + @override + int get hashCode => n123list.hashCode; + + factory ModelList.fromJson(Map json) => + _$ModelListFromJson(json); + + Map toJson() => _$ModelListToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_return.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_return.dart new file mode 100644 index 000000000000..1d2547c95628 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/model_return.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_return.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelReturn { + /// Returns a new [ModelReturn] instance. + ModelReturn({ + this.return_, + }); + + @JsonKey(name: r'return', required: false, includeIfNull: false) + final int? return_; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModelReturn && other.return_ == return_; + + @override + int get hashCode => return_.hashCode; + + factory ModelReturn.fromJson(Map json) => + _$ModelReturnFromJson(json); + + Map toJson() => _$ModelReturnToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/name.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/name.dart new file mode 100644 index 000000000000..0aad5dcc0480 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/name.dart @@ -0,0 +1,61 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'name.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Name { + /// Returns a new [Name] instance. + Name({ + required this.name, + this.snakeCase, + this.property, + this.n123number, + }); + + @JsonKey(name: r'name', required: true, includeIfNull: false) + final int name; + + @JsonKey(name: r'snake_case', required: false, includeIfNull: false) + final int? snakeCase; + + @JsonKey(name: r'property', required: false, includeIfNull: false) + final String? property; + + @JsonKey(name: r'123Number', required: false, includeIfNull: false) + final int? n123number; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Name && + other.name == name && + other.snakeCase == snakeCase && + other.property == property && + other.n123number == n123number; + + @override + int get hashCode => + name.hashCode + + snakeCase.hashCode + + property.hashCode + + n123number.hashCode; + + factory Name.fromJson(Map json) => _$NameFromJson(json); + + Map toJson() => _$NameToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/nullable_class.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/nullable_class.dart new file mode 100644 index 000000000000..66e3f84395b6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/nullable_class.dart @@ -0,0 +1,121 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'nullable_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NullableClass { + /// Returns a new [NullableClass] instance. + NullableClass({ + this.integerProp, + this.numberProp, + this.booleanProp, + this.stringProp, + this.dateProp, + this.datetimeProp, + this.arrayNullableProp, + this.arrayAndItemsNullableProp, + this.arrayItemsNullable, + this.objectNullableProp, + this.objectAndItemsNullableProp, + this.objectItemsNullable, + }); + + @JsonKey(name: r'integer_prop', required: false, includeIfNull: false) + final int? integerProp; + + @JsonKey(name: r'number_prop', required: false, includeIfNull: false) + final num? numberProp; + + @JsonKey(name: r'boolean_prop', required: false, includeIfNull: false) + final bool? booleanProp; + + @JsonKey(name: r'string_prop', required: false, includeIfNull: false) + final String? stringProp; + + @JsonKey(name: r'date_prop', required: false, includeIfNull: false) + final DateTime? dateProp; + + @JsonKey(name: r'datetime_prop', required: false, includeIfNull: false) + final DateTime? datetimeProp; + + @JsonKey(name: r'array_nullable_prop', required: false, includeIfNull: false) + final List? arrayNullableProp; + + @JsonKey( + name: r'array_and_items_nullable_prop', + required: false, + includeIfNull: false) + final List? arrayAndItemsNullableProp; + + @JsonKey(name: r'array_items_nullable', required: false, includeIfNull: false) + final List? arrayItemsNullable; + + @JsonKey(name: r'object_nullable_prop', required: false, includeIfNull: false) + final Map? objectNullableProp; + + @JsonKey( + name: r'object_and_items_nullable_prop', + required: false, + includeIfNull: false) + final Map? objectAndItemsNullableProp; + + @JsonKey( + name: r'object_items_nullable', required: false, includeIfNull: false) + final Map? objectItemsNullable; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NullableClass && + other.integerProp == integerProp && + other.numberProp == numberProp && + other.booleanProp == booleanProp && + other.stringProp == stringProp && + other.dateProp == dateProp && + other.datetimeProp == datetimeProp && + other.arrayNullableProp == arrayNullableProp && + other.arrayAndItemsNullableProp == arrayAndItemsNullableProp && + other.arrayItemsNullable == arrayItemsNullable && + other.objectNullableProp == objectNullableProp && + other.objectAndItemsNullableProp == objectAndItemsNullableProp && + other.objectItemsNullable == objectItemsNullable; + + @override + int get hashCode => + (integerProp == null ? 0 : integerProp.hashCode) + + (numberProp == null ? 0 : numberProp.hashCode) + + (booleanProp == null ? 0 : booleanProp.hashCode) + + (stringProp == null ? 0 : stringProp.hashCode) + + (dateProp == null ? 0 : dateProp.hashCode) + + (datetimeProp == null ? 0 : datetimeProp.hashCode) + + (arrayNullableProp == null ? 0 : arrayNullableProp.hashCode) + + (arrayAndItemsNullableProp == null + ? 0 + : arrayAndItemsNullableProp.hashCode) + + arrayItemsNullable.hashCode + + (objectNullableProp == null ? 0 : objectNullableProp.hashCode) + + (objectAndItemsNullableProp == null + ? 0 + : objectAndItemsNullableProp.hashCode) + + objectItemsNullable.hashCode; + + factory NullableClass.fromJson(Map json) => + _$NullableClassFromJson(json); + + Map toJson() => _$NullableClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/number_only.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/number_only.dart new file mode 100644 index 000000000000..75022ee68437 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/number_only.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'number_only.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NumberOnly { + /// Returns a new [NumberOnly] instance. + NumberOnly({ + this.justNumber, + }); + + @JsonKey(name: r'JustNumber', required: false, includeIfNull: false) + final num? justNumber; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NumberOnly && other.justNumber == justNumber; + + @override + int get hashCode => justNumber.hashCode; + + factory NumberOnly.fromJson(Map json) => + _$NumberOnlyFromJson(json); + + Map toJson() => _$NumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/object_with_deprecated_fields.dart new file mode 100644 index 000000000000..77865e64e421 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/object_with_deprecated_fields.dart @@ -0,0 +1,61 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'object_with_deprecated_fields.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ObjectWithDeprecatedFields { + /// Returns a new [ObjectWithDeprecatedFields] instance. + ObjectWithDeprecatedFields({ + this.uuid, + this.id, + this.deprecatedRef, + this.bars, + }); + + @JsonKey(name: r'uuid', required: false, includeIfNull: false) + final String? uuid; + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final num? id; + + @JsonKey(name: r'deprecatedRef', required: false, includeIfNull: false) + final DeprecatedObject? deprecatedRef; + + @JsonKey(name: r'bars', required: false, includeIfNull: false) + final List? bars; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ObjectWithDeprecatedFields && + other.uuid == uuid && + other.id == id && + other.deprecatedRef == deprecatedRef && + other.bars == bars; + + @override + int get hashCode => + uuid.hashCode + id.hashCode + deprecatedRef.hashCode + bars.hashCode; + + factory ObjectWithDeprecatedFields.fromJson(Map json) => + _$ObjectWithDeprecatedFieldsFromJson(json); + + Map toJson() => _$ObjectWithDeprecatedFieldsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/order.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/order.dart new file mode 100644 index 000000000000..e5bcbae3225e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/order.dart @@ -0,0 +1,90 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'order.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Order { + /// Returns a new [Order] instance. + Order({ + this.id, + this.petId, + this.quantity, + this.shipDate, + this.status, + this.complete = false, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'petId', required: false, includeIfNull: false) + final int? petId; + + @JsonKey(name: r'quantity', required: false, includeIfNull: false) + final int? quantity; + + @JsonKey(name: r'shipDate', required: false, includeIfNull: false) + final DateTime? shipDate; + + /// Order Status + @JsonKey(name: r'status', required: false, includeIfNull: false) + final OrderStatusEnum? status; + + @JsonKey( + defaultValue: false, + name: r'complete', + required: false, + includeIfNull: false) + final bool? complete; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Order && + other.id == id && + other.petId == petId && + other.quantity == quantity && + other.shipDate == shipDate && + other.status == status && + other.complete == complete; + + @override + int get hashCode => + id.hashCode + + petId.hashCode + + quantity.hashCode + + shipDate.hashCode + + status.hashCode + + complete.hashCode; + + factory Order.fromJson(Map json) => _$OrderFromJson(json); + + Map toJson() => _$OrderToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +/// Order Status +enum OrderStatusEnum { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_composite.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_composite.dart new file mode 100644 index 000000000000..df6d371f533f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_composite.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'outer_composite.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OuterComposite { + /// Returns a new [OuterComposite] instance. + OuterComposite({ + this.myNumber, + this.myString, + this.myBoolean, + }); + + @JsonKey(name: r'my_number', required: false, includeIfNull: false) + final num? myNumber; + + @JsonKey(name: r'my_string', required: false, includeIfNull: false) + final String? myString; + + @JsonKey(name: r'my_boolean', required: false, includeIfNull: false) + final bool? myBoolean; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OuterComposite && + other.myNumber == myNumber && + other.myString == myString && + other.myBoolean == myBoolean; + + @override + int get hashCode => + myNumber.hashCode + myString.hashCode + myBoolean.hashCode; + + factory OuterComposite.fromJson(Map json) => + _$OuterCompositeFromJson(json); + + Map toJson() => _$OuterCompositeToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum.dart new file mode 100644 index 000000000000..2d1326c259bf --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum OuterEnum { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_default_value.dart new file mode 100644 index 000000000000..45919f099158 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_default_value.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum OuterEnumDefaultValue { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_integer.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_integer.dart new file mode 100644 index 000000000000..b91ca3455678 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_integer.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum OuterEnumInteger { + @JsonValue(0) + number0, + @JsonValue(1) + number1, + @JsonValue(2) + number2, + @JsonValue(11184809) + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_integer_default_value.dart new file mode 100644 index 000000000000..799321b37c85 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_enum_integer_default_value.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum OuterEnumIntegerDefaultValue { + @JsonValue(0) + number0, + @JsonValue(1) + number1, + @JsonValue(2) + number2, + @JsonValue(11184809) + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_object_with_enum_property.dart new file mode 100644 index 000000000000..7620543d1f4a --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/outer_object_with_enum_property.dart @@ -0,0 +1,43 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'outer_object_with_enum_property.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OuterObjectWithEnumProperty { + /// Returns a new [OuterObjectWithEnumProperty] instance. + OuterObjectWithEnumProperty({ + required this.value, + }); + + @JsonKey(name: r'value', required: true, includeIfNull: false) + final OuterEnumInteger value; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OuterObjectWithEnumProperty && other.value == value; + + @override + int get hashCode => value.hashCode; + + factory OuterObjectWithEnumProperty.fromJson(Map json) => + _$OuterObjectWithEnumPropertyFromJson(json); + + Map toJson() => _$OuterObjectWithEnumPropertyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pasta.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pasta.dart new file mode 100644 index 000000000000..816d59814caf --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pasta.dart @@ -0,0 +1,81 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pasta.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pasta { + /// Returns a new [Pasta] instance. + Pasta({ + this.vendor, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'vendor', required: false, includeIfNull: false) + final String? vendor; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Pasta && + other.vendor == vendor && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + vendor.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Pasta.fromJson(Map json) => _$PastaFromJson(json); + + Map toJson() => _$PastaToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pet.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pet.dart new file mode 100644 index 000000000000..58cdc030d017 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pet.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pet.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pet { + /// Returns a new [Pet] instance. + Pet({ + this.id, + required this.name, + this.category, + required this.photoUrls, + this.tags, + this.status, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'name', required: true, includeIfNull: false) + final String name; + + @JsonKey(name: r'category', required: false, includeIfNull: false) + final Category? category; + + @JsonKey(name: r'photoUrls', required: true, includeIfNull: false) + final List photoUrls; + + @JsonKey(name: r'tags', required: false, includeIfNull: false) + final List? tags; + + /// pet status in the store + @JsonKey(name: r'status', required: false, includeIfNull: false) + final PetStatusEnum? status; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Pet && + other.id == id && + other.name == name && + other.category == category && + other.photoUrls == photoUrls && + other.tags == tags && + other.status == status; + + @override + int get hashCode => + id.hashCode + + name.hashCode + + category.hashCode + + photoUrls.hashCode + + tags.hashCode + + status.hashCode; + + factory Pet.fromJson(Map json) => _$PetFromJson(json); + + Map toJson() => _$PetToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +/// pet status in the store +enum PetStatusEnum { + @JsonValue(r'available') + available, + @JsonValue(r'pending') + pending, + @JsonValue(r'sold') + sold, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pizza.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pizza.dart new file mode 100644 index 000000000000..32d80d992a50 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pizza.dart @@ -0,0 +1,81 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pizza.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pizza { + /// Returns a new [Pizza] instance. + Pizza({ + this.pizzaSize, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'pizzaSize', required: false, includeIfNull: false) + final num? pizzaSize; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Pizza && + other.pizzaSize == pizzaSize && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + pizzaSize.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Pizza.fromJson(Map json) => _$PizzaFromJson(json); + + Map toJson() => _$PizzaToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pizza_speziale.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pizza_speziale.dart new file mode 100644 index 000000000000..07d031e8c289 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/pizza_speziale.dart @@ -0,0 +1,82 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/pizza.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pizza_speziale.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PizzaSpeziale { + /// Returns a new [PizzaSpeziale] instance. + PizzaSpeziale({ + this.toppings, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'toppings', required: false, includeIfNull: false) + final String? toppings; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PizzaSpeziale && + other.toppings == toppings && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + toppings.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory PizzaSpeziale.fromJson(Map json) => + _$PizzaSpezialeFromJson(json); + + Map toJson() => _$PizzaSpezialeToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/read_only_first.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/read_only_first.dart new file mode 100644 index 000000000000..38c57afbafd8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/read_only_first.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'read_only_first.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ReadOnlyFirst { + /// Returns a new [ReadOnlyFirst] instance. + ReadOnlyFirst({ + this.bar, + this.baz, + }); + + @JsonKey(name: r'bar', required: false, includeIfNull: false) + final String? bar; + + @JsonKey(name: r'baz', required: false, includeIfNull: false) + final String? baz; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ReadOnlyFirst && other.bar == bar && other.baz == baz; + + @override + int get hashCode => bar.hashCode + baz.hashCode; + + factory ReadOnlyFirst.fromJson(Map json) => + _$ReadOnlyFirstFromJson(json); + + Map toJson() => _$ReadOnlyFirstToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/single_ref_type.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/single_ref_type.dart new file mode 100644 index 000000000000..783d766acc82 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/single_ref_type.dart @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum SingleRefType { + @JsonValue(r'admin') + admin, + @JsonValue(r'user') + user, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/special_model_name.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/special_model_name.dart new file mode 100644 index 000000000000..fe1029818a7f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/special_model_name.dart @@ -0,0 +1,47 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'special_model_name.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class SpecialModelName { + /// Returns a new [SpecialModelName] instance. + SpecialModelName({ + this.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, + }); + + @JsonKey( + name: r'$special[property.name]', required: false, includeIfNull: false) + final int? dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SpecialModelName && + other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + @override + int get hashCode => + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + .hashCode; + + factory SpecialModelName.fromJson(Map json) => + _$SpecialModelNameFromJson(json); + + Map toJson() => _$SpecialModelNameToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/tag.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/tag.dart new file mode 100644 index 000000000000..e1c5a2c8cc1c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/tag.dart @@ -0,0 +1,45 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'tag.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Tag { + /// Returns a new [Tag] instance. + Tag({ + this.id, + this.name, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Tag && other.id == id && other.name == name; + + @override + int get hashCode => id.hashCode + name.hashCode; + + factory Tag.fromJson(Map json) => _$TagFromJson(json); + + Map toJson() => _$TagToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart new file mode 100644 index 000000000000..cbea21d55960 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart @@ -0,0 +1,47 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'test_query_style_form_explode_true_array_string_query_object_parameter.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { + /// Returns a new [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter] instance. + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter({ + this.values, + }); + + @JsonKey(name: r'values', required: false, includeIfNull: false) + final List? values; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter && + other.values == values; + + @override + int get hashCode => values.hashCode; + + factory TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.fromJson( + Map json) => + _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterFromJson( + json); + + Map toJson() => + _$TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterToJson( + this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/user.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/user.dart new file mode 100644 index 000000000000..f1da4cd38cab --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/user.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'user.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class User { + /// Returns a new [User] instance. + User({ + this.id, + this.username, + this.firstName, + this.lastName, + this.email, + this.password, + this.phone, + this.userStatus, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'username', required: false, includeIfNull: false) + final String? username; + + @JsonKey(name: r'firstName', required: false, includeIfNull: false) + final String? firstName; + + @JsonKey(name: r'lastName', required: false, includeIfNull: false) + final String? lastName; + + @JsonKey(name: r'email', required: false, includeIfNull: false) + final String? email; + + @JsonKey(name: r'password', required: false, includeIfNull: false) + final String? password; + + @JsonKey(name: r'phone', required: false, includeIfNull: false) + final String? phone; + + /// User Status + @JsonKey(name: r'userStatus', required: false, includeIfNull: false) + final int? userStatus; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is User && + other.id == id && + other.username == username && + other.firstName == firstName && + other.lastName == lastName && + other.email == email && + other.password == password && + other.phone == phone && + other.userStatus == userStatus; + + @override + int get hashCode => + id.hashCode + + username.hashCode + + firstName.hashCode + + lastName.hashCode + + email.hashCode + + password.hashCode + + phone.hashCode + + userStatus.hashCode; + + factory User.fromJson(Map json) => _$UserFromJson(json); + + Map toJson() => _$UserToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/pubspec.yaml b/samples/client/echo_api/dart/dart-http-json_serializable/pubspec.yaml new file mode 100644 index 000000000000..26f8b0be6050 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/pubspec.yaml @@ -0,0 +1,19 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '>=2.14.0 <3.0.0' + +dependencies: + + http: '>=0.13.5 <2.0.0' + intl: '^0.17.0' + meta: '^1.1.8' + json_annotation: '^4.4.0' + +dev_dependencies: + build_runner: any + json_serializable: '^6.1.5' + test: ^1.16.0 diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/additional_properties_class_test.dart new file mode 100644 index 000000000000..28348e7fc36e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/additional_properties_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AdditionalPropertiesClass +void main() { + final 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/client/echo_api/dart/dart-http-json_serializable/test/addressable_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/addressable_test.dart new file mode 100644 index 000000000000..00e1b6eba940 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/addressable_test.dart @@ -0,0 +1,22 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/all_of_with_single_ref_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/all_of_with_single_ref_test.dart new file mode 100644 index 000000000000..92cbebda26cf --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/all_of_with_single_ref_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/animal_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/animal_test.dart new file mode 100644 index 000000000000..d5464a4278b1 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/animal_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/api_response_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/api_response_test.dart new file mode 100644 index 000000000000..3132ef4e8a51 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/api_response_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/apple_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/apple_test.dart new file mode 100644 index 000000000000..1c2c2037cd06 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/apple_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/array_of_array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/array_of_array_of_number_only_test.dart new file mode 100644 index 000000000000..f844a1cd920d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/array_of_array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfArrayOfNumberOnly +void main() { + final 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/client/echo_api/dart/dart-http-json_serializable/test/array_of_number_only_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/array_of_number_only_test.dart new file mode 100644 index 000000000000..b547bb1728d8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/array_of_number_only_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/array_test_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/array_test_test.dart new file mode 100644 index 000000000000..83b1fee56fb0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/array_test_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/banana_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/banana_test.dart new file mode 100644 index 000000000000..d5b0a6def843 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/banana_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/bar_create_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/bar_create_test.dart new file mode 100644 index 000000000000..0833036690d6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/bar_create_test.dart @@ -0,0 +1,55 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/bar_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/bar_ref_or_value_test.dart new file mode 100644 index 000000000000..3088b2f6cd4e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/bar_ref_or_value_test.dart @@ -0,0 +1,40 @@ +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, () { + // 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/client/echo_api/dart/dart-http-json_serializable/test/bar_ref_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/bar_ref_test.dart new file mode 100644 index 000000000000..080a462d0be6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/bar_ref_test.dart @@ -0,0 +1,40 @@ +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, () { + // 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/client/echo_api/dart/dart-http-json_serializable/test/bar_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/bar_test.dart new file mode 100644 index 000000000000..80bcd0c8227c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/bar_test.dart @@ -0,0 +1,54 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/body_api_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/body_api_test.dart new file mode 100644 index 000000000000..05eedc2d2540 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/body_api_test.dart @@ -0,0 +1,18 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +/// tests for BodyApi +void main() { + final instance = Openapi().getBodyApi(); + + group(BodyApi, () { + // Test body parameter(s) + // + // Test body parameter(s) + // + //Future testEchoBodyPet({ Pet pet }) async + test('test testEchoBodyPet', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/capitalization_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/capitalization_test.dart new file mode 100644 index 000000000000..6d1094e22d0d --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/capitalization_test.dart @@ -0,0 +1,41 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/cat_all_of_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/cat_all_of_test.dart new file mode 100644 index 000000000000..c9df8b953a81 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/cat_all_of_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for CatAllOf +void main() { + final CatAllOf? instance = /* CatAllOf(...) */ null; + // TODO add properties to the entity + + group(CatAllOf, () { + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/cat_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/cat_test.dart new file mode 100644 index 000000000000..28e5faaeb1cd --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/cat_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/category_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/category_test.dart new file mode 100644 index 000000000000..d4e1abb4179c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/category_test.dart @@ -0,0 +1,20 @@ +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 + test('to test the property `name`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/child_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/child_test.dart new file mode 100644 index 000000000000..48eac97bfd9c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/child_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/class_model_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/class_model_test.dart new file mode 100644 index 000000000000..66305bae33e5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/class_model_test.dart @@ -0,0 +1,15 @@ +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 classField + test('to test the property `classField`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/deprecated_object_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/deprecated_object_test.dart new file mode 100644 index 000000000000..8668a44a0158 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/deprecated_object_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/dog_all_of_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/dog_all_of_test.dart new file mode 100644 index 000000000000..ca5f74f20fbe --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/dog_all_of_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DogAllOf +void main() { + final DogAllOf? instance = /* DogAllOf(...) */ null; + // TODO add properties to the entity + + group(DogAllOf, () { + // String breed + test('to test the property `breed`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/dog_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/dog_test.dart new file mode 100644 index 000000000000..611f2a3fdc6f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/dog_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/entity_ref_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/entity_ref_test.dart new file mode 100644 index 000000000000..6f3bf3393abc --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/entity_ref_test.dart @@ -0,0 +1,52 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/entity_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/entity_test.dart new file mode 100644 index 000000000000..72563a81a3e5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/entity_test.dart @@ -0,0 +1,40 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/enum_arrays_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/enum_arrays_test.dart new file mode 100644 index 000000000000..5c12838ce848 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/enum_arrays_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/enum_test_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/enum_test_test.dart new file mode 100644 index 000000000000..40083505d1c0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/enum_test_test.dart @@ -0,0 +1,50 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/example_non_primitive_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/example_non_primitive_test.dart new file mode 100644 index 000000000000..dbc2c1fcae41 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/example_non_primitive_test.dart @@ -0,0 +1,10 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ExampleNonPrimitive +void main() { + final ExampleNonPrimitive? instance = /* ExampleNonPrimitive(...) */ null; + // TODO add properties to the entity + + group(ExampleNonPrimitive, () {}); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/example_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/example_test.dart new file mode 100644 index 000000000000..8c5b7ba11746 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/example_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/extensible_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/extensible_test.dart new file mode 100644 index 000000000000..821bd1b142fa --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/extensible_test.dart @@ -0,0 +1,28 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/file_schema_test_class_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/file_schema_test_class_test.dart new file mode 100644 index 000000000000..14d7c2120cd9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/file_schema_test_class_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/foo_ref_or_value_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/foo_ref_or_value_test.dart new file mode 100644 index 000000000000..e5c101940aa0 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/foo_ref_or_value_test.dart @@ -0,0 +1,40 @@ +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, () { + // 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/client/echo_api/dart/dart-http-json_serializable/test/foo_ref_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/foo_ref_test.dart new file mode 100644 index 000000000000..fe14a0965722 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/foo_ref_test.dart @@ -0,0 +1,45 @@ +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 + }); + + // 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/client/echo_api/dart/dart-http-json_serializable/test/foo_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/foo_test.dart new file mode 100644 index 000000000000..42b4149f85b6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/foo_test.dart @@ -0,0 +1,50 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/format_test_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/format_test_test.dart new file mode 100644 index 000000000000..93bb4ba3ca97 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/format_test_test.dart @@ -0,0 +1,92 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/fruit_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/fruit_test.dart new file mode 100644 index 000000000000..e376b1d49990 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/fruit_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/has_only_read_only_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/has_only_read_only_test.dart new file mode 100644 index 000000000000..5b33d9ca7457 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/has_only_read_only_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/health_check_result_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/health_check_result_test.dart new file mode 100644 index 000000000000..adc423fde5d8 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/health_check_result_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/map_test_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/map_test_test.dart new file mode 100644 index 000000000000..e6efc4c58af7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/map_test_test.dart @@ -0,0 +1,30 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart new file mode 100644 index 000000000000..4f4ed38bff17 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MixedPropertiesAndAdditionalPropertiesClass +void main() { + final 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/client/echo_api/dart/dart-http-json_serializable/test/model200_response_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/model200_response_test.dart new file mode 100644 index 000000000000..217772fc7626 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/model200_response_test.dart @@ -0,0 +1,20 @@ +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 classField + test('to test the property `classField`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/model_client_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/model_client_test.dart new file mode 100644 index 000000000000..5ea0a93ab265 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/model_client_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/model_enum_class_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/model_enum_class_test.dart new file mode 100644 index 000000000000..fa31f816801c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/model_enum_class_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelEnumClass +void main() { + group(ModelEnumClass, () {}); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/model_file_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/model_file_test.dart new file mode 100644 index 000000000000..cfc5be5ba117 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/model_file_test.dart @@ -0,0 +1,16 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/model_list_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/model_list_test.dart new file mode 100644 index 000000000000..a4ff05980ee6 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/model_list_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/model_return_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/model_return_test.dart new file mode 100644 index 000000000000..2f97f6cf6ed7 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/model_return_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/name_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/name_test.dart new file mode 100644 index 000000000000..036c3d07845c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/name_test.dart @@ -0,0 +1,30 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/nullable_class_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/nullable_class_test.dart new file mode 100644 index 000000000000..b5b320cae68b --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/nullable_class_test.dart @@ -0,0 +1,70 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/number_only_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/number_only_test.dart new file mode 100644 index 000000000000..6764fbc7a8c5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/number_only_test.dart @@ -0,0 +1,15 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/object_with_deprecated_fields_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/object_with_deprecated_fields_test.dart new file mode 100644 index 000000000000..dd0c27df02a3 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/object_with_deprecated_fields_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ObjectWithDeprecatedFields +void main() { + final 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/client/echo_api/dart/dart-http-json_serializable/test/order_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/order_test.dart new file mode 100644 index 000000000000..8d5cbc6a9df5 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/order_test.dart @@ -0,0 +1,41 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/outer_composite_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_composite_test.dart new file mode 100644 index 000000000000..5d675fe37618 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_composite_test.dart @@ -0,0 +1,25 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_default_value_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_default_value_test.dart new file mode 100644 index 000000000000..a5c83f615194 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_default_value_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumDefaultValue +void main() { + group(OuterEnumDefaultValue, () {}); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_integer_default_value_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_integer_default_value_test.dart new file mode 100644 index 000000000000..49ebbfcead7f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_integer_default_value_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumIntegerDefaultValue +void main() { + group(OuterEnumIntegerDefaultValue, () {}); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_integer_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_integer_test.dart new file mode 100644 index 000000000000..3c6b81305c71 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_integer_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumInteger +void main() { + group(OuterEnumInteger, () {}); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_test.dart new file mode 100644 index 000000000000..4ee10f379d5e --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_enum_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnum +void main() { + group(OuterEnum, () {}); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_object_with_enum_property_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_object_with_enum_property_test.dart new file mode 100644 index 000000000000..c658fed371ec --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/outer_object_with_enum_property_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterObjectWithEnumProperty +void main() { + final 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/client/echo_api/dart/dart-http-json_serializable/test/pasta_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/pasta_test.dart new file mode 100644 index 000000000000..98ba6325ac09 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/pasta_test.dart @@ -0,0 +1,45 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/path_api_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/path_api_test.dart new file mode 100644 index 000000000000..658f714ec35f --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/path_api_test.dart @@ -0,0 +1,18 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +/// tests for PathApi +void main() { + final instance = Openapi().getPathApi(); + + group(PathApi, () { + // Test path parameter(s) + // + // Test path parameter(s) + // + //Future testsPathStringPathStringIntegerPathInteger(String pathString, int pathInteger) async + test('test testsPathStringPathStringIntegerPathInteger', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/pet_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/pet_test.dart new file mode 100644 index 000000000000..fdfc9dbd062c --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/pet_test.dart @@ -0,0 +1,41 @@ +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 + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Category category + test('to test the property `category`', () async { + // TODO + }); + + // List 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/client/echo_api/dart/dart-http-json_serializable/test/pizza_speziale_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/pizza_speziale_test.dart new file mode 100644 index 000000000000..002deb101bfc --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/pizza_speziale_test.dart @@ -0,0 +1,45 @@ +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 + }); + + // 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/client/echo_api/dart/dart-http-json_serializable/test/pizza_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/pizza_test.dart new file mode 100644 index 000000000000..ea886dcc3a49 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/pizza_test.dart @@ -0,0 +1,45 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/query_api_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/query_api_test.dart new file mode 100644 index 000000000000..960e3b243e74 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/query_api_test.dart @@ -0,0 +1,36 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +/// tests for QueryApi +void main() { + final instance = Openapi().getQueryApi(); + + group(QueryApi, () { + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryIntegerBooleanString({ int integerQuery, bool booleanQuery, String stringQuery }) async + test('test testQueryIntegerBooleanString', () async { + // TODO + }); + + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryStyleFormExplodeTrueArrayString({ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject }) async + test('test testQueryStyleFormExplodeTrueArrayString', () async { + // TODO + }); + + // Test query parameter(s) + // + // Test query parameter(s) + // + //Future testQueryStyleFormExplodeTrueObject({ Pet queryObject }) async + test('test testQueryStyleFormExplodeTrueObject', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/read_only_first_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/read_only_first_test.dart new file mode 100644 index 000000000000..4f4d9d207593 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/read_only_first_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/single_ref_type_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/single_ref_type_test.dart new file mode 100644 index 000000000000..2c265f0d24ae --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/single_ref_type_test.dart @@ -0,0 +1,7 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SingleRefType +void main() { + group(SingleRefType, () {}); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/special_model_name_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/special_model_name_test.dart new file mode 100644 index 000000000000..3a6043c9054b --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/special_model_name_test.dart @@ -0,0 +1,17 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/tag_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/tag_test.dart new file mode 100644 index 000000000000..df95f3461fd9 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/tag_test.dart @@ -0,0 +1,20 @@ +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/client/echo_api/dart/dart-http-json_serializable/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart new file mode 100644 index 000000000000..882e416d1958 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/test_query_style_form_explode_true_array_string_query_object_parameter_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter +void main() { + final TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? + instance = /* TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(...) */ null; + // TODO add properties to the entity + + group(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, () { + // List values + test('to test the property `values`', () async { + // TODO + }); + }); +} diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/test/user_test.dart b/samples/client/echo_api/dart/dart-http-json_serializable/test/user_test.dart new file mode 100644 index 000000000000..fc1bb1cea555 --- /dev/null +++ b/samples/client/echo_api/dart/dart-http-json_serializable/test/user_test.dart @@ -0,0 +1,51 @@ +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 + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES index b34094eb0a2f..076f3ef85168 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -66,12 +66,14 @@ 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/_exports.dart lib/src/auth/api_key_auth.dart lib/src/auth/auth.dart lib/src/auth/basic_auth.dart lib/src/auth/bearer_auth.dart lib/src/auth/oauth.dart lib/src/deserialize.dart +lib/src/model/_exports.dart lib/src/model/additional_properties_class.dart lib/src/model/all_of_with_single_ref.dart lib/src/model/animal.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..2b5a605452bc 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 @@ -3,9 +3,7 @@ // export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; +export 'package:openapi/src/auth/_exports.dart'; export 'package:openapi/src/api/another_fake_api.dart'; @@ -16,51 +14,4 @@ export 'package:openapi/src/api/pet_api.dart'; export 'package:openapi/src/api/store_api.dart'; export 'package:openapi/src/api/user_api.dart'; -export 'package:openapi/src/model/additional_properties_class.dart'; -export 'package:openapi/src/model/all_of_with_single_ref.dart'; -export 'package:openapi/src/model/animal.dart'; -export 'package:openapi/src/model/api_response.dart'; -export 'package:openapi/src/model/array_of_array_of_number_only.dart'; -export 'package:openapi/src/model/array_of_number_only.dart'; -export 'package:openapi/src/model/array_test.dart'; -export 'package:openapi/src/model/capitalization.dart'; -export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; -export 'package:openapi/src/model/category.dart'; -export 'package:openapi/src/model/class_model.dart'; -export 'package:openapi/src/model/deprecated_object.dart'; -export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; -export 'package:openapi/src/model/enum_arrays.dart'; -export 'package:openapi/src/model/enum_test.dart'; -export 'package:openapi/src/model/file_schema_test_class.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_get_default_response.dart'; -export 'package:openapi/src/model/format_test.dart'; -export 'package:openapi/src/model/has_only_read_only.dart'; -export 'package:openapi/src/model/health_check_result.dart'; -export 'package:openapi/src/model/map_test.dart'; -export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -export 'package:openapi/src/model/model200_response.dart'; -export 'package:openapi/src/model/model_client.dart'; -export 'package:openapi/src/model/model_enum_class.dart'; -export 'package:openapi/src/model/model_file.dart'; -export 'package:openapi/src/model/model_list.dart'; -export 'package:openapi/src/model/model_return.dart'; -export 'package:openapi/src/model/name.dart'; -export 'package:openapi/src/model/nullable_class.dart'; -export 'package:openapi/src/model/number_only.dart'; -export 'package:openapi/src/model/object_with_deprecated_fields.dart'; -export 'package:openapi/src/model/order.dart'; -export 'package:openapi/src/model/outer_composite.dart'; -export 'package:openapi/src/model/outer_enum.dart'; -export 'package:openapi/src/model/outer_enum_default_value.dart'; -export 'package:openapi/src/model/outer_enum_integer.dart'; -export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -export 'package:openapi/src/model/outer_object_with_enum_property.dart'; -export 'package:openapi/src/model/pet.dart'; -export 'package:openapi/src/model/read_only_first.dart'; -export 'package:openapi/src/model/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'; +export 'package:openapi/src/model/_exports.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api.dart index 55cd646d296e..82ad544e6591 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api.dart @@ -3,10 +3,7 @@ // 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/auth/_exports.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'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart new file mode 100644 index 000000000000..3bee6983bf3f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart @@ -0,0 +1,10 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +export 'api_key_auth.dart'; +export 'auth.dart'; +export 'basic_auth.dart'; +export 'bearer_auth.dart'; +export 'oauth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart index ee16e3f0f92f..2d204c199d92 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart @@ -4,7 +4,7 @@ import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class ApiKeyAuthInterceptor extends AuthInterceptor { final Map apiKeys = {}; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart index b6e6dce04f9c..72cfa13cd9ab 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart @@ -5,7 +5,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class BasicAuthInfo { final String username; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart index 1d4402b376c0..7e22eaf74b07 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart @@ -3,7 +3,7 @@ // import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class BearerAuthInterceptor extends AuthInterceptor { final Map tokens = {}; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart index 337cf762b0ce..2f5fa42b7e17 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart @@ -3,7 +3,7 @@ // import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class OAuthInterceptor extends AuthInterceptor { final Map tokens = {}; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/_exports.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/_exports.dart new file mode 100644 index 000000000000..c57a76bafa9c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/_exports.dart @@ -0,0 +1,49 @@ +export 'additional_properties_class.dart'; +export 'all_of_with_single_ref.dart'; +export 'animal.dart'; +export 'api_response.dart'; +export 'array_of_array_of_number_only.dart'; +export 'array_of_number_only.dart'; +export 'array_test.dart'; +export 'capitalization.dart'; +export 'cat.dart'; +export 'cat_all_of.dart'; +export 'category.dart'; +export 'class_model.dart'; +export 'deprecated_object.dart'; +export 'dog.dart'; +export 'dog_all_of.dart'; +export 'enum_arrays.dart'; +export 'enum_test.dart'; +export 'file_schema_test_class.dart'; +export 'foo.dart'; +export 'foo_get_default_response.dart'; +export 'format_test.dart'; +export 'has_only_read_only.dart'; +export 'health_check_result.dart'; +export 'map_test.dart'; +export 'mixed_properties_and_additional_properties_class.dart'; +export 'model200_response.dart'; +export 'model_client.dart'; +export 'model_enum_class.dart'; +export 'model_file.dart'; +export 'model_list.dart'; +export 'model_return.dart'; +export 'name.dart'; +export 'nullable_class.dart'; +export 'number_only.dart'; +export 'object_with_deprecated_fields.dart'; +export 'order.dart'; +export 'outer_composite.dart'; +export 'outer_enum.dart'; +export 'outer_enum_default_value.dart'; +export 'outer_enum_integer.dart'; +export 'outer_enum_integer_default_value.dart'; +export 'outer_object_with_enum_property.dart'; +export 'pet.dart'; +export 'read_only_first.dart'; +export 'single_ref_type.dart'; +export 'special_model_name.dart'; +export 'tag.dart'; +export 'user.dart'; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES index 1a69ee77d623..114fc0848e57 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES @@ -66,12 +66,14 @@ lib/src/api/pet_api.dart lib/src/api/store_api.dart lib/src/api/user_api.dart lib/src/api_util.dart +lib/src/auth/_exports.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/date_serializer.dart +lib/src/model/_exports.dart lib/src/model/additional_properties_class.dart lib/src/model/all_of_with_single_ref.dart lib/src/model/animal.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..60c7b440512f 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 @@ -3,11 +3,8 @@ // export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; +export 'package:openapi/src/auth/_exports.dart'; export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; export 'package:openapi/src/api/another_fake_api.dart'; export 'package:openapi/src/api/default_api.dart'; @@ -17,51 +14,4 @@ export 'package:openapi/src/api/pet_api.dart'; export 'package:openapi/src/api/store_api.dart'; export 'package:openapi/src/api/user_api.dart'; -export 'package:openapi/src/model/additional_properties_class.dart'; -export 'package:openapi/src/model/all_of_with_single_ref.dart'; -export 'package:openapi/src/model/animal.dart'; -export 'package:openapi/src/model/api_response.dart'; -export 'package:openapi/src/model/array_of_array_of_number_only.dart'; -export 'package:openapi/src/model/array_of_number_only.dart'; -export 'package:openapi/src/model/array_test.dart'; -export 'package:openapi/src/model/capitalization.dart'; -export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; -export 'package:openapi/src/model/category.dart'; -export 'package:openapi/src/model/class_model.dart'; -export 'package:openapi/src/model/deprecated_object.dart'; -export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; -export 'package:openapi/src/model/enum_arrays.dart'; -export 'package:openapi/src/model/enum_test.dart'; -export 'package:openapi/src/model/file_schema_test_class.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_get_default_response.dart'; -export 'package:openapi/src/model/format_test.dart'; -export 'package:openapi/src/model/has_only_read_only.dart'; -export 'package:openapi/src/model/health_check_result.dart'; -export 'package:openapi/src/model/map_test.dart'; -export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -export 'package:openapi/src/model/model200_response.dart'; -export 'package:openapi/src/model/model_client.dart'; -export 'package:openapi/src/model/model_enum_class.dart'; -export 'package:openapi/src/model/model_file.dart'; -export 'package:openapi/src/model/model_list.dart'; -export 'package:openapi/src/model/model_return.dart'; -export 'package:openapi/src/model/name.dart'; -export 'package:openapi/src/model/nullable_class.dart'; -export 'package:openapi/src/model/number_only.dart'; -export 'package:openapi/src/model/object_with_deprecated_fields.dart'; -export 'package:openapi/src/model/order.dart'; -export 'package:openapi/src/model/outer_composite.dart'; -export 'package:openapi/src/model/outer_enum.dart'; -export 'package:openapi/src/model/outer_enum_default_value.dart'; -export 'package:openapi/src/model/outer_enum_integer.dart'; -export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -export 'package:openapi/src/model/outer_object_with_enum_property.dart'; -export 'package:openapi/src/model/pet.dart'; -export 'package:openapi/src/model/read_only_first.dart'; -export 'package:openapi/src/model/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'; +export 'package:openapi/src/model/_exports.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api.dart index 21ef3bc359d6..a58d137c8705 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api.dart @@ -5,10 +5,7 @@ import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; import 'package:openapi/src/serializers.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/auth/_exports.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'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart new file mode 100644 index 000000000000..3bee6983bf3f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart @@ -0,0 +1,10 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +export 'api_key_auth.dart'; +export 'auth.dart'; +export 'basic_auth.dart'; +export 'bearer_auth.dart'; +export 'oauth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart index ee16e3f0f92f..2d204c199d92 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart @@ -4,7 +4,7 @@ import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class ApiKeyAuthInterceptor extends AuthInterceptor { final Map apiKeys = {}; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart index b6e6dce04f9c..72cfa13cd9ab 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart @@ -5,7 +5,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class BasicAuthInfo { final String username; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart index 1d4402b376c0..7e22eaf74b07 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart @@ -3,7 +3,7 @@ // import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class BearerAuthInterceptor extends AuthInterceptor { final Map tokens = {}; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart index 337cf762b0ce..2f5fa42b7e17 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart @@ -3,7 +3,7 @@ // import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; +import 'auth.dart'; class OAuthInterceptor extends AuthInterceptor { final Map tokens = {}; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/_exports.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/_exports.dart new file mode 100644 index 000000000000..c2d42bf0e5d8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/_exports.dart @@ -0,0 +1,50 @@ +export 'additional_properties_class.dart'; +export 'all_of_with_single_ref.dart'; +export 'animal.dart'; +export 'api_response.dart'; +export 'array_of_array_of_number_only.dart'; +export 'array_of_number_only.dart'; +export 'array_test.dart'; +export 'capitalization.dart'; +export 'cat.dart'; +export 'cat_all_of.dart'; +export 'category.dart'; +export 'class_model.dart'; +export 'deprecated_object.dart'; +export 'dog.dart'; +export 'dog_all_of.dart'; +export 'enum_arrays.dart'; +export 'enum_test.dart'; +export 'file_schema_test_class.dart'; +export 'foo.dart'; +export 'foo_get_default_response.dart'; +export 'format_test.dart'; +export 'has_only_read_only.dart'; +export 'health_check_result.dart'; +export 'map_test.dart'; +export 'mixed_properties_and_additional_properties_class.dart'; +export 'model200_response.dart'; +export 'model_client.dart'; +export 'model_enum_class.dart'; +export 'model_file.dart'; +export 'model_list.dart'; +export 'model_return.dart'; +export 'name.dart'; +export 'nullable_class.dart'; +export 'number_only.dart'; +export 'object_with_deprecated_fields.dart'; +export 'order.dart'; +export 'outer_composite.dart'; +export 'outer_enum.dart'; +export 'outer_enum_default_value.dart'; +export 'outer_enum_integer.dart'; +export 'outer_enum_integer_default_value.dart'; +export 'outer_object_with_enum_property.dart'; +export 'pet.dart'; +export 'read_only_first.dart'; +export 'single_ref_type.dart'; +export 'special_model_name.dart'; +export 'tag.dart'; +export 'user.dart'; + +export 'date.dart'; From 6753ef8271b6ff6449302269296ac6606a7214f6 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Mon, 2 Jan 2023 06:52:17 +0200 Subject: [PATCH 19/20] fixed empty vars case in json_serializable --- .../json_serializable/class.mustache | 10 ++++++++-- .../json_serializable/dart_constructor.mustache | 8 +++----- .../lib/src/model/example_non_primitive.dart | 15 +++------------ .../lib/src/model/example_non_primitive.dart | 15 +++------------ 4 files changed, 17 insertions(+), 31 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache index 6fe97cc9e4af..54a809d05bf9 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache @@ -55,15 +55,21 @@ class {{{classname}}} { {{/vars}} + + {{#vars}} + {{#-first}} @override bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && - {{#vars}} + {{/-first}} + other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} {{/vars}} + {{#vars}} + {{#-first}} @override int get hashCode => - {{#vars}} + {{/-first}} {{#isNullable}}({{{name}}} == null ? 0 : {{{name}}}.hashCode){{/isNullable}}{{^isNullable}}{{{name}}}.hashCode{{/isNullable}}{{^-last}} +{{/-last}}{{#-last}};{{/-last}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache index 3b99f0c54016..cecb101699da 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache @@ -1,11 +1,9 @@ /// Returns a new [{{{classname}}}] instance. - {{{classname}}}({ - {{#vars}} + {{{classname}}}({{#vars}}{{#-first}}{{{/-first}} {{! A field is required in Dart when it is required && !defaultValue in OAS }} - {{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}} this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}, - {{/vars}} - }); \ No newline at end of file + {{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}} this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}, + {{#-last}}}{{/-last}}{{/vars}}); \ No newline at end of file diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example_non_primitive.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example_non_primitive.dart index daa629ccf6c4..b05d98f10dc2 100644 --- a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example_non_primitive.dart +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/model/example_non_primitive.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'example_non_primitive.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -16,16 +15,10 @@ part 'example_non_primitive.g.dart'; ) class ExampleNonPrimitive { /// Returns a new [ExampleNonPrimitive] instance. - ExampleNonPrimitive({ - }); - - @override - bool operator ==(Object other) => identical(this, other) || other is ExampleNonPrimitive && + ExampleNonPrimitive(); - @override - int get hashCode => - - factory ExampleNonPrimitive.fromJson(Map json) => _$ExampleNonPrimitiveFromJson(json); + factory ExampleNonPrimitive.fromJson(Map json) => + _$ExampleNonPrimitiveFromJson(json); Map toJson() => _$ExampleNonPrimitiveToJson(this); @@ -33,6 +26,4 @@ class ExampleNonPrimitive { String toString() { return toJson().toString(); } - } - diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example_non_primitive.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example_non_primitive.dart index daa629ccf6c4..b05d98f10dc2 100644 --- a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example_non_primitive.dart +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/model/example_non_primitive.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'example_non_primitive.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -16,16 +15,10 @@ part 'example_non_primitive.g.dart'; ) class ExampleNonPrimitive { /// Returns a new [ExampleNonPrimitive] instance. - ExampleNonPrimitive({ - }); - - @override - bool operator ==(Object other) => identical(this, other) || other is ExampleNonPrimitive && + ExampleNonPrimitive(); - @override - int get hashCode => - - factory ExampleNonPrimitive.fromJson(Map json) => _$ExampleNonPrimitiveFromJson(json); + factory ExampleNonPrimitive.fromJson(Map json) => + _$ExampleNonPrimitiveFromJson(json); Map toJson() => _$ExampleNonPrimitiveToJson(this); @@ -33,6 +26,4 @@ class ExampleNonPrimitive { String toString() { return toJson().toString(); } - } - From 939175fa5543ec627b81a8fe74e7d52d98cb8742 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Mon, 2 Jan 2023 09:40:04 +0200 Subject: [PATCH 20/20] WIP --- .../languages/DartDioClientCodegen.java | 49 ++++++++++--------- .../resources/dart/libraries/dio/api.mustache | 19 ++++++- .../dio-built_value/api_constructor.mustache | 1 + .../api_constructor_call.mustache | 1 + .../dio/dio-built_value/api_fields.mustache | 2 + .../dio/dio-built_value/api_imports.mustache | 2 + .../api_constructor.mustache | 1 + .../api_constructor_call.mustache | 1 + .../dio-json_serializable/api_fields.mustache | 1 + .../api_imports.mustache | 3 ++ .../http-built_value/api_constructor.mustache | 1 + .../api_constructor_call.mustache | 1 + .../dio/http-built_value/api_fields.mustache | 3 ++ .../dio/http-built_value/api_imports.mustache | 2 + .../api_constructor.mustache | 1 + .../api_constructor_call.mustache | 1 + .../api_fields.mustache | 2 + .../api_imports.mustache} | 2 +- .../libraries/dio/networking/dio/api.mustache | 44 +---------------- .../dio/networking/dio/api_client.mustache | 2 +- .../dio/auth/authentication.mustache | 1 - .../networking/dio/operation_header.mustache | 23 +++++++++ .../dio/networking/http/api.mustache | 20 +------- .../dio/networking/http/api_client.mustache | 2 +- .../dio/networking/http/api_util.mustache | 25 ++-------- .../networking/http/auth/_exports.mustache | 2 +- .../http/auth/api_key_auth.mustache | 3 +- .../http/auth/authentication.mustache | 4 +- .../networking/http/auth/basic_auth.mustache | 3 +- .../networking/http/auth/bearer_auth.mustache | 32 +++--------- .../dio/networking/http/auth/header.mustache | 1 + .../dio/networking/http/auth/imports.mustache | 2 + .../dio/networking/http/auth/oauth.mustache | 3 +- .../built_value/api/constructor.mustache | 3 -- .../built_value/api/imports.mustache | 1 - .../api/constructor.mustache | 1 - .../dart_constructor.mustache | 4 +- .../lib/src/api/body_api.dart | 5 +- .../lib/src/api/path_api.dart | 5 +- .../lib/src/api/query_api.dart | 7 +-- .../lib/src/api/body_api.dart | 7 ++- .../lib/src/api/path_api.dart | 7 ++- .../lib/src/api/query_api.dart | 9 ++-- .../dart-http-built_value/lib/src/api.dart | 6 +-- .../lib/src/api/body_api.dart | 12 ++--- .../lib/src/api/path_api.dart | 12 ++--- .../lib/src/api/query_api.dart | 12 ++--- .../lib/src/api_util.dart | 36 +++----------- .../lib/src/auth/api_key_auth.dart | 3 ++ .../lib/src/auth/auth.dart | 3 ++ .../lib/src/auth/basic_auth.dart | 3 ++ .../lib/src/auth/bearer_auth.dart | 33 ++++--------- .../lib/src/auth/oauth.dart | 3 ++ .../lib/src/api/body_api.dart | 8 ++- .../lib/src/api/path_api.dart | 8 ++- .../lib/src/api/query_api.dart | 8 ++- .../lib/src/api_util.dart | 36 +++----------- .../lib/src/auth/api_key_auth.dart | 3 ++ .../lib/src/auth/auth.dart | 3 ++ .../lib/src/auth/basic_auth.dart | 3 ++ .../lib/src/auth/bearer_auth.dart | 33 ++++--------- .../lib/src/auth/oauth.dart | 3 ++ 62 files changed, 224 insertions(+), 313 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_constructor.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_constructor_call.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_fields.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_imports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_constructor.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_constructor_call.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_fields.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_imports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_constructor.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_constructor_call.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_fields.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_imports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_constructor.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_constructor_call.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_fields.mustache rename modules/openapi-generator/src/main/resources/dart/libraries/dio/{serialization/json_serializable/api/imports.mustache => http-json_serializable/api_imports.mustache} (68%) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/operation_header.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/header.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/imports.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 8c039f513c51..ab2d552c2744 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 @@ -237,16 +237,33 @@ public void processOpts() { supportingFiles.add(new SupportingFile("model_exports.mustache", srcFolder + File.separator + modelPackage(), "_exports.dart")); //api exports supportingFiles.add(new SupportingFile("api_exports.mustache", srcFolder + File.separator + apiPackage(), "_exports.dart")); - - /* - * importMapping.put("Date", "package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/date.dart"); - supportingFiles.add(new SupportingFile("serialization/built_value/date.mustache", srcFolder + File.separator + modelPackage(), "date.dart")); - * - */ - + + TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(), isSkipOverwrite()); + TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); + TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); + templateManager = new TemplateManager( + templateManagerOptions, + getTemplatingEngine(), + new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} + ); + configureSerializationLibrary(srcFolder); configureDateLibrary(srcFolder); configureNetworkingLibrary(srcFolder); + + + // A lambda which allows for easy includes of interescting networking and serialization library specific + // templates without having to change the main template files. + additionalProperties.put("includeSubTemplate", (Mustache.Lambda) (fragment, writer) -> { + MustacheEngineAdapter engine = ((MustacheEngineAdapter) getTemplatingEngine()); + String templateFile = networkingLibrary + "-" + library + "/" + fragment.execute() + ".mustache"; + Template tmpl = engine.getCompiler() + .withLoader(name -> engine.findTemplate(templateManager, name)) + .defaultValue("") + .compile(templateManager.getFullTemplateContents(templateFile)); + + fragment.executeTemplate(tmpl, writer); + }); } private void configureNetworkingLibrary(String srcFolder) { @@ -263,14 +280,6 @@ private void configureNetworkingLibrary(String srcFolder) { break; } - TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(), isSkipOverwrite()); - TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); - TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); - templateManager = new TemplateManager( - templateManagerOptions, - getTemplatingEngine(), - new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} - ); // A lambda which allows for easy includes of networking library specific // templates without having to change the main template files. additionalProperties.put("includeNetworkingLibraryTemplate", (Mustache.Lambda) (fragment, writer) -> { @@ -331,15 +340,7 @@ private void configureSerializationLibrary(String srcFolder) { break; } - TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(), isSkipOverwrite()); - TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); - TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); - templateManager = new TemplateManager( - templateManagerOptions, - getTemplatingEngine(), - new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} - ); - + // A lambda which allows for easy includes of serialization library specific // templates without having to change the main template files. additionalProperties.put("includeLibraryTemplate", (Mustache.Lambda) (fragment, writer) -> { 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 550692321374..175710771450 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 @@ -1 +1,18 @@ -{{#includeNetworkingLibraryTemplate}}api{{/includeNetworkingLibraryTemplate}} \ No newline at end of file +{{>header}} +//ignore: unused_import +{{#includeSubTemplate}}api_imports{{/includeSubTemplate}} + +{{#operations}} +{{#imports}}import '{{.}}'; +{{/imports}} + +class {{classname}} { + +{{#includeSubTemplate}}api_fields{{/includeSubTemplate}} + +{{#includeSubTemplate}}api_constructor{{/includeSubTemplate}} + +{{#includeNetworkingLibraryTemplate}}api{{/includeNetworkingLibraryTemplate}} + +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_constructor.mustache new file mode 100644 index 000000000000..7b451db73866 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_constructor.mustache @@ -0,0 +1 @@ + const {{classname}}(this._dio, this._serializers); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_constructor_call.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_constructor_call.mustache new file mode 100644 index 000000000000..7bf1b1669637 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_constructor_call.mustache @@ -0,0 +1 @@ +dio, serializers diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_fields.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_fields.mustache new file mode 100644 index 000000000000..6307350b0108 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_fields.mustache @@ -0,0 +1,2 @@ + final Dio _dio; + final Serializers _serializers; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_imports.mustache new file mode 100644 index 000000000000..79c60fbc994f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-built_value/api_imports.mustache @@ -0,0 +1,2 @@ +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_constructor.mustache new file mode 100644 index 000000000000..a772c3148eaa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/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/dio-json_serializable/api_constructor_call.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_constructor_call.mustache new file mode 100644 index 000000000000..9a0ed73d5960 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_constructor_call.mustache @@ -0,0 +1 @@ +dio diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_fields.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_fields.mustache new file mode 100644 index 000000000000..179e7d0d57b4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_fields.mustache @@ -0,0 +1 @@ + final Dio _dio; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_imports.mustache new file mode 100644 index 000000000000..02d6d8b8e0fa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/dio-json_serializable/api_imports.mustache @@ -0,0 +1,3 @@ +import 'dart:convert'; +import 'package:dio/dio.dart'; +import 'package:{{pubName}}/src/deserialize.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_constructor.mustache new file mode 100644 index 000000000000..9e804ecbe079 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_constructor.mustache @@ -0,0 +1 @@ + const {{classname}}(this._client, this._basePath, this._serializers); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_constructor_call.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_constructor_call.mustache new file mode 100644 index 000000000000..96bcb4d934a0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_constructor_call.mustache @@ -0,0 +1 @@ +client, actualBasePath, serializers \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_fields.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_fields.mustache new file mode 100644 index 000000000000..d97d5fe41e2e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_fields.mustache @@ -0,0 +1,3 @@ + final Client _client; + final Serializers _serializers; + final String _basePath; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_imports.mustache new file mode 100644 index 000000000000..08b4eed13340 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-built_value/api_imports.mustache @@ -0,0 +1,2 @@ +import 'package:built_value/serializer.dart'; +import 'package:http/http.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_constructor.mustache new file mode 100644 index 000000000000..e34ae0a90486 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_constructor.mustache @@ -0,0 +1 @@ + const {{classname}}(this._client, this._basePath); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_constructor_call.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_constructor_call.mustache new file mode 100644 index 000000000000..76f2e3393461 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_constructor_call.mustache @@ -0,0 +1 @@ +client, actualBasePath \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_fields.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_fields.mustache new file mode 100644 index 000000000000..f7b96eb3dfca --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_fields.mustache @@ -0,0 +1,2 @@ + final Client _client; + final String _basePath; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_imports.mustache similarity index 68% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache rename to modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_imports.mustache index f2b20f7171b5..7f179bc4da68 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/http-json_serializable/api_imports.mustache @@ -1,3 +1,3 @@ -// ignore: unused_import +import 'package:http/http.dart'; import 'dart:convert'; import 'package:{{pubName}}/src/deserialize.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api.mustache index 892cbafd4694..2bf8e31334e7 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api.mustache @@ -1,43 +1,5 @@ -{{>header}} -import 'dart:async'; - -{{#includeLibraryTemplate}}api/imports{{/includeLibraryTemplate}} -import 'package:dio/dio.dart'; - -{{#operations}} -{{#imports}}import '{{.}}'; -{{/imports}} - -class {{classname}} { - - final Dio _dio; - -{{#includeLibraryTemplate}}api/constructor{{/includeLibraryTemplate}} - {{#operation}} - /// {{summary}}{{^summary}}{{nickname}}{{/summary}} - /// {{notes}} - /// - /// Parameters: - {{#allParams}} - /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} - {{/allParams}} - /// * [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]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} - /// Throws [DioError] if API call or serialization fails - {{#externalDocs}} - /// {{description}} - /// Also see [{{summary}} Documentation]({{url}}) - {{/externalDocs}} - {{#isDeprecated}} - @Deprecated('This operation has been deprecated') - {{/isDeprecated}} +{{>networking/dio/operation_header}} Future> {{nickname}}({ {{#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}} @@ -141,6 +103,4 @@ class {{classname}} { return _response;{{/returnType}} } - {{/operation}} -} -{{/operations}} + {{/operation}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache index a7638b5c9f03..419103aff950 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/api_client.mustache @@ -64,6 +64,6 @@ class {{clientName}} { /// Get {{classname}} instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed {{classname}} get{{classname}}() { - return {{classname}}(dio{{#useBuiltValue}}, serializers{{/useBuiltValue}}); + return {{classname}}({{#includeSubTemplate}}api_constructor_call{{/includeSubTemplate}}); }{{/apis}}{{/apiInfo}} } diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/authentication.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/authentication.mustache index b2135c140c24..a266e2384c77 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/authentication.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/auth/authentication.mustache @@ -1,7 +1,6 @@ {{>header}} 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 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/operation_header.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/operation_header.mustache new file mode 100644 index 000000000000..cee8509d4225 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/dio/operation_header.mustache @@ -0,0 +1,23 @@ + /// {{summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{notes}} + /// + /// Parameters: + {{#allParams}} + /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} + {{/allParams}} + /// * [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]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} + /// Throws [DioError] if API call or serialization fails + {{#externalDocs}} + /// {{description}} + /// Also see [{{summary}} Documentation]({{url}}) + {{/externalDocs}} + {{#isDeprecated}} + @Deprecated('This operation has been deprecated') + {{/isDeprecated}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache index 1a0b3e5f9bd3..2ac416863fa1 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api.mustache @@ -1,19 +1,3 @@ -{{>header}} -import 'dart:async'; - -{{#includeLibraryTemplate}}api/imports{{/includeLibraryTemplate}} -import 'package:http/http.dart' as http; - -{{#operations}} -{{#imports}}import '{{.}}'; -{{/imports}} - -class {{classname}} { - final String _basePath; - final http.Client? _client; - -{{#includeLibraryTemplate}}api/constructor{{/includeLibraryTemplate}} - {{#operation}} {{>networking/http/operation_header}} @@ -117,6 +101,4 @@ class {{classname}} { return _response;{{/returnType}} } - {{/operation}} -} -{{/operations}} + {{/operation}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.mustache index 339038287254..db613d6babf1 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_client.mustache @@ -26,6 +26,6 @@ class {{clientName}} { /// Get {{classname}} instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed {{classname}} get{{classname}}() { - return {{classname}}(client{{#useBuiltValue}}, serializers{{/useBuiltValue}}, actualBasePath); + return {{classname}}({{#includeSubTemplate}}api_constructor_call{{/includeSubTemplate}}); }{{/apis}}{{/apiInfo}} } diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_util.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_util.mustache index 71a3d7c5fb1b..dce0a60260b2 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_util.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/api_util.mustache @@ -1,6 +1,7 @@ {{>header}} - +import 'dart:convert'; import 'package:http/http.dart'; +import 'package:intl/intl.dart'; const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; const _dateEpochMarker = 'epoch'; @@ -19,6 +20,7 @@ class QueryParam { String toString() => '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}'; } +/* // Ported from the Java version. Iterable _queryParams(String collectionFormat, String name, dynamic value,) { // Assertions to run in debug mode only. @@ -45,26 +47,7 @@ Iterable _queryParams(String collectionFormat, String name, dynamic return params; } - -/// Format the given parameter object into a [String]. -String parameterToString(dynamic value) { - if (value == null) { - return ''; - } - if (value is DateTime) { - return value.toUtc().toIso8601String(); - } - {{#models}} - {{#model}} - {{#isEnum}} - if (value is {{{classname}}}) { -{{#native_serialization}} return {{{classname}}}TypeTransformer().encode(value).toString();{{/native_serialization}} - } - {{/isEnum}} - {{/model}} - {{/models}} - return value.toString(); -} +*/ /// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' /// content type. Otherwise, returns the decoded body as decoded by dart:http package. diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/_exports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/_exports.mustache index 1f9fc7a36702..a6be733bbf0d 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/_exports.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/_exports.mustache @@ -1,4 +1,4 @@ -{{>header}} +{{>networking/http/auth/header}} export 'api_key_auth.dart'; export 'auth.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/api_key_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/api_key_auth.mustache index 21fcd05f9dde..d02f32ebea18 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/api_key_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/api_key_auth.mustache @@ -1,4 +1,5 @@ -{{>header}} +{{>networking/http/auth/header}} +{{>networking/http/auth/imports}} import 'auth.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/authentication.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/authentication.mustache index d6d1dc3552e5..6de932fa5538 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/authentication.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/authentication.mustache @@ -1,4 +1,6 @@ -{{>header}} +{{>networking/http/auth/header}} +{{>networking/http/auth/imports}} + // ignore: one_member_abstracts abstract class Authentication { /// Apply authentication settings to header and query params. diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/basic_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/basic_auth.mustache index 04236f60db89..ad36f6bd485c 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/basic_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/basic_auth.mustache @@ -1,4 +1,5 @@ -{{>header}} +{{>networking/http/auth/header}} +{{>networking/http/auth/imports}} import 'auth.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/bearer_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/bearer_auth.mustache index 8e080a691a7d..10a44f6567fa 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/bearer_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/bearer_auth.mustache @@ -1,41 +1,25 @@ -{{>header}} +{{>networking/http/auth/header}} +{{>networking/http/auth/imports}} import 'auth.dart'; -typedef HttpBearerAuthProvider = String Function(); +typedef HttpBearerAuthProvider = String? Function(); class HttpBearerAuth implements Authentication { HttpBearerAuth(); - dynamic _accessToken; - - dynamic get accessToken => _accessToken; - - set accessToken(dynamic accessToken) { - if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { - throw ArgumentError('accessToken value must be either a String or a String Function().'); - } - _accessToken = accessToken; - } + HttpBearerAuthProvider? accessTokenProvider; @override Future applyToParams(List queryParams, Map headerParams,) async { - if (_accessToken == null) { - return; - } - - String accessToken; - - if (_accessToken is String) { - accessToken = _accessToken; - } else if (_accessToken is HttpBearerAuthProvider) { - accessToken = _accessToken!(); - } else { + final provider = accessTokenProvider; + if (provider == null) { return; } - if (accessToken.isNotEmpty) { + final accessToken = provider(); + if (accessToken != null && accessToken.isNotEmpty) { headerParams['Authorization'] = 'Bearer $accessToken'; } } diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/header.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/header.mustache new file mode 100644 index 000000000000..a6c2e54ed951 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/header.mustache @@ -0,0 +1 @@ +{{>header}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/imports.mustache new file mode 100644 index 000000000000..7a8f3d5e3d29 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/imports.mustache @@ -0,0 +1,2 @@ +import 'package:{{pubName}}/{{sourceFolder}}/api_util.dart'; +import 'dart:convert'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/oauth.mustache index 979e92948a88..99430d958977 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/oauth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/networking/http/auth/oauth.mustache @@ -1,4 +1,5 @@ -{{>header}} +{{>networking/http/auth/header}} +{{>networking/http/auth/imports}} import 'auth.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache deleted file mode 100644 index 4802c14a5a32..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache +++ /dev/null @@ -1,3 +0,0 @@ - final Serializers _serializers; - - const {{classname}}({{#useHttp}}this._client{{/useHttp}}{{#useDio}}this._dio{{/useDio}}, this._serializers{{#useHttp}}, this._basePath{{/useHttp}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache deleted file mode 100644 index 2f62fbda4267..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache +++ /dev/null @@ -1 +0,0 @@ -import 'package:built_value/serializer.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache deleted file mode 100644 index 0abb62fa7ff6..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache +++ /dev/null @@ -1 +0,0 @@ - const {{classname}}({{#useDio}}this._dio{{/useDio}}{{#useHttp}}this._client, this._basePath{{/useHttp}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache index cecb101699da..332aa591838c 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache @@ -1,9 +1,9 @@ /// Returns a new [{{{classname}}}] instance. - {{{classname}}}({{#vars}}{{#-first}}{{{/-first}} + {{{classname}}}({{#vars}}{{#-first}}{ {{/-first}} {{! A field is required in Dart when it is required && !defaultValue in OAS }} {{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}} this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}, - {{#-last}}}{{/-last}}{{/vars}}); \ No newline at end of file + {{#-last}} }{{/-last}}{{/vars}}); \ No newline at end of file diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart index a0230285c129..ca1e12b1cb49 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/body_api.dart @@ -2,8 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - +//ignore: unused_import import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -11,7 +10,6 @@ import 'package:openapi/src/model/pet.dart'; class BodyApi { final Dio _dio; - final Serializers _serializers; const BodyApi(this._dio, this._serializers); @@ -30,6 +28,7 @@ class BodyApi { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioError] if API call or serialization fails + Future> testEchoBodyPet({ Pet? pet, CancelToken? cancelToken, diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart index 28f96bb26f2f..d895d14e9976 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/path_api.dart @@ -2,14 +2,12 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - +//ignore: unused_import import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; class PathApi { final Dio _dio; - final Serializers _serializers; const PathApi(this._dio, this._serializers); @@ -29,6 +27,7 @@ class PathApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails + Future> testsPathStringPathStringIntegerPathInteger({ required String pathString, required int pathInteger, diff --git a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart index bc37616efdbb..a224d04fd7c9 100644 --- a/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart +++ b/samples/client/echo_api/dart/dart-dio-built_value/lib/src/api/query_api.dart @@ -2,8 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - +//ignore: unused_import import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -13,7 +12,6 @@ import 'package:openapi/src/model/test_query_style_form_explode_true_array_strin class QueryApi { final Dio _dio; - final Serializers _serializers; const QueryApi(this._dio, this._serializers); @@ -34,6 +32,7 @@ class QueryApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails + Future> testQueryIntegerBooleanString({ int? integerQuery, bool? booleanQuery, @@ -118,6 +117,7 @@ class QueryApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails + Future> testQueryStyleFormExplodeTrueArrayString({ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? queryObject, CancelToken? cancelToken, @@ -197,6 +197,7 @@ class QueryApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails + Future> testQueryStyleFormExplodeTrueObject({ Pet? queryObject, CancelToken? cancelToken, diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/body_api.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/body_api.dart index 1fa0654254e6..7393d14c3a6b 100644 --- a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/body_api.dart +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/body_api.dart @@ -2,12 +2,10 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - -// ignore: unused_import +//ignore: unused_import import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; +import 'package:openapi/src/deserialize.dart'; import 'package:openapi/src/model/pet.dart'; @@ -30,6 +28,7 @@ class BodyApi { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioError] if API call or serialization fails + Future> testEchoBodyPet({ Pet? pet, CancelToken? cancelToken, diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/path_api.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/path_api.dart index 4a3619f3305c..214425d7f403 100644 --- a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/path_api.dart +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/path_api.dart @@ -2,12 +2,10 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - -// ignore: unused_import +//ignore: unused_import import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; +import 'package:openapi/src/deserialize.dart'; class PathApi { final Dio _dio; @@ -29,6 +27,7 @@ class PathApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails + Future> testsPathStringPathStringIntegerPathInteger({ required String pathString, required int pathInteger, diff --git a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/query_api.dart b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/query_api.dart index b32a2e6c7516..2d552eba310c 100644 --- a/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/query_api.dart +++ b/samples/client/echo_api/dart/dart-dio-json_serializable/lib/src/api/query_api.dart @@ -2,12 +2,10 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - -// ignore: unused_import +//ignore: unused_import import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; +import 'package:openapi/src/deserialize.dart'; import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; @@ -33,6 +31,7 @@ class QueryApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails + Future> testQueryIntegerBooleanString({ int? integerQuery, bool? booleanQuery, @@ -112,6 +111,7 @@ class QueryApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails + Future> testQueryStyleFormExplodeTrueArrayString({ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? queryObject, CancelToken? cancelToken, @@ -187,6 +187,7 @@ class QueryApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails + Future> testQueryStyleFormExplodeTrueObject({ Pet? queryObject, CancelToken? cancelToken, diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart index ca1372a6c2b4..739cec85ba7f 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api.dart @@ -28,18 +28,18 @@ class Openapi { /// Get BodyApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed BodyApi getBodyApi() { - return BodyApi(client, serializers, actualBasePath); + return BodyApi(client, actualBasePath, serializers); } /// Get PathApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed PathApi getPathApi() { - return PathApi(client, serializers, actualBasePath); + return PathApi(client, actualBasePath, serializers); } /// Get QueryApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed QueryApi getQueryApi() { - return QueryApi(client, serializers, actualBasePath); + return QueryApi(client, actualBasePath, serializers); } } diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart index 273f5663a648..0dee499ea283 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/body_api.dart @@ -2,20 +2,18 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - +//ignore: unused_import import 'package:built_value/serializer.dart'; -import 'package:http/http.dart' as http; +import 'package:http/http.dart'; import 'package:openapi/src/model/pet.dart'; class BodyApi { - final String _basePath; - final http.Client? _client; - + final Client _client; final Serializers _serializers; + final String _basePath; - const BodyApi(this._client, this._serializers, this._basePath); + const BodyApi(this._client, this._basePath, this._serializers); /// Test body parameter(s) /// Test body parameter(s) diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart index 337279dd7dfe..fb77bd6681e2 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/path_api.dart @@ -2,18 +2,16 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - +//ignore: unused_import import 'package:built_value/serializer.dart'; -import 'package:http/http.dart' as http; +import 'package:http/http.dart'; class PathApi { - final String _basePath; - final http.Client? _client; - + final Client _client; final Serializers _serializers; + final String _basePath; - const PathApi(this._client, this._serializers, this._basePath); + const PathApi(this._client, this._basePath, this._serializers); /// Test path parameter(s) /// Test path parameter(s) diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart index 5da1563a9e87..ce0ebce9b469 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api/query_api.dart @@ -2,22 +2,20 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - +//ignore: unused_import import 'package:built_value/serializer.dart'; -import 'package:http/http.dart' as http; +import 'package:http/http.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; class QueryApi { - final String _basePath; - final http.Client? _client; - + final Client _client; final Serializers _serializers; + final String _basePath; - const QueryApi(this._client, this._serializers, this._basePath); + const QueryApi(this._client, this._basePath, this._serializers); /// Test query parameter(s) /// Test query parameter(s) diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart index 38448f5b5e53..2ff0d4b96f15 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/api_util.dart @@ -2,7 +2,9 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'dart:convert'; import 'package:http/http.dart'; +import 'package:intl/intl.dart'; const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; const _dateEpochMarker = 'epoch'; @@ -22,12 +24,9 @@ class QueryParam { '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}'; } +/* // Ported from the Java version. -Iterable _queryParams( - String collectionFormat, - String name, - dynamic value, -) { +Iterable _queryParams(String collectionFormat, String name, dynamic value,) { // Assertions to run in debug mode only. assert(name.isNotEmpty, 'Parameter cannot be an empty string.'); @@ -35,9 +34,7 @@ Iterable _queryParams( if (value is List) { if (collectionFormat == 'multi') { - return value.map( - (dynamic v) => QueryParam(name, parameterToString(v)), - ); + return value.map((dynamic v) => QueryParam(name, parameterToString(v)),); } // Default collection format is 'csv'. @@ -47,33 +44,14 @@ Iterable _queryParams( final delimiter = _delimiters[collectionFormat] ?? ','; - params.add(QueryParam( - name, - value.map(parameterToString).join(delimiter), - )); + params.add(QueryParam(name, value.map(parameterToString).join(delimiter),)); } else if (value != null) { params.add(QueryParam(name, parameterToString(value))); } return params; } - -/// Format the given parameter object into a [String]. -String parameterToString(dynamic value) { - if (value == null) { - return ''; - } - if (value is DateTime) { - return value.toUtc().toIso8601String(); - } - if (value is ModelEnumClass) {} - if (value is OuterEnum) {} - if (value is OuterEnumDefaultValue) {} - if (value is OuterEnumInteger) {} - if (value is OuterEnumIntegerDefaultValue) {} - if (value is SingleRefType) {} - return value.toString(); -} +*/ /// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' /// content type. Otherwise, returns the decoded body as decoded by dart:http package. diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart index efff2af616a5..396c364ce26b 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/api_key_auth.dart @@ -2,6 +2,9 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'package:openapi/src/api_util.dart'; +import 'dart:convert'; + import 'auth.dart'; class ApiKeyAuth implements Authentication { diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/auth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/auth.dart index 320391a37f1c..88550b41a798 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/auth.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/auth.dart @@ -2,6 +2,9 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'package:openapi/src/api_util.dart'; +import 'dart:convert'; + // ignore: one_member_abstracts abstract class Authentication { /// Apply authentication settings to header and query params. diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/basic_auth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/basic_auth.dart index 9977aca31f69..d80e4cd88cc6 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/basic_auth.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/basic_auth.dart @@ -2,6 +2,9 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'package:openapi/src/api_util.dart'; +import 'dart:convert'; + import 'auth.dart'; class HttpBasicAuth implements Authentication { diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/bearer_auth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/bearer_auth.dart index 26df17824f20..238136cd86bc 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/bearer_auth.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/bearer_auth.dart @@ -2,45 +2,30 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'package:openapi/src/api_util.dart'; +import 'dart:convert'; + import 'auth.dart'; -typedef HttpBearerAuthProvider = String Function(); +typedef HttpBearerAuthProvider = String? Function(); class HttpBearerAuth implements Authentication { HttpBearerAuth(); - dynamic _accessToken; - - dynamic get accessToken => _accessToken; - - set accessToken(dynamic accessToken) { - if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { - throw ArgumentError( - 'accessToken value must be either a String or a String Function().'); - } - _accessToken = accessToken; - } + HttpBearerAuthProvider? accessTokenProvider; @override Future applyToParams( List queryParams, Map headerParams, ) async { - if (_accessToken == null) { - return; - } - - String accessToken; - - if (_accessToken is String) { - accessToken = _accessToken; - } else if (_accessToken is HttpBearerAuthProvider) { - accessToken = _accessToken!(); - } else { + final provider = accessTokenProvider; + if (provider == null) { return; } - if (accessToken.isNotEmpty) { + final accessToken = provider(); + if (accessToken != null && accessToken.isNotEmpty) { headerParams['Authorization'] = 'Bearer $accessToken'; } } diff --git a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart index 2bfe87455779..02d848a3c53f 100644 --- a/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart +++ b/samples/client/echo_api/dart/dart-http-built_value/lib/src/auth/oauth.dart @@ -2,6 +2,9 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'package:openapi/src/api_util.dart'; +import 'dart:convert'; + import 'auth.dart'; class OAuth implements Authentication { diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/body_api.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/body_api.dart index 7b3053ae3495..5f18910ad38f 100644 --- a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/body_api.dart +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/body_api.dart @@ -2,18 +2,16 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - -// ignore: unused_import +//ignore: unused_import +import 'package:http/http.dart'; import 'dart:convert'; import 'package:openapi/src/deserialize.dart'; -import 'package:http/http.dart' as http; import 'package:openapi/src/model/pet.dart'; class BodyApi { + final Client _client; final String _basePath; - final http.Client? _client; const BodyApi(this._client, this._basePath); diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/path_api.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/path_api.dart index 94c828e0c315..a4f06def2bd7 100644 --- a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/path_api.dart +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/path_api.dart @@ -2,16 +2,14 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - -// ignore: unused_import +//ignore: unused_import +import 'package:http/http.dart'; import 'dart:convert'; import 'package:openapi/src/deserialize.dart'; -import 'package:http/http.dart' as http; class PathApi { + final Client _client; final String _basePath; - final http.Client? _client; const PathApi(this._client, this._basePath); diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/query_api.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/query_api.dart index df891b425f3b..73e6529cc133 100644 --- a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/query_api.dart +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api/query_api.dart @@ -2,19 +2,17 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -import 'dart:async'; - -// ignore: unused_import +//ignore: unused_import +import 'package:http/http.dart'; import 'dart:convert'; import 'package:openapi/src/deserialize.dart'; -import 'package:http/http.dart' as http; import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/test_query_style_form_explode_true_array_string_query_object_parameter.dart'; class QueryApi { + final Client _client; final String _basePath; - final http.Client? _client; const QueryApi(this._client, this._basePath); diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api_util.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api_util.dart index 38448f5b5e53..2ff0d4b96f15 100644 --- a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api_util.dart +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/api_util.dart @@ -2,7 +2,9 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'dart:convert'; import 'package:http/http.dart'; +import 'package:intl/intl.dart'; const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; const _dateEpochMarker = 'epoch'; @@ -22,12 +24,9 @@ class QueryParam { '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}'; } +/* // Ported from the Java version. -Iterable _queryParams( - String collectionFormat, - String name, - dynamic value, -) { +Iterable _queryParams(String collectionFormat, String name, dynamic value,) { // Assertions to run in debug mode only. assert(name.isNotEmpty, 'Parameter cannot be an empty string.'); @@ -35,9 +34,7 @@ Iterable _queryParams( if (value is List) { if (collectionFormat == 'multi') { - return value.map( - (dynamic v) => QueryParam(name, parameterToString(v)), - ); + return value.map((dynamic v) => QueryParam(name, parameterToString(v)),); } // Default collection format is 'csv'. @@ -47,33 +44,14 @@ Iterable _queryParams( final delimiter = _delimiters[collectionFormat] ?? ','; - params.add(QueryParam( - name, - value.map(parameterToString).join(delimiter), - )); + params.add(QueryParam(name, value.map(parameterToString).join(delimiter),)); } else if (value != null) { params.add(QueryParam(name, parameterToString(value))); } return params; } - -/// Format the given parameter object into a [String]. -String parameterToString(dynamic value) { - if (value == null) { - return ''; - } - if (value is DateTime) { - return value.toUtc().toIso8601String(); - } - if (value is ModelEnumClass) {} - if (value is OuterEnum) {} - if (value is OuterEnumDefaultValue) {} - if (value is OuterEnumInteger) {} - if (value is OuterEnumIntegerDefaultValue) {} - if (value is SingleRefType) {} - return value.toString(); -} +*/ /// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' /// content type. Otherwise, returns the decoded body as decoded by dart:http package. diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/api_key_auth.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/api_key_auth.dart index efff2af616a5..396c364ce26b 100644 --- a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/api_key_auth.dart +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/api_key_auth.dart @@ -2,6 +2,9 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'package:openapi/src/api_util.dart'; +import 'dart:convert'; + import 'auth.dart'; class ApiKeyAuth implements Authentication { diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/auth.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/auth.dart index 320391a37f1c..88550b41a798 100644 --- a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/auth.dart +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/auth.dart @@ -2,6 +2,9 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'package:openapi/src/api_util.dart'; +import 'dart:convert'; + // ignore: one_member_abstracts abstract class Authentication { /// Apply authentication settings to header and query params. diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/basic_auth.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/basic_auth.dart index 9977aca31f69..d80e4cd88cc6 100644 --- a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/basic_auth.dart +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/basic_auth.dart @@ -2,6 +2,9 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'package:openapi/src/api_util.dart'; +import 'dart:convert'; + import 'auth.dart'; class HttpBasicAuth implements Authentication { diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/bearer_auth.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/bearer_auth.dart index 26df17824f20..238136cd86bc 100644 --- a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/bearer_auth.dart +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/bearer_auth.dart @@ -2,45 +2,30 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'package:openapi/src/api_util.dart'; +import 'dart:convert'; + import 'auth.dart'; -typedef HttpBearerAuthProvider = String Function(); +typedef HttpBearerAuthProvider = String? Function(); class HttpBearerAuth implements Authentication { HttpBearerAuth(); - dynamic _accessToken; - - dynamic get accessToken => _accessToken; - - set accessToken(dynamic accessToken) { - if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { - throw ArgumentError( - 'accessToken value must be either a String or a String Function().'); - } - _accessToken = accessToken; - } + HttpBearerAuthProvider? accessTokenProvider; @override Future applyToParams( List queryParams, Map headerParams, ) async { - if (_accessToken == null) { - return; - } - - String accessToken; - - if (_accessToken is String) { - accessToken = _accessToken; - } else if (_accessToken is HttpBearerAuthProvider) { - accessToken = _accessToken!(); - } else { + final provider = accessTokenProvider; + if (provider == null) { return; } - if (accessToken.isNotEmpty) { + final accessToken = provider(); + if (accessToken != null && accessToken.isNotEmpty) { headerParams['Authorization'] = 'Bearer $accessToken'; } } diff --git a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/oauth.dart b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/oauth.dart index 2bfe87455779..02d848a3c53f 100644 --- a/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/oauth.dart +++ b/samples/client/echo_api/dart/dart-http-json_serializable/lib/src/auth/oauth.dart @@ -2,6 +2,9 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // +import 'package:openapi/src/api_util.dart'; +import 'dart:convert'; + import 'auth.dart'; class OAuth implements Authentication {