Skip to content

Commit

Permalink
json_annotation: prepare to release v4.9.0 (#1417)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Apr 24, 2024
1 parent dbe976a commit eea959d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions json_annotation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## 4.9.0-wip
## 4.9.0

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

## 4.8.1
Expand Down
13 changes: 8 additions & 5 deletions json_annotation/lib/src/json_serializable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,19 @@ class JsonSerializable {
final bool? createFieldMap;

/// If `true` (defaults to false), a private class `_$ExampleJsonKeys`
/// constant is created in the generated part file.
/// class is created in the generated part file.
///
/// This class will contain every property, with the json key as value,
/// exposing a secured way to access the json key from the property.
/// This class will contain every property as a [String] field with the JSON
/// key as the value.
///
/// ```dart
/// @JsonSerializable(createJsonKeys: true)
/// class Example {
/// // ...
/// static const jsonKeys = _$PublicationImplJsonKeys();
/// @JsonKey(name: 'LAST_NAME')
/// String? firstName;
///
/// // Will have the value `LAST_NAME`
/// static const firstName = _$ExampleJsonKeys.firstName;
/// }
/// ```
final bool? createJsonKeys;
Expand Down
2 changes: 1 addition & 1 deletion json_annotation/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: json_annotation
version: 4.9.0-wip
version: 4.9.0
description: >-
Classes and helper functions that support JSON code generation via the
`json_serializable` package.
Expand Down
5 changes: 2 additions & 3 deletions json_serializable/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
## 6.8.0-wip

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

Expand Down
18 changes: 9 additions & 9 deletions json_serializable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,15 @@ targets:
[`Enum`]: https://api.dart.dev/stable/dart-core/Enum-class.html
[`int`]: https://api.dart.dev/stable/dart-core/int-class.html
[`Iterable`]: https://api.dart.dev/stable/dart-core/Iterable-class.html
[`JsonConverter`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonConverter-class.html
[`JsonEnum.valueField`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonEnum/valueField.html
[`JsonEnum`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonEnum-class.html
[`JsonKey.fromJson`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/fromJson.html
[`JsonKey.toJson`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/toJson.html
[`JsonKey`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey-class.html
[`JsonLiteral`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonLiteral-class.html
[`JsonSerializable`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonSerializable-class.html
[`JsonValue`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonValue-class.html
[`JsonConverter`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonConverter-class.html
[`JsonEnum.valueField`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonEnum/valueField.html
[`JsonEnum`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonEnum-class.html
[`JsonKey.fromJson`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonKey/fromJson.html
[`JsonKey.toJson`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonKey/toJson.html
[`JsonKey`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonKey-class.html
[`JsonLiteral`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonLiteral-class.html
[`JsonSerializable`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonSerializable-class.html
[`JsonValue`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonValue-class.html
[`List`]: https://api.dart.dev/stable/dart-core/List-class.html
[`Map`]: https://api.dart.dev/stable/dart-core/Map-class.html
[`num`]: https://api.dart.dev/stable/dart-core/num-class.html
Expand Down

0 comments on commit eea959d

Please sign in to comment.