My class looks like this
@JsonSerializable(createFactory: false)
class ArticleId {
final String? id;
final String? ean;
ArticleId.id(this.id)
: ean = null;
ArticleId.ean(this.ean)
: id = null;
Map<String, dynamic> toJson() => _$ArticleIdToJson(this);
}
and even though I am generating only toJson, it shows The class `ArticleId` has no default constructor.
I don't know if this is intended or not, but currently I have to create private constructor with // ignore: unused_element to satisfy the analyzer, which would be nice to not have to do.
I'm on latest json_serializable 6.0.1