Skip to content

Commit

Permalink
⬆️ update to qs_dart to enable Enum encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
techouse committed Apr 4, 2024
1 parent 34d1d06 commit 7a6c67a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chopper/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions chopper/test/utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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', () {
<Map<String, dynamic>, String>{
Expand Down Expand Up @@ -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'),
);
});
},
);

Expand Down
2 changes: 1 addition & 1 deletion chopper_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7a6c67a

Please sign in to comment.