Changelog History
Page 4
-
v1.2.0.0 Changes
0️⃣
tagSingleConstructors
, an option to encode single-constructor types as tagged sums was added toOptions
. It is disabled by default for backward compatibility.0️⃣ The
cffi
flag is now turned off (False
) by default, this means C FFI code is no longer used by default. You can flip the flag to get C implementation.0️⃣ The
Options
constructor is no longer exposed to prevent new options from being breaking changes, usedefaultOptions
instead.The contents of
GToJSON
andGToEncoding
are no longer exposed.🚚 Some INLINE pragmas were removed to avoid GHC running out of simplifier ticks.
-
v1.1.2.0 Changes
🛠 Fix an accidental change in the format of
deriveJSON
. Thanks to Xia Li-yao!📚 Documentation improvements regarding
ToJSON
,FromJSON
, andSumEncoding
. Thanks to Xia Li-yao and Lennart Spitzner!
-
v1.1.1.0 Changes
➕ Added a pure implementation of the C FFI code, the C FFI code. If you wish to use the pure haskell version set the
cffi
flag toFalse
. This should make aeson compile when C isn't available, such as for GHCJS. Thanks to James Parker & Marcin Tolysz!✅ Using the
fast
flag can no longer cause a test case to fail. As far as we know this didn't affect any users of the library itself. Thanks to Xia Li-yao!
-
v1.1.0.0 Changes
➕ Added instances for
UUID
.📜 The operators for parsing fields now have named aliases:
-
.:
=>parseField
-
.:?
=>parseFieldMaybe
-
.:!
=>parseFieldMaybe'
- These functions now also have variants with explicit parser functions:
explicitParseField
,explicitParseFieldMaybe
, "explicitParseFieldMaybe'` Thanks to Oleg Grenrus.
-
ToJSONKey (Identity a)
andFromJSONKey (Identity a)
no longer require the unnecessaryFromJSON a
constraint. Thanks to Oleg Grenrus.➕ Added
Data.Aeson.Encoding.pair'
which is a more general version ofData.Aeson.Encoding.pair
. Thanks to Andrew Martin.Day
s BCE are properly encoded and+
is now a valid prefix forDay
s CE. Thanks to Matt Parsons.Some commonly used ToJSON instances are now specialized in order to improve compile time. Thanks to Bartosz Nitka.
✅ JSONTestSuite cleanups, all motivated by tighter RFC 7159 compliance:
- 📜 The parser now rejects numbers for which the integer portion contains a leading zero.
- 📜 The parser now rejects numbers for which a decimal point is not followed by at least one digit,
- 📜 The parser now rejects documents that contain whitespace outside the set {space, newline, carriage return, tab}.
✅ Over 90% of JSONTestSuite tests currently pass. The remainder can be categorised as follows:
📜 The string parser is strict with Unicode compliance where the RFC leaves room for implementation-defined behaviour (tests prefixed with "
i_string_
". (This is necessary because thetext
library cannot accommodate invalid Unicode.)📜 The parser does not (and will not) support UTF-16, UTF-32, or byte order marks (BOM).
📜 The parser accepts unescaped control characters, even though the RFC states that control characters must be escaped. (This may change at some point, but doesn't seem important.)
-
v1.0.2.1 Changes
- 🛠 Fixes a regression where a bunch of valid characters caused an "Invalid UTF8-Stream" error when decoding. Thanks to Vladimir Shabanov who investigated and fixed this.
-
v1.0.2.0 Changes
- 🛠 Fixes a regression where it was no longer possible to derive
instances for types such as
data T a = T { f1 :: a, f2 :: Maybe a }
.
Thanks to Sean Leather for fixing this, and to Ryan Scott for helping out.
- 🛠 Fixes a regression where it was no longer possible to derive
instances for types such as
-
v1.0.1.0 Changes
🐎 Decoding performance has been significantly improved (see https://github.com/bos/aeson/pull/452). Thanks to @winterland1989.
➕ Add
ToJSON
/FromJSON
instances for newtypes fromData.Semigroup
:Min
,Max
,First
,Last
,WrappedMonoid
,Option
. Thanks to Lennart Spitzner.📚 Make the documentation for
.:!
more accurate. Thanks to Ian Jeffries.
-
v1.0.0.0 Changes
April 07, 2018Major enhancements:
Introduced new
FromJSONKey
andToJSONKey
type classes that are used to encode maps without going through HashMap. This also allows arbitrary serialization of keys where a string-like key will encode into an object and other keys will encode into an array of key-value tuples.➕ Added higher rank classes:
ToJSON1
,ToJSON2
,FromJSON1
, andFromJSON2
.➕ Added
Data.Aeson.Encoding
with functions to safely writeToJSON
instances usingtoEncoding
.
Other enhancements:
A Cabal
fast
flag was added to disable building with optimizations. This drastically speeds up compiling both aeson and libraries using aeson so it is recommended to enable it during development. With cabal-install you cancabal install aeson -ffast
and with stack you can add a flag section to your stack.yaml:flags: aeson: fast: true
➕ Added list specific members to
ToJSON
andFromJSON
classes. In the same wayRead
andShow
handle lists specifically. This removes need for overlapping instances to handleString
.➕ Added a new
sumEncoding
optionUntaggedValue
which prevents objects from being tagged with the constructor name.JSONPaths are now tracked in instances derived with template-haskell and generics.
Get rid of redundancy of JSONPath error messages in nested records.
eitherDecode "{\"x\":{\"a\": [1,2,true]}}" :: Either String Y
previously yieldedError in $.x.a[2]: failed to parse field" x: failed to parse field a: expected Int, encountered Boolean
and now yieldsError in $.x.a[2]: expected Int, encountered Boolean"
.Some users might prefer to insert
modifyFailure
themselves to customize error messages, which previously prevented the use of(.:)
.✅ Backwards compatibility with
bytestring-0.9
using thebytestring-builder
compatibility package.Export
decodeWith
,decodeStrictWith
,eitherDecodeWith
, andeitherDecodeStrictWith
fromData.Aeson.Parser
. This allows decoding using explicit parsers instead of usingFromJSON
instances.Un-orphan internal instances to render them in haddocks.
Other changes:
Integral
FromJSON
instances now only accept integral values. E.g. parsing3.14
toInt
fails instead of succeeding with the value3
.Over/underflows are now caught for bounded numeric types.
✂ Remove the
contents
field encoding withallNullaryToStringTag = False
, giving us{ "tag" : "c1" }
instead of{ "tag" : "c1", contents : [] }
. The contents field is optional when parsing so this is only a breaking change for ToJSON instances.🛠 Fix a bug where
genericToEncoding
withunwrapUnaryRecords = True
would produce an invalid encoding:"unwrap\":""
.ToJSON
instances usinggenericToEncoding
andomitNothingFields
no longer produce invalid JSON.➕ Added instances for
DList
,Compose
,Product
,Sum
.
-
v0.11.2.0 Changes
- Enable
PolyKinds
to generalizeProxy
,Tagged
, andConst
instances. - ➕ Add
unsafeToEncoding
inData.Aeson.Types
, use with care!
- Enable
-
v0.11.1.4 Changes
- 🛠 Fix build with
base >= 4.8
andunordered-containers < 0.2.6
.
- 🛠 Fix build with