Skip to content

Prepare to release v0.2.3 json_annotations #127

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 1 commit into from
Apr 3, 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
7 changes: 6 additions & 1 deletion json_annotation/lib/json_annotation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
// 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.

/// Use these annotations on members you'd like to enable source generation on.
/// Provides annotation classes to use with
/// [json_serializable](https://pub.dartlang.org/packages/json_serializable).
///
/// Also contains helper functions and classes – prefixed with `$` used by
/// `json_serializable` when generating wrappers.
library json_annotation;

export 'src/json_literal.dart';
export 'src/json_serializable.dart';
5 changes: 5 additions & 0 deletions json_annotation/lib/src/json_literal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
// 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.

/// An annotation used to generate a private field containing the contents of a
/// JSON file.
///
/// The annotation can be applied to any member, but usually it's applied to
/// getter.
class JsonLiteral {
/// The relative path from the Dart file with the annotation to the file
/// containing the source JSON.
Expand Down
22 changes: 21 additions & 1 deletion json_annotation/lib/src/json_serializable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import 'dart:collection';

/// An annotation used to specify a class to generate code for.
class JsonSerializable {
// TODO(kevmoo): document these fields
final bool createFactory;
Expand Down Expand Up @@ -77,20 +78,39 @@ class JsonKey {
const JsonKey({this.name, this.nullable, this.includeIfNull, this.ignore});
}

// TODO(kevmoo): Add documentation
/// Helper classes used in generated code when
/// `JsonSerializableGenerator.useWrappers` is `true`.
///
/// Should not be used directly.
abstract class $JsonMapWrapper extends UnmodifiableMapBase<String, dynamic> {}

/// Helper function used in generated code when
/// `JsonSerializableGenerator.useWrappers` is `true`.
///
/// Should not be used directly.
Map<String, dynamic> $wrapMap<K, V>(
Map<K, V> source, dynamic converter(V key)) =>
new _MappingMap(source, converter);

/// Helper function used in generated code when
/// `JsonSerializableGenerator.useWrappers` is `true`.
///
/// Should not be used directly.
Map<String, dynamic> $wrapMapHandleNull<K, V>(
Map<K, V> source, dynamic converter(V key)) =>
source == null ? null : new _MappingMap(source, converter);

/// Helper function used in generated code when
/// `JsonSerializableGenerator.useWrappers` is `true`.
///
/// Should not be used directly.
List<dynamic> $wrapList<T>(List<T> source, dynamic converter(T key)) =>
new _MappingList(source, converter);

/// Helper function used in generated code when
/// `JsonSerializableGenerator.useWrappers` is `true`.
///
/// Should not be used directly.
List<dynamic> $wrapListHandleNull<T>(
List<T> source, dynamic converter(T key)) =>
source == null ? null : new _MappingList(source, converter);
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.3-dev
version: 0.2.3
description: Annotations for the json_serializable package
homepage: https://github.com/dart-lang/json_serializable
author: Dart Team <misc@dartlang.org>
Expand Down