All Projects → scalapb → Scalapb

scalapb / Scalapb

Licence: apache-2.0
Protocol buffer compiler for Scala.

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to Scalapb

Protobuf
A pure Elixir implementation of Google Protobuf
Stars: ✭ 442 (-58.5%)
Mutual labels:  protocol-buffers
Go Proto Validators
Generate message validators from .proto annotations.
Stars: ✭ 713 (-33.05%)
Mutual labels:  protocol-buffers
Gnostic
A compiler for APIs described by the OpenAPI Specification with plugins for code generation and other API support tasks.
Stars: ✭ 870 (-18.31%)
Mutual labels:  protocol-buffers
Protobuf Inspector
🕵️ Tool to reverse-engineer Protocol Buffers with unknown definition
Stars: ✭ 513 (-51.83%)
Mutual labels:  protocol-buffers
Pbf
A low-level, lightweight protocol buffers implementation in JavaScript.
Stars: ✭ 618 (-41.97%)
Mutual labels:  protocol-buffers
Es Cqrs Shopping Cart
A resilient and scalable shopping cart system designed using Event Sourcing (ES) and Command Query Responsibility Segregation (CQRS)
Stars: ✭ 19 (-98.22%)
Mutual labels:  protocol-buffers
Awesome Grpc
A curated list of useful resources for gRPC
Stars: ✭ 4,932 (+363.1%)
Mutual labels:  protocol-buffers
Samay
Command line Time tracking and reporting. Built using Go(programming language) and protocol buffers.
Stars: ✭ 37 (-96.53%)
Mutual labels:  protocol-buffers
Protoreflect
Reflection (Rich Descriptors) for Go Protocol Buffers
Stars: ✭ 651 (-38.87%)
Mutual labels:  protocol-buffers
Assistant Sdk Python
Samples and bindings for the Google Assistant API
Stars: ✭ 844 (-20.75%)
Mutual labels:  protocol-buffers
Prototool
Your Swiss Army Knife for Protocol Buffers
Stars: ✭ 4,932 (+363.1%)
Mutual labels:  protocol-buffers
Startup Os
Working examples of Google's Open Source stack and deployment to the cloud.
Stars: ✭ 564 (-47.04%)
Mutual labels:  protocol-buffers
Protobuf Swift
Google ProtocolBuffers for Apple Swift
Stars: ✭ 925 (-13.15%)
Mutual labels:  protocol-buffers
Protobuf
[Looking for new ownership] Protocol Buffers for Go with Gadgets
Stars: ✭ 4,998 (+369.3%)
Mutual labels:  protocol-buffers
Ts Protoc Gen
Protocol Buffers Compiler (protoc) plugin for TypeScript and gRPC-Web.
Stars: ✭ 913 (-14.27%)
Mutual labels:  protocol-buffers
Alexa Assistant
Implementation of the Google Assistant SDK as an Alexa skill
Stars: ✭ 422 (-60.38%)
Mutual labels:  protocol-buffers
Protobuf Go
Go support for Google's protocol buffers
Stars: ✭ 785 (-26.29%)
Mutual labels:  protocol-buffers
Protocol Buffers Language Server
[WIP] Protocol Buffers Language Server
Stars: ✭ 44 (-95.87%)
Mutual labels:  protocol-buffers
Protobuf
Go support for Google's protocol buffers
Stars: ✭ 8,111 (+661.6%)
Mutual labels:  protocol-buffers
Bgpmon
CSU's BGP Observatory code (bgpmon/pheme)
Stars: ✭ 25 (-97.65%)
Mutual labels:  protocol-buffers

ScalaPB

Join the chat at https://gitter.im/ScalaPB/community

Build Status

ScalaPB is a protocol buffer compiler (protoc) plugin for Scala. It will generate Scala case classes, parsers and serializers for your protocol buffers.

ScalaPB generates case classes that can co-exist in the same project alongside the Java-generated code for ProtocolBuffer. This makes it easy to gradually migrate an existing project from the Java version of protocol buffers to Scala. This is achieved by having the ScalaPB generated code use the proto file as part of the package name (in contrast to Java which uses the file name in CamelCase as an outer class)

Each top-level message and enum is written to a separate Scala file. This results in a significant improvement in incremental compilations.

Another cool feature of ScalaPB is that it can optionally generate methods that convert a Java protocol buffer to a Scala protocol buffer and vice versa. This is useful if you are gradually migrating a large code base from Java protocol buffers to Scala. The optional Java conversion is required if you want to use fromAscii (parsing ASCII representation of a protocol buffer). The current implementation delegates to the Java version.

Highlights

  • Supports proto2 and proto3

  • Easily update nested structure in functional way using lenses

  • Scala.js integration

  • GRPC integration

  • Compatible with SparkSQL (through a helper library)

  • Conversion to and from JSON

  • Support user-defined options (since 0.5.29)

  • Support extensions (since 0.6.0)

Versions

Version Description
0.6.x Stable. Supports Protobuf 2.6.x to 3.5.x
0.5.x Supports Protobuf 2.6.x and Protobuf 3.1.x.
0.4.x Stable, unsupported. Works with Protobuf 2.6.x

Installing

To automatically generate Scala case classes for your messages add ScalaPB's sbt plugin to your project. Create a file named project/protoc.sbt containing the following line:

addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.0")

libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.10.10"

Add the following line to your build.sbt:

Compile / PB.targets := Seq(
  scalapb.gen() -> (Compile / sourceManaged).value / "scalapb"
)

For additional configuration options, see ScalaPB SBT Settings documentation

Using ScalaPB

Documentation is available at ScalaPB website.

Questions?

See contacting us.

Testing

ScalaPB uses ScalaCheck to aggressively test the generated code. The test generates many different sets of proto files. The sets are growing in complexity: number of files, references to messages from other protos, message nesting and so on. Then, test data is generated to populate this protocol schema, then we check that the ScalaPB generated code behaves exactly like the reference implementation in Java.

Running the tests:

$ sbt test

The tests take a few minutes to run. There is a smaller test suite called e2e that uses the sbt plugin to compile the protos and runs a series of ScalaChecks on the outputs. To run it:

$ ./e2e.sh

Sponsors

We are very thankful to our sponsors:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].