Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.32 KB

README.md

File metadata and controls

47 lines (30 loc) · 1.32 KB

scalapb-circe 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-circe" % "0.4.2"

for scala-js

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

macros

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

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