Json/Protobuf convertors for ScalaPB use circe
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
js/src/test/scala/scalapb_circe
jvm/src/test/scala/scalapb_circe
project
shared/src
.gitignore
.scalafmt.conf
.travis.yml
LICENSE.txt
README.md update README.md Sep 27, 2018
build.sbt
version.sbt

README.md

scalapb-circe Build Status

scaladoc

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

Dependency

Include in your build.sbt file

libraryDependencies += "io.github.scalapb-json" %% "scalapb-circe" % "0.3.0"

for scala-js

libraryDependencies += "io.github.scalapb-json" %%% "scalapb-circe" % "0.3.0"

for ScalaPB 0.7.x

see https://github.com/scalapb-json/scalapb-circe/tree/0.2.x

Usage

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

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

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

Credits