Skip to content
Utils for using aeson's deriveJSON with lens's makeFields
Haskell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Data/Aeson
test
.gitignore
LICENSE
README.md
Setup.hs
api-field-json-th.cabal
stack.yaml

README.md

api-field-json-th

Utils for using aeson's deriveJSON with lens's makeFields

Hackage

example

data SomeQuery = SomeQuery {
    _someQueryPage :: Int
    , _someQueryText :: String
} deriving (Eq, Show)
makeFields ''SomeQuery
deriveApiFieldJSON ''SomeQuery

This is compatible with the next json

{"page": 3, "text": "foo"}

(And, it is lens field)

x ^. page
You can’t perform that action at this time.