json_serializable.dart
json_serializable.dart copied to clipboard
[Feature Request] list name
Hello, sometimes i need to have a list of different names for values @JsonKey(name: ['firstName' , 'altertativeName'])
codogen json['firstNane'] ?? json['altertativeName']
Do you mean something like that https://github.com/k-paxian/dart-json-mapper#name-aliases-configuration ?
k
yes)) as I understand it, this is your add-on to the current package
Nope, unfortunately it's a different independent package
Use https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/readValue.html – this is a general solution for this case.