@@ -28,10 +28,10 @@ class PetApi {
28
28
29
29
List <String > contentTypes = ["application/json" ,"application/xml" ];
30
30
31
- String contentType = contentTypes.isNotEmpty ? contentTypes[0 ] : "application/json" ;
31
+ String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0 ] : null ;
32
32
List <String > authNames = ["petstore_auth" ];
33
33
34
- if (contentType .startsWith ("multipart/form-data" )) {
34
+ if (nullableContentType != null && nullableContentType .startsWith ("multipart/form-data" )) {
35
35
bool hasFields = false ;
36
36
MultipartRequest mp = MultipartRequest (null , null );
37
37
if (hasFields)
@@ -46,7 +46,7 @@ class PetApi {
46
46
postBody,
47
47
headerParams,
48
48
formParams,
49
- contentType ,
49
+ nullableContentType ,
50
50
authNames);
51
51
return response;
52
52
}
@@ -86,10 +86,10 @@ class PetApi {
86
86
87
87
List <String > contentTypes = [];
88
88
89
- String contentType = contentTypes.isNotEmpty ? contentTypes[0 ] : "application/json" ;
89
+ String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0 ] : null ;
90
90
List <String > authNames = ["petstore_auth" ];
91
91
92
- if (contentType .startsWith ("multipart/form-data" )) {
92
+ if (nullableContentType != null && nullableContentType .startsWith ("multipart/form-data" )) {
93
93
bool hasFields = false ;
94
94
MultipartRequest mp = MultipartRequest (null , null );
95
95
if (hasFields)
@@ -104,7 +104,7 @@ class PetApi {
104
104
postBody,
105
105
headerParams,
106
106
formParams,
107
- contentType ,
107
+ nullableContentType ,
108
108
authNames);
109
109
return response;
110
110
}
@@ -144,10 +144,10 @@ class PetApi {
144
144
145
145
List <String > contentTypes = [];
146
146
147
- String contentType = contentTypes.isNotEmpty ? contentTypes[0 ] : "application/json" ;
147
+ String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0 ] : null ;
148
148
List <String > authNames = ["petstore_auth" ];
149
149
150
- if (contentType .startsWith ("multipart/form-data" )) {
150
+ if (nullableContentType != null && nullableContentType .startsWith ("multipart/form-data" )) {
151
151
bool hasFields = false ;
152
152
MultipartRequest mp = MultipartRequest (null , null );
153
153
if (hasFields)
@@ -162,7 +162,7 @@ class PetApi {
162
162
postBody,
163
163
headerParams,
164
164
formParams,
165
- contentType ,
165
+ nullableContentType ,
166
166
authNames);
167
167
return response;
168
168
}
@@ -203,10 +203,10 @@ class PetApi {
203
203
204
204
List <String > contentTypes = [];
205
205
206
- String contentType = contentTypes.isNotEmpty ? contentTypes[0 ] : "application/json" ;
206
+ String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0 ] : null ;
207
207
List <String > authNames = ["petstore_auth" ];
208
208
209
- if (contentType .startsWith ("multipart/form-data" )) {
209
+ if (nullableContentType != null && nullableContentType .startsWith ("multipart/form-data" )) {
210
210
bool hasFields = false ;
211
211
MultipartRequest mp = MultipartRequest (null , null );
212
212
if (hasFields)
@@ -221,7 +221,7 @@ class PetApi {
221
221
postBody,
222
222
headerParams,
223
223
formParams,
224
- contentType ,
224
+ nullableContentType ,
225
225
authNames);
226
226
return response;
227
227
}
@@ -261,10 +261,10 @@ class PetApi {
261
261
262
262
List <String > contentTypes = [];
263
263
264
- String contentType = contentTypes.isNotEmpty ? contentTypes[0 ] : "application/json" ;
264
+ String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0 ] : null ;
265
265
List <String > authNames = ["api_key" ];
266
266
267
- if (contentType .startsWith ("multipart/form-data" )) {
267
+ if (nullableContentType != null && nullableContentType .startsWith ("multipart/form-data" )) {
268
268
bool hasFields = false ;
269
269
MultipartRequest mp = MultipartRequest (null , null );
270
270
if (hasFields)
@@ -279,7 +279,7 @@ class PetApi {
279
279
postBody,
280
280
headerParams,
281
281
formParams,
282
- contentType ,
282
+ nullableContentType ,
283
283
authNames);
284
284
return response;
285
285
}
@@ -319,10 +319,10 @@ class PetApi {
319
319
320
320
List <String > contentTypes = ["application/json" ,"application/xml" ];
321
321
322
- String contentType = contentTypes.isNotEmpty ? contentTypes[0 ] : "application/json" ;
322
+ String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0 ] : null ;
323
323
List <String > authNames = ["petstore_auth" ];
324
324
325
- if (contentType .startsWith ("multipart/form-data" )) {
325
+ if (nullableContentType != null && nullableContentType .startsWith ("multipart/form-data" )) {
326
326
bool hasFields = false ;
327
327
MultipartRequest mp = MultipartRequest (null , null );
328
328
if (hasFields)
@@ -337,7 +337,7 @@ class PetApi {
337
337
postBody,
338
338
headerParams,
339
339
formParams,
340
- contentType ,
340
+ nullableContentType ,
341
341
authNames);
342
342
return response;
343
343
}
@@ -376,10 +376,10 @@ class PetApi {
376
376
377
377
List <String > contentTypes = ["application/x-www-form-urlencoded" ];
378
378
379
- String contentType = contentTypes.isNotEmpty ? contentTypes[0 ] : "application/json" ;
379
+ String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0 ] : null ;
380
380
List <String > authNames = ["petstore_auth" ];
381
381
382
- if (contentType .startsWith ("multipart/form-data" )) {
382
+ if (nullableContentType != null && nullableContentType .startsWith ("multipart/form-data" )) {
383
383
bool hasFields = false ;
384
384
MultipartRequest mp = MultipartRequest (null , null );
385
385
if (name != null ) {
@@ -406,7 +406,7 @@ class PetApi {
406
406
postBody,
407
407
headerParams,
408
408
formParams,
409
- contentType ,
409
+ nullableContentType ,
410
410
authNames);
411
411
return response;
412
412
}
@@ -445,10 +445,10 @@ class PetApi {
445
445
446
446
List <String > contentTypes = ["multipart/form-data" ];
447
447
448
- String contentType = contentTypes.isNotEmpty ? contentTypes[0 ] : "application/json" ;
448
+ String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0 ] : null ;
449
449
List <String > authNames = ["petstore_auth" ];
450
450
451
- if (contentType .startsWith ("multipart/form-data" )) {
451
+ if (nullableContentType != null && nullableContentType .startsWith ("multipart/form-data" )) {
452
452
bool hasFields = false ;
453
453
MultipartRequest mp = MultipartRequest (null , null );
454
454
if (additionalMetadata != null ) {
@@ -474,7 +474,7 @@ class PetApi {
474
474
postBody,
475
475
headerParams,
476
476
formParams,
477
- contentType ,
477
+ nullableContentType ,
478
478
authNames);
479
479
return response;
480
480
}
0 commit comments