json_serializable
Automatically generate code for converting to and from JSON by annotating Dart classes.
6.14.1
1000K downloads/mo
#20 most downloaded on pub.dev
google/json_serializable.dart
What this package is like to depend on
Last release 24 days ago
30 Jul 2026
Ships fairly regularly
a new release about every 6 weeks
Nearly every release is documented
notes for 118 of 119 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
121 releases · first in 2017
10 releases in the last 12 months
see the full history below
Release timeline
121 releases · Jul 2017 to Jul 2026Releases
latest 60 of 121-
6.14.130 Jul 2026 -
6.14.015 May 2026Release notes
Open source →- Support
JsonKey.explicitJsonNullWhenNonNullFieldfor PATCH-style tri-state
JSON fields: distinguish omitted keys from explicitnullinfromJsonand
emit explicit JSONnullintoJsonwhen the Dart field is non-null. - Require
json_annotation: '>=4.12.0 <4.13.0'
Release notes
Open source →- Support
JsonKey.explicitJsonNullWhenNonNullFieldfor PATCH-style tri-state JSON fields: distinguish omitted keys from explicitnullinfromJsonand emit explicit JSONnullintoJsonwhen the Dart field is non-null. - Require
json_annotation: '>=4.12.0 <4.13.0'
- Support
-
6.13.230 Apr 2026 -
6.13.120 Mar 2026Release notes
Open source →- Improve error message when generating code for
Recordtypes with unsupported
fields.
(#1559) - Require
analyzer: '>=10.0.0 <13.0.0' - Require
build: ^4.0.4 - Require
dart_style: ^3.1.4 - Require
source_gen: ^4.1.2 - Require
source_helper: ^1.3.10
Release notes
Open source →- Improve error message when generating code for
Recordtypes with unsupported fields. (#1559) - Require
analyzer: '>=10.0.0 <13.0.0' - Require
build: ^4.0.4 - Require
dart_style: ^3.1.4 - Require
source_gen: ^4.1.2 - Require
source_helper: ^1.3.10
- Improve error message when generating code for
-
6.13.019 Feb 2026 -
6.12.029 Jan 2026Release notes
Open source →- Support
JsonKeyannotation on constructor parameters. - Add support for
JsonSerializable(createJsonSchema: true).
Release notes
Open source →- Support
JsonKeyannotation on constructor parameters. - Add support for
JsonSerializable(createJsonSchema: true). (Huge thanks to Chris Sells for the PR!)
- Support
-
6.11.413 Jan 2026 -
6.11.320 Nov 2025Release notes
Open source →- 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_gen: ^4.1.1 - Require
source_helper: ^1.3.9
- Require
-
6.11.220 Nov 2025Release notes
Open source →- Allow
run_only_if_triggeredto be specified inbuild.yamlto turn on thebuild_runnertriggers heuristic. - Skip warning about annotations on both constructor and field if the values match.
- Allow
-
6.11.105 Sep 2025 -
6.11.026 Aug 2025Release notes
Open source →- Support
JsonKeyannotation on constructor parameters. - Require
analyzer: '>=7.4.0 <9.0.0' - Require
dart_style: ^3.0.0 - Require
meta: ^1.15.0 - Require
source_helper: ^1.3.6 - Require
source_gen: ^3.1.0, stop using deprecatedTypeChecker.fromRuntimeand use the newTypeChecker.typeNamedinstead.
- Support
-
6.10.017 Jul 2025Release notes
Open source →- Required
analyzer: ^7.4.0. - Switch to analyzer element2 model and
build: ^3.0.0-dev. - Move
package:collectionto a dev dependency. - Use new
null-aware elementfeature in generated code. - Require Dart 3.8
- Required
-
6.10.0-dev10 Jul 2025 pre-releaseNothing published for this version
-
6.9.517 Apr 2025Release notes
Open source →- Support the
analyzer: '>=6.9.0 <8.0.0'. - Fixed use of deprecated analyzer APIs.
- Support the
-
6.9.412 Feb 2025 -
6.9.313 Jan 2025Release notes
Open source →- Error out if the target package does not have a language version of
3.0or greater.
- Error out if the target package does not have a language version of
-
6.9.217 Dec 2024 -
6.9.117 Dec 2024 -
6.9.019 Nov 2024Release notes
Open source →- Use conditional map syntax to clean up
nullhandling intoJsonfunctions. - Fix core Dart type links in docs.
- Require Dart 3.5
- Use conditional map syntax to clean up
-
6.8.024 Apr 2024Release notes
Open source →- Add type arguments to
Mapliterals used forRecordserialization. - Add support for
JsonSerializable(createJsonKeys: true). (#1401) - Handle decoding an
intvalue from adoubleliteral. This now matches the behavior ofdoublevalues being encoded asint.
- Add type arguments to
-
6.7.130 Jun 2023 -
6.7.016 May 2023 -
6.6.203 May 2023Release notes
Open source →- Better handling of
Object?ordynamicasfromJsonconstructor param. - Require Dart 2.19
- Better handling of
-
6.6.101 Feb 2023 -
6.6.019 Jan 2023Release notes
Open source →- Support for
JsonKey.includeFromJsonandJsonKey.includeToJson. - Support
JsonEnum.valueFieldbeing set with'index'. - Support
JsonSerializable.createPerFieldToJson. - Require Dart SDK
>=2.18.0. - Require
analyzer: ^5.2.0 - Require
json_annotation: '>=4.8.0 <4.9.0'
- Support for
-
6.5.425 Oct 2022Release notes
Open source →- Fixed handling of nullable fields with converters which return non-nullable values.
-
6.5.319 Oct 2022 -
6.5.217 Oct 2022Release notes
Open source →- Better handling of
nullwhen encodingenumvalues or values with conversions.
- Better handling of
-
6.5.110 Oct 2022Release notes
Open source →- Fixed
BigInt,DateTime, andUrisupport forJsonKey.defaultValuewith a function value.
- Fixed
-
6.5.007 Oct 2022Release notes
Open source →- Allow constructors to be passed to
JsonKeyparameters that supportFunctiontypes. - Accept
Functionvalues forJsonKey.defaultValue. The providedFunctionwill be invoked for the default value if the target JSON element is missing ornull.
- Allow constructors to be passed to
-
6.4.128 Sep 2022Release notes
Open source →- Fixed a bug when an
@JsonSerializableclass uses a mixin with fields. - Added more documentation
@JsonEnum.
- Fixed a bug when an
-
6.4.021 Sep 2022Release notes
Open source →- Add support for
JsonEnum.valueFieldwhich allows specifying a field in an "enhanced enum" to use for serialization instead of specifying each value individually with `JsonValue - Require
json_annotation: '>=4.7.0 <4.8.0'
- Add support for
-
6.3.213 Sep 2022 -
6.3.108 Jul 2022 -
6.3.007 Jul 2022Release notes
Open source →- Added support for generating
_$ExampleFieldMap, which can be used by other code-generators that needs to interact with JSON serialization. (#1164) - Added support for using a
JsonConverter<MyClass, Object>on properties of typeMyClass?. (#822) - Added support for
JsonSerializable(converters: <JsonConverter>[])(#1072) - Fix issue with serialization of non-nullable enumerations emitting a nullable type (#1146)
- Added support for generating
-
6.2.027 Apr 2022Release notes
Open source →- Added support for the new
FieldRename.screamingSnakefield inpackage:json_annotation.
- Added support for the new
-
6.1.614 Apr 2022 -
6.1.507 Mar 2022 -
6.1.413 Jan 2022Release notes
Open source →- Fix issues with latest
package:analyzerrelated to enums and annotations.
- Fix issues with latest
-
6.1.317 Dec 2021 -
6.1.216 Dec 2021Release notes
Open source →- Fix issue with nested generics and
genericArgumentFactories: true. (#1047)
- Fix issue with nested generics and
-
6.1.102 Dec 2021 -
6.1.001 Dec 2021Release notes
Open source →- Support
JsonKey.readValueto allow customized reading of values from source JSON map objects. - The check to make sure there is a correctly constrained dependency on
package:json_annotationis now a warning and doesn't fail the build. - Require
json_annotation'>=4.4.0 <4.5.0'.
- Support
-
6.0.122 Oct 2021Release notes
Open source →- Don't require
json_annotationindependenciesif it's just used in tests.
- Don't require
-
6.0.015 Oct 2021Release notes
Open source →- Added support for
JsonSerializable.constructorto allow specifying an alternative constructor to invoke when creating afromJsonhelper. - Support the new
@JsonEnumannotation inpackage:json_annotation. - Support
JsonKey.nullForUndefinedEnumValueas a value forJsonKey.unknownEnumValuewhen you want to usenullas the unknown value. - Use the new
$enumDecodeNullableand$enumDecodein `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. - The builder now checks to make sure there is a correctly constrained
dependency on
package:json_annotation. - Require Dart SDK
>=2.14.0. - Require
json_annotation'>=4.3.0 <4.4.0'.
- Added support for
-
5.0.220 Sep 2021Release notes
Open source →- Include type arguments when invoking
fromJsonon custom types. This fixes an edge case where the generic arguments could not be inferred.
- Include type arguments when invoking
-
5.0.115 Sep 2021Release notes
Open source →- Correctly handle nullable custom objects within
IterableandMap. - Require the latest
package:source_helper.
- Correctly handle nullable custom objects within
-
5.0.013 Jul 2021Release notes
Open source →- Use the default value for optional constructor parameters if
JsonKey.defaultValueis not provided. This could be a breaking behavior change in generated code in some cases. - Fixed
fromJsonforMapfields with nullable values. - Improve names of private classes generated for
toJsonandfromJson. - Use the new
$checkedCreatehelper exposed inpackage:json_annotationv4.1+. - Generated code now conforms to this
prefer_expression_function_bodieslint. - Support default values and types with a
fromJsonconstructor. - Support default values with class- and function-based converters.
type_helper.dart:- BREAKING: removed
typeArgumentsOf. This is now an extension exposed bypackage:source_helper.
- BREAKING: removed
- Require
package:analyzer^2.0.0.
- Use the default value for optional constructor parameters if
-
4.1.413 Jul 2021 -
4.1.326 May 2021 -
4.1.214 May 2021 -
4.1.120 Apr 2021 -
4.1.019 Mar 2021Release notes
Open source →-
Implementation is now null-safe.
-
Correctly handle nullable generic fields (
T?) withgenericArgumentFactories. -
type_helper.dart- BREAKING changes- The API is now null-safe.
- new
KeyConfigclass replacesJsonKey. - new
ClassConfigclass replacesJsonSerializable.
-
-
4.0.315 Mar 2021Release notes
Open source →- Correctly handle nullable values with
genericArgumentFactories. - Require the latest
package:build.
- Correctly handle nullable values with
-
4.0.201 Mar 2021Release notes
Open source →- Correctly handle nullable
MapandIterableJSON types exposed by both class- and function-based converters.
- Correctly handle nullable
-
4.0.118 Feb 2021 -
4.0.012 Feb 2021Release notes
Open source →- Requires Dart 2.12 or greater.
- Generates null-safe code.
- The
nullablefield onJsonKeyignored. The nullability of a field is now determined by the Dart type system.
- The
- BREAKING
bool defaultProvidedarg added toTypeHelper.deserialize. Only applies to code usingTypeHelperdirectly.
-
4.0.0-nullsafety.009 Dec 2020 pre-releaseNothing published for this version
-
3.5.206 Jan 2022 -
3.5.102 Dec 2020Release notes
Open source →- Improved error messages for unsupported types.
package:json_serializable/type_helper.dart- Made the third parameter to
UnsupportedTypeErrorpositional (optional).
- Made the third parameter to
- Require
package:analyzer>=0.39.0 <0.42.0.