yesod-json-0.2.3: Generate content for Yesod using the aeson package.

Yesod.Json

Contents

Synopsis

Convert from a JSON value

defaultLayoutJson :: Yesod master => GWidget sub master () -> Value -> GHandler sub master RepHtmlJson

Provide both an HTML and JSON representation for a piece of data, using the default layout for the HTML output (defaultLayout).

jsonToRepJson :: Value -> GHandler sub master RepJson

Wraps the Content generated by jsonToContent in a RepJson.

Convert to a JSON value

parseJsonBody :: GHandler sub master Value

Parse the request body as a JSON value.

Since: 0.2.3

Compatibility wrapper for old API

type Json = Value

jsonMap :: [(String, Json)] -> Json