[dart-dio] Incorrect hashCode and == overide for fields withList (#18198)

* [dart-dio] Incorrect hashCode and == overide for fields withList

* fix

* extend description

---------

Co-authored-by: Vasiliy Ditsyak <vasilich6107@users.noreply.github.com>
This commit is contained in:
Vasiliy Ditsyak 2024-05-19 11:35:25 +02:00 committed by GitHub
parent 8924083d73
commit 3d15864eac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
59 changed files with 684 additions and 510 deletions

View File

@ -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.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true| |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.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|false| |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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|false|
|equalityCheckMethod|Specify equality check method. Takes effect only in case if serializationLibrary is json_serializable.|<dl><dt>**default**</dt><dd>[DEFAULT] Built in hash code generation method</dd><dt>**equatable**</dt><dd>Uses equatable library for equality checking</dd></dl>|default|
|finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true| |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).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>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.</dd></dl>|true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>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.</dd></dl>|true|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|

View File

@ -60,6 +60,9 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
public static final String DATE_LIBRARY_TIME_MACHINE = "timemachine"; public static final String DATE_LIBRARY_TIME_MACHINE = "timemachine";
public static final String DATE_LIBRARY_DEFAULT = DATE_LIBRARY_CORE; 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_BUILT_VALUE = "built_value";
public static final String SERIALIZATION_LIBRARY_JSON_SERIALIZABLE = "json_serializable"; 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 SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE;
@ -71,6 +74,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
private static final String CLIENT_NAME = "clientName"; private static final String CLIENT_NAME = "clientName";
private String dateLibrary; private String dateLibrary;
private String equalityCheckMethod;
private String clientName; private String clientName;
@ -107,19 +111,30 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT);
cliOptions.add(serializationLibrary); cliOptions.add(serializationLibrary);
// Equality check option
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<String, String> 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 // Date Library Option
final CliOption dateOption = CliOption.newString(DATE_LIBRARY, "Specify Date library"); final CliOption dateOption = CliOption.newString(DATE_LIBRARY, "Specify Date library");
dateOption.setDefault(DATE_LIBRARY_DEFAULT); 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<String, String> dateOptions = new HashMap<>(); final Map<String, String> dateOptions = new HashMap<>();
dateOptions.put(DATE_LIBRARY_CORE, "[DEFAULT] Dart core library (DateTime)"); dateOptions.put(DATE_LIBRARY_CORE, "[DEFAULT] Dart core library (DateTime)");
dateOptions.put(DATE_LIBRARY_TIME_MACHINE, "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing."); dateOptions.put(DATE_LIBRARY_TIME_MACHINE, "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.");
dateOption.setEnum(dateOptions); dateOption.setEnum(dateOptions);
cliOptions.add(dateOption); 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() { public String getDateLibrary() {
@ -130,6 +145,14 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
this.dateLibrary = library; this.dateLibrary = library;
} }
public String getEqualityCheckMethod() {
return equalityCheckMethod;
}
public void setEqualityCheckMethod(String equalityCheckMethod) {
this.equalityCheckMethod = equalityCheckMethod;
}
public String getClientName() { public String getClientName() {
return clientName; return clientName;
} }
@ -172,6 +195,12 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
} }
setDateLibrary(additionalProperties.get(DATE_LIBRARY).toString()); 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)) { if (!additionalProperties.containsKey(FINAL_PROPERTIES)) {
additionalProperties.put(FINAL_PROPERTIES, Boolean.parseBoolean(FINAL_PROPERTIES_DEFAULT_VALUE)); additionalProperties.put(FINAL_PROPERTIES, Boolean.parseBoolean(FINAL_PROPERTIES_DEFAULT_VALUE));
LOGGER.debug("finalProperties not set, using default {}", FINAL_PROPERTIES_DEFAULT_VALUE); LOGGER.debug("finalProperties not set, using default {}", FINAL_PROPERTIES_DEFAULT_VALUE);
@ -205,6 +234,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
supportingFiles.add(new SupportingFile("auth/auth.mustache", authFolder, "auth.dart")); supportingFiles.add(new SupportingFile("auth/auth.mustache", authFolder, "auth.dart"));
configureSerializationLibrary(srcFolder); configureSerializationLibrary(srcFolder);
configureEqualityCheckMethod(srcFolder);
configureDateLibrary(srcFolder); configureDateLibrary(srcFolder);
} }
@ -278,6 +308,17 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
imports.put("MultipartFile", DIO_IMPORT); 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) { private void configureDateLibrary(String srcFolder) {
switch (dateLibrary) { switch (dateLibrary) {
case DATE_LIBRARY_TIME_MACHINE: case DATE_LIBRARY_TIME_MACHINE:

View File

@ -20,6 +20,9 @@ dependencies:
built_value: '>=8.4.0 <9.0.0' built_value: '>=8.4.0 <9.0.0'
built_collection: '>=5.1.1 <6.0.0' built_collection: '>=5.1.1 <6.0.0'
{{/useBuiltValue}} {{/useBuiltValue}}
{{#useEquatable}}
equatable: '^2.0.5'
{{/useEquatable}}
{{#useJsonSerializable}} {{#useJsonSerializable}}
json_annotation: '^4.4.0' json_annotation: '^4.4.0'
{{/useJsonSerializable}} {{/useJsonSerializable}}

View File

@ -1,4 +1,7 @@
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
{{#useEquatable}}
import 'package:equatable/src/equatable_utils.dart';
{{/useEquatable}}
part '{{classFilename}}.g.dart'; part '{{classFilename}}.g.dart';
@ -61,17 +64,50 @@ class {{{classname}}} {
{{/vars}} {{/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 @override
bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} &&
{{#vars}} {{#vars}}
other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}}
{{/vars}} {{/vars}}
{{/useEquatable}}
{{#useEquatable}}
@override
int get hashCode => runtimeType.hashCode ^ mapPropsToHashCode([
{{#vars}}
{{{name}}},
{{/vars}}
],);
{{/useEquatable}}
{{^useEquatable}}
@override @override
int get hashCode => int get hashCode =>
{{#vars}} {{#vars}}
{{#isNullable}}({{{name}}} == null ? 0 : {{{name}}}.hashCode){{/isNullable}}{{^isNullable}}{{{name}}}.hashCode{{/isNullable}}{{^-last}} +{{/-last}}{{#-last}};{{/-last}} {{#isNullable}}({{{name}}} == null ? 0 : {{{name}}}.hashCode){{/isNullable}}{{^isNullable}}{{{name}}}.hashCode{{/isNullable}}{{^-last}} +{{/-last}}{{#-last}};{{/-last}}
{{/vars}} {{/vars}}
{{/useEquatable}}
factory {{{classname}}}.fromJson(Map<String, dynamic> json) => _${{{classname}}}FromJson(json); factory {{{classname}}}.fromJson(Map<String, dynamic> json) => _${{{classname}}}FromJson(json);

View File

@ -7,11 +7,13 @@ import 'package:json_annotation/json_annotation.dart';
enum {{{classname}}} { enum {{{classname}}} {
{{#allowableValues}} {{#allowableValues}}
{{#enumVars}} {{#enumVars}}
{{^isNull}}
{{#description}} {{#description}}
/// {{{.}}} /// {{{.}}}
{{/description}} {{/description}}
@JsonValue({{#isString}}r{{/isString}}{{{value}}}) @JsonValue({{#isString}}r{{/isString}}{{{value}}})
{{{name}}}({{^isString}}'{{/isString}}{{#isString}}r{{/isString}}{{{value}}}{{^isString}}'{{/isString}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{{name}}}({{^isString}}'{{/isString}}{{#isString}}r{{/isString}}{{{value}}}{{^isString}}'{{/isString}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
{{/isNull}}
{{/enumVars}} {{/enumVars}}
{{/allowableValues}} {{/allowableValues}}

View File

@ -20,6 +20,7 @@ package org.openapitools.codegen.dart;
import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.AbstractOptionsTest;
import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConfig;
import org.openapitools.codegen.languages.DartClientCodegen; import org.openapitools.codegen.languages.DartClientCodegen;
import org.openapitools.codegen.languages.DartDioClientCodegen;
import org.openapitools.codegen.options.DartClientOptionsProvider; import org.openapitools.codegen.options.DartClientOptionsProvider;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;

View File

@ -53,6 +53,7 @@ public class DartDioClientOptionsTest extends AbstractOptionsTest {
verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioClientOptionsProvider.USE_ENUM_EXTENSION));
verify(clientCodegen).setDateLibrary(DartDioClientCodegen.DATE_LIBRARY_DEFAULT); verify(clientCodegen).setDateLibrary(DartDioClientCodegen.DATE_LIBRARY_DEFAULT);
verify(clientCodegen).setLibrary(DartDioClientCodegen.SERIALIZATION_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)); verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartDioClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE));
} }
} }

View File

@ -64,6 +64,7 @@ public class DartDioClientOptionsProvider implements OptionsProvider {
.put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT) .put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT)
.put(DartDioClientCodegen.DATE_LIBRARY, DartDioClientCodegen.DATE_LIBRARY_DEFAULT) .put(DartDioClientCodegen.DATE_LIBRARY, DartDioClientCodegen.DATE_LIBRARY_DEFAULT)
.put(DartDioClientCodegen.FINAL_PROPERTIES, DartDioClientCodegen.FINAL_PROPERTIES_DEFAULT_VALUE) .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(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
.put(DartDioClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION) .put(DartDioClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION)
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)

View File

@ -47,6 +47,8 @@ class AdditionalPropertiesClass {
@override @override
bool operator ==(Object other) => identical(this, other) || other is AdditionalPropertiesClass && bool operator ==(Object other) => identical(this, other) || other is AdditionalPropertiesClass &&
other.mapProperty == mapProperty && other.mapProperty == mapProperty &&

View File

@ -48,6 +48,8 @@ class AllOfWithSingleRef {
@override @override
bool operator ==(Object other) => identical(this, other) || other is AllOfWithSingleRef && bool operator ==(Object other) => identical(this, other) || other is AllOfWithSingleRef &&
other.username == username && other.username == username &&

View File

@ -47,6 +47,8 @@ class Animal {
@override @override
bool operator ==(Object other) => identical(this, other) || other is Animal && bool operator ==(Object other) => identical(this, other) || other is Animal &&
other.className == className && other.className == className &&

View File

@ -61,6 +61,8 @@ class ApiResponse {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ApiResponse && bool operator ==(Object other) => identical(this, other) || other is ApiResponse &&
other.code == code && other.code == code &&

View File

@ -33,6 +33,8 @@ class ArrayOfArrayOfNumberOnly {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ArrayOfArrayOfNumberOnly && bool operator ==(Object other) => identical(this, other) || other is ArrayOfArrayOfNumberOnly &&
other.arrayArrayNumber == arrayArrayNumber; other.arrayArrayNumber == arrayArrayNumber;

View File

@ -33,6 +33,8 @@ class ArrayOfNumberOnly {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ArrayOfNumberOnly && bool operator ==(Object other) => identical(this, other) || other is ArrayOfNumberOnly &&
other.arrayNumber == arrayNumber; other.arrayNumber == arrayNumber;

View File

@ -62,6 +62,8 @@ class ArrayTest {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ArrayTest && bool operator ==(Object other) => identical(this, other) || other is ArrayTest &&
other.arrayOfString == arrayOfString && other.arrayOfString == arrayOfString &&

View File

@ -104,6 +104,8 @@ class Capitalization {
@override @override
bool operator ==(Object other) => identical(this, other) || other is Capitalization && bool operator ==(Object other) => identical(this, other) || other is Capitalization &&
other.smallCamel == smallCamel && other.smallCamel == smallCamel &&

View File

@ -64,6 +64,8 @@ class Cat {
@override @override
bool operator ==(Object other) => identical(this, other) || other is Cat && bool operator ==(Object other) => identical(this, other) || other is Cat &&
other.className == className && other.className == className &&

View File

@ -47,6 +47,8 @@ class Category {
@override @override
bool operator ==(Object other) => identical(this, other) || other is Category && bool operator ==(Object other) => identical(this, other) || other is Category &&
other.id == id && other.id == id &&

View File

@ -64,6 +64,8 @@ class ChildWithNullable {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ChildWithNullable && bool operator ==(Object other) => identical(this, other) || other is ChildWithNullable &&
other.type == type && other.type == type &&

View File

@ -33,6 +33,8 @@ class ClassModel {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ClassModel && bool operator ==(Object other) => identical(this, other) || other is ClassModel &&
other.class_ == class_; other.class_ == class_;

View File

@ -34,6 +34,8 @@ class DeprecatedObject {
@override @override
bool operator ==(Object other) => identical(this, other) || other is DeprecatedObject && bool operator ==(Object other) => identical(this, other) || other is DeprecatedObject &&
other.name == name; other.name == name;

View File

@ -64,6 +64,8 @@ class Dog {
@override @override
bool operator ==(Object other) => identical(this, other) || other is Dog && bool operator ==(Object other) => identical(this, other) || other is Dog &&
other.className == className && other.className == className &&

View File

@ -47,6 +47,8 @@ class EnumArrays {
@override @override
bool operator ==(Object other) => identical(this, other) || other is EnumArrays && bool operator ==(Object other) => identical(this, other) || other is EnumArrays &&
other.justSymbol == justSymbol && other.justSymbol == justSymbol &&

View File

@ -135,6 +135,8 @@ class EnumTest {
@override @override
bool operator ==(Object other) => identical(this, other) || other is EnumTest && bool operator ==(Object other) => identical(this, other) || other is EnumTest &&
other.enumString == enumString && other.enumString == enumString &&

View File

@ -47,6 +47,8 @@ class FakeBigDecimalMap200Response {
@override @override
bool operator ==(Object other) => identical(this, other) || other is FakeBigDecimalMap200Response && bool operator ==(Object other) => identical(this, other) || other is FakeBigDecimalMap200Response &&
other.someId == someId && other.someId == someId &&

View File

@ -48,6 +48,8 @@ class FileSchemaTestClass {
@override @override
bool operator ==(Object other) => identical(this, other) || other is FileSchemaTestClass && bool operator ==(Object other) => identical(this, other) || other is FileSchemaTestClass &&
other.file == file && other.file == file &&

View File

@ -33,6 +33,8 @@ class Foo {
@override @override
bool operator ==(Object other) => identical(this, other) || other is Foo && bool operator ==(Object other) => identical(this, other) || other is Foo &&
other.bar == bar; other.bar == bar;

View File

@ -34,6 +34,8 @@ class FooGetDefaultResponse {
@override @override
bool operator ==(Object other) => identical(this, other) || other is FooGetDefaultResponse && bool operator ==(Object other) => identical(this, other) || other is FooGetDefaultResponse &&
other.string == string; other.string == string;

View File

@ -251,6 +251,8 @@ class FormatTest {
@override @override
bool operator ==(Object other) => identical(this, other) || other is FormatTest && bool operator ==(Object other) => identical(this, other) || other is FormatTest &&
other.integer == integer && other.integer == integer &&

View File

@ -47,6 +47,8 @@ class HasOnlyReadOnly {
@override @override
bool operator ==(Object other) => identical(this, other) || other is HasOnlyReadOnly && bool operator ==(Object other) => identical(this, other) || other is HasOnlyReadOnly &&
other.bar == bar && other.bar == bar &&

View File

@ -33,6 +33,8 @@ class HealthCheckResult {
@override @override
bool operator ==(Object other) => identical(this, other) || other is HealthCheckResult && bool operator ==(Object other) => identical(this, other) || other is HealthCheckResult &&
other.nullableMessage == nullableMessage; other.nullableMessage == nullableMessage;

View File

@ -75,6 +75,8 @@ class MapTest {
@override @override
bool operator ==(Object other) => identical(this, other) || other is MapTest && bool operator ==(Object other) => identical(this, other) || other is MapTest &&
other.mapMapOfString == mapMapOfString && other.mapMapOfString == mapMapOfString &&

View File

@ -62,6 +62,8 @@ class MixedPropertiesAndAdditionalPropertiesClass {
@override @override
bool operator ==(Object other) => identical(this, other) || other is MixedPropertiesAndAdditionalPropertiesClass && bool operator ==(Object other) => identical(this, other) || other is MixedPropertiesAndAdditionalPropertiesClass &&
other.uuid == uuid && other.uuid == uuid &&

View File

@ -47,6 +47,8 @@ class Model200Response {
@override @override
bool operator ==(Object other) => identical(this, other) || other is Model200Response && bool operator ==(Object other) => identical(this, other) || other is Model200Response &&
other.name == name && other.name == name &&

View File

@ -33,6 +33,8 @@ class ModelClient {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ModelClient && bool operator ==(Object other) => identical(this, other) || other is ModelClient &&
other.client == client; other.client == client;

View File

@ -34,6 +34,8 @@ class ModelFile {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ModelFile && bool operator ==(Object other) => identical(this, other) || other is ModelFile &&
other.sourceURI == sourceURI; other.sourceURI == sourceURI;

View File

@ -33,6 +33,8 @@ class ModelList {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ModelList && bool operator ==(Object other) => identical(this, other) || other is ModelList &&
other.n123list == n123list; other.n123list == n123list;

View File

@ -33,6 +33,8 @@ class ModelReturn {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ModelReturn && bool operator ==(Object other) => identical(this, other) || other is ModelReturn &&
other.return_ == return_; other.return_ == return_;

View File

@ -75,6 +75,8 @@ class Name {
@override @override
bool operator ==(Object other) => identical(this, other) || other is Name && bool operator ==(Object other) => identical(this, other) || other is Name &&
other.name == name && other.name == name &&

View File

@ -187,6 +187,8 @@ class NullableClass {
@override @override
bool operator ==(Object other) => identical(this, other) || other is NullableClass && bool operator ==(Object other) => identical(this, other) || other is NullableClass &&
other.integerProp == integerProp && other.integerProp == integerProp &&

View File

@ -33,6 +33,8 @@ class NumberOnly {
@override @override
bool operator ==(Object other) => identical(this, other) || other is NumberOnly && bool operator ==(Object other) => identical(this, other) || other is NumberOnly &&
other.justNumber == justNumber; other.justNumber == justNumber;

View File

@ -79,6 +79,8 @@ class ObjectWithDeprecatedFields {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ObjectWithDeprecatedFields && bool operator ==(Object other) => identical(this, other) || other is ObjectWithDeprecatedFields &&
other.uuid == uuid && other.uuid == uuid &&

View File

@ -104,6 +104,8 @@ class Order {
@override @override
bool operator ==(Object other) => identical(this, other) || other is Order && bool operator ==(Object other) => identical(this, other) || other is Order &&
other.id == id && other.id == id &&

View File

@ -61,6 +61,8 @@ class OuterComposite {
@override @override
bool operator ==(Object other) => identical(this, other) || other is OuterComposite && bool operator ==(Object other) => identical(this, other) || other is OuterComposite &&
other.myNumber == myNumber && other.myNumber == myNumber &&

View File

@ -34,6 +34,8 @@ class OuterObjectWithEnumProperty {
@override @override
bool operator ==(Object other) => identical(this, other) || other is OuterObjectWithEnumProperty && bool operator ==(Object other) => identical(this, other) || other is OuterObjectWithEnumProperty &&
other.value == value; other.value == value;

View File

@ -47,6 +47,8 @@ class ParentWithNullable {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ParentWithNullable && bool operator ==(Object other) => identical(this, other) || other is ParentWithNullable &&
other.type == type && other.type == type &&

View File

@ -106,6 +106,8 @@ class Pet {
@override @override
bool operator ==(Object other) => identical(this, other) || other is Pet && bool operator ==(Object other) => identical(this, other) || other is Pet &&
other.id == id && other.id == id &&

View File

@ -47,6 +47,8 @@ class ReadOnlyFirst {
@override @override
bool operator ==(Object other) => identical(this, other) || other is ReadOnlyFirst && bool operator ==(Object other) => identical(this, other) || other is ReadOnlyFirst &&
other.bar == bar && other.bar == bar &&

View File

@ -33,6 +33,8 @@ class SpecialModelName {
@override @override
bool operator ==(Object other) => identical(this, other) || other is SpecialModelName && bool operator ==(Object other) => identical(this, other) || other is SpecialModelName &&
other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket;

View File

@ -47,6 +47,8 @@ class Tag {
@override @override
bool operator ==(Object other) => identical(this, other) || other is Tag && bool operator ==(Object other) => identical(this, other) || other is Tag &&
other.id == id && other.id == id &&

View File

@ -33,6 +33,8 @@ class TestInlineFreeformAdditionalPropertiesRequest {
@override @override
bool operator ==(Object other) => identical(this, other) || other is TestInlineFreeformAdditionalPropertiesRequest && bool operator ==(Object other) => identical(this, other) || other is TestInlineFreeformAdditionalPropertiesRequest &&
other.someProperty == someProperty; other.someProperty == someProperty;

View File

@ -132,6 +132,8 @@ class User {
@override @override
bool operator ==(Object other) => identical(this, other) || other is User && bool operator ==(Object other) => identical(this, other) || other is User &&
other.id == id && other.id == id &&