[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|
|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|
|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|
|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|

View File

@ -8545,7 +8545,7 @@ public class DefaultCodegen implements CodegenConfig {
// 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));

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_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 class DartDioClientCodegen extends AbstractDartCodegen {
serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT);
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
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<String, String> 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 class DartDioClientCodegen extends AbstractDartCodegen {
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 class DartDioClientCodegen extends AbstractDartCodegen {
}
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 class DartDioClientCodegen extends AbstractDartCodegen {
supportingFiles.add(new SupportingFile("auth/auth.mustache", authFolder, "auth.dart"));
configureSerializationLibrary(srcFolder);
configureEqualityCheckMethod(srcFolder);
configureDateLibrary(srcFolder);
}
@ -278,6 +308,17 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
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:

View File

@ -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}}

View File

@ -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<String, dynamic> json) => _${{{classname}}}FromJson(json);

View File

@ -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}}

View File

@ -20,6 +20,7 @@ package org.openapitools.codegen.dart;
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;

View File

@ -53,6 +53,7 @@ public class DartDioClientOptionsTest extends AbstractOptionsTest {
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));
}
}

View File

@ -64,6 +64,7 @@ public class DartDioClientOptionsProvider implements OptionsProvider {
.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)

View File

@ -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<String, dynamic> json) => _$AdditionalPropertiesClassFromJson(json);

View File

@ -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<String, dynamic> json) => _$AllOfWithSingleRefFromJson(json);

View File

@ -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<String, dynamic> json) => _$AnimalFromJson(json);

View File

@ -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<String, dynamic> json) => _$ApiResponseFromJson(json);

View File

@ -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<String, dynamic> json) => _$ArrayOfArrayOfNumberOnlyFromJson(json);

View File

@ -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<String, dynamic> json) => _$ArrayOfNumberOnlyFromJson(json);

View File

@ -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<String, dynamic> json) => _$ArrayTestFromJson(json);

View File

@ -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<String, dynamic> json) => _$CapitalizationFromJson(json);

View File

@ -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<String, dynamic> json) => _$CatFromJson(json);

View File

@ -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<String, dynamic> json) => _$CategoryFromJson(json);

View File

@ -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<String, dynamic> json) => _$ChildWithNullableFromJson(json);

View File

@ -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<String, dynamic> json) => _$ClassModelFromJson(json);

View File

@ -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<String, dynamic> json) => _$DeprecatedObjectFromJson(json);

View File

@ -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<String, dynamic> json) => _$DogFromJson(json);

View File

@ -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<String, dynamic> json) => _$EnumArraysFromJson(json);

View File

@ -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<String, dynamic> json) => _$EnumTestFromJson(json);

View File

@ -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<String, dynamic> json) => _$FakeBigDecimalMap200ResponseFromJson(json);

View File

@ -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<String, dynamic> json) => _$FileSchemaTestClassFromJson(json);

View File

@ -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<String, dynamic> json) => _$FooFromJson(json);

View File

@ -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<String, dynamic> json) => _$FooGetDefaultResponseFromJson(json);

View File

@ -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<String, dynamic> json) => _$FormatTestFromJson(json);

View File

@ -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<String, dynamic> json) => _$HasOnlyReadOnlyFromJson(json);

View File

@ -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<String, dynamic> json) => _$HealthCheckResultFromJson(json);

View File

@ -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<String, dynamic> json) => _$MapTestFromJson(json);

View File

@ -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<String, dynamic> json) => _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json);

View File

@ -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<String, dynamic> json) => _$Model200ResponseFromJson(json);

View File

@ -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<String, dynamic> json) => _$ModelClientFromJson(json);

View File

@ -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);

View File

@ -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<String, dynamic> json) => _$ModelFileFromJson(json);

View File

@ -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<String, dynamic> json) => _$ModelListFromJson(json);

View File

@ -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<String, dynamic> json) => _$ModelReturnFromJson(json);

View File

@ -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<String, dynamic> json) => _$NameFromJson(json);

View File

@ -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<String, dynamic> json) => _$NullableClassFromJson(json);

View File

@ -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<String, dynamic> json) => _$NumberOnlyFromJson(json);

View File

@ -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<String, dynamic> json) => _$ObjectWithDeprecatedFieldsFromJson(json);

View File

@ -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<String, dynamic> json) => _$OrderFromJson(json);

View File

@ -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<String, dynamic> json) => _$OuterCompositeFromJson(json);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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<String, dynamic> json) => _$OuterObjectWithEnumPropertyFromJson(json);

View File

@ -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<String, dynamic> json) => _$ParentWithNullableFromJson(json);

View File

@ -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<String, dynamic> json) => _$PetFromJson(json);

View File

@ -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<String, dynamic> json) => _$ReadOnlyFirstFromJson(json);

View File

@ -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);

View File

@ -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<String, dynamic> json) => _$SpecialModelNameFromJson(json);

View File

@ -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<String, dynamic> json) => _$TagFromJson(json);

View File

@ -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<String, dynamic> json) => _$TestInlineFreeformAdditionalPropertiesRequestFromJson(json);

View File

@ -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<String, dynamic> json) => _$UserFromJson(json);