json_serializable 0.2.2+1 copy "json_serializable: ^0.2.2+1" to clipboard
json_serializable: ^0.2.2+1 copied to clipboard

outdatedDart 1 only

Generates utilities to aid in serializing to/from JSON.

0.2.2+1 #

  • Simplify the serialization of Map instances when no conversion is required for values.

0.2.2 #

  • Enable support for enum values.
  • Added asConst to JsonLiteral.
  • Improved the handling of Dart-specific characters in JSON strings.

0.2.1 #

  • Upgrade to package:source_gen v0.7.0

0.2.0+1 #

  • When serializing classes that implement their own fromJson constructor, honor their constructor parameter type.

0.2.0 #

  • BREAKING Types are now segmented into their own libraries.

    • package:json_serializable/generators.dart contains Generator implementations.

    • package:json_serializable/annotations.dart contains annotations. This library should be imported with your target classes.

    • package:json_serializable/type_helpers.dart contains TypeHelper classes and related helpers which allow custom generation for specific types.

  • BREAKING Generation fails for types that are not a JSON primitive or that do not explicitly supports JSON serialization.

  • BREAKING TypeHelper:

    • Removed can methods. Return null from (de)serialize if the provided type is not supported.

    • Added (de)serializeNested arguments to (de)serialize methods allowing generic types. This is how support for Iterable, List, and Map is implemented.

  • BREAKING JsonKey.jsonName was renamed to name and is now a named parameter.

  • Added support for optional, non-nullable fields.

  • Added support for excluding null values when generating JSON.

  • Eliminated all implicit casts in generated code. These would end up being runtime checks in most cases.

  • Provide a helpful error when generation fails due to undefined types.

0.1.0+1 #

  • Fix homepage in pubspec.yaml.

0.1.0 #

  • Split off from source_gen.

  • Add /* unsafe */ comments to generated output likely to be unsafe.

  • Support (de)serializing values in Map.

  • Fix ordering of fields when they are initialized via constructor.

  • Don't use static members when calculating fields to (de)serialize.

3325
likes
0
pub points
99%
popularity

Publisher

verified publishergoogle.dev

Generates utilities to aid in serializing to/from JSON.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

analyzer, build, cli_util, path, source_gen

More

Packages that depend on json_serializable