pray-json

Fully automatic generation of play-json serializers
libraryDependencies += "ru.makkarpov" %% "pray-json" % VERSION
Features (see tests):
- fully recursive generation — no need for intermediate serializer implicits;
- generation can be restricted using
@requireImplicitannotation. - implicit search for
Format[T]happens also in a companion object ofT, and, if companion itself is inside of object — in all outer objects. - recursive structures are also supported.
- generation can be restricted using
- generation of
case classserializers:- simple case classes;
- renamed fields using
@keyannotation. it also can transform key names to snake_case automatically; - support for default values;
- support for
Optional fields. - in some APIs fields should be serialized as strings even if they aren't strings. This is also supported;
- inline formatting of case classes with single parameter
- generation of
sealedserializers:- automatically added
typefield to distinguish between cases; - name and value of
typefield can be customized with annotations; - support for fallback cases;
- automatically added
- generation of serializers for collections:
Traversables:Seqs,Sets, ...;Maps: custom key types are supported viaKeyFormat[K];Options (when not inside of a case class) are serialized either as[]or[something].
- Enumerations:
Values are serialized as strings with their name;ValueSets are serialized as array of strings.