packages feed

json-rpc 1.1.2 → 1.1.3

raw patch · 4 files changed

+14/−6 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -4,6 +4,12 @@ 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.1.3 - 2026-08-18++### Fixed+- Correct JSON identity test for requests that have null params.+- Refactor to eliminate use of `head`.+ ## 1.1.2 - 2025-05-09  ### Fixed
json-rpc.cabal view
@@ -1,13 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.38.0.+-- This file has been generated from package.yaml by hpack version 0.39.6. -- -- see: https://github.com/sol/hpack------ hash: af79897f0e82fbeacd851e9b286216ab406df7508ea4e6c07e7ced0f24912c64  name:           json-rpc-version:        1.1.2+version:        1.1.3 synopsis:       Fully-featured JSON-RPC 2.0 library description:    Please see the README on GitHub at <https://github.com/jprupp/json-rpc#readme> category:       Network
src/Network/JSONRPC/Interface.hs view
@@ -216,7 +216,9 @@ -- by server if any. Just Right means response was received just right. sendRequest :: (MonadLoggerIO m , ToJSON q, ToRequest q, FromResponse r)             => q -> JSONRPCT m (Maybe (Either ErrorObj r))-sendRequest q = head `liftM` sendBatchRequest [q]+sendRequest q = sendBatchRequest [q] >>= \case+  [] -> return Nothing+  x:_ -> return x  -- | Send multiple requests in a batch. If only a single request, do not -- put it in a batch.
test/Spec.hs view
@@ -115,7 +115,9 @@ checkFieldsReqNotif ver m v i o = do     checkVerId ver i o >>= guard     o .: "method" >>= guard . (==m)-    o .: "params" >>= guard . (==v)+    o .:? "params" >>= \case+      Just v' -> guard (v' == v)+      Nothing -> guard (v == Null)     return True  checkFieldsReq :: Request -> Object -> Parser Bool