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 24, 2022
1 parent 691c522 commit 5f1f712
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions json_serializable/CHANGELOG.md
Expand Up @@ -4,6 +4,8 @@
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 emitting a nullable
type ([#1146](https://github.com/google/json_serializable.dart/pull/1146))

## 6.2.0

Expand Down

0 comments on commit 5f1f712

Please sign in to comment.