json-rpc 1.0.0 → 1.0.1
raw patch · 3 files changed
+30/−24 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- json-rpc.cabal +23/−23
- src/Network/JSONRPC/Data.hs +3/−1
CHANGELOG.md view
@@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 1.0.1 - 2019-01-01+### Fixed+- Correct JSON-RPC 2.0 methods returning null result.+ ## 1.0.0 - 2018-08-12 ### Added - Complete JSON-RPC 1.0 and 2.0 support.
json-rpc.cabal view
@@ -1,11 +1,13 @@--- This file has been generated from package.yaml by hpack version 0.20.0.+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.31.2. -- -- see: https://github.com/sol/hpack ----- hash: 17ad40ec32205d9c35293e1ce27724ff52b373645c39da1d0d09976874e4d5e1+-- hash: fd7f8d00f885bb74d1bb71f5b7182a578700dffb6cbceec348421e027cb54c13 name: json-rpc-version: 1.0.0+version: 1.0.1 synopsis: Fully-featured JSON-RPC 2.0 library description: Library compatible with JSON-RPC 2.0 and 1.0 category: Network@@ -16,17 +18,22 @@ license: PublicDomain license-file: UNLICENSE build-type: Simple-cabal-version: >= 1.10- extra-source-files:- CHANGELOG.md README.md+ CHANGELOG.md source-repository head type: git location: https://github.com/xenog/json-rpc.git library+ exposed-modules:+ Network.JSONRPC+ other-modules:+ Network.JSONRPC.Arbitrary+ Network.JSONRPC.Data+ Network.JSONRPC.Interface+ Paths_json_rpc hs-source-dirs: src ghc-options: -Wall@@ -48,17 +55,12 @@ , unliftio , unordered-containers , vector- exposed-modules:- Network.JSONRPC- other-modules:- Network.JSONRPC.Arbitrary- Network.JSONRPC.Data- Network.JSONRPC.Interface- Paths_json_rpc default-language: Haskell2010 executable concurrent-client main-is: examples/concurrent-client.hs+ other-modules:+ Paths_json_rpc build-depends: QuickCheck , aeson@@ -75,12 +77,12 @@ , unliftio , unordered-containers , vector- other-modules:- Paths_json_rpc default-language: Haskell2010 executable concurrent-server main-is: examples/concurrent-server.hs+ other-modules:+ Paths_json_rpc build-depends: QuickCheck , aeson@@ -97,12 +99,12 @@ , unliftio , unordered-containers , vector- other-modules:- Paths_json_rpc default-language: Haskell2010 executable time-client main-is: examples/time-client.hs+ other-modules:+ Paths_json_rpc build-depends: QuickCheck , aeson@@ -119,12 +121,12 @@ , unliftio , unordered-containers , vector- other-modules:- Paths_json_rpc default-language: Haskell2010 executable time-server main-is: examples/time-server.hs+ other-modules:+ Paths_json_rpc build-depends: QuickCheck , aeson@@ -141,13 +143,13 @@ , unliftio , unordered-containers , vector- other-modules:- Paths_json_rpc default-language: Haskell2010 test-suite test-json-rpc type: exitcode-stdio-1.0 main-is: Spec.hs+ other-modules:+ Paths_json_rpc hs-source-dirs: test ghc-options: -threaded -rtsopts -with-rtsopts=-N@@ -168,6 +170,4 @@ , unliftio , unordered-containers , vector- other-modules:- Paths_json_rpc default-language: Haskell2010
src/Network/JSONRPC/Data.hs view
@@ -220,7 +220,9 @@ v <- parseVer o i <- o .:? "id" r <- o .:? "result" .!= Null- p <- if r == Null then Left <$> o .: "error" else return $ Right r+ p <- case v of+ V1 -> if r == Null then Left <$> o .: "error" else return $ Right r+ V2 -> maybe (Right r) Left <$> o .:? "error" return (v, i, p) -- | Create a response from a request. Use in servers.