google / google/json_serializable.dart

Support annotations on ctor params when there is no associated field

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

Description

See https://github.com/dart-lang/json_serializable/issues/285#issuecomment-415609028

```dart
@JsonSerializable(createToJson: false)
class LogisticsItem {
final bool logisticsChecked;
final bool logisticsOK;

LogisticsItem(@JsonKey(name: 'LogistikTeileInOrdnung') String processed)
: logisticsChecked = processed != null && processed != 'null',
logisticsOK = processed == 'true';
}
```

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.