You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/generators/dart-dio.md
+1
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
23
23
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
24
24
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).||true|
25
25
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
26
+
|equalityCheckMethod|Specify equality check method. Takes effect only in case if serializationLibrary is json_serializable.|<dl><dt>**default**</dt><dd>[DEFAULT] Built in hash code generation method</dd><dt>**equatable**</dt><dd>Uses equatable library for equality checking</dd></dl>|default|
26
27
|finalProperties|Whether properties are marked as final when using Json Serializable for serialization||true|
27
28
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
28
29
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.||false|
finalCliOptionequalityCheckOption = CliOption.newString(EQUALITY_CHECK_METHOD, "Specify equality check method. Takes effect only in case if serializationLibrary is json_serializable.");
finalCliOptiondateOption = CliOption.newString(DATE_LIBRARY, "Specify Date library");
112
126
dateOption.setDefault(DATE_LIBRARY_DEFAULT);
113
127
114
-
finalCliOptionfinalProperties = CliOption.newBoolean(FINAL_PROPERTIES, "Whether properties are marked as final when using Json Serializable for serialization");
dateOptions.put(DATE_LIBRARY_TIME_MACHINE, "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.");
121
131
dateOption.setEnum(dateOptions);
122
132
cliOptions.add(dateOption);
133
+
134
+
// Final Properties Option
135
+
finalCliOptionfinalProperties = CliOption.newBoolean(FINAL_PROPERTIES, "Whether properties are marked as final when using Json Serializable for serialization");
136
+
finalProperties.setDefault("true");
137
+
cliOptions.add(finalProperties);
123
138
}
124
139
125
140
publicStringgetDateLibrary() {
@@ -130,6 +145,14 @@ public void setDateLibrary(String library) {
Copy file name to clipboardexpand all lines: modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache
Copy file name to clipboardexpand all lines: modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache
Copy file name to clipboardexpand all lines: modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java
+1
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,7 @@ public Map<String, String> createOptions() {
Copy file name to clipboardexpand all lines: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart
+10-8
Original file line number
Diff line number
Diff line change
@@ -47,15 +47,17 @@ class AdditionalPropertiesClass {
47
47
48
48
49
49
50
-
@override
51
-
booloperator==(Object other) =>identical(this, other) || other isAdditionalPropertiesClass&&
52
-
other.mapProperty == mapProperty &&
53
-
other.mapOfMapProperty == mapOfMapProperty;
54
50
55
-
@override
56
-
intget hashCode =>
57
-
mapProperty.hashCode +
58
-
mapOfMapProperty.hashCode;
51
+
52
+
@override
53
+
booloperator==(Object other) =>identical(this, other) || other isAdditionalPropertiesClass&&
Copy file name to clipboardexpand all lines: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart
+10-8
Original file line number
Diff line number
Diff line change
@@ -48,15 +48,17 @@ class AllOfWithSingleRef {
48
48
49
49
50
50
51
-
@override
52
-
booloperator==(Object other) =>identical(this, other) || other isAllOfWithSingleRef&&
53
-
other.username == username &&
54
-
other.singleRefType == singleRefType;
55
51
56
-
@override
57
-
intget hashCode =>
58
-
username.hashCode +
59
-
singleRefType.hashCode;
52
+
53
+
@override
54
+
booloperator==(Object other) =>identical(this, other) || other isAllOfWithSingleRef&&
Copy file name to clipboardexpand all lines: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart
+10-8
Original file line number
Diff line number
Diff line change
@@ -47,15 +47,17 @@ class Animal {
47
47
48
48
49
49
50
-
@override
51
-
booloperator==(Object other) =>identical(this, other) || other isAnimal&&
52
-
other.className == className &&
53
-
other.color == color;
54
50
55
-
@override
56
-
intget hashCode =>
57
-
className.hashCode +
58
-
color.hashCode;
51
+
52
+
@override
53
+
booloperator==(Object other) =>identical(this, other) || other isAnimal&&
Copy file name to clipboardexpand all lines: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart
+12-10
Original file line number
Diff line number
Diff line change
@@ -61,17 +61,19 @@ class ApiResponse {
61
61
62
62
63
63
64
-
@override
65
-
booloperator==(Object other) =>identical(this, other) || other isApiResponse&&
66
-
other.code == code &&
67
-
other.type == type &&
68
-
other.message == message;
69
64
70
-
@override
71
-
intget hashCode =>
72
-
code.hashCode +
73
-
type.hashCode +
74
-
message.hashCode;
65
+
66
+
@override
67
+
booloperator==(Object other) =>identical(this, other) || other isApiResponse&&
Copy file name to clipboardexpand all lines: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart
+8-6
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,15 @@ class ArrayOfArrayOfNumberOnly {
33
33
34
34
35
35
36
-
@override
37
-
booloperator==(Object other) =>identical(this, other) || other isArrayOfArrayOfNumberOnly&&
38
-
other.arrayArrayNumber == arrayArrayNumber;
39
36
40
-
@override
41
-
intget hashCode =>
42
-
arrayArrayNumber.hashCode;
37
+
38
+
@override
39
+
booloperator==(Object other) =>identical(this, other) || other isArrayOfArrayOfNumberOnly&&
Copy file name to clipboardexpand all lines: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart
+8-6
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,15 @@ class ArrayOfNumberOnly {
33
33
34
34
35
35
36
-
@override
37
-
booloperator==(Object other) =>identical(this, other) || other isArrayOfNumberOnly&&
38
-
other.arrayNumber == arrayNumber;
39
36
40
-
@override
41
-
intget hashCode =>
42
-
arrayNumber.hashCode;
37
+
38
+
@override
39
+
booloperator==(Object other) =>identical(this, other) || other isArrayOfNumberOnly&&
0 commit comments