google / google/json_serializable.dart

Either support converting to converter arg types or explicitly disallow non-JSON argument types

Open
#806 2 comments 3 reactions 0 assignees View on GitHub
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

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.