pray-json

play-json as it was supposed to be

License

License

Categories

Categories

JSON Data Akka Container Microservices Reactive libraries
GroupId

GroupId

ru.makkarpov
ArtifactId

ArtifactId

pray-json_2.12
Last Version

Last Version

0.4.1
Release Date

Release Date

Type

Type

jar
Description

Description

pray-json
play-json as it was supposed to be
Project URL

Project URL

https://github.com/makkarpov/pray-json
Project Organization

Project Organization

Maxim Karpov
Source Code Management

Source Code Management

https://github.com/makkarpov/pray-json

Download pray-json_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/ru.makkarpov/pray-json_2.12/ -->
<dependency>
    <groupId>ru.makkarpov</groupId>
    <artifactId>pray-json_2.12</artifactId>
    <version>0.4.1</version>
</dependency>
// https://jarcasting.com/artifacts/ru.makkarpov/pray-json_2.12/
implementation 'ru.makkarpov:pray-json_2.12:0.4.1'
// https://jarcasting.com/artifacts/ru.makkarpov/pray-json_2.12/
implementation ("ru.makkarpov:pray-json_2.12:0.4.1")
'ru.makkarpov:pray-json_2.12:jar:0.4.1'
<dependency org="ru.makkarpov" name="pray-json_2.12" rev="0.4.1">
  <artifact name="pray-json_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='ru.makkarpov', module='pray-json_2.12', version='0.4.1')
)
libraryDependencies += "ru.makkarpov" % "pray-json_2.12" % "0.4.1"
[ru.makkarpov/pray-json_2.12 "0.4.1"]

Dependencies

compile (2)

Group / Artifact Type Version
com.typesafe.play : play-json_2.12 jar 2.6.2
org.scala-lang : scala-reflect jar 2.12.1

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.12 jar 3.0.1

Project Modules

There are no modules declared in this project.

pray-json Build Status Latest version

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 @requireImplicit annotation.
    • implicit search for Format[T] happens also in a companion object of T, and, if companion itself is inside of object — in all outer objects.
    • recursive structures are also supported.
  • generation of case class serializers:
    • simple case classes;
    • renamed fields using @key annotation. 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 sealed serializers:
    • automatically added type field to distinguish between cases;
    • name and value of type field can be customized with annotations;
    • support for fallback cases;
  • generation of serializers for collections:
    • Traversables: Seqs, Sets, ...;
    • Maps: custom key types are supported via KeyFormat[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.

Versions

Version
0.4.1
0.4
0.3
0.2
0.1