Skip to content

Commit

Permalink
revert: Ignore null attributes using @Body() (#225)
Browse files Browse the repository at this point in the history
* Revert "remove null fields from _data (#222)"

This reverts commit c2b7d76.

* chore: bump version to 1.7.3+5
  • Loading branch information
trevorwang authored Jul 27, 2020
1 parent 8768a83 commit 22e712a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions generator/lib/src/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,6 @@ class RetrofitGenerator extends GeneratorForAnnotation<retrofit.RestApi> {
blocks.add(refer("$_dataVar.addAll").call([
refer("${_bodyName.displayName} ?? <String,dynamic>{}")
]).statement);
blocks.add(Code("$_dataVar.removeWhere((k, v) => v == null);"));
} else if (_typeChecker(File).isExactly(_bodyName.type.element)) {
blocks.add(refer("Stream")
.property("fromIterable")
Expand All @@ -700,7 +699,6 @@ class RetrofitGenerator extends GeneratorForAnnotation<retrofit.RestApi> {
refer("${_bodyName.displayName}?.toJson() ?? <String,dynamic>{}")
]).statement);
}
blocks.add(Code("$_dataVar.removeWhere((k, v) => v == null);"));
} else {
/// @Body annotations with no type are assinged as is
blocks
Expand Down
2 changes: 1 addition & 1 deletion generator/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: retrofit_generator
description: retrofit generator is an dio client generator using source_gen and inspired by Chopper and Retrofit.
version: 1.3.7+4
version: 1.3.7+5

homepage: https://mings.in/retrofit.dart/
repository: https://github.com/trevorwang/retrofit.dart/
Expand Down

0 comments on commit 22e712a

Please sign in to comment.