Skip to content
No description or website provided.
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.
nix
src/Servant/API/ContentTypes
test
.gitignore
.travis.yml
CHANGELOG.md
LICENCE
README.md
Setup.hs
default.nix
servant-waargonaut-deps.nix
servant-waargonaut.cabal
servant-waargonaut.nix
shell.nix

README.md

Build Status

Servant integration for Waargonaut

This package allows you to use waargonaut for your Servant API. Where you use would JSON in your API type, instead use WaargJSON t. Where t is the type you're using the tag your Waargonaut JsonEncode/JsonDecode typeclasses. Since Servant does not provide a nice way to pass in our encoders or decoders as values.

>>> -- GET /hello/world
>>> -- returning a JSON encoded World value
>>> data MyTag = MyTag
>>> type MyApi = "hello" :> "world" :> Get '[WaargJSON MyTag] World

Although the design of waargonaut does not encourage the use of typeclasses for encoding/decoding JSON. We still have Generic functions, JsonEncode, and JsonDecode typeclasses to allow this sort of integration.

You can’t perform that action at this time.