NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #192 most downloaded on pub.dev
Automatically generate code for converting to and from JSON by annotating Dart classes.
Last release 2 months ago
30 Jul 2026
Ships fairly regularly
a new release about every 6 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
121 releases · first in 2017
Require analyzer: '>=10.0.0 <15.0.0'
analyzer: '>=10.0.0 <15.0.0'Support JsonKey.explicitJsonNullWhenNonNullField for PATCH-style tri-state JSON fields: distinguish omitted keys from explicit null in fromJson and em
JsonKey.explicitJsonNullWhenNonNullField for PATCH-style tri-statenull in fromJson andnull in toJson when the Dart field is non-null.json_annotation: '>=4.12.0 <4.13.0'One column per quarter.
JsonKey.explicitJsonNullWhenNonNullField for PATCH-style tri-state
JSON fields: distinguish omitted keys from explicit null in fromJson and
emit explicit JSON null in toJson when the Dart field is non-null.json_annotation: '>=4.12.0 <4.13.0'Require analyzer: '>=10.0.0 <14.0.0'
analyzer: '>=10.0.0 <14.0.0'Improve error message when generating code for Record types with unsupported fields.
Record types with unsupportedanalyzer: '>=10.0.0 <13.0.0'build: ^4.0.4dart_style: ^3.1.4source_gen: ^4.1.2source_helper: ^1.3.10Fix schema generation for many different types of fields.
Support JsonKey annotation on constructor parameters.
JsonKey annotation on constructor parameters.JsonSerializable(createJsonSchema: true).JsonKey annotation on constructor parameters.JsonSerializable(createJsonSchema: true).
(Huge thanks to Chris Sells for the PR!)Allow analyzer: >=9.0.0 <11.0.0
analyzer: >=9.0.0 <11.0.0- Require analyzer: ^9.0.0 - Require build: ^4.0.3 - Require build_config: ^1.2.0 - Require dart_style: ^3.1.3 - Require sdk: ^3.9.0 - Require source_
analyzer: ^9.0.0build: ^4.0.3build_config: ^1.2.0dart_style: ^3.1.3sdk: ^3.9.0source_gen: ^4.1.1source_helper: ^1.3.9Allow run_only_if_triggered to be specified in build.yaml to turn on the build_runner triggers heuristic.
run_only_if_triggered to be specified in build.yaml to turn on the
build_runner triggers heuristic.Allow source_gen: '>=3.1.0 <5.0.0'.
build: '>=3.0.0 <5.0.0'.source_gen: '>=3.1.0 <5.0.0'.Require source_gen: ^3.1.0, stop using deprecated TypeChecker.fromRuntime and use the new TypeChecker.typeNamed instead.
JsonKey annotation on constructor parameters.analyzer: '>=7.4.0 <9.0.0'dart_style: ^3.0.0meta: ^1.15.0source_helper: ^1.3.6source_gen: ^3.1.0, stop using deprecated TypeChecker.fromRuntime
and use the new TypeChecker.typeNamed instead.Switch to analyzer element2 model and build: ^3.0.0-dev.
analyzer: ^7.4.0.build: ^3.0.0-dev.package:collection to a dev dependency.null-aware element feature in generated code.Nothing published for this version
Fixed use of deprecated analyzer APIs.
analyzer: '>=6.9.0 <8.0.0'.Fix extra line being generated when targeting Dart 3.7 package.
Error out if the target package does not have a language version of 3.0 or greater.
3.0 or
greater.Support the latest package:analyzer.
package:analyzer.Support the latest package:source_gen.
package:source_gen.Use conditional map syntax to clean up null handling in toJson functions.
null handling in toJson functions.Add type arguments to Map literals used for Record serialization.
Map literals used for Record serialization.JsonSerializable(createJsonKeys: true).
(#1401)int value from a double literal.
This now matches the behavior of double values being encoded as int.Support the latest package:analyzer.
package:analyzer.- Support Record types. - Require Dart 3.0 - Require analyzer: ^5.12.0
Record types.analyzer: ^5.12.0Better handling of Object? or dynamic as fromJson constructor param.
Object? or dynamic as fromJson constructor param.Fix bug when JsonKey.includeToJson is false.
JsonKey.includeToJson is false.Support for JsonKey.includeFromJson and JsonKey.includeToJson.
JsonKey.includeFromJson and JsonKey.includeToJson.JsonEnum.valueField being set with 'index'.JsonSerializable.createPerFieldToJson.>=2.18.0.analyzer: ^5.2.0json_annotation: '>=4.8.0 <4.9.0'Fixed handling of nullable fields with converters which return non-nullable values.
Fixed handling of nullable enum fields with includeIfNull: false.
enum fields with includeIfNull: false.Better handling of null when encoding enum values or values with conversions.
null when encoding enum values or values with
conversions.Fixed BigInt, DateTime, and Uri support for JsonKey.defaultValue with a function value.
BigInt, DateTime, and Uri support for JsonKey.defaultValue with
a function value.Allow constructors to be passed to JsonKey parameters that support Function types.
JsonKey parameters that support
Function types.Function values for JsonKey.defaultValue. The provided
Function will be invoked for the default value if the target JSON element is
missing or null.Fixed a bug when an @JsonSerializable class uses a mixin with fields.
@JsonSerializable class uses a mixin with fields.@JsonEnum.Add support for JsonEnum.valueField which allows specifying a field in an "enhanced enum" to use for serialization instead of specifying each value in
JsonEnum.valueField which allows specifying a field in an
"enhanced enum" to use for serialization instead of specifying each value
individually with `JsonValuejson_annotation: '>=4.7.0 <4.8.0'Require analyzer: '>=4.6.0 <6.0.0'
analyzer: '>=4.6.0 <6.0.0'sdk: '>=2.17.0 <3.0.0'Fixed support for Duration fields with default values.
Duration fields with default values.
(#1170)Added support for generating _$ExampleFieldMap, which can be used by other code-generators that needs to interact with JSON serialization.
_$ExampleFieldMap, which can be used by other
code-generators that needs to interact with JSON serialization.
(#1164)JsonConverter<MyClass, Object> on properties of
type MyClass?.
(#822)JsonSerializable(converters: <JsonConverter>[])
(#1072)Added support for the new FieldRename.screamingSnake field in package:json_annotation.
FieldRename.screamingSnake field in
package:json_annotation.- Allow latest package:analyzer.
package:analyzer.Fix enum support for upcoming enhanced enums in Dart 2.17.
Fix issues with latest package:analyzer related to enums and annotations.
package:analyzer related to enums and annotations.- Allow latest package:analyzer.
package:analyzer.Fix issue with nested generics and genericArgumentFactories: true.
genericArgumentFactories: true.
(#1047)Fix JsonKey.readValue support to allow static functions.
JsonKey.readValue support to allow static functions.Support JsonKey.readValue to allow customized reading of values from source JSON map objects.
JsonKey.readValue to allow customized reading of values from source
JSON map objects.package:json_annotation is now a warning and doesn't fail the build.json_annotation '>=4.4.0 <4.5.0'.Don't require json_annotation in dependencies if it's just used in tests.
json_annotation in dependencies if it's just used in tests.…for each library. NOTE: This is a potential breaking change if any user code relies on the previously generated private functions.
JsonSerializable.constructor to allow specifying an
alternative constructor to invoke when creating a fromJson helper.@JsonEnum annotation in package:json_annotation.JsonKey.nullForUndefinedEnumValue as a value for
JsonKey.unknownEnumValue when you want to use null as the unknown value.$enumDecodeNullable and $enumDecode in `json_annotation'
instead of generating these for each library. NOTE: This is a potential
breaking change if any user code relies on the previously generated private
functions.package:json_annotation.>=2.14.0.json_annotation '>=4.3.0 <4.4.0'.Include type arguments when invoking fromJson on custom types. This fixes an edge case where the generic arguments could not be inferred.
fromJson on custom types. This fixes an
edge case where the generic arguments could not be inferred.Correctly handle nullable custom objects within Iterable and Map.
Iterable and Map.package:source_helper.Use the default value for optional constructor parameters if JsonKey.defaultValue is not provided. This could be a breaking behavior change in generat
JsonKey.defaultValue is not provided. This could be a breaking behavior
change in generated code in some cases.fromJson for Map fields with nullable values.toJson and fromJson.$checkedCreate helper exposed in package:json_annotation
v4.1+.prefer_expression_function_bodies lint.fromJson constructor.type_helper.dart:
typeArgumentsOf. This is now an extension exposed by
package:source_helper.package:analyzer ^2.0.0.Allow the latest package:json_annotation.
package:json_annotation.Correctly handle nullable types with type arguments in generated code.
Correctly decode Map when the input has int literals.
Map<String, double> when the input has int literals.Allow the latest package:build_config.
package:build_config.type_helper.dart - BREAKING changes
Implementation is now null-safe.
Correctly handle nullable generic fields (T?) with
genericArgumentFactories.
type_helper.dart - BREAKING changes
KeyConfig class replaces JsonKey.ClassConfig class replaces JsonSerializable.Correctly handle nullable values with genericArgumentFactories.
genericArgumentFactories.package:build.Correctly handle nullable Map and Iterable JSON types exposed by both class- and function-based converters.
Map and Iterable JSON types exposed by both
class- and function-based converters.- Allow latest package:analyzer.
package:analyzer.The nullable field on JsonKey ignored. The nullability of a field is now determined by the Dart type system.
nullable field on JsonKey ignored. The nullability of a field is now
determined by the Dart type system.bool defaultProvided arg added to TypeHelper.deserialize.
Only applies to code using TypeHelper directly.Nothing published for this version
Widen package:analyzer range to allow v1.x.
package:analyzer range to allow v1.x.Improved error messages for unsupported types.
package:json_serializable/type_helper.dart
UnsupportedTypeError positional (optional).package:analyzer >=0.39.0 <0.42.0.Your coding agent can read these notes before it upgrades. Set up the MCP server →