diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java index 4d7eb4dbe7c1..336f0aa3db03 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java @@ -719,6 +719,19 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required) { property.isModel = true; }); + } else if (property.isEnum) { + // Multi-element anyOf/oneOf where the default codegen guessed at an + // inline enum (e.g. anyOf of [$ref enum, inline literal enum]). The + // dart generator can't produce a single enum class that covers all + // branches, and the inline-enum template is suppressed for composed + // schemas, so we'd emit references to an enum class that is never + // declared anywhere in lib/model/. Collapse the property to its + // underlying primitive type instead. + property.isEnum = false; + property.datatypeWithEnum = property.dataType; + property.enumName = null; + property.allowableValues = null; + property._enum = null; } } return property; diff --git a/modules/openapi-generator/src/main/resources/dart2/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart2/dart_constructor.mustache index 29f362d5e58e..84e9af230f24 100644 --- a/modules/openapi-generator/src/main/resources/dart2/dart_constructor.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/dart_constructor.mustache @@ -1,5 +1,5 @@ /// Returns a new [{{{classname}}}] instance. - {{{classname}}}({ + {{{classname}}}({{#hasVars}}{ {{#vars}} {{! A field is required in Dart when it is @@ -7,4 +7,4 @@ }} {{^required}}{{#vendorExtensions.x-is-optional}}this.{{{name}}}{{#defaultValue}} = const Optional.present({{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{.}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^defaultValue}} = const Optional.absent(){{/defaultValue}},{{/vendorExtensions.x-is-optional}}{{/required}}{{^required}}{{^vendorExtensions.x-is-optional}}this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{.}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}},{{/vendorExtensions.x-is-optional}}{{/required}}{{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}}{{#required}}this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{.}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}},{{/required}} {{/vars}} - }); + }{{/hasVars}}); diff --git a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache index ddc6d6c06133..1a5128f220ed 100644 --- a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache @@ -47,17 +47,17 @@ class {{{classname}}} { {{/vars}} @override - bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && + bool operator ==(Object other) => identical(this, other) || other is {{{classname}}}{{#hasVars}} && {{#vars}} {{#isMap}}_deepEquality.equals(other.{{{name}}}, {{{name}}}){{/isMap}}{{^isMap}}{{#isArray}}_deepEquality.equals(other.{{{name}}}, {{{name}}}){{/isArray}}{{^isArray}}other.{{{name}}} == {{{name}}}{{/isArray}}{{/isMap}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} - {{/vars}} + {{/vars}}{{/hasVars}}{{^hasVars}};{{/hasVars}} @override int get hashCode => // ignore: unnecessary_parenthesis {{#vars}} ({{#isNullable}}{{{name}}} == null ? 0 : {{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}{{{name}}} == null ? 0 : {{/defaultValue}}{{/required}}{{/isNullable}}{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}} - {{/vars}} + {{/vars}}{{^hasVars}} 0;{{/hasVars}} @override String toString() => '{{{classname}}}[{{#vars}}{{{name}}}=${{{name}}}{{^-last}}, {{/-last}}{{/vars}}]'; @@ -228,7 +228,7 @@ class {{{classname}}} { {{{name}}}: {{items.complexType}}.mapFromJson(json[r'{{{baseName}}}']), {{/items.complexType}} {{^items.complexType}} - {{{name}}}: mapCastOfType(json, r'{{{baseName}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, + {{{name}}}: (json[r'{{{baseName}}}'] as Map?)?.map((k, v) => MapEntry(k as String, (v as Map).cast())){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, {{/items.complexType}} {{/items.isMap}} {{^items.isMap}} diff --git a/modules/openapi-generator/src/test/resources/3_0/dart/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/dart/petstore-with-fake-endpoints-models-for-testing.yaml index eec97cecc18f..420e23720c29 100644 --- a/modules/openapi-generator/src/test/resources/3_0/dart/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/dart/petstore-with-fake-endpoints-models-for-testing.yaml @@ -2141,3 +2141,54 @@ components: $ref: '#/components/schemas/ObjectWithInlineEnum' object_two: $ref: '#/components/schemas/ObjectWithDuplicateInlineEnum' + PetReactionStatus: + type: string + title: PetReactionStatus + enum: + - liked + - disliked + - barked + PetReactionResponse: + type: object + description: | + Reproduces a bug where anyOf between a named-enum $ref and an inline + literal-enum produced a property typed as an undeclared enum class. + Generator must either inline a proper enum or fall back to String. + properties: + petId: + type: integer + format: int64 + status: + anyOf: + - $ref: '#/components/schemas/PetReactionStatus' + - type: string + enum: + - pending-verification + PetEmptyMetadata: + description: | + Reproduces a bug where a schema that resolves to a class with zero + properties (e.g. an empty oneOf wrapper) emitted invalid Dart syntax + in `==`, `hashCode`, and the named-args constructor. + oneOf: + - type: string + - type: integer + PetReactionsResponse: + type: object + description: | + Reproduces a bug where nested `Map>` properties + were decoded with a single-level `mapCastOfType` cast + that can't be assigned to the declared field type. + properties: + myReacts: + type: object + additionalProperties: + type: object + additionalProperties: + type: boolean + reactionCounts: + type: object + additionalProperties: + type: object + additionalProperties: + type: integer + format: int32 diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES index a3483714374f..b5feb2a5d87a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -56,6 +56,10 @@ doc/OuterObjectWithEnumProperty.md doc/ParentWithNullable.md doc/Pet.md doc/PetApi.md +doc/PetEmptyMetadata.md +doc/PetReactionResponse.md +doc/PetReactionStatus.md +doc/PetReactionsResponse.md doc/ReadOnlyFirst.md doc/SingleRefType.md doc/SpecialModelName.md @@ -129,6 +133,10 @@ lib/src/model/outer_enum_integer_default_value.dart lib/src/model/outer_object_with_enum_property.dart lib/src/model/parent_with_nullable.dart lib/src/model/pet.dart +lib/src/model/pet_empty_metadata.dart +lib/src/model/pet_reaction_response.dart +lib/src/model/pet_reaction_status.dart +lib/src/model/pet_reactions_response.dart lib/src/model/read_only_first.dart lib/src/model/single_ref_type.dart lib/src/model/special_model_name.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md index 35d389a002b7..6229408edbd9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md @@ -166,6 +166,10 @@ Class | Method | HTTP request | Description - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) - [ParentWithNullable](doc/ParentWithNullable.md) - [Pet](doc/Pet.md) + - [PetEmptyMetadata](doc/PetEmptyMetadata.md) + - [PetReactionResponse](doc/PetReactionResponse.md) + - [PetReactionStatus](doc/PetReactionStatus.md) + - [PetReactionsResponse](doc/PetReactionsResponse.md) - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - [SingleRefType](doc/SingleRefType.md) - [SpecialModelName](doc/SpecialModelName.md) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetEmptyMetadata.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetEmptyMetadata.md new file mode 100644 index 000000000000..0ae2218444e8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetEmptyMetadata.md @@ -0,0 +1,14 @@ +# openapi.model.PetEmptyMetadata + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetReactionResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetReactionResponse.md new file mode 100644 index 000000000000..865eb33d3c4f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetReactionResponse.md @@ -0,0 +1,16 @@ +# openapi.model.PetReactionResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**petId** | **int** | | [optional] +**status** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetReactionStatus.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetReactionStatus.md new file mode 100644 index 000000000000..1e1d1107b9ba --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetReactionStatus.md @@ -0,0 +1,14 @@ +# openapi.model.PetReactionStatus + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetReactionsResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetReactionsResponse.md new file mode 100644 index 000000000000..40c1e7a8c5a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetReactionsResponse.md @@ -0,0 +1,16 @@ +# openapi.model.PetReactionsResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myReacts** | [**Map<String, Map<String, bool>>**](Map.md) | | [optional] +**reactionCounts** | [**Map<String, Map<String, int>>**](Map.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart index 6f9f9c4e11ab..cf1e40105cf9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart @@ -66,6 +66,10 @@ export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; export 'package:openapi/src/model/outer_object_with_enum_property.dart'; export 'package:openapi/src/model/parent_with_nullable.dart'; export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/pet_empty_metadata.dart'; +export 'package:openapi/src/model/pet_reaction_response.dart'; +export 'package:openapi/src/model/pet_reaction_status.dart'; +export 'package:openapi/src/model/pet_reactions_response.dart'; export 'package:openapi/src/model/read_only_first.dart'; export 'package:openapi/src/model/single_ref_type.dart'; export 'package:openapi/src/model/special_model_name.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart index ebb014d5076a..e48a86fbdff2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart @@ -42,6 +42,9 @@ import 'package:openapi/src/model/outer_composite.dart'; import 'package:openapi/src/model/outer_object_with_enum_property.dart'; import 'package:openapi/src/model/parent_with_nullable.dart'; import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/pet_empty_metadata.dart'; +import 'package:openapi/src/model/pet_reaction_response.dart'; +import 'package:openapi/src/model/pet_reactions_response.dart'; import 'package:openapi/src/model/read_only_first.dart'; import 'package:openapi/src/model/special_model_name.dart'; import 'package:openapi/src/model/tag.dart'; @@ -169,6 +172,15 @@ final _regMap = RegExp(r'^Map$'); return ParentWithNullable.fromJson(value as Map) as ReturnType; case 'Pet': return Pet.fromJson(value as Map) as ReturnType; + case 'PetEmptyMetadata': + return PetEmptyMetadata.fromJson(value as Map) as ReturnType; + case 'PetReactionResponse': + return PetReactionResponse.fromJson(value as Map) as ReturnType; + case 'PetReactionStatus': + + + case 'PetReactionsResponse': + return PetReactionsResponse.fromJson(value as Map) as ReturnType; case 'ReadOnlyFirst': return ReadOnlyFirst.fromJson(value as Map) as ReturnType; case 'SingleRefType': diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_empty_metadata.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_empty_metadata.dart new file mode 100644 index 000000000000..e7d80f93b150 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_empty_metadata.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pet_empty_metadata.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PetEmptyMetadata { + /// Returns a new [PetEmptyMetadata] instance. + PetEmptyMetadata({ + }); + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PetEmptyMetadata && + + @override + int get hashCode => + + factory PetEmptyMetadata.fromJson(Map json) => _$PetEmptyMetadataFromJson(json); + + Map toJson() => _$PetEmptyMetadataToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_reaction_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_reaction_response.dart new file mode 100644 index 000000000000..63a55db00fb5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_reaction_response.dart @@ -0,0 +1,74 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pet_reaction_response.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PetReactionResponse { + /// Returns a new [PetReactionResponse] instance. + PetReactionResponse({ + + this.petId, + + this.status, + }); + + @JsonKey( + + name: r'petId', + required: false, + includeIfNull: false, + ) + + + final int? petId; + + + + @JsonKey( + + name: r'status', + required: false, + includeIfNull: false, + ) + + + final String? status; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PetReactionResponse && + other.petId == petId && + other.status == status; + + @override + int get hashCode => + petId.hashCode + + status.hashCode; + + factory PetReactionResponse.fromJson(Map json) => _$PetReactionResponseFromJson(json); + + Map toJson() => _$PetReactionResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_reaction_status.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_reaction_status.dart new file mode 100644 index 000000000000..05d0c243f2be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_reaction_status.dart @@ -0,0 +1,25 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum PetReactionStatus { + @JsonValue(r'liked') + liked(r'liked'), + @JsonValue(r'disliked') + disliked(r'disliked'), + @JsonValue(r'barked') + barked(r'barked'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); + + const PetReactionStatus(this.value); + + final String value; + + @override + String toString() => value; +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_reactions_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_reactions_response.dart new file mode 100644 index 000000000000..dcbd6837110f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet_reactions_response.dart @@ -0,0 +1,74 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pet_reactions_response.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PetReactionsResponse { + /// Returns a new [PetReactionsResponse] instance. + PetReactionsResponse({ + + this.myReacts, + + this.reactionCounts, + }); + + @JsonKey( + + name: r'myReacts', + required: false, + includeIfNull: false, + ) + + + final Map>? myReacts; + + + + @JsonKey( + + name: r'reactionCounts', + required: false, + includeIfNull: false, + ) + + + final Map>? reactionCounts; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PetReactionsResponse && + other.myReacts == myReacts && + other.reactionCounts == reactionCounts; + + @override + int get hashCode => + myReacts.hashCode + + reactionCounts.hashCode; + + factory PetReactionsResponse.fromJson(Map json) => _$PetReactionsResponseFromJson(json); + + Map toJson() => _$PetReactionsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_empty_metadata_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_empty_metadata_test.dart new file mode 100644 index 000000000000..370de630725c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_empty_metadata_test.dart @@ -0,0 +1,11 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PetEmptyMetadata +void main() { + final PetEmptyMetadata? instance = /* PetEmptyMetadata(...) */ null; + // TODO add properties to the entity + + group(PetEmptyMetadata, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_reaction_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_reaction_response_test.dart new file mode 100644 index 000000000000..8bf360a6ed6b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_reaction_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PetReactionResponse +void main() { + final PetReactionResponse? instance = /* PetReactionResponse(...) */ null; + // TODO add properties to the entity + + group(PetReactionResponse, () { + // int petId + test('to test the property `petId`', () async { + // TODO + }); + + // String status + test('to test the property `status`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_reaction_status_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_reaction_status_test.dart new file mode 100644 index 000000000000..2ebe0f44f163 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_reaction_status_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PetReactionStatus +void main() { + + group(PetReactionStatus, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_reactions_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_reactions_response_test.dart new file mode 100644 index 000000000000..09da73e2257f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_reactions_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PetReactionsResponse +void main() { + final PetReactionsResponse? instance = /* PetReactionsResponse(...) */ null; + // TODO add properties to the entity + + group(PetReactionsResponse, () { + // Map> myReacts + test('to test the property `myReacts`', () async { + // TODO + }); + + // Map> reactionCounts + test('to test the property `reactionCounts`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES index c70cda02a13d..8d30cbb7bf66 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES @@ -55,6 +55,10 @@ doc/OuterObjectWithEnumProperty.md doc/ParentWithNullable.md doc/Pet.md doc/PetApi.md +doc/PetEmptyMetadata.md +doc/PetReactionResponse.md +doc/PetReactionStatus.md +doc/PetReactionsResponse.md doc/ReadOnlyFirst.md doc/SingleRefType.md doc/SpecialModelName.md @@ -130,6 +134,10 @@ lib/src/model/outer_enum_integer_default_value.dart lib/src/model/outer_object_with_enum_property.dart lib/src/model/parent_with_nullable.dart lib/src/model/pet.dart +lib/src/model/pet_empty_metadata.dart +lib/src/model/pet_reaction_response.dart +lib/src/model/pet_reaction_status.dart +lib/src/model/pet_reactions_response.dart lib/src/model/read_only_first.dart lib/src/model/single_ref_type.dart lib/src/model/special_model_name.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md index 37857acea508..1011e7ef0c33 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md @@ -165,6 +165,10 @@ Class | Method | HTTP request | Description - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) - [ParentWithNullable](doc/ParentWithNullable.md) - [Pet](doc/Pet.md) + - [PetEmptyMetadata](doc/PetEmptyMetadata.md) + - [PetReactionResponse](doc/PetReactionResponse.md) + - [PetReactionStatus](doc/PetReactionStatus.md) + - [PetReactionsResponse](doc/PetReactionsResponse.md) - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - [SingleRefType](doc/SingleRefType.md) - [SpecialModelName](doc/SpecialModelName.md) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetEmptyMetadata.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetEmptyMetadata.md new file mode 100644 index 000000000000..0ae2218444e8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetEmptyMetadata.md @@ -0,0 +1,14 @@ +# openapi.model.PetEmptyMetadata + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetReactionResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetReactionResponse.md new file mode 100644 index 000000000000..865eb33d3c4f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetReactionResponse.md @@ -0,0 +1,16 @@ +# openapi.model.PetReactionResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**petId** | **int** | | [optional] +**status** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetReactionStatus.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetReactionStatus.md new file mode 100644 index 000000000000..1e1d1107b9ba --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetReactionStatus.md @@ -0,0 +1,14 @@ +# openapi.model.PetReactionStatus + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetReactionsResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetReactionsResponse.md new file mode 100644 index 000000000000..4374ad5e0f56 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetReactionsResponse.md @@ -0,0 +1,16 @@ +# openapi.model.PetReactionsResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myReacts** | [**BuiltMap<String, BuiltMap<String, bool>>**](BuiltMap.md) | | [optional] +**reactionCounts** | [**BuiltMap<String, BuiltMap<String, int>>**](BuiltMap.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart index 0eae8eb4a6df..29e9e46c2026 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart @@ -67,6 +67,10 @@ export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; export 'package:openapi/src/model/outer_object_with_enum_property.dart'; export 'package:openapi/src/model/parent_with_nullable.dart'; export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/pet_empty_metadata.dart'; +export 'package:openapi/src/model/pet_reaction_response.dart'; +export 'package:openapi/src/model/pet_reaction_status.dart'; +export 'package:openapi/src/model/pet_reactions_response.dart'; export 'package:openapi/src/model/read_only_first.dart'; export 'package:openapi/src/model/single_ref_type.dart'; export 'package:openapi/src/model/special_model_name.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_empty_metadata.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_empty_metadata.dart new file mode 100644 index 000000000000..f3325df2238b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_empty_metadata.dart @@ -0,0 +1,68 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'dart:core'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'pet_empty_metadata.g.dart'; + +/// Reproduces a bug where a schema that resolves to a class with zero properties (e.g. an empty oneOf wrapper) emitted invalid Dart syntax in `==`, `hashCode`, and the named-args constructor. +@BuiltValue() +abstract class PetEmptyMetadata implements Built { + /// One Of [String], [int] + OneOf get oneOf; + + PetEmptyMetadata._(); + + factory PetEmptyMetadata([void updates(PetEmptyMetadataBuilder b)]) = _$PetEmptyMetadata; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PetEmptyMetadataBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PetEmptyMetadataSerializer(); +} + +class _$PetEmptyMetadataSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PetEmptyMetadata, _$PetEmptyMetadata]; + + @override + final String wireName = r'PetEmptyMetadata'; + + Iterable _serializeProperties( + Serializers serializers, + PetEmptyMetadata object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + PetEmptyMetadata object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + PetEmptyMetadata deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PetEmptyMetadataBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [FullType(String), FullType(int), ]); + oneOfDataSrc = serialized; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_reaction_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_reaction_response.dart new file mode 100644 index 000000000000..d5442e9af563 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_reaction_response.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pet_reaction_response.g.dart'; + +/// Reproduces a bug where anyOf between a named-enum $ref and an inline literal-enum produced a property typed as an undeclared enum class. Generator must either inline a proper enum or fall back to String. +/// +/// Properties: +/// * [petId] +/// * [status] +@BuiltValue() +abstract class PetReactionResponse implements Built { + @BuiltValueField(wireName: r'petId') + int? get petId; + + @BuiltValueField(wireName: r'status') + String? get status; + + PetReactionResponse._(); + + factory PetReactionResponse([void updates(PetReactionResponseBuilder b)]) = _$PetReactionResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PetReactionResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PetReactionResponseSerializer(); +} + +class _$PetReactionResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PetReactionResponse, _$PetReactionResponse]; + + @override + final String wireName = r'PetReactionResponse'; + + Iterable _serializeProperties( + Serializers serializers, + PetReactionResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.petId != null) { + yield r'petId'; + yield serializers.serialize( + object.petId, + specifiedType: const FullType(int), + ); + } + if (object.status != null) { + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + PetReactionResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PetReactionResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'petId': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.petId = valueDes; + break; + case r'status': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.status = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PetReactionResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PetReactionResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_reaction_status.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_reaction_status.dart new file mode 100644 index 000000000000..2354ae5010aa --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_reaction_status.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pet_reaction_status.g.dart'; + +class PetReactionStatus extends EnumClass { + + @BuiltValueEnumConst(wireName: r'liked') + static const PetReactionStatus liked = _$liked; + @BuiltValueEnumConst(wireName: r'disliked') + static const PetReactionStatus disliked = _$disliked; + @BuiltValueEnumConst(wireName: r'barked') + static const PetReactionStatus barked = _$barked; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const PetReactionStatus unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$petReactionStatusSerializer; + + const PetReactionStatus._(String name): super(name); + + static BuiltSet get values => _$values; + static PetReactionStatus valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class PetReactionStatusMixin = Object with _$PetReactionStatusMixin; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_reactions_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_reactions_response.dart new file mode 100644 index 000000000000..c996f3d14d2f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet_reactions_response.dart @@ -0,0 +1,127 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pet_reactions_response.g.dart'; + +/// Reproduces a bug where nested `Map>` properties were decoded with a single-level `mapCastOfType` cast that can't be assigned to the declared field type. +/// +/// Properties: +/// * [myReacts] +/// * [reactionCounts] +@BuiltValue() +abstract class PetReactionsResponse implements Built { + @BuiltValueField(wireName: r'myReacts') + BuiltMap>? get myReacts; + + @BuiltValueField(wireName: r'reactionCounts') + BuiltMap>? get reactionCounts; + + PetReactionsResponse._(); + + factory PetReactionsResponse([void updates(PetReactionsResponseBuilder b)]) = _$PetReactionsResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PetReactionsResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PetReactionsResponseSerializer(); +} + +class _$PetReactionsResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PetReactionsResponse, _$PetReactionsResponse]; + + @override + final String wireName = r'PetReactionsResponse'; + + Iterable _serializeProperties( + Serializers serializers, + PetReactionsResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.myReacts != null) { + yield r'myReacts'; + yield serializers.serialize( + object.myReacts, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(bool)])]), + ); + } + if (object.reactionCounts != null) { + yield r'reactionCounts'; + yield serializers.serialize( + object.reactionCounts, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(int)])]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + PetReactionsResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PetReactionsResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'myReacts': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(bool)])]), + ) as BuiltMap>; + result.myReacts.replace(valueDes); + break; + case r'reactionCounts': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(int)])]), + ) as BuiltMap>; + result.reactionCounts.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PetReactionsResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PetReactionsResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart index f55ca699ac78..51b42764ddb7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart @@ -63,6 +63,10 @@ import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; import 'package:openapi/src/model/outer_object_with_enum_property.dart'; import 'package:openapi/src/model/parent_with_nullable.dart'; import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/pet_empty_metadata.dart'; +import 'package:openapi/src/model/pet_reaction_response.dart'; +import 'package:openapi/src/model/pet_reaction_status.dart'; +import 'package:openapi/src/model/pet_reactions_response.dart'; import 'package:openapi/src/model/read_only_first.dart'; import 'package:openapi/src/model/single_ref_type.dart'; import 'package:openapi/src/model/special_model_name.dart'; @@ -123,6 +127,10 @@ part 'serializers.g.dart'; OuterObjectWithEnumProperty, ParentWithNullable,$ParentWithNullable, Pet, + PetEmptyMetadata, + PetReactionResponse, + PetReactionStatus, + PetReactionsResponse, ReadOnlyFirst, SingleRefType, SpecialModelName, @@ -164,6 +172,10 @@ Serializers serializers = (_$serializers.toBuilder() const FullType(BuiltList, [FullType(ModelEnumClass)]), () => ListBuilder(), ) + ..addBuilderFactory( + const FullType(BuiltMap, [FullType(String), FullType(bool)]), + () => MapBuilder(), + ) ..addBuilderFactory( const FullType(BuiltList, [FullType(String)]), () => ListBuilder(), diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_empty_metadata_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_empty_metadata_test.dart new file mode 100644 index 000000000000..8f8d9314b431 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_empty_metadata_test.dart @@ -0,0 +1,11 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PetEmptyMetadata +void main() { + final instance = PetEmptyMetadataBuilder(); + // TODO add properties to the builder and call build() + + group(PetEmptyMetadata, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_reaction_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_reaction_response_test.dart new file mode 100644 index 000000000000..eee734e9f50d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_reaction_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PetReactionResponse +void main() { + final instance = PetReactionResponseBuilder(); + // TODO add properties to the builder and call build() + + group(PetReactionResponse, () { + // int petId + test('to test the property `petId`', () async { + // TODO + }); + + // String status + test('to test the property `status`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_reaction_status_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_reaction_status_test.dart new file mode 100644 index 000000000000..2ebe0f44f163 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_reaction_status_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PetReactionStatus +void main() { + + group(PetReactionStatus, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_reactions_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_reactions_response_test.dart new file mode 100644 index 000000000000..b5f2402825a8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_reactions_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PetReactionsResponse +void main() { + final instance = PetReactionsResponseBuilder(); + // TODO add properties to the builder and call build() + + group(PetReactionsResponse, () { + // BuiltMap> myReacts + test('to test the property `myReacts`', () async { + // TODO + }); + + // BuiltMap> reactionCounts + test('to test the property `reactionCounts`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart index 4ae4da84e37b..de07a8c4bcdc 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart @@ -45,15 +45,17 @@ class ApiResponse { @override bool operator ==(Object other) => identical(this, other) || other is ApiResponse && other.code == code && - other.type == type && - other.message == message; + other.type == type && + other.message == message; + @override int get hashCode => // ignore: unnecessary_parenthesis (code == null ? 0 : code!.hashCode) + - (type == null ? 0 : type!.hashCode) + - (message == null ? 0 : message!.hashCode); + (type == null ? 0 : type!.hashCode) + + (message == null ? 0 : message!.hashCode); + @override String toString() => 'ApiResponse[code=$code, type=$type, message=$message]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/category.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/category.dart index 84abdf613706..1f75a9c6266e 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/category.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/category.dart @@ -36,13 +36,15 @@ class Category { @override bool operator ==(Object other) => identical(this, other) || other is Category && other.id == id && - other.name == name; + other.name == name; + @override int get hashCode => // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + - (name == null ? 0 : name!.hashCode); + (name == null ? 0 : name!.hashCode); + @override String toString() => 'Category[id=$id, name=$name]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart index c6597f735d64..51c5acfd88c0 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart @@ -61,21 +61,23 @@ 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; + other.petId == petId && + other.quantity == quantity && + other.shipDate == shipDate && + other.status == status && + other.complete == complete; + @override int get hashCode => // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + - (petId == null ? 0 : petId!.hashCode) + - (quantity == null ? 0 : quantity!.hashCode) + - (shipDate == null ? 0 : shipDate!.hashCode) + - (status == null ? 0 : status!.hashCode) + - (complete.hashCode); + (petId == null ? 0 : petId!.hashCode) + + (quantity == null ? 0 : quantity!.hashCode) + + (shipDate == null ? 0 : shipDate!.hashCode) + + (status == null ? 0 : status!.hashCode) + + (complete.hashCode); + @override String toString() => 'Order[id=$id, petId=$petId, quantity=$quantity, shipDate=$shipDate, status=$status, complete=$complete]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart index c8e0a76ba377..00a3a5d17429 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart @@ -49,21 +49,23 @@ class Pet { @override bool operator ==(Object other) => identical(this, other) || other is Pet && other.id == id && - other.category == category && - other.name == name && - _deepEquality.equals(other.photoUrls, photoUrls) && - _deepEquality.equals(other.tags, tags) && - other.status == status; + other.category == category && + other.name == name && + _deepEquality.equals(other.photoUrls, photoUrls) && + _deepEquality.equals(other.tags, tags) && + other.status == status; + @override int get hashCode => // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + - (category == null ? 0 : category!.hashCode) + - (name.hashCode) + - (photoUrls.hashCode) + - (tags.hashCode) + - (status == null ? 0 : status!.hashCode); + (category == null ? 0 : category!.hashCode) + + (name.hashCode) + + (photoUrls.hashCode) + + (tags.hashCode) + + (status == null ? 0 : status!.hashCode); + @override String toString() => 'Pet[id=$id, category=$category, name=$name, photoUrls=$photoUrls, tags=$tags, status=$status]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart index 519cc76dbf17..0aaeeae46e30 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart @@ -36,13 +36,15 @@ class Tag { @override bool operator ==(Object other) => identical(this, other) || other is Tag && other.id == id && - other.name == name; + other.name == name; + @override int get hashCode => // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + - (name == null ? 0 : name!.hashCode); + (name == null ? 0 : name!.hashCode); + @override String toString() => 'Tag[id=$id, name=$name]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/user.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/user.dart index 1d283f499266..2514791f288a 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/user.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/user.dart @@ -91,25 +91,27 @@ 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; + 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 => // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + - (username == null ? 0 : username!.hashCode) + - (firstName == null ? 0 : firstName!.hashCode) + - (lastName == null ? 0 : lastName!.hashCode) + - (email == null ? 0 : email!.hashCode) + - (password == null ? 0 : password!.hashCode) + - (phone == null ? 0 : phone!.hashCode) + - (userStatus == null ? 0 : userStatus!.hashCode); + (username == null ? 0 : username!.hashCode) + + (firstName == null ? 0 : firstName!.hashCode) + + (lastName == null ? 0 : lastName!.hashCode) + + (email == null ? 0 : email!.hashCode) + + (password == null ? 0 : password!.hashCode) + + (phone == null ? 0 : phone!.hashCode) + + (userStatus == null ? 0 : userStatus!.hashCode); + @override String toString() => 'User[id=$id, username=$username, firstName=$firstName, lastName=$lastName, email=$email, password=$password, phone=$phone, userStatus=$userStatus]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES index 276e90e59908..ab8f85215c94 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES @@ -56,6 +56,10 @@ doc/OuterObjectWithEnumProperty.md doc/ParentWithNullable.md doc/Pet.md doc/PetApi.md +doc/PetEmptyMetadata.md +doc/PetReactionResponse.md +doc/PetReactionStatus.md +doc/PetReactionsResponse.md doc/ReadOnlyFirst.md doc/SingleRefType.md doc/SpecialModelName.md @@ -131,6 +135,10 @@ lib/model/outer_enum_integer_default_value.dart lib/model/outer_object_with_enum_property.dart lib/model/parent_with_nullable.dart lib/model/pet.dart +lib/model/pet_empty_metadata.dart +lib/model/pet_reaction_response.dart +lib/model/pet_reaction_status.dart +lib/model/pet_reactions_response.dart lib/model/read_only_first.dart lib/model/single_ref_type.dart lib/model/special_model_name.dart diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md index de9badc771dc..12c10441d500 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md @@ -159,6 +159,10 @@ Class | Method | HTTP request | Description - [OuterObjectWithEnumProperty](doc//OuterObjectWithEnumProperty.md) - [ParentWithNullable](doc//ParentWithNullable.md) - [Pet](doc//Pet.md) + - [PetEmptyMetadata](doc//PetEmptyMetadata.md) + - [PetReactionResponse](doc//PetReactionResponse.md) + - [PetReactionStatus](doc//PetReactionStatus.md) + - [PetReactionsResponse](doc//PetReactionsResponse.md) - [ReadOnlyFirst](doc//ReadOnlyFirst.md) - [SingleRefType](doc//SingleRefType.md) - [SpecialModelName](doc//SpecialModelName.md) diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetEmptyMetadata.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetEmptyMetadata.md new file mode 100644 index 000000000000..0ae2218444e8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetEmptyMetadata.md @@ -0,0 +1,14 @@ +# openapi.model.PetEmptyMetadata + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetReactionResponse.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetReactionResponse.md new file mode 100644 index 000000000000..865eb33d3c4f --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetReactionResponse.md @@ -0,0 +1,16 @@ +# openapi.model.PetReactionResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**petId** | **int** | | [optional] +**status** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetReactionStatus.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetReactionStatus.md new file mode 100644 index 000000000000..1e1d1107b9ba --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetReactionStatus.md @@ -0,0 +1,14 @@ +# openapi.model.PetReactionStatus + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetReactionsResponse.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetReactionsResponse.md new file mode 100644 index 000000000000..5df688e216a1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/PetReactionsResponse.md @@ -0,0 +1,16 @@ +# openapi.model.PetReactionsResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myReacts** | [**Map>**](Map.md) | | [optional] [default to const {}] +**reactionCounts** | [**Map>**](Map.md) | | [optional] [default to const {}] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart index 4dd7698021e2..ec89f45aa1fd 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart @@ -85,6 +85,10 @@ part 'model/outer_enum_integer_default_value.dart'; part 'model/outer_object_with_enum_property.dart'; part 'model/parent_with_nullable.dart'; part 'model/pet.dart'; +part 'model/pet_empty_metadata.dart'; +part 'model/pet_reaction_response.dart'; +part 'model/pet_reaction_status.dart'; +part 'model/pet_reactions_response.dart'; part 'model/read_only_first.dart'; part 'model/single_ref_type.dart'; part 'model/special_model_name.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart index 7deaf18cebeb..e8f63f47cf46 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart @@ -280,6 +280,14 @@ class ApiClient { return ParentWithNullable.fromJson(value); case 'Pet': return Pet.fromJson(value); + case 'PetEmptyMetadata': + return PetEmptyMetadata.fromJson(value); + case 'PetReactionResponse': + return PetReactionResponse.fromJson(value); + case 'PetReactionStatus': + return PetReactionStatusTypeTransformer().decode(value); + case 'PetReactionsResponse': + return PetReactionsResponse.fromJson(value); case 'ReadOnlyFirst': return ReadOnlyFirst.fromJson(value); case 'SingleRefType': diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_helper.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_helper.dart index d4cebed49204..b955a33e3752 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_helper.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_helper.dart @@ -70,6 +70,9 @@ String parameterToString(dynamic value) { if (value is OuterEnumIntegerDefaultValue) { return OuterEnumIntegerDefaultValueTypeTransformer().encode(value).toString(); } + if (value is PetReactionStatus) { + return PetReactionStatusTypeTransformer().encode(value).toString(); + } if (value is SingleRefType) { return SingleRefTypeTypeTransformer().encode(value).toString(); } diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/additional_properties_class.dart index 5bc1fc5c7802..37fb7a92529f 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/additional_properties_class.dart @@ -27,15 +27,17 @@ class AdditionalPropertiesClass { @override bool operator ==(Object other) => identical(this, other) || other is AdditionalPropertiesClass && _deepEquality.equals(other.mapProperty, mapProperty) && - _deepEquality.equals(other.mapOfMapProperty, mapOfMapProperty) && - _deepEquality.equals(other.mapOfArrayInteger, mapOfArrayInteger); + _deepEquality.equals(other.mapOfMapProperty, mapOfMapProperty) && + _deepEquality.equals(other.mapOfArrayInteger, mapOfArrayInteger); + @override int get hashCode => // ignore: unnecessary_parenthesis (mapProperty.hashCode) + - (mapOfMapProperty.hashCode) + - (mapOfArrayInteger.hashCode); + (mapOfMapProperty.hashCode) + + (mapOfArrayInteger.hashCode); + @override String toString() => 'AdditionalPropertiesClass[mapProperty=$mapProperty, mapOfMapProperty=$mapOfMapProperty, mapOfArrayInteger=$mapOfArrayInteger]'; @@ -64,7 +66,7 @@ class AdditionalPropertiesClass { return AdditionalPropertiesClass( mapProperty: mapCastOfType(json, r'map_property') ?? const {}, - mapOfMapProperty: mapCastOfType(json, r'map_of_map_property') ?? const {}, + mapOfMapProperty: (json[r'map_of_map_property'] as Map?)?.map((k, v) => MapEntry(k as String, (v as Map).cast())) ?? const {}, mapOfArrayInteger: json[r'map_of_array_integer'] == null ? const {} : (json[r'map_of_array_integer'] as Map).map((k, v) => MapEntry(k, v == null ? const [] : (v as List).cast())), diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/all_of_with_single_ref.dart index 4b9734051976..e7ad86f4d127 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/all_of_with_single_ref.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/all_of_with_single_ref.dart @@ -36,13 +36,15 @@ class AllOfWithSingleRef { @override bool operator ==(Object other) => identical(this, other) || other is AllOfWithSingleRef && other.username == username && - other.singleRefType == singleRefType; + other.singleRefType == singleRefType; + @override int get hashCode => // ignore: unnecessary_parenthesis (username == null ? 0 : username!.hashCode) + - (singleRefType == null ? 0 : singleRefType!.hashCode); + (singleRefType == null ? 0 : singleRefType!.hashCode); + @override String toString() => 'AllOfWithSingleRef[username=$username, singleRefType=$singleRefType]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/animal.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/animal.dart index 7af5a98e5318..c5149361bea0 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/animal.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/animal.dart @@ -24,13 +24,15 @@ class Animal { @override bool operator ==(Object other) => identical(this, other) || other is Animal && other.className == className && - other.color == color; + other.color == color; + @override int get hashCode => // ignore: unnecessary_parenthesis (className.hashCode) + - (color.hashCode); + (color.hashCode); + @override String toString() => 'Animal[className=$className, color=$color]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/api_response.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/api_response.dart index 4ae4da84e37b..de07a8c4bcdc 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/api_response.dart @@ -45,15 +45,17 @@ class ApiResponse { @override bool operator ==(Object other) => identical(this, other) || other is ApiResponse && other.code == code && - other.type == type && - other.message == message; + other.type == type && + other.message == message; + @override int get hashCode => // ignore: unnecessary_parenthesis (code == null ? 0 : code!.hashCode) + - (type == null ? 0 : type!.hashCode) + - (message == null ? 0 : message!.hashCode); + (type == null ? 0 : type!.hashCode) + + (message == null ? 0 : message!.hashCode); + @override String toString() => 'ApiResponse[code=$code, type=$type, message=$message]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart index a45ea2f3af1d..39ae5b792993 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart @@ -21,11 +21,13 @@ class ArrayOfArrayOfNumberOnly { @override bool operator ==(Object other) => identical(this, other) || other is ArrayOfArrayOfNumberOnly && _deepEquality.equals(other.arrayArrayNumber, arrayArrayNumber); + @override int get hashCode => // ignore: unnecessary_parenthesis (arrayArrayNumber.hashCode); + @override String toString() => 'ArrayOfArrayOfNumberOnly[arrayArrayNumber=$arrayArrayNumber]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_number_only.dart index 028b9e86673d..1c1713366d79 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_number_only.dart @@ -21,11 +21,13 @@ class ArrayOfNumberOnly { @override bool operator ==(Object other) => identical(this, other) || other is ArrayOfNumberOnly && _deepEquality.equals(other.arrayNumber, arrayNumber); + @override int get hashCode => // ignore: unnecessary_parenthesis (arrayNumber.hashCode); + @override String toString() => 'ArrayOfNumberOnly[arrayNumber=$arrayNumber]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_test.dart index 8e73cd62b943..415a19f05b76 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_test.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_test.dart @@ -27,15 +27,17 @@ class ArrayTest { @override bool operator ==(Object other) => identical(this, other) || other is ArrayTest && _deepEquality.equals(other.arrayOfString, arrayOfString) && - _deepEquality.equals(other.arrayArrayOfInteger, arrayArrayOfInteger) && - _deepEquality.equals(other.arrayArrayOfModel, arrayArrayOfModel); + _deepEquality.equals(other.arrayArrayOfInteger, arrayArrayOfInteger) && + _deepEquality.equals(other.arrayArrayOfModel, arrayArrayOfModel); + @override int get hashCode => // ignore: unnecessary_parenthesis (arrayOfString.hashCode) + - (arrayArrayOfInteger.hashCode) + - (arrayArrayOfModel.hashCode); + (arrayArrayOfInteger.hashCode) + + (arrayArrayOfModel.hashCode); + @override String toString() => 'ArrayTest[arrayOfString=$arrayOfString, arrayArrayOfInteger=$arrayArrayOfInteger, arrayArrayOfModel=$arrayArrayOfModel]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/capitalization.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/capitalization.dart index 5ae1a61778a3..c3133a085f79 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/capitalization.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/capitalization.dart @@ -73,21 +73,23 @@ 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; + other.capitalCamel == capitalCamel && + other.smallSnake == smallSnake && + other.capitalSnake == capitalSnake && + other.sCAETHFlowPoints == sCAETHFlowPoints && + other.ATT_NAME == ATT_NAME; + @override int get hashCode => // ignore: unnecessary_parenthesis (smallCamel == null ? 0 : smallCamel!.hashCode) + - (capitalCamel == null ? 0 : capitalCamel!.hashCode) + - (smallSnake == null ? 0 : smallSnake!.hashCode) + - (capitalSnake == null ? 0 : capitalSnake!.hashCode) + - (sCAETHFlowPoints == null ? 0 : sCAETHFlowPoints!.hashCode) + - (ATT_NAME == null ? 0 : ATT_NAME!.hashCode); + (capitalCamel == null ? 0 : capitalCamel!.hashCode) + + (smallSnake == null ? 0 : smallSnake!.hashCode) + + (capitalSnake == null ? 0 : capitalSnake!.hashCode) + + (sCAETHFlowPoints == null ? 0 : sCAETHFlowPoints!.hashCode) + + (ATT_NAME == null ? 0 : ATT_NAME!.hashCode); + @override String toString() => 'Capitalization[smallCamel=$smallCamel, capitalCamel=$capitalCamel, smallSnake=$smallSnake, capitalSnake=$capitalSnake, sCAETHFlowPoints=$sCAETHFlowPoints, ATT_NAME=$ATT_NAME]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat.dart index c0415c407887..7a17e1b72526 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat.dart @@ -33,15 +33,17 @@ class Cat { @override bool operator ==(Object other) => identical(this, other) || other is Cat && other.className == className && - other.color == color && - other.declawed == declawed; + other.color == color && + other.declawed == declawed; + @override int get hashCode => // ignore: unnecessary_parenthesis (className.hashCode) + - (color.hashCode) + - (declawed == null ? 0 : declawed!.hashCode); + (color.hashCode) + + (declawed == null ? 0 : declawed!.hashCode); + @override String toString() => 'Cat[className=$className, color=$color, declawed=$declawed]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/category.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/category.dart index ae2ac90a47c0..cd40e702a06a 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/category.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/category.dart @@ -30,13 +30,15 @@ class Category { @override bool operator ==(Object other) => identical(this, other) || other is Category && other.id == id && - other.name == name; + other.name == name; + @override int get hashCode => // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + - (name.hashCode); + (name.hashCode); + @override String toString() => 'Category[id=$id, name=$name]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/child_with_nullable.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/child_with_nullable.dart index 689245e15e9f..01ccbfa13b9c 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/child_with_nullable.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/child_with_nullable.dart @@ -39,15 +39,17 @@ class ChildWithNullable { @override bool operator ==(Object other) => identical(this, other) || other is ChildWithNullable && other.type == type && - other.nullableProperty == nullableProperty && - other.otherProperty == otherProperty; + other.nullableProperty == nullableProperty && + other.otherProperty == otherProperty; + @override int get hashCode => // ignore: unnecessary_parenthesis (type == null ? 0 : type!.hashCode) + - (nullableProperty == null ? 0 : nullableProperty!.hashCode) + - (otherProperty == null ? 0 : otherProperty!.hashCode); + (nullableProperty == null ? 0 : nullableProperty!.hashCode) + + (otherProperty == null ? 0 : otherProperty!.hashCode); + @override String toString() => 'ChildWithNullable[type=$type, nullableProperty=$nullableProperty, otherProperty=$otherProperty]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/class_model.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/class_model.dart index 9b5ae73f3292..cb17a5d12999 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/class_model.dart @@ -27,11 +27,13 @@ class ClassModel { @override bool operator ==(Object other) => identical(this, other) || other is ClassModel && other.class_ == class_; + @override int get hashCode => // ignore: unnecessary_parenthesis (class_ == null ? 0 : class_!.hashCode); + @override String toString() => 'ClassModel[class_=$class_]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/deprecated_object.dart index d802079e32db..7ca1a08d61b2 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/deprecated_object.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/deprecated_object.dart @@ -27,11 +27,13 @@ class DeprecatedObject { @override bool operator ==(Object other) => identical(this, other) || other is DeprecatedObject && other.name == name; + @override int get hashCode => // ignore: unnecessary_parenthesis (name == null ? 0 : name!.hashCode); + @override String toString() => 'DeprecatedObject[name=$name]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog.dart index 2612b4e50fd3..1700498713f8 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog.dart @@ -33,15 +33,17 @@ class Dog { @override bool operator ==(Object other) => identical(this, other) || other is Dog && other.className == className && - other.color == color && - other.breed == breed; + other.color == color && + other.breed == breed; + @override int get hashCode => // ignore: unnecessary_parenthesis (className.hashCode) + - (color.hashCode) + - (breed == null ? 0 : breed!.hashCode); + (color.hashCode) + + (breed == null ? 0 : breed!.hashCode); + @override String toString() => 'Dog[className=$className, color=$color, breed=$breed]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart index a289585193b0..198b3bad5af7 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart @@ -24,13 +24,15 @@ class EnumArrays { @override bool operator ==(Object other) => identical(this, other) || other is EnumArrays && other.justSymbol == justSymbol && - _deepEquality.equals(other.arrayEnum, arrayEnum); + _deepEquality.equals(other.arrayEnum, arrayEnum); + @override int get hashCode => // ignore: unnecessary_parenthesis (justSymbol == null ? 0 : justSymbol!.hashCode) + - (arrayEnum.hashCode); + (arrayEnum.hashCode); + @override String toString() => 'EnumArrays[justSymbol=$justSymbol, arrayEnum=$arrayEnum]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart index b074c3b4b145..ca0af01635e5 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart @@ -60,25 +60,27 @@ 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; + 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 => // ignore: unnecessary_parenthesis (enumString == null ? 0 : enumString!.hashCode) + - (enumStringRequired.hashCode) + - (enumInteger == null ? 0 : enumInteger!.hashCode) + - (enumNumber == null ? 0 : enumNumber!.hashCode) + - (outerEnum == null ? 0 : outerEnum!.hashCode) + - (outerEnumInteger == null ? 0 : outerEnumInteger!.hashCode) + - (outerEnumDefaultValue == null ? 0 : outerEnumDefaultValue!.hashCode) + - (outerEnumIntegerDefaultValue == null ? 0 : outerEnumIntegerDefaultValue!.hashCode); + (enumStringRequired.hashCode) + + (enumInteger == null ? 0 : enumInteger!.hashCode) + + (enumNumber == null ? 0 : enumNumber!.hashCode) + + (outerEnum == null ? 0 : outerEnum!.hashCode) + + (outerEnumInteger == null ? 0 : outerEnumInteger!.hashCode) + + (outerEnumDefaultValue == null ? 0 : outerEnumDefaultValue!.hashCode) + + (outerEnumIntegerDefaultValue == null ? 0 : outerEnumIntegerDefaultValue!.hashCode); + @override String toString() => 'EnumTest[enumString=$enumString, enumStringRequired=$enumStringRequired, enumInteger=$enumInteger, enumNumber=$enumNumber, outerEnum=$outerEnum, outerEnumInteger=$outerEnumInteger, outerEnumDefaultValue=$outerEnumDefaultValue, outerEnumIntegerDefaultValue=$outerEnumIntegerDefaultValue]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/fake_big_decimal_map200_response.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/fake_big_decimal_map200_response.dart index 86eff453eff9..28acde8abd70 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/fake_big_decimal_map200_response.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/fake_big_decimal_map200_response.dart @@ -30,13 +30,15 @@ class FakeBigDecimalMap200Response { @override bool operator ==(Object other) => identical(this, other) || other is FakeBigDecimalMap200Response && other.someId == someId && - _deepEquality.equals(other.someMap, someMap); + _deepEquality.equals(other.someMap, someMap); + @override int get hashCode => // ignore: unnecessary_parenthesis (someId == null ? 0 : someId!.hashCode) + - (someMap.hashCode); + (someMap.hashCode); + @override String toString() => 'FakeBigDecimalMap200Response[someId=$someId, someMap=$someMap]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/file_schema_test_class.dart index e4bbad1e569f..cdde6bc91f12 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/file_schema_test_class.dart @@ -30,13 +30,15 @@ class FileSchemaTestClass { @override bool operator ==(Object other) => identical(this, other) || other is FileSchemaTestClass && other.file == file && - _deepEquality.equals(other.files, files); + _deepEquality.equals(other.files, files); + @override int get hashCode => // ignore: unnecessary_parenthesis (file == null ? 0 : file!.hashCode) + - (files.hashCode); + (files.hashCode); + @override String toString() => 'FileSchemaTestClass[file=$file, files=$files]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo.dart index 22a2797c3442..9f3b12e11063 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo.dart @@ -21,11 +21,13 @@ class Foo { @override bool operator ==(Object other) => identical(this, other) || other is Foo && other.bar == bar; + @override int get hashCode => // ignore: unnecessary_parenthesis (bar.hashCode); + @override String toString() => 'Foo[bar=$bar]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo_get_default_response.dart index 45dc5c50b812..bd7690857d04 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo_get_default_response.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo_get_default_response.dart @@ -27,11 +27,13 @@ class FooGetDefaultResponse { @override bool operator ==(Object other) => identical(this, other) || other is FooGetDefaultResponse && other.string == string; + @override int get hashCode => // ignore: unnecessary_parenthesis (string == null ? 0 : string!.hashCode); + @override String toString() => 'FooGetDefaultResponse[string=$string]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/format_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/format_test.dart index 5c22fff27825..4b79a1db204f 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/format_test.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/format_test.dart @@ -150,41 +150,43 @@ 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; + 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 => // ignore: unnecessary_parenthesis (integer == null ? 0 : integer!.hashCode) + - (int32 == null ? 0 : int32!.hashCode) + - (int64 == null ? 0 : int64!.hashCode) + - (number.hashCode) + - (float == null ? 0 : float!.hashCode) + - (double_ == null ? 0 : double_!.hashCode) + - (decimal == null ? 0 : decimal!.hashCode) + - (string == null ? 0 : string!.hashCode) + - (byte.hashCode) + - (binary == null ? 0 : binary!.hashCode) + - (date.hashCode) + - (dateTime == null ? 0 : dateTime!.hashCode) + - (uuid == null ? 0 : uuid!.hashCode) + - (password.hashCode) + - (patternWithDigits == null ? 0 : patternWithDigits!.hashCode) + - (patternWithDigitsAndDelimiter == null ? 0 : patternWithDigitsAndDelimiter!.hashCode); + (int32 == null ? 0 : int32!.hashCode) + + (int64 == null ? 0 : int64!.hashCode) + + (number.hashCode) + + (float == null ? 0 : float!.hashCode) + + (double_ == null ? 0 : double_!.hashCode) + + (decimal == null ? 0 : decimal!.hashCode) + + (string == null ? 0 : string!.hashCode) + + (byte.hashCode) + + (binary == null ? 0 : binary!.hashCode) + + (date.hashCode) + + (dateTime == null ? 0 : dateTime!.hashCode) + + (uuid == null ? 0 : uuid!.hashCode) + + (password.hashCode) + + (patternWithDigits == null ? 0 : patternWithDigits!.hashCode) + + (patternWithDigitsAndDelimiter == null ? 0 : patternWithDigitsAndDelimiter!.hashCode); + @override String toString() => 'FormatTest[integer=$integer, int32=$int32, int64=$int64, number=$number, float=$float, double_=$double_, decimal=$decimal, string=$string, byte=$byte, binary=$binary, date=$date, dateTime=$dateTime, uuid=$uuid, password=$password, patternWithDigits=$patternWithDigits, patternWithDigitsAndDelimiter=$patternWithDigitsAndDelimiter]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/has_only_read_only.dart index 4813166f3c3c..93ccded36ae5 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/has_only_read_only.dart @@ -36,13 +36,15 @@ class HasOnlyReadOnly { @override bool operator ==(Object other) => identical(this, other) || other is HasOnlyReadOnly && other.bar == bar && - other.foo == foo; + other.foo == foo; + @override int get hashCode => // ignore: unnecessary_parenthesis (bar == null ? 0 : bar!.hashCode) + - (foo == null ? 0 : foo!.hashCode); + (foo == null ? 0 : foo!.hashCode); + @override String toString() => 'HasOnlyReadOnly[bar=$bar, foo=$foo]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/health_check_result.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/health_check_result.dart index fcb439d61024..14d8c3d7827a 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/health_check_result.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/health_check_result.dart @@ -21,11 +21,13 @@ class HealthCheckResult { @override bool operator ==(Object other) => identical(this, other) || other is HealthCheckResult && other.nullableMessage == nullableMessage; + @override int get hashCode => // ignore: unnecessary_parenthesis (nullableMessage == null ? 0 : nullableMessage!.hashCode); + @override String toString() => 'HealthCheckResult[nullableMessage=$nullableMessage]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart index c403ca02947a..11fc90128404 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart @@ -30,17 +30,19 @@ class MapTest { @override bool operator ==(Object other) => identical(this, other) || other is MapTest && _deepEquality.equals(other.mapMapOfString, mapMapOfString) && - _deepEquality.equals(other.mapOfEnumString, mapOfEnumString) && - _deepEquality.equals(other.directMap, directMap) && - _deepEquality.equals(other.indirectMap, indirectMap); + _deepEquality.equals(other.mapOfEnumString, mapOfEnumString) && + _deepEquality.equals(other.directMap, directMap) && + _deepEquality.equals(other.indirectMap, indirectMap); + @override int get hashCode => // ignore: unnecessary_parenthesis (mapMapOfString.hashCode) + - (mapOfEnumString.hashCode) + - (directMap.hashCode) + - (indirectMap.hashCode); + (mapOfEnumString.hashCode) + + (directMap.hashCode) + + (indirectMap.hashCode); + @override String toString() => 'MapTest[mapMapOfString=$mapMapOfString, mapOfEnumString=$mapOfEnumString, directMap=$directMap, indirectMap=$indirectMap]'; @@ -69,7 +71,7 @@ class MapTest { }()); return MapTest( - mapMapOfString: mapCastOfType(json, r'map_map_of_string') ?? const {}, + mapMapOfString: (json[r'map_map_of_string'] as Map?)?.map((k, v) => MapEntry(k as String, (v as Map).cast())) ?? const {}, mapOfEnumString: mapCastOfType(json, r'map_of_enum_string') ?? const {}, directMap: mapCastOfType(json, r'direct_map') ?? const {}, indirectMap: mapCastOfType(json, r'indirect_map') ?? const {}, diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart index 1ea2d31cd096..617874010e27 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart @@ -39,15 +39,17 @@ class MixedPropertiesAndAdditionalPropertiesClass { @override bool operator ==(Object other) => identical(this, other) || other is MixedPropertiesAndAdditionalPropertiesClass && other.uuid == uuid && - other.dateTime == dateTime && - _deepEquality.equals(other.map, map); + other.dateTime == dateTime && + _deepEquality.equals(other.map, map); + @override int get hashCode => // ignore: unnecessary_parenthesis (uuid == null ? 0 : uuid!.hashCode) + - (dateTime == null ? 0 : dateTime!.hashCode) + - (map.hashCode); + (dateTime == null ? 0 : dateTime!.hashCode) + + (map.hashCode); + @override String toString() => 'MixedPropertiesAndAdditionalPropertiesClass[uuid=$uuid, dateTime=$dateTime, map=$map]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model200_response.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model200_response.dart index 8c824ad3f2b4..affee0736654 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model200_response.dart @@ -36,13 +36,15 @@ class Model200Response { @override bool operator ==(Object other) => identical(this, other) || other is Model200Response && other.name == name && - other.class_ == class_; + other.class_ == class_; + @override int get hashCode => // ignore: unnecessary_parenthesis (name == null ? 0 : name!.hashCode) + - (class_ == null ? 0 : class_!.hashCode); + (class_ == null ? 0 : class_!.hashCode); + @override String toString() => 'Model200Response[name=$name, class_=$class_]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_client.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_client.dart index 63a2056a38b0..9996e746fd98 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_client.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_client.dart @@ -27,11 +27,13 @@ class ModelClient { @override bool operator ==(Object other) => identical(this, other) || other is ModelClient && other.client == client; + @override int get hashCode => // ignore: unnecessary_parenthesis (client == null ? 0 : client!.hashCode); + @override String toString() => 'ModelClient[client=$client]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_file.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_file.dart index 0e1f8de75674..38dc78c4e932 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_file.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_file.dart @@ -28,11 +28,13 @@ class ModelFile { @override bool operator ==(Object other) => identical(this, other) || other is ModelFile && other.sourceURI == sourceURI; + @override int get hashCode => // ignore: unnecessary_parenthesis (sourceURI == null ? 0 : sourceURI!.hashCode); + @override String toString() => 'ModelFile[sourceURI=$sourceURI]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_list.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_list.dart index 805b0087e95f..11830d8f53ee 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_list.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_list.dart @@ -27,11 +27,13 @@ class ModelList { @override bool operator ==(Object other) => identical(this, other) || other is ModelList && other.n123list == n123list; + @override int get hashCode => // ignore: unnecessary_parenthesis (n123list == null ? 0 : n123list!.hashCode); + @override String toString() => 'ModelList[n123list=$n123list]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_return.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_return.dart index 4c98bece7111..bc978b4df348 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_return.dart @@ -27,11 +27,13 @@ class ModelReturn { @override bool operator ==(Object other) => identical(this, other) || other is ModelReturn && other.return_ == return_; + @override int get hashCode => // ignore: unnecessary_parenthesis (return_ == null ? 0 : return_!.hashCode); + @override String toString() => 'ModelReturn[return_=$return_]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/name.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/name.dart index 619a0070d398..cb3ab2c14d8d 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/name.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/name.dart @@ -48,17 +48,19 @@ 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; + other.snakeCase == snakeCase && + other.property == property && + other.n123number == n123number; + @override int get hashCode => // ignore: unnecessary_parenthesis (name.hashCode) + - (snakeCase == null ? 0 : snakeCase!.hashCode) + - (property == null ? 0 : property!.hashCode) + - (n123number == null ? 0 : n123number!.hashCode); + (snakeCase == null ? 0 : snakeCase!.hashCode) + + (property == null ? 0 : property!.hashCode) + + (n123number == null ? 0 : n123number!.hashCode); + @override String toString() => 'Name[name=$name, snakeCase=$snakeCase, property=$property, n123number=$n123number]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/nullable_class.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/nullable_class.dart index 650652778f91..32dd25e2db5c 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/nullable_class.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/nullable_class.dart @@ -54,33 +54,35 @@ 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 && - _deepEquality.equals(other.arrayNullableProp, arrayNullableProp) && - _deepEquality.equals(other.arrayAndItemsNullableProp, arrayAndItemsNullableProp) && - _deepEquality.equals(other.arrayItemsNullable, arrayItemsNullable) && - _deepEquality.equals(other.objectNullableProp, objectNullableProp) && - _deepEquality.equals(other.objectAndItemsNullableProp, objectAndItemsNullableProp) && - _deepEquality.equals(other.objectItemsNullable, objectItemsNullable); + other.numberProp == numberProp && + other.booleanProp == booleanProp && + other.stringProp == stringProp && + other.dateProp == dateProp && + other.datetimeProp == datetimeProp && + _deepEquality.equals(other.arrayNullableProp, arrayNullableProp) && + _deepEquality.equals(other.arrayAndItemsNullableProp, arrayAndItemsNullableProp) && + _deepEquality.equals(other.arrayItemsNullable, arrayItemsNullable) && + _deepEquality.equals(other.objectNullableProp, objectNullableProp) && + _deepEquality.equals(other.objectAndItemsNullableProp, objectAndItemsNullableProp) && + _deepEquality.equals(other.objectItemsNullable, objectItemsNullable); + @override int get hashCode => // ignore: unnecessary_parenthesis (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); + (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 String toString() => 'NullableClass[integerProp=$integerProp, numberProp=$numberProp, booleanProp=$booleanProp, stringProp=$stringProp, dateProp=$dateProp, datetimeProp=$datetimeProp, arrayNullableProp=$arrayNullableProp, arrayAndItemsNullableProp=$arrayAndItemsNullableProp, arrayItemsNullable=$arrayItemsNullable, objectNullableProp=$objectNullableProp, objectAndItemsNullableProp=$objectAndItemsNullableProp, objectItemsNullable=$objectItemsNullable]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/number_only.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/number_only.dart index 124d620f5834..0fd56a476b6d 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/number_only.dart @@ -27,11 +27,13 @@ class NumberOnly { @override bool operator ==(Object other) => identical(this, other) || other is NumberOnly && other.justNumber == justNumber; + @override int get hashCode => // ignore: unnecessary_parenthesis (justNumber == null ? 0 : justNumber!.hashCode); + @override String toString() => 'NumberOnly[justNumber=$justNumber]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_that_references_objects_with_duplicate_inline_enums.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_that_references_objects_with_duplicate_inline_enums.dart index 9ad96992b33f..50daf2ba34be 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_that_references_objects_with_duplicate_inline_enums.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_that_references_objects_with_duplicate_inline_enums.dart @@ -36,13 +36,15 @@ class ObjectThatReferencesObjectsWithDuplicateInlineEnums { @override bool operator ==(Object other) => identical(this, other) || other is ObjectThatReferencesObjectsWithDuplicateInlineEnums && other.objectOne == objectOne && - other.objectTwo == objectTwo; + other.objectTwo == objectTwo; + @override int get hashCode => // ignore: unnecessary_parenthesis (objectOne == null ? 0 : objectOne!.hashCode) + - (objectTwo == null ? 0 : objectTwo!.hashCode); + (objectTwo == null ? 0 : objectTwo!.hashCode); + @override String toString() => 'ObjectThatReferencesObjectsWithDuplicateInlineEnums[objectOne=$objectOne, objectTwo=$objectTwo]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_deprecated_fields.dart index 4df1a906d978..83ca7e82f9ff 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_deprecated_fields.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_deprecated_fields.dart @@ -48,17 +48,19 @@ class ObjectWithDeprecatedFields { @override bool operator ==(Object other) => identical(this, other) || other is ObjectWithDeprecatedFields && other.uuid == uuid && - other.id == id && - other.deprecatedRef == deprecatedRef && - _deepEquality.equals(other.bars, bars); + other.id == id && + other.deprecatedRef == deprecatedRef && + _deepEquality.equals(other.bars, bars); + @override int get hashCode => // ignore: unnecessary_parenthesis (uuid == null ? 0 : uuid!.hashCode) + - (id == null ? 0 : id!.hashCode) + - (deprecatedRef == null ? 0 : deprecatedRef!.hashCode) + - (bars.hashCode); + (id == null ? 0 : id!.hashCode) + + (deprecatedRef == null ? 0 : deprecatedRef!.hashCode) + + (bars.hashCode); + @override String toString() => 'ObjectWithDeprecatedFields[uuid=$uuid, id=$id, deprecatedRef=$deprecatedRef, bars=$bars]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_duplicate_inline_enum.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_duplicate_inline_enum.dart index d806fd7155dc..de913bb81dfc 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_duplicate_inline_enum.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_duplicate_inline_enum.dart @@ -22,11 +22,13 @@ class ObjectWithDuplicateInlineEnum { @override bool operator ==(Object other) => identical(this, other) || other is ObjectWithDuplicateInlineEnum && _deepEquality.equals(other.attribute, attribute); + @override int get hashCode => // ignore: unnecessary_parenthesis (attribute.hashCode); + @override String toString() => 'ObjectWithDuplicateInlineEnum[attribute=$attribute]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_enum.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_enum.dart index 9798caa7b3c4..eb7dd63ccbf5 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_enum.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_enum.dart @@ -21,11 +21,13 @@ class ObjectWithEnum { @override bool operator ==(Object other) => identical(this, other) || other is ObjectWithEnum && other.attribute == attribute; + @override int get hashCode => // ignore: unnecessary_parenthesis (attribute.hashCode); + @override String toString() => 'ObjectWithEnum[attribute=$attribute]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_inline_enum.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_inline_enum.dart index 858d3d77851e..6bfc5d6e7009 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_inline_enum.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_inline_enum.dart @@ -22,11 +22,13 @@ class ObjectWithInlineEnum { @override bool operator ==(Object other) => identical(this, other) || other is ObjectWithInlineEnum && _deepEquality.equals(other.attribute, attribute); + @override int get hashCode => // ignore: unnecessary_parenthesis (attribute.hashCode); + @override String toString() => 'ObjectWithInlineEnum[attribute=$attribute]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_inline_enum_default_value.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_inline_enum_default_value.dart index 895a0bbdd072..1bf3302727c9 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_inline_enum_default_value.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/object_with_inline_enum_default_value.dart @@ -22,11 +22,13 @@ class ObjectWithInlineEnumDefaultValue { @override bool operator ==(Object other) => identical(this, other) || other is ObjectWithInlineEnumDefaultValue && other.attribute == attribute; + @override int get hashCode => // ignore: unnecessary_parenthesis (attribute.hashCode); + @override String toString() => 'ObjectWithInlineEnumDefaultValue[attribute=$attribute]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart index 9d632ff2e90a..043a4fa76dc7 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart @@ -61,21 +61,23 @@ 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; + other.petId == petId && + other.quantity == quantity && + other.shipDate == shipDate && + other.status == status && + other.complete == complete; + @override int get hashCode => // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + - (petId == null ? 0 : petId!.hashCode) + - (quantity == null ? 0 : quantity!.hashCode) + - (shipDate == null ? 0 : shipDate!.hashCode) + - (status == null ? 0 : status!.hashCode) + - (complete.hashCode); + (petId == null ? 0 : petId!.hashCode) + + (quantity == null ? 0 : quantity!.hashCode) + + (shipDate == null ? 0 : shipDate!.hashCode) + + (status == null ? 0 : status!.hashCode) + + (complete.hashCode); + @override String toString() => 'Order[id=$id, petId=$petId, quantity=$quantity, shipDate=$shipDate, status=$status, complete=$complete]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_composite.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_composite.dart index ee0cb9628b82..d5d89834f4d4 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_composite.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_composite.dart @@ -45,15 +45,17 @@ class OuterComposite { @override bool operator ==(Object other) => identical(this, other) || other is OuterComposite && other.myNumber == myNumber && - other.myString == myString && - other.myBoolean == myBoolean; + other.myString == myString && + other.myBoolean == myBoolean; + @override int get hashCode => // ignore: unnecessary_parenthesis (myNumber == null ? 0 : myNumber!.hashCode) + - (myString == null ? 0 : myString!.hashCode) + - (myBoolean == null ? 0 : myBoolean!.hashCode); + (myString == null ? 0 : myString!.hashCode) + + (myBoolean == null ? 0 : myBoolean!.hashCode); + @override String toString() => 'OuterComposite[myNumber=$myNumber, myString=$myString, myBoolean=$myBoolean]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_object_with_enum_property.dart index 9d902dcfb1b4..6e9a27714fba 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_object_with_enum_property.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_object_with_enum_property.dart @@ -21,11 +21,13 @@ class OuterObjectWithEnumProperty { @override bool operator ==(Object other) => identical(this, other) || other is OuterObjectWithEnumProperty && other.value == value; + @override int get hashCode => // ignore: unnecessary_parenthesis (value.hashCode); + @override String toString() => 'OuterObjectWithEnumProperty[value=$value]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/parent_with_nullable.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/parent_with_nullable.dart index 430935179ab7..d0df6becd2cd 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/parent_with_nullable.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/parent_with_nullable.dart @@ -30,13 +30,15 @@ class ParentWithNullable { @override bool operator ==(Object other) => identical(this, other) || other is ParentWithNullable && other.type == type && - other.nullableProperty == nullableProperty; + other.nullableProperty == nullableProperty; + @override int get hashCode => // ignore: unnecessary_parenthesis (type == null ? 0 : type!.hashCode) + - (nullableProperty == null ? 0 : nullableProperty!.hashCode); + (nullableProperty == null ? 0 : nullableProperty!.hashCode); + @override String toString() => 'ParentWithNullable[type=$type, nullableProperty=$nullableProperty]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart index 09d7dd88ca42..7edddc308062 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart @@ -49,21 +49,23 @@ class Pet { @override bool operator ==(Object other) => identical(this, other) || other is Pet && other.id == id && - other.category == category && - other.name == name && - _deepEquality.equals(other.photoUrls, photoUrls) && - _deepEquality.equals(other.tags, tags) && - other.status == status; + other.category == category && + other.name == name && + _deepEquality.equals(other.photoUrls, photoUrls) && + _deepEquality.equals(other.tags, tags) && + other.status == status; + @override int get hashCode => // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + - (category == null ? 0 : category!.hashCode) + - (name.hashCode) + - (photoUrls.hashCode) + - (tags.hashCode) + - (status == null ? 0 : status!.hashCode); + (category == null ? 0 : category!.hashCode) + + (name.hashCode) + + (photoUrls.hashCode) + + (tags.hashCode) + + (status == null ? 0 : status!.hashCode); + @override String toString() => 'Pet[id=$id, category=$category, name=$name, photoUrls=$photoUrls, tags=$tags, status=$status]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_empty_metadata.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_empty_metadata.dart new file mode 100644 index 000000000000..88eab85011a4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_empty_metadata.dart @@ -0,0 +1,97 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PetEmptyMetadata { + /// Returns a new [PetEmptyMetadata] instance. + PetEmptyMetadata(); + + @override + bool operator ==(Object other) => identical(this, other) || other is PetEmptyMetadata; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + 0; + + @override + String toString() => 'PetEmptyMetadata[]'; + + Map toJson() { + final json = {}; + return json; + } + + /// Returns a new [PetEmptyMetadata] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PetEmptyMetadata? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + + return PetEmptyMetadata( + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PetEmptyMetadata.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PetEmptyMetadata.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PetEmptyMetadata-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = PetEmptyMetadata.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_reaction_response.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_reaction_response.dart new file mode 100644 index 000000000000..bc2381a7ba2c --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_reaction_response.dart @@ -0,0 +1,133 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PetReactionResponse { + /// Returns a new [PetReactionResponse] instance. + PetReactionResponse({ + this.petId, + this.status, + }); + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? petId; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? status; + + @override + bool operator ==(Object other) => identical(this, other) || other is PetReactionResponse && + other.petId == petId && + other.status == status; + + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (petId == null ? 0 : petId!.hashCode) + + (status == null ? 0 : status!.hashCode); + + + @override + String toString() => 'PetReactionResponse[petId=$petId, status=$status]'; + + Map toJson() { + final json = {}; + if (this.petId != null) { + json[r'petId'] = this.petId; + } else { + json[r'petId'] = null; + } + if (this.status != null) { + json[r'status'] = this.status; + } else { + json[r'status'] = null; + } + return json; + } + + /// Returns a new [PetReactionResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PetReactionResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + + return PetReactionResponse( + petId: mapValueOfType(json, r'petId'), + status: mapValueOfType(json, r'status'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PetReactionResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PetReactionResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PetReactionResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = PetReactionResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_reaction_status.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_reaction_status.dart new file mode 100644 index 000000000000..f06ebedf3c3f --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_reaction_status.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class PetReactionStatus { + /// Instantiate a new enum with the provided [value]. + const PetReactionStatus._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const liked = PetReactionStatus._(r'liked'); + static const disliked = PetReactionStatus._(r'disliked'); + static const barked = PetReactionStatus._(r'barked'); + + /// List of all possible values in this [enum][PetReactionStatus]. + static const values = [ + liked, + disliked, + barked, + ]; + + static PetReactionStatus? fromJson(dynamic value) => PetReactionStatusTypeTransformer().decode(value); + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PetReactionStatus.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [PetReactionStatus] to String, +/// and [decode] dynamic data back to [PetReactionStatus]. +class PetReactionStatusTypeTransformer { + factory PetReactionStatusTypeTransformer() => _instance ??= const PetReactionStatusTypeTransformer._(); + + const PetReactionStatusTypeTransformer._(); + + String encode(PetReactionStatus data) => data.value; + + /// Decodes a [dynamic value][data] to a PetReactionStatus. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + PetReactionStatus? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + case r'liked': return PetReactionStatus.liked; + case r'disliked': return PetReactionStatus.disliked; + case r'barked': return PetReactionStatus.barked; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [PetReactionStatusTypeTransformer] instance. + static PetReactionStatusTypeTransformer? _instance; +} + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_reactions_response.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_reactions_response.dart new file mode 100644 index 000000000000..3f85ecdb0114 --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet_reactions_response.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PetReactionsResponse { + /// Returns a new [PetReactionsResponse] instance. + PetReactionsResponse({ + this.myReacts = const {}, + this.reactionCounts = const {}, + }); + + Map> myReacts; + + Map> reactionCounts; + + @override + bool operator ==(Object other) => identical(this, other) || other is PetReactionsResponse && + _deepEquality.equals(other.myReacts, myReacts) && + _deepEquality.equals(other.reactionCounts, reactionCounts); + + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (myReacts.hashCode) + + (reactionCounts.hashCode); + + + @override + String toString() => 'PetReactionsResponse[myReacts=$myReacts, reactionCounts=$reactionCounts]'; + + Map toJson() { + final json = {}; + json[r'myReacts'] = this.myReacts; + json[r'reactionCounts'] = this.reactionCounts; + return json; + } + + /// Returns a new [PetReactionsResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PetReactionsResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + + return PetReactionsResponse( + myReacts: (json[r'myReacts'] as Map?)?.map((k, v) => MapEntry(k as String, (v as Map).cast())) ?? const {}, + reactionCounts: (json[r'reactionCounts'] as Map?)?.map((k, v) => MapEntry(k as String, (v as Map).cast())) ?? const {}, + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PetReactionsResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PetReactionsResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PetReactionsResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = PetReactionsResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/read_only_first.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/read_only_first.dart index d0d5820c58a0..2a10df3a7640 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/read_only_first.dart @@ -36,13 +36,15 @@ class ReadOnlyFirst { @override bool operator ==(Object other) => identical(this, other) || other is ReadOnlyFirst && other.bar == bar && - other.baz == baz; + other.baz == baz; + @override int get hashCode => // ignore: unnecessary_parenthesis (bar == null ? 0 : bar!.hashCode) + - (baz == null ? 0 : baz!.hashCode); + (baz == null ? 0 : baz!.hashCode); + @override String toString() => 'ReadOnlyFirst[bar=$bar, baz=$baz]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_model_name.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_model_name.dart index 35c54b5eaa06..ea9c229e3427 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_model_name.dart @@ -27,11 +27,13 @@ class SpecialModelName { @override bool operator ==(Object other) => identical(this, other) || other is SpecialModelName && other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + @override int get hashCode => // ignore: unnecessary_parenthesis (dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == null ? 0 : dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket!.hashCode); + @override String toString() => 'SpecialModelName[dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket=$dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/tag.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/tag.dart index 519cc76dbf17..0aaeeae46e30 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/tag.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/tag.dart @@ -36,13 +36,15 @@ class Tag { @override bool operator ==(Object other) => identical(this, other) || other is Tag && other.id == id && - other.name == name; + other.name == name; + @override int get hashCode => // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + - (name == null ? 0 : name!.hashCode); + (name == null ? 0 : name!.hashCode); + @override String toString() => 'Tag[id=$id, name=$name]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/test_inline_freeform_additional_properties_request.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/test_inline_freeform_additional_properties_request.dart index b00c9ed668f0..d5bdbe9e2011 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/test_inline_freeform_additional_properties_request.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/test_inline_freeform_additional_properties_request.dart @@ -27,11 +27,13 @@ class TestInlineFreeformAdditionalPropertiesRequest { @override bool operator ==(Object other) => identical(this, other) || other is TestInlineFreeformAdditionalPropertiesRequest && other.someProperty == someProperty; + @override int get hashCode => // ignore: unnecessary_parenthesis (someProperty == null ? 0 : someProperty!.hashCode); + @override String toString() => 'TestInlineFreeformAdditionalPropertiesRequest[someProperty=$someProperty]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/user.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/user.dart index 1d283f499266..2514791f288a 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/user.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/user.dart @@ -91,25 +91,27 @@ 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; + 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 => // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + - (username == null ? 0 : username!.hashCode) + - (firstName == null ? 0 : firstName!.hashCode) + - (lastName == null ? 0 : lastName!.hashCode) + - (email == null ? 0 : email!.hashCode) + - (password == null ? 0 : password!.hashCode) + - (phone == null ? 0 : phone!.hashCode) + - (userStatus == null ? 0 : userStatus!.hashCode); + (username == null ? 0 : username!.hashCode) + + (firstName == null ? 0 : firstName!.hashCode) + + (lastName == null ? 0 : lastName!.hashCode) + + (email == null ? 0 : email!.hashCode) + + (password == null ? 0 : password!.hashCode) + + (phone == null ? 0 : phone!.hashCode) + + (userStatus == null ? 0 : userStatus!.hashCode); + @override String toString() => 'User[id=$id, username=$username, firstName=$firstName, lastName=$lastName, email=$email, password=$password, phone=$phone, userStatus=$userStatus]'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_empty_metadata_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_empty_metadata_test.dart new file mode 100644 index 000000000000..03073f8213b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_empty_metadata_test.dart @@ -0,0 +1,22 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for PetEmptyMetadata +void main() { + // final instance = PetEmptyMetadata(); + + group('test PetEmptyMetadata', () { + + }); + +} diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_reaction_response_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_reaction_response_test.dart new file mode 100644 index 000000000000..98d08d5e0dcf --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_reaction_response_test.dart @@ -0,0 +1,32 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for PetReactionResponse +void main() { + // final instance = PetReactionResponse(); + + group('test PetReactionResponse', () { + // int petId + test('to test the property `petId`', () async { + // TODO + }); + + // String status + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_reaction_status_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_reaction_status_test.dart new file mode 100644 index 000000000000..7a7a3bb9a213 --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_reaction_status_test.dart @@ -0,0 +1,21 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for PetReactionStatus +void main() { + + group('test PetReactionStatus', () { + + }); + +} diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_reactions_response_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_reactions_response_test.dart new file mode 100644 index 000000000000..72d90d535b43 --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/pet_reactions_response_test.dart @@ -0,0 +1,32 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for PetReactionsResponse +void main() { + // final instance = PetReactionsResponse(); + + group('test PetReactionsResponse', () { + // Map> myReacts (default value: const {}) + test('to test the property `myReacts`', () async { + // TODO + }); + + // Map> reactionCounts (default value: const {}) + test('to test the property `reactionCounts`', () async { + // TODO + }); + + + }); + +}