Skip to content

Commit eea959d

Browse files
authored
json_annotation: prepare to release v4.9.0 (#1417)
1 parent dbe976a commit eea959d

File tree

5 files changed

+22
-20
lines changed

5 files changed

+22
-20
lines changed

Diff for: json_annotation/CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## 4.9.0-wip
1+
## 4.9.0
22

33
- Require Dart 3.0
4-
- Added `JsonSerializable(createJsonKeys: true)`.
4+
- Add `JsonSerializable(createJsonKeys: true)`.
55
([#1401](https://github.com/google/json_serializable.dart/pull/1401))
66

77
## 4.8.1

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

+8-5
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,19 @@ class JsonSerializable {
8888
final bool? createFieldMap;
8989

9090
/// If `true` (defaults to false), a private class `_$ExampleJsonKeys`
91-
/// constant is created in the generated part file.
91+
/// class is created in the generated part file.
9292
///
93-
/// This class will contain every property, with the json key as value,
94-
/// exposing a secured way to access the json key from the property.
93+
/// This class will contain every property as a [String] field with the JSON
94+
/// key as the value.
9595
///
9696
/// ```dart
9797
/// @JsonSerializable(createJsonKeys: true)
9898
/// class Example {
99-
/// // ...
100-
/// static const jsonKeys = _$PublicationImplJsonKeys();
99+
/// @JsonKey(name: 'LAST_NAME')
100+
/// String? firstName;
101+
///
102+
/// // Will have the value `LAST_NAME`
103+
/// static const firstName = _$ExampleJsonKeys.firstName;
101104
/// }
102105
/// ```
103106
final bool? createJsonKeys;

Diff for: json_annotation/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: json_annotation
2-
version: 4.9.0-wip
2+
version: 4.9.0
33
description: >-
44
Classes and helper functions that support JSON code generation via the
55
`json_serializable` package.

Diff for: json_serializable/CHANGELOG.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
## 6.8.0-wip
22

33
- Add type arguments to `Map` literals used for `Record` serialization.
4-
- Added support for generating `ExampleJsonKeys`, exposing a secured way to
5-
access the json keys from the properties.
6-
([#1164](https://github.com/google/json_serializable.dart/pull/1164))
4+
- Add support for `JsonSerializable(createJsonKeys: true)`.
5+
([#1401](https://github.com/google/json_serializable.dart/pull/1401))
76
- Handle decoding an `int` value from a `double` literal.
87
This now matches the behavior of `double` values being encoded as `int`.
98

Diff for: json_serializable/README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,15 @@ targets:
298298
[`Enum`]: https://api.dart.dev/stable/dart-core/Enum-class.html
299299
[`int`]: https://api.dart.dev/stable/dart-core/int-class.html
300300
[`Iterable`]: https://api.dart.dev/stable/dart-core/Iterable-class.html
301-
[`JsonConverter`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonConverter-class.html
302-
[`JsonEnum.valueField`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonEnum/valueField.html
303-
[`JsonEnum`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonEnum-class.html
304-
[`JsonKey.fromJson`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/fromJson.html
305-
[`JsonKey.toJson`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/toJson.html
306-
[`JsonKey`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey-class.html
307-
[`JsonLiteral`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonLiteral-class.html
308-
[`JsonSerializable`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonSerializable-class.html
309-
[`JsonValue`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonValue-class.html
301+
[`JsonConverter`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonConverter-class.html
302+
[`JsonEnum.valueField`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonEnum/valueField.html
303+
[`JsonEnum`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonEnum-class.html
304+
[`JsonKey.fromJson`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonKey/fromJson.html
305+
[`JsonKey.toJson`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonKey/toJson.html
306+
[`JsonKey`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonKey-class.html
307+
[`JsonLiteral`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonLiteral-class.html
308+
[`JsonSerializable`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonSerializable-class.html
309+
[`JsonValue`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonValue-class.html
310310
[`List`]: https://api.dart.dev/stable/dart-core/List-class.html
311311
[`Map`]: https://api.dart.dev/stable/dart-core/Map-class.html
312312
[`num`]: https://api.dart.dev/stable/dart-core/num-class.html

0 commit comments

Comments
 (0)