google / google/json_serializable.dart
Either support converting to converter arg types or explicitly disallow non-JSON argument types
Open
P3 low
Type: bug
- Dominant language
- Dart
- Stars
- 1.6k
- Forks
- 461
- Avg merge
- 45m
- Merged PRs (30d)
- 1
Description
See https://github.com/google/json_serializable.dart/issues/795
Converter takes type of `List`.
generates
```dart
LoginState _$LoginStateFromJson(Map json) {
return LoginState(
cookies:
const _CookiesJsonConverter().fromJson(json['cookies'] as List),
);
}
```
Of course the `as List` will fail always.
We could/should do better here!
Annoying, but this is not a blocker. User can just change the converter to do the right thing.
Contributor guide
Assessment
This issue has not been assessed yet.