Skip to content

Commit

Permalink
Ensure query parameters are stringified
Browse files Browse the repository at this point in the history
  • Loading branch information
walsha2 committed Sep 15, 2023
1 parent 309b8eb commit 679ab36
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changelog

## 0.5.8
## 0.5.9

* Ensure query parameters are stringified
* Allow URI construction to handle query parameter encoding

## 0.5.7
Expand Down
9 changes: 9 additions & 0 deletions lib/src/generators/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ class $clientName {
);
}
// Ensure query parameters are strings or iterable of strings
queryParams = queryParams.map((key, value) {
if (value is List) {
return MapEntry(key, value.map((v) => v.toString()));
} else {
return MapEntry(key, value.toString());
}
});
// Build the request URI
final secure = Uri.parse(host).scheme == 'https';
Uri uri;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: openapi_spec
description: OpenAPI Specification generator using native Dart code, as well as an all-in-one parser of existing specifications.
version: 0.5.8
version: 0.5.9
maintainer: Taza Technology LLC
repository: https://github.com/tazatechnology/openapi_spec
issue_tracker: https://github.com/tazatechnology/openapi_spec/issues
Expand Down

0 comments on commit 679ab36

Please sign in to comment.