apiary 2.0.1.1 → 2.0.2
raw patch · 5 files changed
+14/−2 lines, 5 files
Files
- CHANGELOG.md +3/−0
- apiary.cabal +1/−1
- src/Control/Monad/Apiary/Action.hs +1/−0
- src/Control/Monad/Apiary/Action/Internal.hs +8/−1
- src/Web/Apiary.hs +1/−0
CHANGELOG.md view
@@ -1,3 +1,6 @@+# 2.0.2+* add json to send ToJson instances with auto 'application/json' content type.+ # 2.0.1 * document Data.Param.File * expose Control.Monad.Apiary.Action.getReqBodyJSON
apiary.cabal view
@@ -1,5 +1,5 @@ name: apiary-version: 2.0.1.1+version: 2.0.2 synopsis: Simple and type safe web framework that generate web API documentation. description: Simple and type safe web framework that can be automatically generate API documentation.
src/Control/Monad/Apiary/Action.hs view
@@ -20,6 +20,7 @@ , bytes, lazyBytes , text, lazyText , showing+ , json , string, char , appendBuilder , appendBytes, appendLazyBytes
src/Control/Monad/Apiary/Action/Internal.hs view
@@ -34,6 +34,7 @@ , bytes, lazyBytes , text, lazyText , showing+ , json , string, char , appendBuilder , appendBytes, appendLazyBytes@@ -139,7 +140,7 @@ import qualified Data.Text.Lazy as TL import qualified Data.Vault.Lazy as V import Data.Word (Word64)-import Data.Aeson (FromJSON)+import Data.Aeson (FromJSON, ToJSON) import qualified Data.Aeson as JSON data ApiaryConfig = ApiaryConfig@@ -764,6 +765,12 @@ -- | set response body from show. encoding UTF-8. since 0.15.2. showing :: (Monad m, Show a) => a -> ActionT exts prms m () showing = builder . B.fromShow++-- | set response body from 'ToJSON' with content-type set to @application/json@. since 2.0.2+json :: (Monad m, ToJSON a) => a -> ActionT exts prms m ()+json x = do+ contentType "application/json"+ lazyBytes (JSON.encode x) -- | set response body from string. encoding UTF-8. since 0.15.2. string :: Monad m => String -> ActionT exts prms m ()
src/Web/Apiary.hs view
@@ -60,6 +60,7 @@ , bytes, lazyBytes , text, lazyText , showing+ , json , string, char , appendBuilder , appendBytes, appendLazyBytes