From 7a6c67a7916c79e1867cd23d6f12909ffbb2203f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemen=20Tu=C5=A1ar?= Date: Thu, 4 Apr 2024 21:28:48 +0200 Subject: [PATCH] :arrow_up: update to qs_dart to enable Enum encoding --- chopper/pubspec.yaml | 2 +- chopper/test/utils_test.dart | 16 ++++++++++++++++ chopper_generator/pubspec.yaml | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/chopper/pubspec.yaml b/chopper/pubspec.yaml index 200da353..dd8f83d2 100644 --- a/chopper/pubspec.yaml +++ b/chopper/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: http: ^1.1.0 logging: ^1.2.0 meta: ^1.9.1 - qs_dart: ^1.0.2 + qs_dart: ^1.0.3 dev_dependencies: build_runner: ^2.4.6 diff --git a/chopper/test/utils_test.dart b/chopper/test/utils_test.dart index 674b6ab9..fc4e6810 100644 --- a/chopper/test/utils_test.dart +++ b/chopper/test/utils_test.dart @@ -5,6 +5,8 @@ import 'package:chopper/src/request.dart'; import 'package:chopper/src/utils.dart'; import 'package:test/test.dart'; +import 'fixtures/example_enum.dart'; + void main() { group('mapToQuery single', () { , String>{ @@ -1795,6 +1797,20 @@ void main() { ), ), ); + + test('mapToQuery maps with enums', () { + final map = { + 'filters': { + 'name': 'foo', + 'example': ExampleEnum.bar, + } + }; + + expect( + mapToQuery(map), + equals('filters.name=foo&filters.example=bar'), + ); + }); }, ); diff --git a/chopper_generator/pubspec.yaml b/chopper_generator/pubspec.yaml index 0ad1cc73..0df81516 100644 --- a/chopper_generator/pubspec.yaml +++ b/chopper_generator/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: meta: ^1.9.1 source_gen: ^1.4.0 yaml: ^3.1.2 - qs_dart: ^1.0.2 + qs_dart: ^1.0.3 collection: ^1.18.0 dev_dependencies: