Skip to content

Commit 755d5d3

Browse files
authored
Records: more testing (#1320)
1 parent be8e9a3 commit 755d5d3

14 files changed

+1098
-5
lines changed

json_annotation/lib/src/json_key.dart

+2-3
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,15 @@ class JsonKey {
153153
///
154154
/// Only required when the default behavior is not desired.
155155
const JsonKey({
156-
@Deprecated('Has no effect')
157-
bool? nullable,
156+
@Deprecated('Has no effect') bool? nullable,
158157
this.defaultValue,
159158
this.disallowNullValue,
160159
this.fromJson,
161160
@Deprecated(
162161
'Use `includeFromJson` and `includeToJson` with a value of `false` '
163162
'instead.',
164163
)
165-
this.ignore,
164+
this.ignore,
166165
this.includeFromJson,
167166
this.includeIfNull,
168167
this.includeToJson,

json_serializable/test/supported_types/input.type_iterable.dart

+28
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,34 @@ class SimpleClassNullableOfObjectNullable {
689689
_$SimpleClassNullableOfObjectNullableToJson(this);
690690
}
691691

692+
@JsonSerializable()
693+
class SimpleClassOfRecord {
694+
final Iterable<(int, String, {bool truth})> value;
695+
696+
SimpleClassOfRecord(
697+
this.value,
698+
);
699+
700+
factory SimpleClassOfRecord.fromJson(Map<String, Object?> json) =>
701+
_$SimpleClassOfRecordFromJson(json);
702+
703+
Map<String, Object?> toJson() => _$SimpleClassOfRecordToJson(this);
704+
}
705+
706+
@JsonSerializable()
707+
class SimpleClassNullableOfRecord {
708+
final Iterable<(int, String, {bool truth})>? value;
709+
710+
SimpleClassNullableOfRecord(
711+
this.value,
712+
);
713+
714+
factory SimpleClassNullableOfRecord.fromJson(Map<String, Object?> json) =>
715+
_$SimpleClassNullableOfRecordFromJson(json);
716+
717+
Map<String, Object?> toJson() => _$SimpleClassNullableOfRecordToJson(this);
718+
}
719+
692720
@JsonSerializable()
693721
class SimpleClassOfString {
694722
final Iterable<String> value;

json_serializable/test/supported_types/input.type_iterable.g.dart

+55
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

json_serializable/test/supported_types/input.type_list.dart

+28
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,34 @@ class SimpleClassNullableOfObjectNullable {
689689
_$SimpleClassNullableOfObjectNullableToJson(this);
690690
}
691691

692+
@JsonSerializable()
693+
class SimpleClassOfRecord {
694+
final List<(int, String, {bool truth})> value;
695+
696+
SimpleClassOfRecord(
697+
this.value,
698+
);
699+
700+
factory SimpleClassOfRecord.fromJson(Map<String, Object?> json) =>
701+
_$SimpleClassOfRecordFromJson(json);
702+
703+
Map<String, Object?> toJson() => _$SimpleClassOfRecordToJson(this);
704+
}
705+
706+
@JsonSerializable()
707+
class SimpleClassNullableOfRecord {
708+
final List<(int, String, {bool truth})>? value;
709+
710+
SimpleClassNullableOfRecord(
711+
this.value,
712+
);
713+
714+
factory SimpleClassNullableOfRecord.fromJson(Map<String, Object?> json) =>
715+
_$SimpleClassNullableOfRecordFromJson(json);
716+
717+
Map<String, Object?> toJson() => _$SimpleClassNullableOfRecordToJson(this);
718+
}
719+
692720
@JsonSerializable()
693721
class SimpleClassOfString {
694722
final List<String> value;

json_serializable/test/supported_types/input.type_list.g.dart

+59
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)