Skip to content

Commit 54c3b48

Browse files
committed
Revert linter fix
1 parent 86f8fbf commit 54c3b48

11 files changed

Lines changed: 62 additions & 0 deletions

File tree

modules/openapi-generator/src/main/resources/dart2/api.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ class {{{classname}}} {
188188
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), '{{{returnType}}}',) as {{{returnType}}};
189189
{{/isMap}}{{/isArray}}{{/native_serialization}}
190190
}
191+
return Future<{{{returnType}}}>.value();
191192
{{/returnType}}
192193
}
193194
{{/operation}}

samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/pet_api.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class PetApi {
6969
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Pet',) as Pet;
7070

7171
}
72+
return Future<Pet>.value();
7273
}
7374

7475
/// Deletes a pet
@@ -133,6 +134,7 @@ class PetApi {
133134
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
134135

135136
}
137+
return Future<Map<String, dynamic>>.value();
136138
}
137139

138140
/// Finds Pets by status
@@ -197,6 +199,7 @@ class PetApi {
197199
.toList(growable: false);
198200

199201
}
202+
return Future<List<Pet>>.value();
200203
}
201204

202205
/// Finds Pets by tags
@@ -261,6 +264,7 @@ class PetApi {
261264
.toList(growable: false);
262265

263266
}
267+
return Future<List<Pet>>.value();
264268
}
265269

266270
/// Find pet by ID
@@ -321,6 +325,7 @@ class PetApi {
321325
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Pet',) as Pet;
322326

323327
}
328+
return Future<Pet>.value();
324329
}
325330

326331
/// Update an existing pet
@@ -376,6 +381,7 @@ class PetApi {
376381
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Pet',) as Pet;
377382

378383
}
384+
return Future<Pet>.value();
379385
}
380386

381387
/// Updates a pet in the store with form data
@@ -450,6 +456,7 @@ class PetApi {
450456
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
451457

452458
}
459+
return Future<Map<String, dynamic>>.value();
453460
}
454461

455462
/// uploads an image
@@ -532,5 +539,6 @@ class PetApi {
532539
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiResponse',) as ApiResponse;
533540

534541
}
542+
return Future<ApiResponse>.value();
535543
}
536544
}

samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/store_api.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class StoreApi {
7474
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
7575

7676
}
77+
return Future<Map<String, dynamic>>.value();
7778
}
7879

7980
/// Returns pet inventories by status
@@ -123,6 +124,7 @@ class StoreApi {
123124
return Map<String, int>.from(await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, int>'),);
124125

125126
}
127+
return Future<Map<String, int>>.value();
126128
}
127129

128130
/// Find purchase order by ID
@@ -183,6 +185,7 @@ class StoreApi {
183185
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Order',) as Order;
184186

185187
}
188+
return Future<Order>.value();
186189
}
187190

188191
/// Place an order for a pet
@@ -238,5 +241,6 @@ class StoreApi {
238241
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Order',) as Order;
239242

240243
}
244+
return Future<Order>.value();
241245
}
242246
}

samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api/user_api.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class UserApi {
7373
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
7474

7575
}
76+
return Future<Map<String, dynamic>>.value();
7677
}
7778

7879
/// Creates list of users with given input array
@@ -128,6 +129,7 @@ class UserApi {
128129
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
129130

130131
}
132+
return Future<Map<String, dynamic>>.value();
131133
}
132134

133135
/// Creates list of users with given input array
@@ -183,6 +185,7 @@ class UserApi {
183185
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
184186

185187
}
188+
return Future<Map<String, dynamic>>.value();
186189
}
187190

188191
/// Delete user
@@ -243,6 +246,7 @@ class UserApi {
243246
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
244247

245248
}
249+
return Future<Map<String, dynamic>>.value();
246250
}
247251

248252
/// Get user by user name
@@ -299,6 +303,7 @@ class UserApi {
299303
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'User',) as User;
300304

301305
}
306+
return Future<User>.value();
302307
}
303308

304309
/// Logs user into the system
@@ -363,6 +368,7 @@ class UserApi {
363368
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
364369

365370
}
371+
return Future<String>.value();
366372
}
367373

368374
/// Logs out current logged in user session
@@ -408,6 +414,7 @@ class UserApi {
408414
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
409415

410416
}
417+
return Future<Map<String, dynamic>>.value();
411418
}
412419

413420
/// Updated user
@@ -474,5 +481,6 @@ class UserApi {
474481
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
475482

476483
}
484+
return Future<Map<String, dynamic>>.value();
477485
}
478486
}

samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/another_fake_api.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,6 @@ class AnotherFakeApi {
7373
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ModelClient',) as ModelClient;
7474

7575
}
76+
return Future<ModelClient>.value();
7677
}
7778
}

samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/default_api.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ class DefaultApi {
5656
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InlineResponseDefault',) as InlineResponseDefault;
5757

5858
}
59+
return Future<InlineResponseDefault>.value();
5960
}
6061
}

samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class FakeApi {
5959
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'HealthCheckResult',) as HealthCheckResult;
6060

6161
}
62+
return Future<HealthCheckResult>.value();
6263
}
6364

6465
/// test http signature authentication
@@ -134,6 +135,7 @@ class FakeApi {
134135
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
135136

136137
}
138+
return Future<Map<String, dynamic>>.value();
137139
}
138140

139141
/// Test serialization of outer boolean types
@@ -189,6 +191,7 @@ class FakeApi {
189191
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'bool',) as bool;
190192

191193
}
194+
return Future<bool>.value();
192195
}
193196

194197
/// Test serialization of object with outer number type
@@ -244,6 +247,7 @@ class FakeApi {
244247
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'OuterComposite',) as OuterComposite;
245248

246249
}
250+
return Future<OuterComposite>.value();
247251
}
248252

249253
/// Test serialization of outer number types
@@ -299,6 +303,7 @@ class FakeApi {
299303
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'num',) as num;
300304

301305
}
306+
return Future<num>.value();
302307
}
303308

304309
/// Test serialization of outer string types
@@ -354,6 +359,7 @@ class FakeApi {
354359
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
355360

356361
}
362+
return Future<String>.value();
357363
}
358364

359365
/// Test serialization of enum (int) properties with examples
@@ -409,6 +415,7 @@ class FakeApi {
409415
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'OuterObjectWithEnumProperty',) as OuterObjectWithEnumProperty;
410416

411417
}
418+
return Future<OuterObjectWithEnumProperty>.value();
412419
}
413420

414421
/// For this test, the body has to be a binary file.
@@ -464,6 +471,7 @@ class FakeApi {
464471
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
465472

466473
}
474+
return Future<Map<String, dynamic>>.value();
467475
}
468476

469477
/// For this test, the body for this request must reference a schema named `File`.
@@ -517,6 +525,7 @@ class FakeApi {
517525
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
518526

519527
}
528+
return Future<Map<String, dynamic>>.value();
520529
}
521530

522531
/// Performs an HTTP 'PUT /fake/body-with-query-params' operation and returns the [Response].
@@ -571,6 +580,7 @@ class FakeApi {
571580
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
572581

573582
}
583+
return Future<Map<String, dynamic>>.value();
574584
}
575585

576586
/// To test \"client\" model
@@ -630,6 +640,7 @@ class FakeApi {
630640
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ModelClient',) as ModelClient;
631641

632642
}
643+
return Future<ModelClient>.value();
633644
}
634645

635646
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -806,6 +817,7 @@ class FakeApi {
806817
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
807818

808819
}
820+
return Future<Map<String, dynamic>>.value();
809821
}
810822

811823
/// To test enum parameters
@@ -933,6 +945,7 @@ class FakeApi {
933945
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
934946

935947
}
948+
return Future<Map<String, dynamic>>.value();
936949
}
937950

938951
/// Fake endpoint to test group parameters (optional)
@@ -1036,6 +1049,7 @@ class FakeApi {
10361049
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
10371050

10381051
}
1052+
return Future<Map<String, dynamic>>.value();
10391053
}
10401054

10411055
/// test inline additionalProperties
@@ -1091,6 +1105,7 @@ class FakeApi {
10911105
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
10921106

10931107
}
1108+
return Future<Map<String, dynamic>>.value();
10941109
}
10951110

10961111
/// test json serialization of form data
@@ -1158,6 +1173,7 @@ class FakeApi {
11581173
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
11591174

11601175
}
1176+
return Future<Map<String, dynamic>>.value();
11611177
}
11621178

11631179
/// To test the collection format in query parameters
@@ -1245,5 +1261,6 @@ class FakeApi {
12451261
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
12461262

12471263
}
1264+
return Future<Map<String, dynamic>>.value();
12481265
}
12491266
}

samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_classname_tags123_api.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,6 @@ class FakeClassnameTags123Api {
7373
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ModelClient',) as ModelClient;
7474

7575
}
76+
return Future<ModelClient>.value();
7677
}
7778
}

samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/pet_api.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class PetApi {
6969
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
7070

7171
}
72+
return Future<Map<String, dynamic>>.value();
7273
}
7374

7475
/// Deletes a pet
@@ -133,6 +134,7 @@ class PetApi {
133134
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
134135

135136
}
137+
return Future<Map<String, dynamic>>.value();
136138
}
137139

138140
/// Finds Pets by status
@@ -197,6 +199,7 @@ class PetApi {
197199
.toList(growable: false);
198200

199201
}
202+
return Future<List<Pet>>.value();
200203
}
201204

202205
/// Finds Pets by tags
@@ -261,6 +264,7 @@ class PetApi {
261264
.toSet();
262265

263266
}
267+
return Future<Set<Pet>>.value();
264268
}
265269

266270
/// Find pet by ID
@@ -321,6 +325,7 @@ class PetApi {
321325
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Pet',) as Pet;
322326

323327
}
328+
return Future<Pet>.value();
324329
}
325330

326331
/// Update an existing pet
@@ -376,6 +381,7 @@ class PetApi {
376381
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
377382

378383
}
384+
return Future<Map<String, dynamic>>.value();
379385
}
380386

381387
/// Updates a pet in the store with form data
@@ -450,6 +456,7 @@ class PetApi {
450456
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, dynamic>',) as Map<String, dynamic>;
451457

452458
}
459+
return Future<Map<String, dynamic>>.value();
453460
}
454461

455462
/// uploads an image
@@ -532,6 +539,7 @@ class PetApi {
532539
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiResponse',) as ApiResponse;
533540

534541
}
542+
return Future<ApiResponse>.value();
535543
}
536544

537545
/// uploads an image (required)
@@ -614,5 +622,6 @@ class PetApi {
614622
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiResponse',) as ApiResponse;
615623

616624
}
625+
return Future<ApiResponse>.value();
617626
}
618627
}

0 commit comments

Comments
 (0)