| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Aeson.APIFieldJsonTH
Contents
Description
Utils for using aeson's deriveJSON with lens's makeFields
- deriveApiFieldJSON :: Name -> Q [Dec]
How to use this library
data SomeQuery = SomeQuery {
_someQueryPage :: Int
, _someQueryText :: String
} deriving (Eq, Show)
makeFields ''SomeQuery
deriveApiFieldJSON ''SomeQueryThis is compatible with the next json
{"page": 3, "text": "foo"}