Generically obtain tests for JSON serialization
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/Servant/Aeson
test
.gitignore
.travis.yml
ChangeLog.md
LICENSE
README.md
Setup.hs
package.yaml
stack-servant-0.10.yaml
stack-servant-0.11.yaml
stack-servant-0.12.yaml
stack-servant-0.4.yaml
stack-servant-0.5.yaml
stack-servant-0.6.yaml
stack-servant-0.7.yaml
stack-servant-0.8.yaml
stack-servant-0.9.yaml
stack.yaml
test-stack-files.sh

README.md

servant-aeson-specs

servant-aeson-specs allows you to generically obtain tests to make sure that the types you use in your servant applications can correctly be converted to JSON and read back to Haskell using aeson.

Backwards compatibility with 0.4.1

If you already have some golden files created by 0.4.1, there are two options to maintain backwards compatibility. You can either move the files into a directory called golden and set the sampleSize to 200:

apiGoldenSpecsWithSettings (defaultSettings { sampleSize = 200}) (Proxy :: Proxy SomeType)

or if you want to keep the golden files in golden.json you can do the following:

apiGoldenSpecsWithSettings (defaultSettings { goldenDirectoryOption = CustomDirectoryName "golden.json"
                                            , sampleSize = 200}) (Proxy :: Proxy SomeType)