scalapb-playjson Build Status

scaladoc

The structure of this project is hugely inspired by scalapb-json4s

Dependency

Include in your build.sbt file

core

libraryDependencies += "io.github.scalapb-json" %% "scalapb-playjson" % "0.12.0-M2"

for scala-js

libraryDependencies += "io.github.scalapb-json" %%% "scalapb-playjson" % "0.12.0-M2"

macros

libraryDependencies += "io.github.scalapb-json" %% "scalapb-playjson-macros" % "0.12.0-M2"

Usage

There are four functions you can use directly to serialize/deserialize your messages:

JsonFormat.toJsonString(msg) // returns String
JsonFormat.toJson(msg) // returns JsObject

JsonFormat.fromJsonString(str) // return MessageType
JsonFormat.fromJson(json) // return MessageType

Credits

fork from https://github.com/whisklabs/scalapb-playjson