-
Notifications
You must be signed in to change notification settings - Fork 435
Open
Description
This issue is related to rrousselGit/freezed#423
Is your feature request related to a problem? Please describe.
I'm building an API wrapper, and I'm dealing with two JSON object that have numerous shared keys and only a few specific ones. I have an interface like this to implement this:
abstract class MyBaseType {
@JsonKey(name: 'property_key')
final String property;
}And a couple of freezed classes like this:
@freezed
class MySpecializedType extends MyBaseType with _$MySpecializedType {
const MySpecializedType._();
const factory MySpecializedType({
required String property,
@JsonKey(name: 'another_propery_key') required String anotherProperty,
}) = _MySpecializedType
}Normally, when using json_serializable, the JsonKey annotation in the base class will be used in subclasses. This is not happening when using freezed.
Describe the solution you'd like
I'd like JsonKey annotations used in superclasses to be used in freezed subclasses as well.
Describe alternatives you've considered
The only alternative is writing the same annotation everywhere it's needed.
hacker1024, JonasWanke and RyanRamchandarblaueeiner, goevexx and tomislavsaf
Metadata
Metadata
Assignees
Labels
No labels