safe-json 1.1.2.0 → 1.1.3.0
raw patch · 4 files changed
+33/−24 lines, 4 filesdep ~bytestringdep ~textPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: bytestring, text
API changes (from Hackage documentation)
Files
- ChangeLog.md +12/−7
- safe-json.cabal +9/−11
- src/Data/SafeJSON/Internal.hs +4/−1
- test/Instances.hs +8/−5
ChangeLog.md view
@@ -1,11 +1,16 @@ # Changelog for safe-json +## 1.1.3.0++* Compatibility with `aeson < 2.1` and `text < 2.1` [#33](https://github.com/Vlix/safe-json/pull/33) Thanks to [@ysangkok](https://github.com/ysangkok)+* Compatibility with `bytestring < 0.12`.+ ## 1.1.2.0 * Aeson <= 2.0.2.0 compatibility (https://cs-syd.eu/posts/2021-09-11-json-vulnerability)- * Fix internal code to work with new `Key` and `KeyMap` from `aeson-2.0.0.0` [#28] Thanks to @dysinger- * Added `SafeJSON` instances for `Key` and `KeyMap` [#29]- * Added `SafeJSON` instances for `Compose`, `Product` and `Sum` [#29]+ * Fix internal code to work with new `Key` and `KeyMap` from `aeson-2.0.0.0` [#28](https://github.com/Vlix/safe-json/pull/28) Thanks to [@dysinger](https://github.com/dysinger)+ * Added `SafeJSON` instances for `Key` and `KeyMap` [#29](https://github.com/Vlix/safe-json/pull/29)+ * Added `SafeJSON` instances for `Compose`, `Product` and `Sum` [#29](https://github.com/Vlix/safe-json/pull/29) ## 1.1.1.1 @@ -14,15 +19,15 @@ ## 1.1.1 -* Fix clash in `test/Instances.hs` of `Ord` instance for `Data.Aeson.Value` [#23]+* Fix clash in `test/Instances.hs` of `Ord` instance for `Data.Aeson.Value` [#23](https://github.com/Vlix/safe-json/pull/23) ## 1.1.0 -* update for GHC 8.8.1 [#15]+* update for GHC 8.8.1 [#15](https://github.com/Vlix/safe-json/pull/15) * loosened dependency restriction on `time` * fixed instance for IntMap-* DRY-er `TestMigrate` and `TestReverseMigrate` type synonyms [#17] Thanks to @blinkytoy-* fixed documentation [#17] Thanks to @blinkytoy+* DRY-er `TestMigrate` and `TestReverseMigrate` type synonyms [#17](https://github.com/Vlix/safe-json/pull/17) Thanks to [@blinkytoy](https://github.com/blinkytoy)+* fixed documentation [#17](https://github.com/Vlix/safe-json/pull/17) Thanks to [@blinkytoy](https://github.com/blinkytoy) * broken links to modules * `setVersion`'s documentation only showing half
safe-json.cabal view
@@ -3,11 +3,9 @@ -- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack------ hash: 8355ba082d5b33671f6951544a67e1c0874971b8a3b339abe51a00d2d381641f name: safe-json-version: 1.1.2.0+version: 1.1.3.0 synopsis: Automatic JSON format versioning description: This library aims to make the updating of JSON formats or contents, while keeping backward compatibility, as painless as possible. The way this is achieved is through versioning and defined migration functions to migrate older (or newer) versions to the one used. .@@ -28,9 +26,9 @@ copyright: 2019 Felix Paulusma license: MIT license-file: LICENSE-tested-with:- GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.1 build-type: Simple+tested-with:+ GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2 extra-source-files: README ChangeLog.md@@ -66,15 +64,15 @@ build-depends: aeson >=1.4.1 && <2.1 , base >=4.9 && <5- , bytestring >=0.10.8.1 && <0.11+ , bytestring >=0.10.8.1 && <0.12 , containers >=0.5.7.1 && <0.7 , dlist >=0.8.0.3 && <2- , hashable >=1.2.6.1 && <1.4+ , hashable >=1.2.6.1 && <1.5 , scientific >=0.3.5.2 && <0.4 , tasty >=0.11.3 && <1.5 , tasty-hunit >=0.9.2 && <0.11 , tasty-quickcheck >=0.8.4 && <0.11- , text >=1.2.3 && <1.3+ , text >=1.2.3 && <2.1 , time >=1.6.0.1 && <1.10 , unordered-containers >=0.2.9 && <0.3 , uuid-types >=1.0.3 && <1.1@@ -104,11 +102,11 @@ build-depends: aeson >=1.4.1 && <2.1 , base >=4.9 && <5- , bytestring >=0.10.8.1 && <0.11+ , bytestring >=0.10.8.1 && <0.12 , containers >=0.5.7.1 && <0.7 , dlist >=0.8.0.3 && <2 , generic-arbitrary >=0.1.0 && <0.3- , hashable >=1.2.6.1 && <1.4+ , hashable >=1.2.6.1 && <1.5 , quickcheck-instances >=0.3.16 && <0.4 , safe-json , scientific >=0.3.5.2 && <0.4@@ -116,7 +114,7 @@ , tasty-hunit , tasty-quickcheck , temporary >=1.2.1.1 && <1.4- , text >=1.2.3 && <1.3+ , text >=1.2.3 && <2.1 , time >=1.6.0.1 && <1.10 , unordered-containers >=0.2.9 && <0.3 , uuid >=1.3.13 && <1.4
src/Data/SafeJSON/Internal.hs view
@@ -95,7 +95,10 @@ #if MIN_VERSION_aeson(2,0,0) import qualified Data.Aeson.Key as K (Key)-import qualified Data.Aeson.KeyMap as Map (KeyMap, delete, fromMap, insert, lookup, size, toList)+import qualified Data.Aeson.KeyMap as Map (KeyMap, delete, insert, lookup, size, toList)+#if !MIN_VERSION_aeson(2,0,1)+import qualified Data.Aeson.KeyMapp as Map (fromMap)+#endif #else import qualified Data.HashMap.Strict as Map (delete, insert, lookup, size, toList) #endif
test/Instances.hs view
@@ -9,7 +9,7 @@ import Data.Aeson-#if MIN_VERSION_aeson(2,0,0)+#if MIN_VERSION_aeson(2,0,0) && !MIN_VERSION_aeson(2,0,3) import qualified Data.Aeson.Key as K import qualified Data.Aeson.KeyMap as KM #endif@@ -19,10 +19,11 @@ import Data.Time.Clock.POSIX (posixSecondsToUTCTime) import qualified Data.Vector.Primitive as VP -#if MIN_VERSION_base(4,13,0)+#if !MIN_VERSION_base(4,13,0)+import Test.Tasty.QuickCheck (Arbitrary(..))+#endif+#if !MIN_VERSION_aeson(2,0,3) import Test.Tasty.QuickCheck (oneof, resize)-#else-import Test.Tasty.QuickCheck (Arbitrary(..), oneof, resize) #endif import Test.QuickCheck.Arbitrary.Generic import Test.QuickCheck.Instances()@@ -46,6 +47,7 @@ arbitrary = VP.fromList <$> arbitrary shrink = fmap VP.fromList . shrink . VP.toList +#if !MIN_VERSION_aeson(2,0,3) instance Arbitrary Value where arbitrary = oneof [ resize 5 $ Object <$> arbitrary@@ -56,6 +58,7 @@ , pure Null ] shrink = genericShrink+#endif #if !MIN_VERSION_aeson(1,5,2) -- | This is here just to test 'Set' in 'parseCollection'@@ -79,7 +82,7 @@ _ `compare` _ = GT #endif -#if MIN_VERSION_aeson(2,0,0)+#if MIN_VERSION_aeson(2,0,0) && !MIN_VERSION_aeson(2,0,3) instance Arbitrary v => Arbitrary (KM.KeyMap v) where arbitrary = KM.fromList <$> arbitrary