google / google/json_serializable.dart

[Feature Request] Custom fromJson for JsonEnum

Open
#1,036 2 comments 2 reactions 0 assignees View on GitHub
Area: enums Type: enhancement
Dominant language
Dart
Stars
1.6k
Forks
461
Avg merge
45m
Merged PRs (30d)
1

Description

I want to track when `unknownValue` occurs when parsing fromJson for enum type, so that I can fix the model or tell the BE if something unexpected happen.

In order to do that, I guess we need to be able to inject custom deserialization method, not just mapping. Just like `fromJson` and `toJson` in `JsonKey`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.