seals

seals is an experimental project by Daniel Urban, which provides tools for schema evolution and language-integrated schemata.

By using it, you will be able to

define schemata by creating ordinary Scala datatypes;

check the compatibility of different versions of a schema at compile time, as well as runtime;

automatically derive serializers and deserializers for your schema-datatypes (currently only circe and scodec encoders and decoders are implemented);

and communicate between components using different (but compatible) versions of a schema.

Since it's a fairly new project, not all of these features are implemented yet. Bugs are to be expected as well. Contributions to improve the project, and reports about issues you encounter are welcome.

Getting started

seals is currently available for Scala 2.11 and 2.12. JARs are available on Maven Central. To use it, put this into your build.sbt (see below for the available modules):

Then there will be no Compat instance available, since the schemata are not compatible:

Compat[User, UserV3] // error: could not find implicit value for ...

For a more detailed introduction to the Compat type class, see this example.

Build-time compatibility checking

By using the seals-plugin module (which is an sbt plugin), we can check in our build whether our current schemata are compatible with previously released versions. (Similarly to how MiMa checks binary compatibility with previous versions.) For how to do this, see this example. The plugin is available for sbt 0.13 and 1.x.

Other features

If you are interested in other features (like automatic derivation of serializers, or runtime compatibility checking), at the moment the best way is to look at the examples or directly at the sources (and Scaladoc comments, and laws/tests).