Skip to content

Commit 63babf6

Browse files
committed
regenerate petstore sample with optional non-nullable fix
1 parent 9637541 commit 63babf6

50 files changed

Lines changed: 451 additions & 234 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,25 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer<Addit
9696
case r'map_property':
9797
final valueDes = serializers.deserialize(
9898
value,
99-
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]),
100-
) as BuiltMap<String, String>;
99+
specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(String)]),
100+
) as BuiltMap<String, String>?;
101+
if (valueDes == null) continue;
101102
result.mapProperty.replace(valueDes);
102103
break;
103104
case r'map_of_map_property':
104105
final valueDes = serializers.deserialize(
105106
value,
106-
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]),
107-
) as BuiltMap<String, BuiltMap<String, String>>;
107+
specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]),
108+
) as BuiltMap<String, BuiltMap<String, String>>?;
109+
if (valueDes == null) continue;
108110
result.mapOfMapProperty.replace(valueDes);
109111
break;
110112
case r'map_of_array_integer':
111113
final valueDes = serializers.deserialize(
112114
value,
113-
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltList, [FullType(int)])]),
114-
) as BuiltMap<String, BuiltList<int>>;
115+
specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(BuiltList, [FullType(int)])]),
116+
) as BuiltMap<String, BuiltList<int>>?;
117+
if (valueDes == null) continue;
115118
result.mapOfArrayInteger.replace(valueDes);
116119
break;
117120
default:
@@ -122,6 +125,7 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer<Addit
122125
}
123126
}
124127

128+
125129
@override
126130
AdditionalPropertiesClass deserialize(
127131
Serializers serializers,

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,17 @@ class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer<AllOfWithSin
8686
case r'username':
8787
final valueDes = serializers.deserialize(
8888
value,
89-
specifiedType: const FullType(String),
90-
) as String;
89+
specifiedType: const FullType.nullable(String),
90+
) as String?;
91+
if (valueDes == null) continue;
9192
result.username = valueDes;
9293
break;
9394
case r'SingleRefType':
9495
final valueDes = serializers.deserialize(
9596
value,
96-
specifiedType: const FullType(SingleRefType),
97-
) as SingleRefType;
97+
specifiedType: const FullType.nullable(SingleRefType),
98+
) as SingleRefType?;
99+
if (valueDes == null) continue;
98100
result.singleRefType = valueDes;
99101
break;
100102
default:
@@ -105,6 +107,7 @@ class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer<AllOfWithSin
105107
}
106108
}
107109

110+
108111
@override
109112
AllOfWithSingleRef deserialize(
110113
Serializers serializers,

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ class _$$AnimalSerializer implements PrimitiveSerializer<$Animal> {
170170
case r'color':
171171
final valueDes = serializers.deserialize(
172172
value,
173-
specifiedType: const FullType(String),
174-
) as String;
173+
specifiedType: const FullType.nullable(String),
174+
) as String?;
175+
if (valueDes == null) continue;
175176
result.color = valueDes;
176177
break;
177178
default:
@@ -182,6 +183,7 @@ class _$$AnimalSerializer implements PrimitiveSerializer<$Animal> {
182183
}
183184
}
184185

186+
185187
@override
186188
$Animal deserialize(
187189
Serializers serializers,

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,25 @@ class _$ApiResponseSerializer implements PrimitiveSerializer<ApiResponse> {
9595
case r'code':
9696
final valueDes = serializers.deserialize(
9797
value,
98-
specifiedType: const FullType(int),
99-
) as int;
98+
specifiedType: const FullType.nullable(int),
99+
) as int?;
100+
if (valueDes == null) continue;
100101
result.code = valueDes;
101102
break;
102103
case r'type':
103104
final valueDes = serializers.deserialize(
104105
value,
105-
specifiedType: const FullType(String),
106-
) as String;
106+
specifiedType: const FullType.nullable(String),
107+
) as String?;
108+
if (valueDes == null) continue;
107109
result.type = valueDes;
108110
break;
109111
case r'message':
110112
final valueDes = serializers.deserialize(
111113
value,
112-
specifiedType: const FullType(String),
113-
) as String;
114+
specifiedType: const FullType.nullable(String),
115+
) as String?;
116+
if (valueDes == null) continue;
114117
result.message = valueDes;
115118
break;
116119
default:
@@ -121,6 +124,7 @@ class _$ApiResponseSerializer implements PrimitiveSerializer<ApiResponse> {
121124
}
122125
}
123126

127+
124128
@override
125129
ApiResponse deserialize(
126130
Serializers serializers,

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer<ArrayO
7474
case r'ArrayArrayNumber':
7575
final valueDes = serializers.deserialize(
7676
value,
77-
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]),
78-
) as BuiltList<BuiltList<num>>;
77+
specifiedType: const FullType.nullable(BuiltList, [FullType(BuiltList, [FullType(num)])]),
78+
) as BuiltList<BuiltList<num>>?;
79+
if (valueDes == null) continue;
7980
result.arrayArrayNumber.replace(valueDes);
8081
break;
8182
default:
@@ -86,6 +87,7 @@ class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer<ArrayO
8687
}
8788
}
8889

90+
8991
@override
9092
ArrayOfArrayOfNumberOnly deserialize(
9193
Serializers serializers,

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer<ArrayOfNumber
7474
case r'ArrayNumber':
7575
final valueDes = serializers.deserialize(
7676
value,
77-
specifiedType: const FullType(BuiltList, [FullType(num)]),
78-
) as BuiltList<num>;
77+
specifiedType: const FullType.nullable(BuiltList, [FullType(num)]),
78+
) as BuiltList<num>?;
79+
if (valueDes == null) continue;
7980
result.arrayNumber.replace(valueDes);
8081
break;
8182
default:
@@ -86,6 +87,7 @@ class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer<ArrayOfNumber
8687
}
8788
}
8889

90+
8991
@override
9092
ArrayOfNumberOnly deserialize(
9193
Serializers serializers,

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_test.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,25 @@ class _$ArrayTestSerializer implements PrimitiveSerializer<ArrayTest> {
9797
case r'array_of_string':
9898
final valueDes = serializers.deserialize(
9999
value,
100-
specifiedType: const FullType(BuiltList, [FullType(String)]),
101-
) as BuiltList<String>;
100+
specifiedType: const FullType.nullable(BuiltList, [FullType(String)]),
101+
) as BuiltList<String>?;
102+
if (valueDes == null) continue;
102103
result.arrayOfString.replace(valueDes);
103104
break;
104105
case r'array_array_of_integer':
105106
final valueDes = serializers.deserialize(
106107
value,
107-
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]),
108-
) as BuiltList<BuiltList<int>>;
108+
specifiedType: const FullType.nullable(BuiltList, [FullType(BuiltList, [FullType(int)])]),
109+
) as BuiltList<BuiltList<int>>?;
110+
if (valueDes == null) continue;
109111
result.arrayArrayOfInteger.replace(valueDes);
110112
break;
111113
case r'array_array_of_model':
112114
final valueDes = serializers.deserialize(
113115
value,
114-
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]),
115-
) as BuiltList<BuiltList<ReadOnlyFirst>>;
116+
specifiedType: const FullType.nullable(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]),
117+
) as BuiltList<BuiltList<ReadOnlyFirst>>?;
118+
if (valueDes == null) continue;
116119
result.arrayArrayOfModel.replace(valueDes);
117120
break;
118121
default:
@@ -123,6 +126,7 @@ class _$ArrayTestSerializer implements PrimitiveSerializer<ArrayTest> {
123126
}
124127
}
125128

129+
126130
@override
127131
ArrayTest deserialize(
128132
Serializers serializers,

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,43 +129,49 @@ class _$CapitalizationSerializer implements PrimitiveSerializer<Capitalization>
129129
case r'smallCamel':
130130
final valueDes = serializers.deserialize(
131131
value,
132-
specifiedType: const FullType(String),
133-
) as String;
132+
specifiedType: const FullType.nullable(String),
133+
) as String?;
134+
if (valueDes == null) continue;
134135
result.smallCamel = valueDes;
135136
break;
136137
case r'CapitalCamel':
137138
final valueDes = serializers.deserialize(
138139
value,
139-
specifiedType: const FullType(String),
140-
) as String;
140+
specifiedType: const FullType.nullable(String),
141+
) as String?;
142+
if (valueDes == null) continue;
141143
result.capitalCamel = valueDes;
142144
break;
143145
case r'small_Snake':
144146
final valueDes = serializers.deserialize(
145147
value,
146-
specifiedType: const FullType(String),
147-
) as String;
148+
specifiedType: const FullType.nullable(String),
149+
) as String?;
150+
if (valueDes == null) continue;
148151
result.smallSnake = valueDes;
149152
break;
150153
case r'Capital_Snake':
151154
final valueDes = serializers.deserialize(
152155
value,
153-
specifiedType: const FullType(String),
154-
) as String;
156+
specifiedType: const FullType.nullable(String),
157+
) as String?;
158+
if (valueDes == null) continue;
155159
result.capitalSnake = valueDes;
156160
break;
157161
case r'SCA_ETH_Flow_Points':
158162
final valueDes = serializers.deserialize(
159163
value,
160-
specifiedType: const FullType(String),
161-
) as String;
164+
specifiedType: const FullType.nullable(String),
165+
) as String?;
166+
if (valueDes == null) continue;
162167
result.sCAETHFlowPoints = valueDes;
163168
break;
164169
case r'ATT_NAME':
165170
final valueDes = serializers.deserialize(
166171
value,
167-
specifiedType: const FullType(String),
168-
) as String;
172+
specifiedType: const FullType.nullable(String),
173+
) as String?;
174+
if (valueDes == null) continue;
169175
result.ATT_NAME = valueDes;
170176
break;
171177
default:
@@ -176,6 +182,7 @@ class _$CapitalizationSerializer implements PrimitiveSerializer<Capitalization>
176182
}
177183
}
178184

185+
179186
@override
180187
Capitalization deserialize(
181188
Serializers serializers,

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,17 @@ class _$CatSerializer implements PrimitiveSerializer<Cat> {
8989
case r'color':
9090
final valueDes = serializers.deserialize(
9191
value,
92-
specifiedType: const FullType(String),
93-
) as String;
92+
specifiedType: const FullType.nullable(String),
93+
) as String?;
94+
if (valueDes == null) continue;
9495
result.color = valueDes;
9596
break;
9697
case r'declawed':
9798
final valueDes = serializers.deserialize(
9899
value,
99-
specifiedType: const FullType(bool),
100-
) as bool;
100+
specifiedType: const FullType.nullable(bool),
101+
) as bool?;
102+
if (valueDes == null) continue;
101103
result.declawed = valueDes;
102104
break;
103105
case r'className':
@@ -115,6 +117,7 @@ class _$CatSerializer implements PrimitiveSerializer<Cat> {
115117
}
116118
}
117119

120+
118121
@override
119122
Cat deserialize(
120123
Serializers serializers,

samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ class _$CategorySerializer implements PrimitiveSerializer<Category> {
8383
case r'id':
8484
final valueDes = serializers.deserialize(
8585
value,
86-
specifiedType: const FullType(int),
87-
) as int;
86+
specifiedType: const FullType.nullable(int),
87+
) as int?;
88+
if (valueDes == null) continue;
8889
result.id = valueDes;
8990
break;
9091
case r'name':
@@ -102,6 +103,7 @@ class _$CategorySerializer implements PrimitiveSerializer<Category> {
102103
}
103104
}
104105

106+
105107
@override
106108
Category deserialize(
107109
Serializers serializers,

0 commit comments

Comments
 (0)