Could you please add an option that enums are generated with unkown value? This enables enums to be more safe for future additions.
json_serializable does unfortunately not support null values for unkown cases, but you can define a fallback value like unkown.
The configuration in json_serializable for this looks like this:
@JsonEnum()
enum MenuItemType {
...
@JsonValue('unkown')
unkown;
}
@JsonKey(
name: 'type',
unknownEnumValue: MenuItemType.unkown,
)
final MenuItemType type;
Could you please add an option that enums are generated with unkown value? This enables enums to be more safe for future additions.
json_serializable does unfortunately not support null values for unkown cases, but you can define a fallback value like unkown.
The configuration in json_serializable for this looks like this: