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
The getter 'field' isn't defined for the type 'List<MultipartFile>'.
Try importing the library that defines 'field', correcting the name to the name of an existing getter, or defining a getter or field named 'field'.
Future<Response> uploaderUploadWithHttpInfo(List<MultipartFile> images,) async {
// ignore: prefer_const_declarationsfinal path =r'/upload';
// ignore: prefer_final_localsObject? postBody;
final queryParams =<QueryParam>[];
final headerParams =<String, String>{};
final formParams =<String, String>{};
const contentTypes =<String>['multipart/form-data'];
bool hasFields =false;
final mp =MultipartRequest('POST', Uri.parse(path));
if (images !=null) {
hasFields =true;
// Error:// The getter 'field' isn't defined for the type 'List<MultipartFile>'.// Try importing the library that defines 'field', correcting the name to the name of an existing getter, or defining a getter or field named 'field'.
mp.fields[r'images'] = images.field;
// Error:// The argument type 'List<MultipartFile>' can't be assigned to the parameter type 'MultipartFile'
mp.files.add(images);
}
if (hasFields) {
postBody = mp;
}
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ?null: contentTypes.first,
);
}
Hi, unfortunately, file upload is something that breaks from time to time.
To work around this, I suggest you fix the bad code and then add the file to .openapi-generator to prevent it from being overwritten the next time the geenrator runs.
Generated code error in file
Error message:
Error file Path: /lib/api/uploader_api.dart > UploaderApi > uploaderUploadWithHttpInfo
Annotation
Input spec file
The text was updated successfully, but these errors were encountered: