servant-auth-token-api-0.3.2.0: Servant based API for token based authorisation

Copyright(c) Anton Gushcha, 2016
LicenseMIT
Maintainerncrashed@gmail.com
Stabilityexperimental
PortabilityPortable
Safe HaskellNone
LanguageHaskell2010

Servant.API.Auth.Token.Internal.DeriveJson

Description

Common usage:

data PagedList i a = PagedList {
  pagedListItems :: ![a] -- ^ Payload
, pagedListPages :: !Word -- ^ Count of available pages
} deriving (Generic, Show)

$(deriveJSON (derivePrefix "pagedList") ''PagedList)

It will work with the following jsons:

{ "items": [], "pages": 0 }

Synopsis

Documentation

derivePrefix :: Text -> Options Source #

For aeson deriving, drop prefix t and map to lower

deriveJSON :: Options -> Name -> Q [Dec] #