Skip to content

Commit

Permalink
Merge remote-tracking branch 'google/master' into google#780
Browse files Browse the repository at this point in the history
  • Loading branch information
hacker1024 committed Mar 22, 2021
2 parents 3c6d717 + d096a39 commit 7016851
Show file tree
Hide file tree
Showing 158 changed files with 884 additions and 511 deletions.
2 changes: 1 addition & 1 deletion _test_yaml/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ environment:

dev_dependencies:
build_runner: ^1.0.0
build_verify: ^1.1.0
build_verify: ^2.0.0
checked_yaml: any
json_annotation: any
json_serializable: any
Expand Down
2 changes: 0 additions & 2 deletions _test_yaml/test/ensure_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// @dart=2.9

@TestOn('vm')
@Tags(['presubmit-only'])
import 'package:build_verify/build_verify.dart';
Expand Down
2 changes: 2 additions & 0 deletions checked_yaml/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 2.0.2-dev

## 2.0.1

- If `CheckedFromJsonException` is caught for a key missing in the source map,
Expand Down
9 changes: 2 additions & 7 deletions checked_yaml/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: checked_yaml
version: 2.0.1
version: 2.0.2-dev

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

dev_dependencies:
build_runner: ^1.0.0
build_verify: ^1.1.0
build_verify: ^2.0.0
json_serializable: ^4.0.0
path: ^1.0.0
test: ^1.16.0
test_process: ^2.0.0

dependency_overrides:
# Need to update dependencies on these packages
build_config: ^0.4.4
pubspec_parse: ^0.1.5
2 changes: 0 additions & 2 deletions checked_yaml/test/ensure_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// @dart=2.9

@TestOn('vm')
@Tags(['presubmit-only'])
import 'package:build_verify/build_verify.dart';
Expand Down
4 changes: 2 additions & 2 deletions example/lib/tuple_example.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dev_dependencies:
build_runner: ^1.0.0

# Used by tests. Not required to use `json_serializable`.
build_verify: ^1.0.0
build_verify: ^2.0.0

json_serializable: ^4.0.0

Expand Down
2 changes: 0 additions & 2 deletions example/test/ensure_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// @dart=2.9

@Tags(['presubmit-only'])
import 'package:build_verify/build_verify.dart';
import 'package:test/test.dart';
Expand Down
4 changes: 3 additions & 1 deletion json_annotation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## 4.0.1-dev
## 4.0.1

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

## 4.0.0

Expand Down
2 changes: 2 additions & 0 deletions json_annotation/lib/src/json_serializable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class JsonSerializable {

/// An instance of [JsonSerializable] with all fields set to their default
/// values.
@Deprecated('Was only ever included to support builder infrastructure.')
static const defaults = JsonSerializable(
anyMap: false,
checked: false,
Expand All @@ -212,6 +213,7 @@ class JsonSerializable {
///
/// Otherwise, the returned value has the default value as defined in
/// [defaults].
@Deprecated('Was only ever included to support builder infrastructure.')
JsonSerializable withDefaults() => JsonSerializable(
anyMap: anyMap ?? defaults.anyMap,
checked: checked ?? defaults.checked,
Expand Down
69 changes: 37 additions & 32 deletions json_annotation/lib/src/json_serializable.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions json_annotation/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: json_annotation
version: 4.0.1-dev
version: 4.0.1
description: >-
Classes and helper functions that support JSON code generation via the
`json_serializable` package.
Expand All @@ -10,4 +10,4 @@ environment:
# When changing JsonSerializable class.
# dev_dependencies:
# build_runner: ^1.0.0
# json_serializable: ^3.1.0
# json_serializable: ^4.0.0
16 changes: 16 additions & 0 deletions json_serializable/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 4.1.0

- Implementation is now null-safe.
- Correctly handle nullable generic fields (`T?`) with
`genericArgumentFactories`.

- `type_helper.dart` - **BREAKING changes**
- The API is now null-safe.
- new `KeyConfig` class replaces `JsonKey`.
- new `ClassConfig` class replaces `JsonSerializable`.

## 4.0.3

- Correctly handle nullable values with `genericArgumentFactories`.
- Require the latest `package:build`.

## 4.0.2

- Correctly handle nullable `Map` and `Iterable` JSON types exposed by both
Expand Down
38 changes: 19 additions & 19 deletions json_serializable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,25 @@ is generated:
| | | [JsonKey.unknownEnumValue] |
| | | [JsonKey.extra] |

[JsonSerializable.anyMap]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/anyMap.html
[JsonSerializable.checked]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/checked.html
[JsonSerializable.createFactory]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/createFactory.html
[JsonSerializable.createToJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/createToJson.html
[JsonSerializable.disallowUnrecognizedKeys]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/disallowUnrecognizedKeys.html
[JsonSerializable.explicitToJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/explicitToJson.html
[JsonSerializable.fieldRename]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/fieldRename.html
[JsonSerializable.genericArgumentFactories]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/genericArgumentFactories.html
[JsonSerializable.ignoreUnannotated]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/ignoreUnannotated.html
[JsonSerializable.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/includeIfNull.html
[JsonKey.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/includeIfNull.html
[JsonKey.defaultValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/defaultValue.html
[JsonKey.disallowNullValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/disallowNullValue.html
[JsonKey.fromJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/fromJson.html
[JsonKey.ignore]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/ignore.html
[JsonKey.name]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/name.html
[JsonKey.required]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/required.html
[JsonKey.toJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/toJson.html
[JsonKey.unknownEnumValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/unknownEnumValue.html
[JsonSerializable.anyMap]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/anyMap.html
[JsonSerializable.checked]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/checked.html
[JsonSerializable.createFactory]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/createFactory.html
[JsonSerializable.createToJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/createToJson.html
[JsonSerializable.disallowUnrecognizedKeys]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/disallowUnrecognizedKeys.html
[JsonSerializable.explicitToJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/explicitToJson.html
[JsonSerializable.fieldRename]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/fieldRename.html
[JsonSerializable.genericArgumentFactories]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/genericArgumentFactories.html
[JsonSerializable.ignoreUnannotated]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/ignoreUnannotated.html
[JsonSerializable.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/includeIfNull.html
[JsonKey.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/includeIfNull.html
[JsonKey.defaultValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/defaultValue.html
[JsonKey.disallowNullValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/disallowNullValue.html
[JsonKey.fromJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/fromJson.html
[JsonKey.ignore]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/ignore.html
[JsonKey.name]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/name.html
[JsonKey.required]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/required.html
[JsonKey.toJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/toJson.html
[JsonKey.unknownEnumValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/unknownEnumValue.html
[JsonKey.extra]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/extra.html

> Note: every `JsonSerializable` field is configurable via `build.yaml`
Expand Down
38 changes: 19 additions & 19 deletions json_serializable/doc/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@
| | | [JsonKey.toJson] |
| | | [JsonKey.unknownEnumValue] |

[JsonSerializable.anyMap]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/anyMap.html
[JsonSerializable.checked]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/checked.html
[JsonSerializable.createFactory]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/createFactory.html
[JsonSerializable.createToJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/createToJson.html
[JsonSerializable.disallowUnrecognizedKeys]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/disallowUnrecognizedKeys.html
[JsonSerializable.explicitToJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/explicitToJson.html
[JsonSerializable.fieldRename]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/fieldRename.html
[JsonSerializable.genericArgumentFactories]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/genericArgumentFactories.html
[JsonSerializable.ignoreUnannotated]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/ignoreUnannotated.html
[JsonSerializable.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonSerializable/includeIfNull.html
[JsonKey.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/includeIfNull.html
[JsonKey.defaultValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/defaultValue.html
[JsonKey.disallowNullValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/disallowNullValue.html
[JsonKey.fromJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/fromJson.html
[JsonKey.ignore]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/ignore.html
[JsonKey.name]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/name.html
[JsonKey.required]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/required.html
[JsonKey.toJson]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/toJson.html
[JsonKey.unknownEnumValue]: https://pub.dev/documentation/json_annotation/4.0.0/json_annotation/JsonKey/unknownEnumValue.html
[JsonSerializable.anyMap]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/anyMap.html
[JsonSerializable.checked]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/checked.html
[JsonSerializable.createFactory]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/createFactory.html
[JsonSerializable.createToJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/createToJson.html
[JsonSerializable.disallowUnrecognizedKeys]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/disallowUnrecognizedKeys.html
[JsonSerializable.explicitToJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/explicitToJson.html
[JsonSerializable.fieldRename]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/fieldRename.html
[JsonSerializable.genericArgumentFactories]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/genericArgumentFactories.html
[JsonSerializable.ignoreUnannotated]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/ignoreUnannotated.html
[JsonSerializable.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonSerializable/includeIfNull.html
[JsonKey.includeIfNull]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/includeIfNull.html
[JsonKey.defaultValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/defaultValue.html
[JsonKey.disallowNullValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/disallowNullValue.html
[JsonKey.fromJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/fromJson.html
[JsonKey.ignore]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/ignore.html
[JsonKey.name]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/name.html
[JsonKey.required]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/required.html
[JsonKey.toJson]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/toJson.html
[JsonKey.unknownEnumValue]: https://pub.dev/documentation/json_annotation/4.0.1/json_annotation/JsonKey/unknownEnumValue.html
2 changes: 0 additions & 2 deletions json_serializable/example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// @dart=2.12

import 'package:json_annotation/json_annotation.dart';

part 'example.g.dart';
Expand Down
1 change: 0 additions & 1 deletion json_serializable/example/example.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion json_serializable/lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Builder jsonSerializable(BuilderOptions options) {
lines.add('There is a problem with "${e.key}".');
}
if (e.message != null) {
lines.add(e.message);
lines.add(e.message!);
} else if (e.innerError != null) {
lines.add(e.innerError.toString());
}
Expand Down

0 comments on commit 7016851

Please sign in to comment.