Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.98 KB

README.md

File metadata and controls

31 lines (20 loc) · 1.98 KB

Sangria MessagePack marshalling.

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

SBT Configuration:

libraryDependencies += "org.sangria-graphql" %% "sangria-msgpack" % "<latest version>"

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.