Sangria MessagePack marshalling.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
project
src
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
build.sbt

README.md

Sangria MessagePack marshalling.

Build Status Coverage Status Maven Central License Join the chat at https://gitter.im/sangria-graphql/sangria

SBT Configuration:

libraryDependencies += "org.sangria-graphql" %% "sangria-msgpack" % "1.0.0"

BigDecimal handling

MessagePack does not support BigDecimal natively. However it supports extension types.

In order to provide BigDecimal support, sangria-msgpack implements an extension type with type ID 47. It packs the scale in the first 4 bytes (int) followed by unscaled big integers value. This is the default behaviour, so you don't need any addition import for it.

If you would like to allow sangria-msgpack to pack BigDecimal values as standard types (big integer and double), then you need to add following import:

import sangria.marshalling.msgpack.standardTypeBigDecimal._

Please use it with caution because it will throw IllegalArgumentException if number does not fit in big integer or double.

License

sangria-msgpack is licensed under Apache License, Version 2.0.