jankuss / genq

Instant Data Class Generation for Dart
MIT License
133 stars 0 forks source link

Add `JsonSerializable`-like annotation #16

Open jankuss opened 4 months ago

jankuss commented 4 months ago

A lot of existing dart code bases use vanilla json_serializable & json_annotation (https://pub.dev/packages/json_serializable), without any freezed. For classes marked with the annotation, the fields within the class will be considered for generating the serialization/deserialization code.

We could offer such an annotation, which is almost identical to the annotation from json_serializable (maybe @GenqJsonSerializable()). This should make migrations relatively trivial.

A limitation might be that genq has no ability to resolve inherited fields.