NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #20 most downloaded on pub.dev
Classes and helper functions that support JSON code generation via the `json_serializable` package.
Last release 4 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
Add JsonKey.explicitJsonNullWhenNonNullField for PATCH-style tri-state JSON fields (omit key vs explicit null vs value).
JsonKey.explicitJsonNullWhenNonNullField for PATCH-style tri-state JSONnull vs value).Add JsonSerializable.dateTimeUtc configuration option.
JsonSerializable.dateTimeUtc configuration option.One column per quarter.
Support JsonKey annotation on constructor parameters.
JsonKey annotation on constructor parameters.JsonSerializable(createJsonSchema: true).meta: ^1.16.0sdk: ^3.9.0JsonKey annotation on constructor parameters.JsonSerializable(createJsonSchema: true).
(Huge thanks to Chris Sells for the PR!)meta: ^1.16.0sdk: ^3.9.0Add JsonSerializable(createJsonKeys: true).
JsonSerializable(createJsonKeys: true).
(#1401)- Require Dart 2.19 - Add topics.
DEPRECATED JsonKey.ignore. Replaced by...
JsonKey.ignore. Replaced by...JsonKey.includeFromJson and JsonKey.includeToJson to allow
fine-grained control of if a field is encoded/decoded.JsonSerializable.createPerFieldToJson which allows generating
a _$ModelPerFieldToJson, enabling partial encoding of a model.JsonKey documentation to align with new features in
package:json_serializable.>=2.18.0.Added JsonEnum.valueField which allows specifying a field in an "enhanced enum" to use for serialization instead of specifying each value individually
JsonEnum.valueField which allows specifying a field in an
"enhanced enum" to use for serialization instead of specifying each value
individually with JsonValue.Added JsonSerializable(createFieldMap: true).
Added FieldRename.screamingSnake.
FieldRename.screamingSnake.Non-breaking updates to checkedCreate and checkedConvert to support JsonKey.readValue.
JsonKey.readValue.checkedCreate and checkedConvert to support
JsonKey.readValue.toString in included exceptions.Nothing published for this version
Changed the type of JsonKey.unknownEnumValue from Object? to Enum?. Assuming this feature has been used correctly, it shouldn't be a breaking change.
JsonKey.unknownEnumValue from Object? to Enum?.
Assuming this feature has been used correctly, it shouldn't be a breaking
change.$enumDecodeNullable parameter unknownValue from
Object? to Enum?.Added JsonSerializable.constructor field to allow specifying an alternative constructor to invoke when creating a fromJson helper.
JsonSerializable.constructor field to allow specifying an alternative
constructor to invoke when creating a fromJson helper.JsonEnum for annotating enum types.$enumDecodeNullable and $enumDecode helpers to minimize generated
code.const JsonKey.nullForUndefinedEnumValue for use in
JsonKey.unknownEnumValue when you want to use null for an unknown value.>=2.14.0.Added a const constructor to JsonConverter.
const constructor to JsonConverter.$checkedCreate helper that will be used by package:json_serializable
v5+ and replaces both $checkedNew and $checkedConvert.Deprecate JsonSerializable defaults and withDefaults().
checked: true when ArgumentError.message is
null.JsonSerializable.fromJson to handle null values.JsonSerializable defaults and withDefaults().Removed the nullable field on JsonKey – the constructor entry still exists, but it's marked @Deprecated. The nullability of a field is now determined…
$checkedConvert helper to support null-safety.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.Nothing published for this version
Avoid null values for CheckedFromJsonException.message by using toString() with unrecognized error types.
null values for CheckedFromJsonException.message by using
toString() with unrecognized error types.UnrecognizedKeysException.toString().JsonSerializable.genericArgumentFactories.Added JsonSerializable.genericArgumentFactories field.
JsonSerializable.genericArgumentFactories field.2.7.0.Fix lint that was affecting pub.dev score.
2.6.0.pub.dev score.BREAKING Removed JsonSerializable.useWrappers and associated $-prefixed helpers.
JsonSerializable.useWrappers and associated
$-prefixed helpers.JsonSerializable.generateToJsonFunction.encodeEmptyCollection from JsonSerializable and
JsonKey.JsonSerializable.ignoreUnannotated.JsonKey.unknownEnumValue.2.3.0.Deprecate members that will be removed in json_annotation 3.0.0 and that are not supported in json_serializable 3.0.0.
json_annotation 3.0.0 and that
are not supported in json_serializable 3.0.0.
JsonSerializable.useWrappers and associated $-prefixed helpersJsonSerializable.generateToJsonFunction,encodeEmptyCollection from JsonSerializable and JsonKey.Added pascal as an additional fieldRename option.
pascal as an additional fieldRename option.2.2.0.Add an optional (named) badKey parameter and field to CheckedFromJsonException.
badKey parameter and field to
CheckedFromJsonException.JsonSerializable.fromJson now throws CheckedFromJsonException on errors. This is potentially a breaking change.
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.
Potentially Breaking JsonSerializable no longer sets default values for fields when constructor arguments are unset or null. This is not likely an iss
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.
Added JsonConverter class to support custom conversion of types.
JsonConverter class to support custom conversion of types.Added the fieldRename option to JsonSerializable and the associated FieldRename enum.
fieldRename option to JsonSerializable and the associated
FieldRename enum.Added JsonValue class for annotating enum fields with a custom serialization value.
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.
Support the Dart 2.0 stable release.
When FormatException is caught in "checked mode", use the message property when creating CheckedFromJsonException.
FormatException is caught in "checked mode", use the message property
when creating CheckedFromJsonException.Added $checkKeys helper function and deprecated $checkAllowedKeys. Upgrading to the latest json_serializable and re-running your build will eliminate…
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.
Small improvement to UnrecognizedKeysException.message output and documentation comments.
UnrecognizedKeysException.message output and
documentation comments.Added JsonSerializable.disallowUnrecognizedKeys.
JsonSerializable.disallowUnrecognizedKeys.
$ and should only be referenced by generated code. It is not meant for
direct use.UnrecognizedKeysException for reporting errors.Added a public constructor to support hand-written JSON decoding logic.
CheckedFromJsonException
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.
Added CheckedFromJsonException which is thrown by code generated when checked is enabled in json_serializable.
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.
Added fromJson and toJson fields to JsonKey class.
fromJson and toJson fields to JsonKey class.Added ignore field to JsonKey class annotation
ignore field to JsonKey class annotationAdded a helper class – $JsonMapWrapper – and helper functions – $wrapMap, $wrapMapHandleNull, $wrapList, and $wrapListHandleNull – to support the useW
$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.JsonSerializable class annotation
JsonSerializable class annotation
nullable field.Moved annotation classes for JsonSerializable and JsonLiteral.
JsonSerializable and JsonLiteral.Your coding agent can read these notes before it upgrades. Set up the MCP server →