From ff72d7443e71ec466581c681b61e5a76f6cd72fc Mon Sep 17 00:00:00 2001 From: adg-mh <40580891+adg-mh@users.noreply.github.com> Date: Sun, 15 Mar 2020 11:29:39 -0500 Subject: [PATCH] [dart-dio][client] Handle x-www-form-urlencoded form data --- .../openapi-generator/src/main/resources/dart-dio/api.mustache | 3 +++ samples/client/petstore/dart-dio/.openapi-generator/VERSION | 2 +- samples/client/petstore/dart-dio/lib/api/pet_api.dart | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) 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 58592f031f65..bfbf77eb7fad 100644 --- a/samples/client/petstore/dart-dio/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-dio/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.3-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file 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);