Skip to content

release pkg:json_annotation #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions json_annotation/lib/src/json_serializable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,25 @@ class JsonKey {

/// A top-level [Function] to use when deserializing the associated JSON
/// value to the annotated field.
///
/// The [Function] should take one argument that maps to the expected JSON
/// value and return a value that can be assigned to the type of the annotated
/// field.
///
/// When creating a class that supports both `toJson` and `fromJson`
/// (the default), you should also set [toJson] if you set [fromJson].
/// Values returned by [toJson] should "round-trip" through [fromJson].
final Function fromJson;

/// A top-level [Function] to use when serializing the annotated field to
/// JSON.
///
/// The [Function] should take one argument that is compatible with the field
/// being serialized and return a JSON-compatible value.
///
/// When creating a class that supports both `toJson` and `fromJson`
/// (the default), you should also set [fromJson] if you set [toJson].
/// Values returned by [toJson] should "round-trip" through [fromJson].
final Function toJson;

/// Creates a new [JsonKey].
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: 0.2.4-dev
version: 0.2.4
description: Annotations for the json_serializable package
homepage: https://github.com/dart-lang/json_serializable
author: Dart Team <misc@dartlang.org>
Expand Down