json_annotation 3.0.0
json_annotation: ^3.0.0 copied to clipboard
Classes and helper functions that support JSON code generation via the `json_serializable` package.
3.0.0 #
- BREAKING Removed
JsonSerializable.useWrappersand associated$-prefixed helpers. - BREAKING Removed
JsonSerializable.generateToJsonFunction. - BREAKING Removed
encodeEmptyCollectionfromJsonSerializableandJsonKey. - Added
JsonSerializable.ignoreUnannotated. - Added
JsonKey.unknownEnumValue. - Require at least Dart
2.3.0.
2.4.0 #
- Deprecate members that will be removed in
json_annotation3.0.0and that are not supported injson_serializable3.0.0.JsonSerializable.useWrappersand associated$-prefixed helpersJsonSerializable.generateToJsonFunction,encodeEmptyCollectionfromJsonSerializableandJsonKey.
2.3.0 #
- Added
pascalas an additionalfieldRenameoption. - Require at least Dart
2.2.0.
2.2.0 #
- Add an optional (named)
badKeyparameter and field toCheckedFromJsonException.
2.1.0 #
-
Require at least Dart
2.1.1. -
Added to
encodeEmptyCollectiontoJsonKeyandJsonSerializable. -
JsonSerializable.fromJsonnow throwsCheckedFromJsonExceptionon errors. This is potentially a breaking change. -
Added a more helpful
toStringtoCheckedFromJsonException.
2.0.0 #
-
Potentially Breaking
JsonSerializableno longer sets default values for fields when constructor arguments are unset ornull. This is not likely an issue for developers using this class as an annotation with a compatible version ofpackage:json_serializable, but it may cause issues if class is used in other contexts. -
Support all
build.yamlconfiguration options on classes by adding a number of fields toJsonSerializable:anyMap,checked,explicitToJson,generateToJsonFunction, anduseWrappers.
1.2.0 #
- Added
JsonConverterclass to support custom conversion of types.
1.1.0 #
- Added the
fieldRenameoption toJsonSerializableand the associatedFieldRenameenum.
1.0.0 #
-
Added
JsonValueclass for annotatingenumfields with a custom serialization value. -
Removed
$checkAllowedKeys,$enumDecodeand$enumDecodeNullablewhich are no longer needed by the latest release ofpackage:json_serializable.
0.2.9+1 #
- Support the Dart 2.0 stable release.
0.2.9 #
- When
FormatExceptionis caught in "checked mode", use themessageproperty when creatingCheckedFromJsonException.
0.2.8 #
-
Added
$checkKeyshelper function and deprecated$checkAllowedKeys. Upgrading to the latestjson_serializableand re-running your build will eliminate any@deprecatedhints you see. -
Added
BadKeyExceptionexception which is the abstract super class forMissingRequiredKeysException,UnrecognizedKeysException, andDisallowedNullValueException. -
Added
JsonKey.requiredfield and an associatedMissingRequiredKeysExceptionthat is thrown whenrequiredfields don't have corresponding keys in a source JSON map. -
Added
JsonKey.disallowNullValuefield and an associatedDisallowedNullValueExceptionthat is thrown when corresponding keys exist in a source JSON map, but their values arenull. -
Updated documentation of
JsonSerializable.createToJsonto include details of the newgenerate_to_json_functionconfiguration option.
0.2.7+1 #
- Small improvement to
UnrecognizedKeysException.messageoutput and documentation comments.
0.2.7 #
- 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
UnrecognizedKeysExceptionfor reporting errors.
- Added a helper function to support this option. This function starts with a
0.2.6 #
-
CheckedFromJsonException- Added a public constructor to support hand-written JSON decoding logic.
- The
messageproperty is nowString(instead ofObject).
-
Added
JsonKey.defaultValue. -
Added helpers for deserialization of
enumvalues. These functions starting with$are referenced by generated code. They are not meant for direct use.
0.2.5 #
-
Added
CheckedFromJsonExceptionwhich is thrown by code generated whencheckedis enabled injson_serializable. -
Added functions to support the
checkedgeneration option. These functions starting with$are referenced by generated code. They are not meant for direct use.
0.2.4 #
- Added
fromJsonandtoJsonfields toJsonKeyclass.
0.2.3 #
- Added
ignorefield toJsonKeyclass annotation
0.2.2 #
- Added a helper class –
$JsonMapWrapper– and helper functions –$wrapMap,$wrapMapHandleNull,$wrapList, and$wrapListHandleNull– to support theuseWrappersoption added toJsonSerializableGeneratorinv0.3.0ofpackage:json_serializable.
0.2.1 #
JsonSerializableclass annotation- Added
nullablefield. - Fixed doc comment.
- Added
0.2.0 #
- Moved annotation classes for
JsonSerializableandJsonLiteral.