Skip to content

Commit 7016851

Browse files
committed
Merge remote-tracking branch 'google/master' into google#780
2 parents 3c6d717 + d096a39 commit 7016851

File tree

158 files changed

+884
-511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+884
-511
lines changed

Diff for: _test_yaml/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ environment:
66

77
dev_dependencies:
88
build_runner: ^1.0.0
9-
build_verify: ^1.1.0
9+
build_verify: ^2.0.0
1010
checked_yaml: any
1111
json_annotation: any
1212
json_serializable: any

Diff for: _test_yaml/test/ensure_build_test.dart

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// @dart=2.9
6-
75
@TestOn('vm')
86
@Tags(['presubmit-only'])
97
import 'package:build_verify/build_verify.dart';

Diff for: checked_yaml/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 2.0.2-dev
2+
13
## 2.0.1
24

35
- If `CheckedFromJsonException` is caught for a key missing in the source map,

Diff for: checked_yaml/pubspec.yaml

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: checked_yaml
2-
version: 2.0.1
2+
version: 2.0.2-dev
33

44
description: >-
55
Generate more helpful exceptions when decoding YAML documents using
@@ -15,13 +15,8 @@ dependencies:
1515

1616
dev_dependencies:
1717
build_runner: ^1.0.0
18-
build_verify: ^1.1.0
18+
build_verify: ^2.0.0
1919
json_serializable: ^4.0.0
2020
path: ^1.0.0
2121
test: ^1.16.0
2222
test_process: ^2.0.0
23-
24-
dependency_overrides:
25-
# Need to update dependencies on these packages
26-
build_config: ^0.4.4
27-
pubspec_parse: ^0.1.5

Diff for: checked_yaml/test/ensure_build_test.dart

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// @dart=2.9
6-
75
@TestOn('vm')
86
@Tags(['presubmit-only'])
97
import 'package:build_verify/build_verify.dart';

Diff for: example/lib/tuple_example.g.dart

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

Diff for: example/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dev_dependencies:
1111
build_runner: ^1.0.0
1212

1313
# Used by tests. Not required to use `json_serializable`.
14-
build_verify: ^1.0.0
14+
build_verify: ^2.0.0
1515

1616
json_serializable: ^4.0.0
1717

Diff for: example/test/ensure_build_test.dart

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// @dart=2.9
6-
75
@Tags(['presubmit-only'])
86
import 'package:build_verify/build_verify.dart';
97
import 'package:test/test.dart';

Diff for: json_annotation/CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
## 4.0.1-dev
1+
## 4.0.1
22

33
- Fix a potential error with `checked: true` when `ArgumentError.message` is
44
`null`.
5+
- Updated `JsonSerializable.fromJson` to handle `null` values.
6+
- Deprecate `JsonSerializable` `defaults` and `withDefaults()`.
57

68
## 4.0.0
79

Diff for: json_annotation/lib/src/json_serializable.dart

+2
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ class JsonSerializable {
194194

195195
/// An instance of [JsonSerializable] with all fields set to their default
196196
/// values.
197+
@Deprecated('Was only ever included to support builder infrastructure.')
197198
static const defaults = JsonSerializable(
198199
anyMap: false,
199200
checked: false,
@@ -212,6 +213,7 @@ class JsonSerializable {
212213
///
213214
/// Otherwise, the returned value has the default value as defined in
214215
/// [defaults].
216+
@Deprecated('Was only ever included to support builder infrastructure.')
215217
JsonSerializable withDefaults() => JsonSerializable(
216218
anyMap: anyMap ?? defaults.anyMap,
217219
checked: checked ?? defaults.checked,

Diff for: json_annotation/lib/src/json_serializable.g.dart

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

Diff for: json_annotation/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: json_annotation
2-
version: 4.0.1-dev
2+
version: 4.0.1
33
description: >-
44
Classes and helper functions that support JSON code generation via the
55
`json_serializable` package.
@@ -10,4 +10,4 @@ environment:
1010
# When changing JsonSerializable class.
1111
# dev_dependencies:
1212
# build_runner: ^1.0.0
13-
# json_serializable: ^3.1.0
13+
# json_serializable: ^4.0.0

Diff for: json_serializable/CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 4.1.0
2+
3+
- Implementation is now null-safe.
4+
- Correctly handle nullable generic fields (`T?`) with
5+
`genericArgumentFactories`.
6+
7+
- `type_helper.dart` - **BREAKING changes**
8+
- The API is now null-safe.
9+
- new `KeyConfig` class replaces `JsonKey`.
10+
- new `ClassConfig` class replaces `JsonSerializable`.
11+
12+
## 4.0.3
13+
14+
- Correctly handle nullable values with `genericArgumentFactories`.
15+
- Require the latest `package:build`.
16+
117
## 4.0.2
218

319
- Correctly handle nullable `Map` and `Iterable` JSON types exposed by both

Diff for: json_serializable/README.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -95,25 +95,25 @@ is generated:
9595
| | | [JsonKey.unknownEnumValue] |
9696
| | | [JsonKey.extra] |
9797

98-
[JsonSerializable.anyMap]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/anyMap.html
99-
[JsonSerializable.checked]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/checked.html
100-
[JsonSerializable.createFactory]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/createFactory.html
101-
[JsonSerializable.createToJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/createToJson.html
102-
[JsonSerializable.disallowUnrecognizedKeys]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/disallowUnrecognizedKeys.html
103-
[JsonSerializable.explicitToJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/explicitToJson.html
104-
[JsonSerializable.fieldRename]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/fieldRename.html
105-
[JsonSerializable.genericArgumentFactories]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/genericArgumentFactories.html
106-
[JsonSerializable.ignoreUnannotated]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/ignoreUnannotated.html
107-
[JsonSerializable.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/includeIfNull.html
108-
[JsonKey.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/includeIfNull.html
109-
[JsonKey.defaultValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/defaultValue.html
110-
[JsonKey.disallowNullValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/disallowNullValue.html
111-
[JsonKey.fromJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/fromJson.html
112-
[JsonKey.ignore]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/ignore.html
113-
[JsonKey.name]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/name.html
114-
[JsonKey.required]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/required.html
115-
[JsonKey.toJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/toJson.html
116-
[JsonKey.unknownEnumValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/unknownEnumValue.html
98+
[JsonSerializable.anyMap]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/anyMap.html
99+
[JsonSerializable.checked]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/checked.html
100+
[JsonSerializable.createFactory]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/createFactory.html
101+
[JsonSerializable.createToJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/createToJson.html
102+
[JsonSerializable.disallowUnrecognizedKeys]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/disallowUnrecognizedKeys.html
103+
[JsonSerializable.explicitToJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/explicitToJson.html
104+
[JsonSerializable.fieldRename]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/fieldRename.html
105+
[JsonSerializable.genericArgumentFactories]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/genericArgumentFactories.html
106+
[JsonSerializable.ignoreUnannotated]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/ignoreUnannotated.html
107+
[JsonSerializable.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/includeIfNull.html
108+
[JsonKey.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/includeIfNull.html
109+
[JsonKey.defaultValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/defaultValue.html
110+
[JsonKey.disallowNullValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/disallowNullValue.html
111+
[JsonKey.fromJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/fromJson.html
112+
[JsonKey.ignore]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/ignore.html
113+
[JsonKey.name]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/name.html
114+
[JsonKey.required]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/required.html
115+
[JsonKey.toJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/toJson.html
116+
[JsonKey.unknownEnumValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/unknownEnumValue.html
117117
[JsonKey.extra]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/extra.html
118118

119119
> Note: every `JsonSerializable` field is configurable via `build.yaml`

Diff for: json_serializable/doc/doc.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@
1919
| | | [JsonKey.toJson] |
2020
| | | [JsonKey.unknownEnumValue] |
2121

22-
[JsonSerializable.anyMap]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/anyMap.html
23-
[JsonSerializable.checked]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/checked.html
24-
[JsonSerializable.createFactory]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/createFactory.html
25-
[JsonSerializable.createToJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/createToJson.html
26-
[JsonSerializable.disallowUnrecognizedKeys]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/disallowUnrecognizedKeys.html
27-
[JsonSerializable.explicitToJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/explicitToJson.html
28-
[JsonSerializable.fieldRename]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/fieldRename.html
29-
[JsonSerializable.genericArgumentFactories]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/genericArgumentFactories.html
30-
[JsonSerializable.ignoreUnannotated]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/ignoreUnannotated.html
31-
[JsonSerializable.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/includeIfNull.html
32-
[JsonKey.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/includeIfNull.html
33-
[JsonKey.defaultValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/defaultValue.html
34-
[JsonKey.disallowNullValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/disallowNullValue.html
35-
[JsonKey.fromJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/fromJson.html
36-
[JsonKey.ignore]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/ignore.html
37-
[JsonKey.name]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/name.html
38-
[JsonKey.required]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/required.html
39-
[JsonKey.toJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/toJson.html
40-
[JsonKey.unknownEnumValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/unknownEnumValue.html
22+
[JsonSerializable.anyMap]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/anyMap.html
23+
[JsonSerializable.checked]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/checked.html
24+
[JsonSerializable.createFactory]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/createFactory.html
25+
[JsonSerializable.createToJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/createToJson.html
26+
[JsonSerializable.disallowUnrecognizedKeys]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/disallowUnrecognizedKeys.html
27+
[JsonSerializable.explicitToJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/explicitToJson.html
28+
[JsonSerializable.fieldRename]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/fieldRename.html
29+
[JsonSerializable.genericArgumentFactories]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/genericArgumentFactories.html
30+
[JsonSerializable.ignoreUnannotated]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/ignoreUnannotated.html
31+
[JsonSerializable.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/includeIfNull.html
32+
[JsonKey.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/includeIfNull.html
33+
[JsonKey.defaultValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/defaultValue.html
34+
[JsonKey.disallowNullValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/disallowNullValue.html
35+
[JsonKey.fromJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/fromJson.html
36+
[JsonKey.ignore]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/ignore.html
37+
[JsonKey.name]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/name.html
38+
[JsonKey.required]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/required.html
39+
[JsonKey.toJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/toJson.html
40+
[JsonKey.unknownEnumValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/unknownEnumValue.html

Diff for: json_serializable/example/example.dart

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// @dart=2.12
6-
75
import 'package:json_annotation/json_annotation.dart';
86

97
part 'example.g.dart';

Diff for: json_serializable/example/example.g.dart

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

Diff for: json_serializable/lib/builder.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Builder jsonSerializable(BuilderOptions options) {
3434
lines.add('There is a problem with "${e.key}".');
3535
}
3636
if (e.message != null) {
37-
lines.add(e.message);
37+
lines.add(e.message!);
3838
} else if (e.innerError != null) {
3939
lines.add(e.innerError.toString());
4040
}

0 commit comments

Comments
 (0)