hjsonschema 0.5.0.0 → 0.5.1.0
raw patch · 3 files changed
+8/−14 lines, 3 filesdep +http-conduitdep −lensdep −wreqPVP ok
version bump matches the API change (PVP)
Dependencies added: http-conduit
Dependencies removed: lens, wreq
API changes (from Hackage documentation)
Files
- README.md +1/−1
- hjsonschema.cabal +2/−3
- src/Data/JsonSchema/Reference.hs +5/−10
README.md view
@@ -29,4 +29,4 @@ Thanks to [Julian Berman](https://github.com/Julian) for the fantastic test suite. -Also thanks to Tim Baumann for his [aeson-schema](https://hackage.haskell.org/package/aeson-schema) library. Hjsonschema's test code and its implementation of Graph both come from Aeson-Schema.+Also thanks to Tim Baumann for his [aeson-schema](https://hackage.haskell.org/package/aeson-schema) library. Hjsonschema's test code and its implementation of `Graph` both come from Aeson-Schema.
hjsonschema.cabal view
@@ -1,5 +1,5 @@ name: hjsonschema-version: 0.5.0.0+version: 0.5.1.0 synopsis: JSON Schema Draft 4 library homepage: https://github.com/seagreen/hjsonschema license: MIT@@ -32,14 +32,13 @@ , file-embed >= 0.0.8 && < 0.0.9 , hashable >= 1.2 && < 1.3 , hjsonpointer >= 0.1 && < 0.2+ , http-conduit >= 2.1.5 && < 2.2 , http-types >= 0.8 && < 0.9- , lens >= 4.7 && < 4.9 , regexpr >= 0.5 && < 0.6 , scientific >= 0.3 && < 0.4 , unordered-containers >= 0.2 && < 0.3 , text >= 1.2 && < 1.3 , vector >= 0.10 && < 0.11- , wreq >= 0.3 && < 0.4 test-suite local type: exitcode-stdio-1.0
src/Data/JsonSchema/Reference.hs view
@@ -1,7 +1,7 @@ module Data.JsonSchema.Reference where +import Control.Arrow import Control.Exception-import Control.Lens import Control.Monad import Data.Aeson import Data.ByteString.Lazy (ByteString)@@ -10,7 +10,7 @@ import Data.Monoid import Data.Text (Text) import qualified Data.Text as T-import Network.Wreq+import Network.HTTP.Conduit import Prelude hiding (foldr) combineIdAndRef :: Text -> Text -> Text@@ -47,18 +47,13 @@ fetchRef t = do eResp <- safeGet t case eResp of- Left err -> return (Left err)- Right b ->- case eitherDecode b of- Right (Object z) -> return (Right z)- Right v -> return . Left $- "fetchRef returned the following instead of an object" <> T.pack (show v)- Left e -> return . Left . T.pack $ e+ Left e -> return $ Left e+ Right b -> return . left T.pack $ eitherDecode b safeGet :: Text -> IO (Either Text ByteString) safeGet url = catch- (return . Right . (^. responseBody) =<< get (T.unpack url))+ (return . Right =<< (simpleHttp . T.unpack) url) handler where handler :: SomeException -> IO (Either Text ByteString)