yesod-json 0.2.2.3 → 0.2.3
raw patch · 2 files changed
+21/−8 lines, 2 filesdep +attoparsec-enumeratordep +transformersnew-uploaderPVP ok
version bump matches the API change (PVP)
Dependencies added: attoparsec-enumerator, transformers
API changes (from Hackage documentation)
+ Yesod.Json: parseJsonBody :: GHandler sub master Value
Files
- Yesod/Json.hs +11/−0
- yesod-json.cabal +10/−8
Yesod/Json.hs view
@@ -5,6 +5,8 @@ ( -- * Convert from a JSON value defaultLayoutJson , jsonToRepJson+ -- * Convert to a JSON value+ , parseJsonBody -- * Compatibility wrapper for old API , Json , jsonScalar@@ -22,8 +24,10 @@ import qualified Data.Aeson as J import qualified Data.Aeson.Encode as JE import Data.Aeson.Encode (fromValue)+import Data.Attoparsec.Enumerator (iterParser) import Data.Text (pack) import Control.Arrow (first)+import Control.Monad.Trans.Class (lift) #if MIN_VERSION_aeson(0, 4, 0) import Data.HashMap.Strict (fromList) #else@@ -61,6 +65,13 @@ -- | Wraps the 'Content' generated by 'jsonToContent' in a 'RepJson'. jsonToRepJson :: J.Value -> GHandler sub master RepJson jsonToRepJson = return . RepJson . toContent++-- | Parse the request body as a JSON value.+--+-- /Since: 0.2.3/+parseJsonBody :: GHandler sub master J.Value+parseJsonBody = lift $ iterParser J.json'+ type Json = J.Value
yesod-json.cabal view
@@ -1,5 +1,5 @@ name: yesod-json-version: 0.2.2.3+version: 0.2.3 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -13,15 +13,17 @@ description: Generate content for Yesod using the aeson package. library- build-depends: base >= 4 && < 5- , yesod-core >= 0.9 && < 0.10- , aeson >= 0.3- , text >= 0.8 && < 0.12- , shakespeare-js >= 0.10 && < 0.11- , vector >= 0.9- , containers >= 0.2 && < 0.5+ build-depends: base >= 4 && < 5+ , yesod-core >= 0.9 && < 0.10+ , aeson >= 0.3+ , text >= 0.8 && < 0.12+ , shakespeare-js >= 0.10 && < 0.11+ , vector >= 0.9+ , containers >= 0.2 && < 0.5 , unordered-containers , blaze-builder+ , attoparsec-enumerator >= 0.3 && < 0.4+ , transformers >= 0.2.2 && < 0.3 exposed-modules: Yesod.Json ghc-options: -Wall