Skip to content

Json/Protobuf convertors for ScalaPB use argonaut

License

Notifications You must be signed in to change notification settings

scalapb-json/scalapb-argonaut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b60e033 · Mar 17, 2025
Jan 17, 2025
Dec 25, 2023
Mar 10, 2022
Mar 17, 2025
Mar 10, 2022
Sep 29, 2016
Oct 2, 2021
Mar 12, 2025
Jan 3, 2018
Jun 7, 2024
Jan 28, 2025
Jun 7, 2024

Repository files navigation

scalapb-argonaut

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-argonaut" % "0.11.0"

for scala-js

libraryDependencies += "io.github.scalapb-json" %%% "scalapb-argonaut" % "0.11.0"

macros

libraryDependencies += "io.github.scalapb-json" %%% "scalapb-argonaut-macros" % "0.11.0"

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