diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache index 112fd77f9993..48b73d914c02 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache @@ -55,6 +55,9 @@ class {{classname}} { } {{/isFile}} {{/isMultipart}} + {{^isMultipart}} + formData['{{baseName}}'] = parameterToString(_serializers, {{paramName}}); + {{/isMultipart}} {{/formParams}} bodyData = FormData.fromMap(formData); {{/hasFormParams}} diff --git a/samples/client/petstore/dart-dio/.openapi-generator/VERSION b/samples/client/petstore/dart-dio/.openapi-generator/VERSION index b5d898602c2c..9e9d3e448fb4 100644 --- a/samples/client/petstore/dart-dio/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-dio/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT diff --git a/samples/client/petstore/dart-dio/lib/api/pet_api.dart b/samples/client/petstore/dart-dio/lib/api/pet_api.dart index 5c78e6e6204c..c5a66f32cc7a 100644 --- a/samples/client/petstore/dart-dio/lib/api/pet_api.dart +++ b/samples/client/petstore/dart-dio/lib/api/pet_api.dart @@ -266,6 +266,8 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; Map formData = {}; + formData['name'] = parameterToString(_serializers, name); + formData['status'] = parameterToString(_serializers, status); bodyData = FormData.fromMap(formData);