json_serializable.dart
json_serializable.dart copied to clipboard
@JsonSerializable() in not working in generated classes;
I want to build toJson() abd fromJson() for a generated class ( A model classs generated by some other generator ),
how can i achieve this?
At the moment, this is not supported!
a good feature request, though!
YES, it will be very helpful. How we can use a generator inside another generator.
I have created a package that generates code for form management and also creates a DataClass for the form. I want to make the DataClasses generate code for Json serializable code also and also don't want to reinvent the wheel so I want to use JsonSerializable directly inside the generated DataClass
Don‘t understand. Can‘t you just generate @JsonKey, etc. annotations in your generator and run json_serializable over the result?
See https://pub.dev/packages/build_config#adjusting-builder-ordering