Skip to content

Commit

Permalink
Fix serialization of non-nullable enums using _$xxxEnumMap
Browse files Browse the repository at this point in the history
Before this change, serializing non-nullable enums in a subtype was incorrectly producing nullable string types.

For example, serializing a class member of type Map<enum, String> produced a type Map<String?, dynamic> where Map<String, dynamic> should have been produced.

Nullable enums should still produce nullable types, eg. serializing List<enum?> should produce List<String?>

fixes 1145
  • Loading branch information
ssabdb committed Jun 19, 2022
1 parent 691c522 commit 1436744
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions json_serializable/CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@
of type `MyClass?`. ([#822](https://github.com/google/json_serializable.dart/issues/822))
- Added support for `JsonSerializable(converters: <JsonConverter>[])`
([#1072](https://github.com/google/json_serializable.dart/issues/1072))
- Fix issue with serialization of non-nullable enumerations to emit a non-nullable type ([#1146](https://github.com/google/json_serializable.dart/pull/1146))

## 6.2.0

Expand Down

0 comments on commit 1436744

Please sign in to comment.