Skip to content

Commit 7326c0e

Browse files
committed
Fix multipart field value mapping
1 parent 2da1e6d commit 7326c0e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 0.12.0
3+
## 0.13.0
44

55
* Improved handling of multipart/form-data for client generation
66

lib/src/generators/client.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,15 +922,15 @@ class $clientName {
922922
if (isPropRequired) {
923923
input.add('required $pDartType $pDartName');
924924
if (isFieldValue) {
925-
multipartFields.add("'$pDartName': $pDartName");
925+
multipartFields.add("'${p.key}': $pDartName");
926926
}
927927
} else {
928928
final pDefault = p.value.defaultValue;
929929

930930
if (pDefault != null) {
931931
input.add("$pDartType $pDartName = '$pDefault'");
932932
if (isFieldValue) {
933-
multipartFields.add("'$pDartName': $pDartName");
933+
multipartFields.add("'${p.key}': $pDartName");
934934
}
935935
} else {
936936
if (!pDartType.contains('?')) {
@@ -939,7 +939,7 @@ class $clientName {
939939
input.add('$pDartType $pDartName');
940940
if (isFieldValue) {
941941
multipartFields
942-
.add("if ($pDartName != null) '$pDartName': $pDartName");
942+
.add("if ($pDartName != null) '${p.key}': $pDartName");
943943
}
944944
}
945945
}

lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: openapi_spec
22
description: OpenAPI Specification generator using native Dart code, as well as an all-in-one parser of existing specifications.
3-
version: 0.12.0
3+
version: 0.13.0
44
maintainer: Taza Technology LLC
55
repository: https://github.com/tazatechnology/openapi_spec
66
issue_tracker: https://github.com/tazatechnology/openapi_spec/issues

0 commit comments

Comments
 (0)