Questions tagged [proto3]

Protocol Buffers - Google's data interchange format

Google Protocol Buffers questions related to version 3 of the Protocol Buffer format should be tagged with this tag.

At this time proto3 is still in alpha stage.

About Versioning

When protobuf was initially opensourced it implemented Protocol Buffers language version 2 (aka proto2), which is why the version number started from v2.0.0. From v3.0.0, a new language version (proto3) is introduced while the old version (proto2) will continue to be supported.

146 questions
0
votes
1 answer

Defining a single RPC with both a streaming and unary response

Is it possible to define a single proto3 RPC that can have either a streaming response or a unary response? Like when I define the RPC I can make it clear that the stream keyword is optional? If streaming is requested, then the response content will…
0
votes
1 answer

In proto3, can validate.rules enforce requiredness? Or do they only apply when the field is supplied. Or does it depend

I'll be able to answer this question myself once I get this service running but I was surprised I couldn't find an answer on SO, at least by the keywords I was searching. The problem is if you search anything about protobufs and requiredness /…
Andrew Cheong
  • 29,362
  • 15
  • 90
  • 145
0
votes
0 answers

Pbtxt files using a subset config in multiple superset configs

Lets say I have two pbtxt files specifying details like so: person1.pbtxt person { id: 001 name: "Jobava" children: "Jiten" children: "Jeffrey" children: "Jassi" } and person2.pbtxt person { id: 002 name: "Jillian" children:…
simplename
  • 717
  • 7
  • 15
0
votes
0 answers

How to model key:value object in the ProtoBuf

I have to compose a protobuf message which should have object with N key:value pairs. { "0xc02aaa39b223fe8d4a0e5c4f27ead9083c756cc2": "73185315951404654", "0x111111111117dc0aa78b770fa6a738034120c302": "90483392540197705773", …
MantasFam
  • 101
  • 1
0
votes
2 answers

Could I reuse an existing protobuf binary, when marshaling a message including it?(protobuf3)

Protobuf definations are like that: syntax = "proto3" message HugeMessage { // omitted } message Request { string name = 1; HugeMessage payload = 2; } In a situation I received a HugeMessage from somebody, and I want to pack it with…
0
votes
0 answers

Do unset fields on Writer side get set to null/default on the Reader side depending on its schema definition?

From https://developers.google.com/protocol-buffers/docs/encoding?csw=1, it seems that optional fields that are not set on the Writer side's schema won't be sent over the wire. That means the Reader does not receive the field. If the Reader's schema…
0
votes
0 answers

Return proto3 go-grpc response: repeated message without message name

Right now I have this proto file that specifies a grpc method that is also an http rest style api using go-grpc-gateway: rpc GetBars(GetBarReq) returns (GetBarRes) { option (google.api.http) = { get : "/v1/bar" }; }; message Bar { …
TSM
  • 1
0
votes
0 answers

Cannot make gRPC postman request to nestjs server

I've set up a nestjs server that handles gRPC requests. In order to do some ad-hoc debugging, I'm trying to use postman. However, whenever I try to send a request, postman returns the following error: Received RST_STREAM with code 2 triggered by…
0
votes
2 answers

Protobuff package vs option csharp_namespace

I am creating a gRPC service using Proto 3 and C#. In the Google developer guide for Protobuff it says about package: In C# the package is used as the namespace after converting to PascalCase, unless you explicitly provide an option…
CodeMonkey
  • 11,196
  • 30
  • 112
  • 203
0
votes
1 answer

Is it possible to generate proto datastore classes as Kotlin instead of Java

Currently my proto datastore setup is generating Java classes. Is it possible to generate Kotlin classes instead?
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
0
votes
1 answer

Protobuf - Object with optional arrays

I have an object that is something like this: { "colorRestrictions": { "availableColors":[ ... ], "excludedColors": [ ... ] } } How do I translate this into a proto file considering that colorRestriction is an object that can have…
Mido
  • 89
  • 1
  • 10
0
votes
1 answer

Creating a protobuf Enum with Especial characters

I need to create an Enum in a proto3 file, and it needs to has the following strings as options: "0,01_200", "200,01_500", "500,01_1.000", "1.000,01_3.000", "3.000,01_10.000", 10.000,01_30.000, "30.000,01_100.000" I tried something like this: enum…
lucas
  • 79
  • 6
0
votes
1 answer

How to get a field object using its name in proto3

I am migrating schemas from proto2 to proto3 syntax. I want to eliminate extensions as they are not supported. Is it possible to get an object using a field name in proto3, similar to what MutableExtension does in proto2. For example, Schema in…
Mihir
  • 3
  • 2
0
votes
0 answers

Issue in proto3 file format data type error

I am working on project where I am using nodejs and Proto3 for jobs. I have following proto3 file. where I want to add version as a field. message Request { string id = 1; string body = 4; string createdAt = 5; string updatedAt = 6; …
Kamal Panhwar
  • 2,345
  • 3
  • 21
  • 37
0
votes
1 answer

Convert JSON structure to proto-buf structure

My requirement is to share the data JSON to proto-buf. I have JSON data. How to write a schema genric for handling all types of value. { "data": [ { "bool": true }, { "string": "abc" }, { "int": 22 }, …
Alex Sparrow
  • 197
  • 2
  • 7