All Projects → os72 → Protobuf Dynamic

os72 / Protobuf Dynamic

Licence: apache-2.0
Protocol Buffers Dynamic Schema - create protobuf schemas programmatically

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Protobuf Dynamic

Protoc Jar Maven Plugin
Protocol Buffers protobuf maven plugin - based on protoc-jar multi-platform executable protoc JAR
Stars: ✭ 177 (-4.84%)
Mutual labels:  protobuf, protocol-buffers, protoc
Protoc Jar
Protocol Buffers protobuf compiler - multi-platform executable protoc JAR and API
Stars: ✭ 103 (-44.62%)
Mutual labels:  protobuf, protocol-buffers, protoc
makego
Makefile setup for our Golang projects.
Stars: ✭ 65 (-65.05%)
Mutual labels:  protobuf, protocol-buffers, protoc
Protobuf
Protocol Buffers - Google's data interchange format
Stars: ✭ 52,305 (+28020.97%)
Mutual labels:  protobuf, protocol-buffers, protoc
Buf
A new way of working with Protocol Buffers.
Stars: ✭ 3,328 (+1689.25%)
Mutual labels:  protocol-buffers, protoc, protobuf
go2gql
graphql-go schema generator by proto files
Stars: ✭ 33 (-82.26%)
Mutual labels:  schema, protobuf, protoc
protocell
Conjures up convenient OCaml types and serialization functions based on protobuf definition files
Stars: ✭ 18 (-90.32%)
Mutual labels:  protobuf, protocol-buffers, protoc
protobuf-d
Protocol Buffers Compiler Plugin and Support Library for D
Stars: ✭ 32 (-82.8%)
Mutual labels:  protobuf, protocol-buffers, protoc
Pb And K
Kotlin Code Generator and Runtime for Protocol Buffers
Stars: ✭ 137 (-26.34%)
Mutual labels:  protobuf, protocol-buffers, protoc
Protolock
Protocol Buffer companion tool. Track your .proto files and prevent changes to messages and services which impact API compatibility.
Stars: ✭ 394 (+111.83%)
Mutual labels:  protobuf, protocol-buffers, protoc
Protodot
transforming your .proto files into .dot files (and .svg, .png if you happen to have graphviz installed)
Stars: ✭ 107 (-42.47%)
Mutual labels:  protobuf, protocol-buffers, protoc
Prototool
Your Swiss Army Knife for Protocol Buffers
Stars: ✭ 4,932 (+2551.61%)
Mutual labels:  protobuf, protocol-buffers, protoc
Rules protobuf
Bazel rules for building protocol buffers and gRPC services (java, c++, go, ...)
Stars: ✭ 206 (+10.75%)
Mutual labels:  protobuf, protocol-buffers, protoc
proto2gql
The project has been migrated to https://github.com/EGT-Ukraine/go2gql.
Stars: ✭ 21 (-88.71%)
Mutual labels:  schema, protobuf, protoc
protopatch
protoc-gen-go patch utility
Stars: ✭ 58 (-68.82%)
Mutual labels:  protobuf, protocol-buffers, protoc
Protobuf
A pure Elixir implementation of Google Protobuf
Stars: ✭ 442 (+137.63%)
Mutual labels:  protobuf, protocol-buffers, protoc
Protobuf Swift
Google ProtocolBuffers for Apple Swift
Stars: ✭ 925 (+397.31%)
Mutual labels:  protobuf, protocol-buffers, protoc
Twirp
PHP port of Twitch's Twirp RPC framework
Stars: ✭ 108 (-41.94%)
Mutual labels:  protobuf, protocol-buffers
Protoc Gen Struct Transformer
Transformation functions generator for Protocol Buffers.
Stars: ✭ 105 (-43.55%)
Mutual labels:  protobuf, protocol-buffers
Schema Registry
Confluent Schema Registry for Kafka
Stars: ✭ 1,647 (+785.48%)
Mutual labels:  protobuf, schema

protobuf-dynamic

Protocol Buffers Dynamic Schema - create protobuf schemas programmatically. Available on Maven Central:

Maven Central Maven Central Join the chat at https://gitter.im/os72/community


Library to simplify working with the Protocol Buffers reflection mechanism, no protoc compiler required. Supports the major protobuf features: primitive types, complex and nested types, labels, default values, etc

  • Dynamic schema creation - at runtime
  • Dynamic message creation from schema
  • Schema merging
  • Schema serialization, deserialization
  • Schema parsing from protoc compiler output
  • Compatible with protobuf-java 2.6.1 or higher
  • (Version 0.9.x compatible with protobuf-java 2.4.1 or higher)

See the Protocol Buffers site for details: https://github.com/google/protobuf

Usage

// Create dynamic schema
DynamicSchema.Builder schemaBuilder = DynamicSchema.newBuilder();
schemaBuilder.setName("PersonSchemaDynamic.proto");

MessageDefinition msgDef = MessageDefinition.newBuilder("Person") // message Person
		.addField("required", "int32", "id", 1)		// required int32 id = 1
		.addField("required", "string", "name", 2)	// required string name = 2
		.addField("optional", "string", "email", 3)	// optional string email = 3
		.build();

schemaBuilder.addMessageDefinition(msgDef);
DynamicSchema schema = schemaBuilder.build();

// Create dynamic message from schema
DynamicMessage.Builder msgBuilder = schema.newMessageBuilder("Person");
Descriptor msgDesc = msgBuilder.getDescriptorForType();
DynamicMessage msg = msgBuilder
		.setField(msgDesc.findFieldByName("id"), 1)
		.setField(msgDesc.findFieldByName("name"), "Alan Turing")
		.setField(msgDesc.findFieldByName("email"), "[email protected]")
		.build();

Maven dependency

<dependency>
  <groupId>com.github.os72</groupId>
  <artifactId>protobuf-dynamic</artifactId>
  <version>1.0.1</version>
</dependency>
<dependency>
  <groupId>com.github.os72</groupId>
  <artifactId>protobuf-dynamic</artifactId>
  <version>0.9.5</version>
</dependency>
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].