Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scalapb-json/scalapb-argonaut
Json/Protobuf convertors for ScalaPB use argonaut
https://github.com/scalapb-json/scalapb-argonaut
json protobuf scala scala-js scala-native scalapb
Last synced: 2 months ago
JSON representation
Json/Protobuf convertors for ScalaPB use argonaut
- Host: GitHub
- URL: https://github.com/scalapb-json/scalapb-argonaut
- Owner: scalapb-json
- License: mit
- Created: 2018-01-03T01:14:15.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-09T22:51:19.000Z (2 months ago)
- Last Synced: 2024-11-09T23:27:55.354Z (2 months ago)
- Topics: json, protobuf, scala, scala-js, scala-native, scalapb
- Language: Scala
- Homepage:
- Size: 385 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-scala-native - scalapb-argonaut - JSON and Protocol Buffer converters for ScalaPB based on [Argonaut](http://argonaut.io). (File Formats and Parsers)
README
# scalapb-argonaut
[![scaladoc](https://javadoc.io/badge2/io.github.scalapb-json/scalapb-argonaut_3/javadoc.svg)](https://javadoc.io/doc/io.github.scalapb-json/scalapb-argonaut_3/latest/api/scalapb_argonaut.html)The structure of this project is hugely inspired by [scalapb-json4s](https://github.com/scalapb/scalapb-json4s)
## Dependency
Include in your `build.sbt` file
### core
```scala
libraryDependencies += "io.github.scalapb-json" %% "scalapb-argonaut" % "0.11.0"
```for scala-js
```scala
libraryDependencies += "io.github.scalapb-json" %%% "scalapb-argonaut" % "0.11.0"
```### macros
```scala
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:
```scala
JsonFormat.toJsonString(msg) // returns String
JsonFormat.toJson(msg) // returns JsonJsonFormat.fromJsonString(str) // return MessageType
JsonFormat.fromJson(json) // return MessageType
```### Credits
- https://github.com/whisklabs/scalapb-playjson
- https://github.com/scalapb/scalapb-json4s