PackageTrack
Sign in Get early access

json_annotation

Classes and helper functions that support JSON code generation via the `json_serializable` package.

4.12.0 12M downloads/mo #8 most downloaded on pub.dev google/json_serializable.dart

What this package is like to depend on

Last release 3 months ago

15 May 2026

Release timing varies

gaps range from 3 weeks to 1.8 years

Nearly every release is documented

notes for 39 of 39 stable releases

Nothing withdrawn

no release was ever pulled

9 years old

41 releases · first in 2017

3 releases in the last 12 months

see the full history below

Release timeline

41 releases · Sep 2017 to May 2026
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 41
  1. 4.12.0 15 May 2026
    Release notes
    • Add JsonKey.explicitJsonNullWhenNonNullField for PATCH-style tri-state JSON
      fields (omit key vs explicit null vs value).
    Open source →
    Release notes
    • Add JsonKey.explicitJsonNullWhenNonNullField for PATCH-style tri-state JSON fields (omit key vs explicit null vs value).
    Open source →
  2. 4.11.0 19 Feb 2026
    Release notes
    • Add JsonSerializable.dateTimeUtc configuration option.
      (#1371)
    Open source →
    Release notes
    • Add JsonSerializable.dateTimeUtc configuration option. (#1371)
    Open source →
  3. 4.10.0 29 Jan 2026
    Release notes
    • Support JsonKey annotation on constructor parameters.
    • Add JsonSerializable(createJsonSchema: true).
    • Require meta: ^1.16.0
    • Require sdk: ^3.9.0
    Open source →
    Release notes
    • Support JsonKey annotation on constructor parameters.
    • Add JsonSerializable(createJsonSchema: true). (Huge thanks to Chris Sells for the PR!)
    • Require meta: ^1.16.0
    • Require sdk: ^3.9.0
    Open source →
  4. 4.9.0 24 Apr 2024
    Release notes
    • Require Dart 3.0
    • Add JsonSerializable(createJsonKeys: true). (#1401)
    Open source →
  5. 4.8.1 03 May 2023
    Release notes
    • Require Dart 2.19
    • Add topics.
    Open source →
  6. 4.8.0 19 Jan 2023
    Release notes
    • DEPRECATED JsonKey.ignore. Replaced by...
    • Added JsonKey.includeFromJson and JsonKey.includeToJson to allow fine-grained control of if a field is encoded/decoded.
    • Added JsonSerializable.createPerFieldToJson which allows generating a _$ModelPerFieldToJson, enabling partial encoding of a model.
    • Update JsonKey documentation to align with new features in package:json_serializable.
    • Require Dart SDK >=2.18.0.
    Open source →
  7. 4.7.0 21 Sep 2022
    Release notes
    • Added JsonEnum.valueField which allows specifying a field in an "enhanced enum" to use for serialization instead of specifying each value individually with JsonValue.
    • Require Dart SDK 2.17
    Open source →
  8. 4.6.0 07 Jul 2022
    Release notes
    • Added JsonSerializable(createFieldMap: true). (#1164)
    • Added JsonSerializable(converters: <JsonConverter>[]) (#1072)
    Open source →
  9. 4.5.0 27 Apr 2022
    Release notes
    • Added FieldRename.screamingSnake.
    Open source →
  10. 4.4.0 01 Dec 2021
    Release notes
    • Added JsonKey.readValue.
    • Non-breaking updates to checkedCreate and checkedConvert to support JsonKey.readValue.
    • Improved toString in included exceptions.
    Open source →
  11. 4.4.0-beta.0 01 Dec 2021 pre-release

    Nothing published for this version

  12. 4.3.0 14 Oct 2021
    Release notes
    • Changed the type of JsonKey.unknownEnumValue from Object? to Enum?. Assuming this feature has been used correctly, it shouldn't be a breaking change.
    • Changed the type of the $enumDecodeNullable parameter unknownValue from Object? to Enum?.
    Open source →
  13. 4.2.0 13 Oct 2021
    Release notes
    • Added JsonSerializable.constructor field to allow specifying an alternative constructor to invoke when creating a fromJson helper.
    • Added JsonEnum for annotating enum types.
    • Added $enumDecodeNullable and $enumDecode helpers to minimize generated code.
    • Added const JsonKey.nullForUndefinedEnumValue for use in JsonKey.unknownEnumValue when you want to use null for an unknown value.
    • Require Dart SDK >=2.14.0.
    Open source →
  14. 4.1.0 13 Jul 2021
    Release notes
    • Added a const constructor to JsonConverter.
    • Added $checkedCreate helper that will be used by package:json_serializable v5+ and replaces both $checkedNew and $checkedConvert.
    • Annotate annotations with the supported target types, to minimize incorrect usage.
    Open source →
  15. 4.0.1 19 Mar 2021
    Release notes
    • Fix a potential error with checked: true when ArgumentError.message is null.
    • Updated JsonSerializable.fromJson to handle null values.
    • Deprecate JsonSerializable defaults and withDefaults().
    Open source →
  16. 4.0.0 11 Feb 2021
    Release notes
    • Support null safety.
    • Requires Dart 2.12.
    • Updated $checkedConvert helper to support null-safety.
    • Removed the nullable field on JsonKey – the constructor entry still exists, but it's marked @Deprecated. The nullability of a field is now determined by the Dart type system.
    Open source →
  17. 4.0.0-nullsafety.0 03 Dec 2020 pre-release

    Nothing published for this version

  18. 3.1.1 20 Nov 2020
    Release notes
    • Avoid null values for CheckedFromJsonException.message by using toString() with unrecognized error types.
    • Added a helpful UnrecognizedKeysException.toString().
    • Fixed doc comments for JsonSerializable.genericArgumentFactories.
    Open source →
  19. 3.1.0 22 Sep 2020
    Release notes
    • Added JsonSerializable.genericArgumentFactories field.
    • Require at least Dart 2.7.0.
    Open source →
  20. 3.0.1 23 Dec 2019
    Release notes
    • Require at least Dart 2.6.0.
    • Fix lint that was affecting pub.dev score.
    Open source →
  21. 3.0.0 07 Aug 2019
    Release notes
    • BREAKING Removed JsonSerializable.useWrappers and associated $-prefixed helpers.
    • BREAKING Removed JsonSerializable.generateToJsonFunction.
    • BREAKING Removed encodeEmptyCollection from JsonSerializable and JsonKey.
    • Added JsonSerializable.ignoreUnannotated.
    • Added JsonKey.unknownEnumValue.
    • Require at least Dart 2.3.0.
    Open source →
  22. 2.4.0 16 May 2019
    Release notes
    • Deprecate members that will be removed in json_annotation 3.0.0 and that are not supported in json_serializable 3.0.0.
      • JsonSerializable.useWrappers and associated $-prefixed helpers
      • JsonSerializable.generateToJsonFunction,
      • encodeEmptyCollection from JsonSerializable and JsonKey.
    Open source →
  23. 2.3.0 09 May 2019
    Release notes
    • Added pascal as an additional fieldRename option.
    • Require at least Dart 2.2.0.
    Open source →
  24. 2.2.0 09 Apr 2019
    Release notes
    • Add an optional (named) badKey parameter and field to CheckedFromJsonException.
    Open source →
  25. 2.1.0 01 Apr 2019
    Release notes
    • Require at least Dart 2.1.1.

    • Added to encodeEmptyCollection to JsonKey and JsonSerializable.

    • JsonSerializable.fromJson now throws CheckedFromJsonException on errors. This is potentially a breaking change.

    • Added a more helpful toString to CheckedFromJsonException.

    Open source →
  26. 2.0.0 23 Oct 2018
    Release notes
    • Potentially Breaking JsonSerializable no longer sets default values for fields when constructor arguments are unset or null. This is not likely an issue for developers using this class as an annotation with a compatible version of package:json_serializable, but it may cause issues if class is used in other contexts.

    • Support all build.yaml configuration options on classes by adding a number of fields to JsonSerializable: anyMap, checked, explicitToJson, generateToJsonFunction, and useWrappers.

    Open source →
  27. 1.2.0 18 Sep 2018
    Release notes
    • Added JsonConverter class to support custom conversion of types.
    Open source →
  28. 1.1.0 09 Aug 2018
    Release notes
    • Added the fieldRename option to JsonSerializable and the associated FieldRename enum.
    Open source →
  29. 1.0.0 24 Jul 2018
    Release notes
    • Added JsonValue class for annotating enum fields with a custom serialization value.

    • Removed $checkAllowedKeys, $enumDecode and $enumDecodeNullable which are no longer needed by the latest release of package:json_serializable.

    Open source →
  30. 0.2.9 21 Jun 2018
    Release notes
    • When FormatException is caught in "checked mode", use the message property when creating CheckedFromJsonException.
    Open source →
  31. 0.2.9+1 20 Jul 2018
    Release notes
    • Support the Dart 2.0 stable release.
    Open source →
  32. 0.2.8 08 Jun 2018
    Release notes
    • Added $checkKeys helper function and deprecated $checkAllowedKeys. Upgrading to the latest json_serializable and re-running your build will eliminate any @deprecated hints you see.

    • Added BadKeyException exception which is the abstract super class for MissingRequiredKeysException, UnrecognizedKeysException, and DisallowedNullValueException.

    • Added JsonKey.required field and an associated MissingRequiredKeysException that is thrown when required fields don't have corresponding keys in a source JSON map.

    • Added JsonKey.disallowNullValue field and an associated DisallowedNullValueException that is thrown when corresponding keys exist in a source JSON map, but their values are null.

    • Updated documentation of JsonSerializable.createToJson to include details of the new generate_to_json_function configuration option.

    Open source →
  33. 0.2.7 01 Jun 2018
    Release notes
    • Added JsonSerializable.disallowUnrecognizedKeys.
      • Added a helper function to support this option. This function starts with a $ and should only be referenced by generated code. It is not meant for direct use.
      • Added UnrecognizedKeysException for reporting errors.
    Open source →
  34. 0.2.7+1 04 Jun 2018
    Release notes
    • Small improvement to UnrecognizedKeysException.message output and documentation comments.
    Open source →
  35. 0.2.6 30 May 2018
    Release notes
    • CheckedFromJsonException

      • Added a public constructor to support hand-written JSON decoding logic.
      • The message property is now String (instead of Object).
    • Added JsonKey.defaultValue.

    • Added helpers for deserialization of enum values. These functions starting with $ are referenced by generated code. They are not meant for direct use.

    Open source →
  36. 0.2.5 22 May 2018
    Release notes
    • Added CheckedFromJsonException which is thrown by code generated when checked is enabled in json_serializable.

    • Added functions to support the checked generation option. These functions starting with $ are referenced by generated code. They are not meant for direct use.

    Open source →
  37. 0.2.4 10 May 2018
    Release notes
    • Added fromJson and toJson fields to JsonKey class.
    Open source →
  38. 0.2.3 03 Apr 2018
    Release notes
    • Added ignore field to JsonKey class annotation
    Open source →
  39. 0.2.2 15 Dec 2017
    Release notes
    • Added a helper class – $JsonMapWrapper – and helper functions – $wrapMap, $wrapMapHandleNull, $wrapList, and $wrapListHandleNull – to support the useWrappers option added to JsonSerializableGenerator in v0.3.0 of package:json_serializable.
    Open source →
  40. 0.2.1 02 Nov 2017
    Release notes
    • JsonSerializable class annotation
      • Added nullable field.
      • Fixed doc comment.
    Open source →
  41. 0.2.0 27 Sep 2017
    Release notes
    • Moved annotation classes for JsonSerializable and JsonLiteral.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive