From 5760d9ac314d06b55dd9dc399b9351e7ed269b07 Mon Sep 17 00:00:00 2001 From: Vasiliy Ditsyak Date: Thu, 21 Mar 2024 23:18:38 +0100 Subject: [PATCH 1/3] [dart-dio] Incorrect hashCode and == overide for fields withList --- docs/generators/dart-dio.md | 1 + .../openapitools/codegen/DefaultCodegen.java | 2 +- .../languages/DartDioClientCodegen.java | 49 ++++++++++++++-- .../dart/libraries/dio/pubspec.mustache | 3 + .../json_serializable/class.mustache | 56 +++++++++++++++---- .../json_serializable/enum.mustache | 12 ++-- .../codegen/dart/DartClientOptionsTest.java | 1 + .../dart/dio/DartDioClientOptionsTest.java | 1 + .../options/DartDioClientOptionsProvider.java | 1 + 9 files changed, 106 insertions(+), 20 deletions(-) diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index 644631f62720..3241413f6b07 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| +|equalityCheckMethod|Specify equality check method|
**default**
[DEFAULT] Built in hash code generation method
**equatable**
Uses equatable library for equality checking
|default| |finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 6424da4631dd..7359080af5be 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -8523,7 +8523,7 @@ protected void handleConstantParams(CodegenOperation operation) { // Also, adds back non constant params to allParams. for (CodegenParameter p : copy) { if (p.isEnum && p.required && p._enum != null && p._enum.size() == 1) { - // Add to constantParams for use in the code generation templates. + // Add to constantParams for use in the code generation templates. operation.constantParams.add(p); if (p.isQueryParam) { operation.queryParams.removeIf(param -> param.baseName.equals(p.baseName)); 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 f63779cb27a7..3642486085e2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -60,6 +60,9 @@ public class DartDioClientCodegen extends AbstractDartCodegen { public static final String DATE_LIBRARY_TIME_MACHINE = "timemachine"; public static final String DATE_LIBRARY_DEFAULT = DATE_LIBRARY_CORE; + public static final String EQUALITY_CHECK_METHOD = "equalityCheckMethod"; + public static final String EQUALITY_CHECK_METHOD_DEFAULT = "default"; + public static final String EQUALITY_CHECK_METHOD_EQUATABLE = "equatable"; public static final String SERIALIZATION_LIBRARY_BUILT_VALUE = "built_value"; public static final String SERIALIZATION_LIBRARY_JSON_SERIALIZABLE = "json_serializable"; public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE; @@ -71,6 +74,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen { private static final String CLIENT_NAME = "clientName"; private String dateLibrary; + private String equalityCheckMethod; private String clientName; @@ -107,19 +111,30 @@ public DartDioClientCodegen() { serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); cliOptions.add(serializationLibrary); + // Equality check option + final CliOption equalityCheckOption = CliOption.newString(EQUALITY_CHECK_METHOD, "Specify equality check method"); + equalityCheckOption.setDefault(EQUALITY_CHECK_METHOD_DEFAULT); + + final Map equalityCheckOptions = new HashMap<>(); + equalityCheckOptions.put(EQUALITY_CHECK_METHOD_DEFAULT, "[DEFAULT] Built in hash code generation method"); + equalityCheckOptions.put(EQUALITY_CHECK_METHOD_EQUATABLE, "Uses equatable library for equality checking"); + equalityCheckOption.setEnum(equalityCheckOptions); + cliOptions.add(equalityCheckOption); + // Date Library Option final CliOption dateOption = CliOption.newString(DATE_LIBRARY, "Specify Date library"); dateOption.setDefault(DATE_LIBRARY_DEFAULT); - 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); - final Map dateOptions = new HashMap<>(); dateOptions.put(DATE_LIBRARY_CORE, "[DEFAULT] Dart core library (DateTime)"); dateOptions.put(DATE_LIBRARY_TIME_MACHINE, "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing."); dateOption.setEnum(dateOptions); cliOptions.add(dateOption); + + // 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); } public String getDateLibrary() { @@ -130,6 +145,14 @@ public void setDateLibrary(String library) { this.dateLibrary = library; } + public String getEqualityCheckMethod() { + return equalityCheckMethod; + } + + public void setEqualityCheckMethod(String equalityCheckMethod) { + this.equalityCheckMethod = equalityCheckMethod; + } + public String getClientName() { return clientName; } @@ -172,6 +195,12 @@ public void processOpts() { } setDateLibrary(additionalProperties.get(DATE_LIBRARY).toString()); + if (!additionalProperties.containsKey(EQUALITY_CHECK_METHOD)) { + additionalProperties.put(EQUALITY_CHECK_METHOD, EQUALITY_CHECK_METHOD_DEFAULT); + LOGGER.debug("Equality check method not set, using default {}", EQUALITY_CHECK_METHOD_DEFAULT); + } + setEqualityCheckMethod(additionalProperties.get(EQUALITY_CHECK_METHOD).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); @@ -205,6 +234,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("auth/auth.mustache", authFolder, "auth.dart")); configureSerializationLibrary(srcFolder); + configureEqualityCheckMethod(srcFolder); configureDateLibrary(srcFolder); } @@ -278,6 +308,17 @@ private void configureSerializationLibraryJsonSerializable(String srcFolder) { imports.put("MultipartFile", DIO_IMPORT); } + private void configureEqualityCheckMethod(String srcFolder) { + switch (equalityCheckMethod) { + case EQUALITY_CHECK_METHOD_EQUATABLE: + additionalProperties.put("useEquatable", "true"); + break; + default: + case EQUALITY_CHECK_METHOD_DEFAULT: + break; + } + } + private void configureDateLibrary(String srcFolder) { switch (dateLibrary) { case DATE_LIBRARY_TIME_MACHINE: diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache index 03255f3eee86..00369d8f3d0f 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache @@ -20,6 +20,9 @@ dependencies: built_value: '>=8.4.0 <9.0.0' built_collection: '>=5.1.1 <6.0.0' {{/useBuiltValue}} +{{#useEquatable}} + equatable: '^2.0.5' +{{/useEquatable}} {{#useJsonSerializable}} json_annotation: '^4.4.0' {{/useJsonSerializable}} 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 506bb7f45180..a670c63e880f 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 @@ -1,4 +1,7 @@ import 'package:json_annotation/json_annotation.dart'; +{{#useEquatable}} +import 'package:equatable/src/equatable_utils.dart'; +{{/useEquatable}} part '{{classFilename}}.g.dart'; @@ -61,17 +64,50 @@ class {{{classname}}} { {{/vars}} - @override - bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && - {{#vars}} - other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} - {{/vars}} - @override - int get hashCode => - {{#vars}} - {{#isNullable}}({{{name}}} == null ? 0 : {{{name}}}.hashCode){{/isNullable}}{{^isNullable}}{{{name}}}.hashCode{{/isNullable}}{{^-last}} +{{/-last}}{{#-last}};{{/-last}} - {{/vars}} + {{#useEquatable}} + bool operator ==(Object other) { + return identical(this, other) || + other is {{{classname}}} && + runtimeType == other.runtimeType && + equals( + [ + {{#vars}} + {{{name}}}, + {{/vars}} + ], + [ + {{#vars}} + other.{{{name}}}, + {{/vars}} + ] + ); + } + {{/useEquatable}} + + {{^useEquatable}} + @override + bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && + {{#vars}} + other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + {{/useEquatable}} + + {{#useEquatable}} + @override + int get hashCode => runtimeType.hashCode ^ mapPropsToHashCode([ + {{#vars}} + {{{name}}}, + {{/vars}} + ],); + {{/useEquatable}} + {{^useEquatable}} + @override + int get hashCode => + {{#vars}} + {{#isNullable}}({{{name}}} == null ? 0 : {{{name}}}.hashCode){{/isNullable}}{{^isNullable}}{{{name}}}.hashCode{{/isNullable}}{{^-last}} +{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + {{/useEquatable}} factory {{{classname}}}.fromJson(Map json) => _${{{classname}}}FromJson(json); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache index 118fb8fc573b..6446c73972fa 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache @@ -7,11 +7,13 @@ import 'package:json_annotation/json_annotation.dart'; enum {{{classname}}} { {{#allowableValues}} {{#enumVars}} - {{#description}} - /// {{{.}}} - {{/description}} - @JsonValue({{#isString}}r{{/isString}}{{{value}}}) - {{{name}}}({{^isString}}'{{/isString}}{{#isString}}r{{/isString}}{{{value}}}{{^isString}}'{{/isString}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{^isNull}} + {{#description}} + /// {{{.}}} + {{/description}} + @JsonValue({{#isString}}r{{/isString}}{{{value}}}) + {{{name}}}({{^isString}}'{{/isString}}{{#isString}}r{{/isString}}{{{value}}}{{^isString}}'{{/isString}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/isNull}} {{/enumVars}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java index 87dabbbfd00d..90136ff895a5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java @@ -20,6 +20,7 @@ import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.DartClientCodegen; +import org.openapitools.codegen.languages.DartDioClientCodegen; import org.openapitools.codegen.options.DartClientOptionsProvider; import static org.mockito.Mockito.mock; 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 23eee3fd2a2c..cb3350d57e2e 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 @@ -53,6 +53,7 @@ protected void verifyOptions() { verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setDateLibrary(DartDioClientCodegen.DATE_LIBRARY_DEFAULT); verify(clientCodegen).setLibrary(DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); + verify(clientCodegen).setEqualityCheckMethod(DartDioClientCodegen.EQUALITY_CHECK_METHOD_DEFAULT); verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartDioClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java index 60cb35293226..bcda220f4328 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java @@ -64,6 +64,7 @@ public Map createOptions() { .put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT) .put(DartDioClientCodegen.DATE_LIBRARY, DartDioClientCodegen.DATE_LIBRARY_DEFAULT) .put(DartDioClientCodegen.FINAL_PROPERTIES, DartDioClientCodegen.FINAL_PROPERTIES_DEFAULT_VALUE) + .put(DartDioClientCodegen.EQUALITY_CHECK_METHOD, DartDioClientCodegen.EQUALITY_CHECK_METHOD_DEFAULT) .put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE) .put(DartDioClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) From 6de1da7b1198ab6a2ae9756d6c052639e3768d08 Mon Sep 17 00:00:00 2001 From: Vasiliy Ditsyak Date: Thu, 25 Apr 2024 14:25:29 +0200 Subject: [PATCH 2/3] fix --- .../model/additional_properties_class.dart | 18 +++-- .../lib/src/model/all_of_with_single_ref.dart | 18 +++-- .../lib/src/model/animal.dart | 18 +++-- .../lib/src/model/api_response.dart | 22 +++--- .../model/array_of_array_of_number_only.dart | 14 ++-- .../lib/src/model/array_of_number_only.dart | 14 ++-- .../lib/src/model/array_test.dart | 22 +++--- .../lib/src/model/capitalization.dart | 34 +++++---- .../lib/src/model/cat.dart | 22 +++--- .../lib/src/model/category.dart | 18 +++-- .../lib/src/model/child_with_nullable.dart | 22 +++--- .../lib/src/model/class_model.dart | 14 ++-- .../lib/src/model/deprecated_object.dart | 14 ++-- .../lib/src/model/dog.dart | 22 +++--- .../lib/src/model/enum_arrays.dart | 18 +++-- .../lib/src/model/enum_test.dart | 42 ++++++----- .../fake_big_decimal_map200_response.dart | 18 +++-- .../lib/src/model/file_schema_test_class.dart | 18 +++-- .../lib/src/model/foo.dart | 14 ++-- .../src/model/foo_get_default_response.dart | 14 ++-- .../lib/src/model/format_test.dart | 74 ++++++++++--------- .../lib/src/model/has_only_read_only.dart | 18 +++-- .../lib/src/model/health_check_result.dart | 14 ++-- .../lib/src/model/map_test.dart | 26 ++++--- ...rties_and_additional_properties_class.dart | 22 +++--- .../lib/src/model/model200_response.dart | 18 +++-- .../lib/src/model/model_client.dart | 14 ++-- .../lib/src/model/model_enum_class.dart | 16 ++-- .../lib/src/model/model_file.dart | 14 ++-- .../lib/src/model/model_list.dart | 14 ++-- .../lib/src/model/model_return.dart | 14 ++-- .../lib/src/model/name.dart | 26 ++++--- .../lib/src/model/nullable_class.dart | 58 ++++++++------- .../lib/src/model/number_only.dart | 14 ++-- .../model/object_with_deprecated_fields.dart | 26 ++++--- .../lib/src/model/order.dart | 34 +++++---- .../lib/src/model/outer_composite.dart | 22 +++--- .../lib/src/model/outer_enum.dart | 16 ++-- .../src/model/outer_enum_default_value.dart | 16 ++-- .../lib/src/model/outer_enum_integer.dart | 16 ++-- .../outer_enum_integer_default_value.dart | 16 ++-- .../outer_object_with_enum_property.dart | 14 ++-- .../lib/src/model/parent_with_nullable.dart | 18 +++-- .../lib/src/model/pet.dart | 34 +++++---- .../lib/src/model/read_only_first.dart | 18 +++-- .../lib/src/model/single_ref_type.dart | 12 +-- .../lib/src/model/special_model_name.dart | 14 ++-- .../lib/src/model/tag.dart | 18 +++-- ...reeform_additional_properties_request.dart | 14 ++-- .../lib/src/model/user.dart | 42 ++++++----- 50 files changed, 578 insertions(+), 490 deletions(-) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart index a3d4df084be5..7cedba75141f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart @@ -47,15 +47,17 @@ class AdditionalPropertiesClass { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart index b654a66733e9..2b799c619dc2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart @@ -48,15 +48,17 @@ class AllOfWithSingleRef { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart index 22a196ce7d7f..19c22c9351e7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart @@ -47,15 +47,17 @@ class Animal { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart index c6700e2d39ce..22cdcaff69ba 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart @@ -61,17 +61,19 @@ class ApiResponse { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart index 7372be1583f2..79f8bf64fee0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart @@ -33,13 +33,15 @@ class ArrayOfArrayOfNumberOnly { - @override - bool operator ==(Object other) => identical(this, other) || other is ArrayOfArrayOfNumberOnly && - other.arrayArrayNumber == arrayArrayNumber; - @override - int get hashCode => - arrayArrayNumber.hashCode; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart index d538bb312fde..d4ecbeff86f2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart @@ -33,13 +33,15 @@ class ArrayOfNumberOnly { - @override - bool operator ==(Object other) => identical(this, other) || other is ArrayOfNumberOnly && - other.arrayNumber == arrayNumber; - @override - int get hashCode => - arrayNumber.hashCode; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart index 30a6ec8a8b72..c6f7c38ac76b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart @@ -62,17 +62,19 @@ class ArrayTest { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart index 707cb05a040f..2c996e5c71bf 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart @@ -104,23 +104,25 @@ class Capitalization { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart index 0b176faf313e..b468550dce5a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart @@ -64,17 +64,19 @@ class Cat { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart index b94c61579909..ffa8d07de9d5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart @@ -47,15 +47,17 @@ class Category { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/child_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/child_with_nullable.dart index 674a58ca893e..22b9df5c55a4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/child_with_nullable.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/child_with_nullable.dart @@ -64,17 +64,19 @@ class ChildWithNullable { - @override - bool operator ==(Object other) => identical(this, other) || other is ChildWithNullable && - other.type == type && - other.nullableProperty == nullableProperty && - other.otherProperty == otherProperty; - @override - int get hashCode => - type.hashCode + - (nullableProperty == null ? 0 : nullableProperty.hashCode) + - otherProperty.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ChildWithNullable && + other.type == type && + other.nullableProperty == nullableProperty && + other.otherProperty == otherProperty; + + @override + int get hashCode => + type.hashCode + + (nullableProperty == null ? 0 : nullableProperty.hashCode) + + otherProperty.hashCode; factory ChildWithNullable.fromJson(Map json) => _$ChildWithNullableFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart index 01837bfcca96..28a10ad25734 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart @@ -33,13 +33,15 @@ class ClassModel { - @override - bool operator ==(Object other) => identical(this, other) || other is ClassModel && - other.class_ == class_; - @override - int get hashCode => - class_.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ClassModel && + other.class_ == class_; + + @override + int get hashCode => + class_.hashCode; factory ClassModel.fromJson(Map json) => _$ClassModelFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart index 0151b72e23a1..7598e9464681 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart @@ -34,13 +34,15 @@ class DeprecatedObject { - @override - bool operator ==(Object other) => identical(this, other) || other is DeprecatedObject && - other.name == name; - @override - int get hashCode => - name.hashCode; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart index a049d0479fb0..8a5b55baf106 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart @@ -64,17 +64,19 @@ class Dog { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart index a97d069a3d25..46959e7ccd72 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart @@ -47,15 +47,17 @@ class EnumArrays { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart index 80555c14d038..687e674d211a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart @@ -135,27 +135,29 @@ class EnumTest { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart index 965257f0a076..d413eadb223e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart @@ -47,15 +47,17 @@ class FakeBigDecimalMap200Response { - @override - bool operator ==(Object other) => identical(this, other) || other is FakeBigDecimalMap200Response && - other.someId == someId && - other.someMap == someMap; - @override - int get hashCode => - someId.hashCode + - someMap.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is FakeBigDecimalMap200Response && + other.someId == someId && + other.someMap == someMap; + + @override + int get hashCode => + someId.hashCode + + someMap.hashCode; factory FakeBigDecimalMap200Response.fromJson(Map json) => _$FakeBigDecimalMap200ResponseFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart index bd2a9dc6f2fc..55195af35dbd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart @@ -48,15 +48,17 @@ class FileSchemaTestClass { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart index b43572d222cb..b8d2d1f2da85 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart @@ -33,13 +33,15 @@ class Foo { - @override - bool operator ==(Object other) => identical(this, other) || other is Foo && - other.bar == bar; - @override - int get hashCode => - bar.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Foo && + other.bar == bar; + + @override + int get hashCode => + bar.hashCode; factory Foo.fromJson(Map json) => _$FooFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart index acc1c60e4353..1702a8fcebdd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart @@ -34,13 +34,15 @@ class FooGetDefaultResponse { - @override - bool operator ==(Object other) => identical(this, other) || other is FooGetDefaultResponse && - other.string == string; - @override - int get hashCode => - string.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is FooGetDefaultResponse && + other.string == string; + + @override + int get hashCode => + string.hashCode; factory FooGetDefaultResponse.fromJson(Map json) => _$FooGetDefaultResponseFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart index 91b35595a34d..65edad5d6461 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart @@ -251,43 +251,45 @@ class FormatTest { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart index 84c99fbc188c..1cf233f8c337 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart @@ -47,15 +47,17 @@ class HasOnlyReadOnly { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart index fcb2973b7514..a77a95c2e4c8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart @@ -33,13 +33,15 @@ class HealthCheckResult { - @override - bool operator ==(Object other) => identical(this, other) || other is HealthCheckResult && - other.nullableMessage == nullableMessage; - @override - int get hashCode => - (nullableMessage == null ? 0 : nullableMessage.hashCode); + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart index 7ab19eabd5cd..beb4547b7702 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart @@ -75,19 +75,21 @@ class MapTest { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart index e2e3cd0b857a..c7262a747b22 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -62,17 +62,19 @@ class MixedPropertiesAndAdditionalPropertiesClass { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart index 346f1257555f..4e84da142bd4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart @@ -47,15 +47,17 @@ class Model200Response { - @override - bool operator ==(Object other) => identical(this, other) || other is Model200Response && - other.name == name && - other.class_ == class_; - @override - int get hashCode => - name.hashCode + - class_.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Model200Response && + other.name == name && + other.class_ == class_; + + @override + int get hashCode => + name.hashCode + + class_.hashCode; factory Model200Response.fromJson(Map json) => _$Model200ResponseFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart index 14e22005a161..29e587b33ac3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart @@ -33,13 +33,15 @@ class ModelClient { - @override - bool operator ==(Object other) => identical(this, other) || other is ModelClient && - other.client == client; - @override - int get hashCode => - client.hashCode; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart index 2cecd3b9c72c..7ff6301e9edf 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart @@ -7,14 +7,14 @@ import 'package:json_annotation/json_annotation.dart'; enum ModelEnumClass { - @JsonValue(r'_abc') - abc(r'_abc'), - @JsonValue(r'-efg') - efg(r'-efg'), - @JsonValue(r'(xyz)') - leftParenthesisXyzRightParenthesis(r'(xyz)'), - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi(r'unknown_default_open_api'); + @JsonValue(r'_abc') + abc(r'_abc'), + @JsonValue(r'-efg') + efg(r'-efg'), + @JsonValue(r'(xyz)') + leftParenthesisXyzRightParenthesis(r'(xyz)'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); const ModelEnumClass(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart index fe95e3ff0029..6fc79d9a0690 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart @@ -34,13 +34,15 @@ class ModelFile { - @override - bool operator ==(Object other) => identical(this, other) || other is ModelFile && - other.sourceURI == sourceURI; - @override - int get hashCode => - sourceURI.hashCode; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart index 543b79ac9f13..cc626409a89c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart @@ -33,13 +33,15 @@ class ModelList { - @override - bool operator ==(Object other) => identical(this, other) || other is ModelList && - other.n123list == n123list; - @override - int get hashCode => - n123list.hashCode; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart index 192b134d8fc6..5d414ad454d5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart @@ -33,13 +33,15 @@ class ModelReturn { - @override - bool operator ==(Object other) => identical(this, other) || other is ModelReturn && - other.return_ == return_; - @override - int get hashCode => - return_.hashCode; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart index 6613fa3afc8b..172e70e7a9d3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart @@ -75,19 +75,21 @@ class Name { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart index 897d489ba450..811eaa2118a7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart @@ -187,35 +187,37 @@ class NullableClass { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart index 3ca6bf704b59..71bb0aa221e8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart @@ -33,13 +33,15 @@ class NumberOnly { - @override - bool operator ==(Object other) => identical(this, other) || other is NumberOnly && - other.justNumber == justNumber; - @override - int get hashCode => - justNumber.hashCode; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart index e4eb52631133..7beda7d4aa87 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart @@ -79,19 +79,21 @@ class ObjectWithDeprecatedFields { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart index 54134b511316..00b4e62e0a14 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart @@ -104,23 +104,25 @@ class Order { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart index f2509cb99213..9986dc4f7d16 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart @@ -61,17 +61,19 @@ class OuterComposite { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart index c3ba7b26a6b6..e7687f47c55b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart @@ -7,14 +7,14 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnum { - @JsonValue(r'placed') - placed(r'placed'), - @JsonValue(r'approved') - approved(r'approved'), - @JsonValue(r'delivered') - delivered(r'delivered'), - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi(r'unknown_default_open_api'); + @JsonValue(r'placed') + placed(r'placed'), + @JsonValue(r'approved') + approved(r'approved'), + @JsonValue(r'delivered') + delivered(r'delivered'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); const OuterEnum(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart index 955683b929b3..e232c230492f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart @@ -7,14 +7,14 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumDefaultValue { - @JsonValue(r'placed') - placed(r'placed'), - @JsonValue(r'approved') - approved(r'approved'), - @JsonValue(r'delivered') - delivered(r'delivered'), - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi(r'unknown_default_open_api'); + @JsonValue(r'placed') + placed(r'placed'), + @JsonValue(r'approved') + approved(r'approved'), + @JsonValue(r'delivered') + delivered(r'delivered'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); const OuterEnumDefaultValue(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart index b1464c0dda3c..304ecf5f51ff 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart @@ -7,14 +7,14 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumInteger { - @JsonValue(0) - number0('0'), - @JsonValue(1) - number1('1'), - @JsonValue(2) - number2('2'), - @JsonValue(11184809) - unknownDefaultOpenApi('11184809'); + @JsonValue(0) + number0('0'), + @JsonValue(1) + number1('1'), + @JsonValue(2) + number2('2'), + @JsonValue(11184809) + unknownDefaultOpenApi('11184809'); const OuterEnumInteger(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart index 64c416abec7c..6483e0b837fe 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart @@ -7,14 +7,14 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumIntegerDefaultValue { - @JsonValue(0) - number0('0'), - @JsonValue(1) - number1('1'), - @JsonValue(2) - number2('2'), - @JsonValue(11184809) - unknownDefaultOpenApi('11184809'); + @JsonValue(0) + number0('0'), + @JsonValue(1) + number1('1'), + @JsonValue(2) + number2('2'), + @JsonValue(11184809) + unknownDefaultOpenApi('11184809'); const OuterEnumIntegerDefaultValue(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart index 76d18676a110..a8602e9183a3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart @@ -34,13 +34,15 @@ class OuterObjectWithEnumProperty { - @override - bool operator ==(Object other) => identical(this, other) || other is OuterObjectWithEnumProperty && - other.value == value; - @override - int get hashCode => - value.hashCode; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/parent_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/parent_with_nullable.dart index 0490c4b2b078..880c2c33cec1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/parent_with_nullable.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/parent_with_nullable.dart @@ -47,15 +47,17 @@ class ParentWithNullable { - @override - bool operator ==(Object other) => identical(this, other) || other is ParentWithNullable && - other.type == type && - other.nullableProperty == nullableProperty; - @override - int get hashCode => - type.hashCode + - (nullableProperty == null ? 0 : nullableProperty.hashCode); + + @override + bool operator ==(Object other) => identical(this, other) || other is ParentWithNullable && + other.type == type && + other.nullableProperty == nullableProperty; + + @override + int get hashCode => + type.hashCode + + (nullableProperty == null ? 0 : nullableProperty.hashCode); factory ParentWithNullable.fromJson(Map json) => _$ParentWithNullableFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart index 28d6294bae59..1e7a108b7600 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart @@ -106,23 +106,25 @@ class Pet { - @override - bool operator ==(Object other) => identical(this, other) || other is Pet && - other.id == id && - other.category == category && - other.name == name && - other.photoUrls == photoUrls && - other.tags == tags && - other.status == status; - @override - int get hashCode => - id.hashCode + - category.hashCode + - name.hashCode + - photoUrls.hashCode + - tags.hashCode + - status.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Pet && + other.id == id && + other.category == category && + other.name == name && + other.photoUrls == photoUrls && + other.tags == tags && + other.status == status; + + @override + int get hashCode => + id.hashCode + + category.hashCode + + name.hashCode + + photoUrls.hashCode + + tags.hashCode + + status.hashCode; factory Pet.fromJson(Map json) => _$PetFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart index c71c088f1381..0a57599c7c3a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart @@ -47,15 +47,17 @@ class ReadOnlyFirst { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart index 9ee2644bf813..3ea636c76a1e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart @@ -7,12 +7,12 @@ import 'package:json_annotation/json_annotation.dart'; enum SingleRefType { - @JsonValue(r'admin') - admin(r'admin'), - @JsonValue(r'user') - user(r'user'), - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi(r'unknown_default_open_api'); + @JsonValue(r'admin') + admin(r'admin'), + @JsonValue(r'user') + user(r'user'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); const SingleRefType(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart index acd3ba099576..d3a033358f8c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart @@ -33,13 +33,15 @@ class SpecialModelName { - @override - bool operator ==(Object other) => identical(this, other) || other is SpecialModelName && - other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; - @override - int get hashCode => - dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket.hashCode; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart index d8a87eec1820..00c6ff8cb702 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart @@ -47,15 +47,17 @@ class Tag { - @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; + + @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); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/test_inline_freeform_additional_properties_request.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/test_inline_freeform_additional_properties_request.dart index f00e1d91eb56..8f5947509baa 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/test_inline_freeform_additional_properties_request.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/test_inline_freeform_additional_properties_request.dart @@ -33,13 +33,15 @@ class TestInlineFreeformAdditionalPropertiesRequest { - @override - bool operator ==(Object other) => identical(this, other) || other is TestInlineFreeformAdditionalPropertiesRequest && - other.someProperty == someProperty; - @override - int get hashCode => - someProperty.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is TestInlineFreeformAdditionalPropertiesRequest && + other.someProperty == someProperty; + + @override + int get hashCode => + someProperty.hashCode; factory TestInlineFreeformAdditionalPropertiesRequest.fromJson(Map json) => _$TestInlineFreeformAdditionalPropertiesRequestFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart index 62f132ce776d..44a437d51349 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart @@ -132,27 +132,29 @@ class User { - @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; + + @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); From d40a44e9e884ff5af0ca997eaeb95b223f3fb649 Mon Sep 17 00:00:00 2001 From: Vasiliy Ditsyak Date: Fri, 26 Apr 2024 22:29:05 +0200 Subject: [PATCH 3/3] extend description --- docs/generators/dart-dio.md | 2 +- .../openapitools/codegen/languages/DartDioClientCodegen.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index 3241413f6b07..54a1df0e76ec 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| -|equalityCheckMethod|Specify equality check method|
**default**
[DEFAULT] Built in hash code generation method
**equatable**
Uses equatable library for equality checking
|default| +|equalityCheckMethod|Specify equality check method. Takes effect only in case if serializationLibrary is json_serializable.|
**default**
[DEFAULT] Built in hash code generation method
**equatable**
Uses equatable library for equality checking
|default| |finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| 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 3642486085e2..7fa0d521e72f 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 @@ -112,7 +112,7 @@ public DartDioClientCodegen() { cliOptions.add(serializationLibrary); // Equality check option - final CliOption equalityCheckOption = CliOption.newString(EQUALITY_CHECK_METHOD, "Specify equality check method"); + final CliOption equalityCheckOption = CliOption.newString(EQUALITY_CHECK_METHOD, "Specify equality check method. Takes effect only in case if serializationLibrary is json_serializable."); equalityCheckOption.setDefault(EQUALITY_CHECK_METHOD_DEFAULT); final Map equalityCheckOptions = new HashMap<>();