pub repository
mirror.p-hatan.irjson_annotation
1.0.0Classes and helper functions that support JSON code generation via the `json_serializable` package.
Readme
Defines the annotations used by json_serializable to create code for JSON serialization and deserialization.
See the example to understand how to configure your package.
Features and bugs
Please file feature requests and bugs at the issue tracker.
Changelog
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.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add json_annotationpubspec.yaml
name: json_annotation
version: 1.0.0
description: >-
Classes and helper functions that support JSON code generation via the
`json_serializable` package.
homepage: https://github.com/dart-lang/json_serializable
author: Dart Team <misc@dartlang.org>
environment:
sdk: '>=2.0.0-dev.54.0 <3.0.0'
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.2.0 | 2017-09-27T22:04:55.605010Z | Download | c8f180d981178010a75ab18dece552de7c790273e5ab627158c9344c01454b98 |
| 0.2.1 | 2017-11-02T23:27:45.242584Z | Download | 17fec4b0b6ed4209cbf4398281b63423b2d0401be839bef78e00a9b5a3bc12f7 |
| 0.2.2 | 2017-12-15T19:27:22.272400Z | Download | 697c97a01ba731817eee96c8ce1f2c6874d7b31e7270953e61bc9bb18630f514 |
| 0.2.3 | 2018-04-03T19:31:33.674146Z | Download | 27efb35da5a01da297114a6c993bb0ce76aa423b03e2ae2028d401f01d23e169 |
| 0.2.4 | 2018-05-10T14:56:41.447408Z | Download | 4b8497580b1de2738b8cd2d20156114f5e0f3741a72d6a578dfdea74ae5f5da3 |
| 0.2.5 | 2018-05-22T22:31:49.636696Z | Download | b3cb53184118c37739eff1cfa13d06e11fdbffc9e836d2e1a91230cbe60ad060 |
| 0.2.6 | 2018-05-30T18:12:46.767561Z | Download | 597b05398ea4335a0ecdec6a9ea410698a5dd2b68947e559b1654cab029c9006 |
| 0.2.7 | 2018-06-01T17:03:15.487988Z | Download | efec1c1144bb1684b4e46cbd3f055306944a94ea8f85a5cfdb4e87c2e25d80fa |
| 0.2.7+1 | 2018-06-04T22:11:10.209680Z | Download | 34c5897646fef59451744d48435ddca5f024ac9d7c75434d66c24cfd87e8eb8e |
| 0.2.8 | 2018-06-08T16:09:54.744202Z | Download | 2aea101d35285abd98c6eb94d0ff97ac643abbaca48b48060c8f96a8ceb68222 |
| 0.2.9 | 2018-06-21T21:07:50.786483Z | Download | ea2c950dec483deb937bb3965112ec423cfd21b77142d5d964d956c00f60a7db |
| 0.2.9+1 | 2018-07-20T20:37:18.469277Z | Download | 0c2cb472c95c01d22cf4545f35c1c17ce0225cc4b30dfea86b4437e13b8b4473 |
| 1.0.0 | 2018-07-24T21:44:44.221278Z | Download | e82f8792ec628291e1ceeaaf9245cc32c15dbf99639184ea84aac02feb206ac8 |
| 1.1.0 | 2018-08-09T23:24:46.776839Z | Download | 9849d6fad7611e66be578295903aec03f8ae6d4b988bd063746d0f177ed14bd4 |
| 1.2.0 | 2018-09-18T18:15:09.120200Z | Download | 039cfc37996a9118a4e8eef0995e484aa8da82efb926d607702596406ee7d942 |
| 2.0.0 | 2018-10-23T21:06:36.909292Z | Download | 7ff791c96f3e5d52e922bbdfeff1eae27fe1c9f0b3c16e2fe5b7b587b58339c0 |
| 2.1.0 | 2019-04-01T21:15:26.656734Z | Download | f36b6238632915c043b552e437253398c7aa4c4ce69a091da40fa56e798344e6 |
| 2.2.0 | 2019-04-09T16:03:39.532856Z | Download | 26b62d56482c02d56896e3bc7e86f4c7370f28b1019eba150edca29783eac1c4 |
| 2.3.0 | 2019-05-09T21:25:45.463685Z | Download | dcba642d19c9d64eaf2a5aec662a54f92fbfbd4b798ce1b865fa8b1c31ff7502 |
| 2.4.0 | 2019-05-16T21:44:15.730409Z | Download | 70fbd227bef9d0b7a9e2a8ac0d7495d1b37a7b722c7da2733df7ee750a8024d8 |
| 3.0.0 | 2019-08-07T23:19:06.434454Z | Download | aa3539e5cf10ae998869046e586438bcdd3efc1c8b49dd7381f984e387b256fc |
| 3.0.1 | 2019-12-23T19:05:55.907126Z | Download | d3ba8a1b8dc542cbe97d0dc695e4bf25abc4d17a6110df4bb9713eb398f305f1 |
| 3.1.0 | 2020-09-22T22:50:33.743690Z | Download | c20d1d4d9a8dc77d5b0a2eec1b007cacbfd3b334b31acad5cc124d13055d44be |
| 3.1.1 | 2020-11-20T19:46:35.534529Z | Download | 6cec7404b25d6338c8cb7b30131cd6c760079a4ec1fa7846c55bdda91f9d2819 |
| 4.0.0-nullsafety.0 | 2020-12-03T03:31:16.957273Z | Download | 400dfbcd1321acc502758c6df693765fd2b923586d939e40dc25a8befc2da07e |
| 4.0.0 | 2021-02-11T23:35:05.016575Z | Download | 0aab0aad3dde662cdc02d3a6fa6c9f20687a91089900bd25c64f3badcc90bf21 |
| 4.0.1 | 2021-03-19T20:51:17.789341Z | Download | fd56fb29e3f02cd9bef80e99e9491d27889fb010f98ff3379b21e7d40d0112b3 |
| 4.1.0 | 2021-07-13T19:52:41.546817Z | Download | 0aa7409f6c82acfab96853b8b0c7503de49918cbe705a57cfdeb477756b4521b |
| 4.2.0 | 2021-10-13T00:49:39.222906Z | Download | 858d1cfa5f09aeb5fae13244c98e4bc8db19bc517b1fc5ee32d4fd9188a5eb0d |
| 4.3.0 | 2021-10-14T23:50:19.775657Z | Download | 3dd806caa7c7f7bb450099a5ece72ae1602cf6b6ed1f72d3d5205c8adbd70288 |
| 4.4.0-beta.0 | 2021-12-01T01:10:20.511865Z | Download | 4c8b1a66c0393bdbb757189a48551b9775045bc388b2cad2ea073f036976999f |
| 4.4.0 | 2021-12-01T01:28:49.589832Z | Download | 2639efc0237c7b71c6584696c0847ea4e4733ddaf571ae9c79d5295e8ae17272 |
| 4.5.0 | 2022-04-27T00:42:54.990861Z | Download | 53cddd9d4a2d253d977dbbd21642f20f580a6a65fcc05d9d69b9f0ecc264cad9 |
| 4.6.0 | 2022-07-07T18:54:21.167085Z | Download | cb314f00b2488de7bc575207e54402cd2f92363f333a7933fd1b0631af226baa |
| 4.7.0 | 2022-09-21T00:13:01.917768Z | Download | 3520fa844009431b5d4491a5a778603520cdc399ab3406332dcc50f93547258c |
| 4.8.0 | 2023-01-19T20:14:57.945587Z | Download | c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 |
| 4.8.1 | 2023-05-03T16:52:22.791042Z | Download | b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 |
| 4.9.0 | 2024-04-24T19:48:22.830950Z | Download | 1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1 |
| 4.10.0 | 2026-01-29T01:16:38.818956Z | Download | 805fa86df56383000f640384b282ce0cb8431f1a7a2396de92fb66186d8c57df |
| 4.11.0 | 2026-02-19T19:05:57.491333Z | Download | cb09e7dac6210041fad964ed7fbee004f14258b4eca4040f72d1234062ace4c8 |
| 4.12.0 | 2026-05-15T18:27:32.045501Z | Download | 2a743920d81b7910627f68ee2c9ac1fc0bfee32b9fc3403587d7c6791ca12f80 |
Dependencies
No direct dependencies declared.