From f31ca984e69762cf240ce0c34504695cfb3364e6 Mon Sep 17 00:00:00 2001 From: Richard Vowles Date: Sat, 23 Jul 2022 18:31:45 +1200 Subject: [PATCH] missing javadocs generator for Central --- CHANGELOG.md | 4 ++++ lib/api_dio_client_delegate.dart | 18 +++++++++++++++--- pubspec.yaml | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efd3666..c6f822c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +4.1.2 +===== +Support for repeating query parameters + 4.1.1 ===== Support for unencoded Date + DateTime parameters for query parameters. diff --git a/lib/api_dio_client_delegate.dart b/lib/api_dio_client_delegate.dart index 61b0305..69e3eef 100644 --- a/lib/api_dio_client_delegate.dart +++ b/lib/api_dio_client_delegate.dart @@ -11,9 +11,21 @@ class DioClientDelegate implements ApiClientDelegate { {bool passErrorsAsApiResponses = false}) async { String url = basePath + path; - // fill in query parameters - Map qp = {}; - queryParams.forEach((q) => qp[q.name] = q.value); + // fill in query parameters, taking care to deal with duplicate + // field names + Map qp = {}; + queryParams.forEach((q) { + if (qp.containsKey(q.name)) { + final val = qp[q.name]; + if (val is List) { + val.add(q.value); + } else { + qp[q.name] = [val, q.value]; + } + } else { + qp[q.name] = q.value; + } + }); options.responseType = ResponseType.stream; options.receiveDataWhenStatusError = true; diff --git a/pubspec.yaml b/pubspec.yaml index b9a9230..ed5aebf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: openapi_dart_common -version: 4.1.1 +version: 4.1.2 homepage: https://www.featurehub.io repository: https://github.com/dart-ogurets/openapi_dart_common description: OpenAPI API common libraries so the generator doesn't generate them