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
2
votes
1 answer

Unit Test proto3 generated objects with verify

I am using proto3 for an Android app and I am having a problem with object equality, which makes it really hard on testing, especially for verify methods Here is a unit-test representing the problem: @Test public void test_equal () { PlayerCards…
madlymad
  • 6,367
  • 6
  • 37
  • 68
1
vote
1 answer

How to serialize protobuf from json with auto ignoring unknown fields in c#?

For example, I have a proto like this: message ProtoType { string field1 = 1; strin field2 = 2; } And I have a json deserialized from a newer version of this proto: { "field1": "111", "field2": "222", "testField": "test" } I use this…
Yyh
  • 103
  • 7
1
vote
1 answer

grpc-gateway removed omitempty tag from generated json tags, but empty fields are still not returned

I am using grpc-gateway v1.16 and I have removed the omitempty tags from the struct generated in the *.pb.go files as suggested here -> golang protobuf remove omitempty tag from generated json tags However, I see the empty fields are still not…
Gary
  • 31
  • 4
1
vote
1 answer

Module XXX found, but does not contain package XXX

Not so familiar with Golang, it's probably a stupid mistake I made... But still, I can't for the life of me figure it out. So, I got a proto3 file (let's call it file.proto), whose header is as follows: syntax = "proto3"; package…
Justin Iurman
  • 18,954
  • 3
  • 35
  • 54
1
vote
1 answer

compile error: Supertypes of the following classes cannot be resolved

I have a gradle project with proto3 generator: buildscript { repositories { mavenCentral() } dependencies { classpath("com.google.protobuf:protobuf-gradle-plugin:0.8.14") } } ... dependencies { ... …
1
vote
1 answer

How to extract map field from protobuf message for C++ consumer

I have a proto3 file. There is a message in the proto file that contains a map field. proto3 package abc.xyz.testproto message abc { map mapfield = 1; } Suppose as a c++ consumer i want to read this map field, what would be the…
Invictus
  • 4,028
  • 10
  • 50
  • 80
1
vote
0 answers

Can a proto3 scalar field be changed to optional without breaking wire compatibility?

Can I change a scalar field in proto3 to optional, e.g. message UpdateAccountRequest { string name = 1; string country = 2; } to message UpdateAccountRequest { optional string name = 1; optional string country = 2; } without breaking…
Andrew Cheong
  • 29,362
  • 15
  • 90
  • 145
1
vote
0 answers

File already exists in database error from protobuf while using on Amazon Linux

We are using protobuf messages to use in Zsockets on AWS Linux machines. We have 3 protobuf files in the same directory. 2 protobuf files are importing the 3rd file. Protobuf files are as below. Fs.proto : syntax = "proto3"; option java_package =…
kadina
  • 5,042
  • 4
  • 42
  • 83
1
vote
1 answer

Defined required fields in proto3

I am using protobuf with version3 in Php. Below is my proto file syntax ="proto3"; package message.events.user.v1; message UserWasActivatedMessage { int32 userId = 1 ; string eventType = 2; } This is my proto file and whenever I do not set…
ujwal dhakal
  • 2,289
  • 2
  • 30
  • 50
1
vote
1 answer

How to declare arrays properly in google protobuf

Here is how I have defined a message: message PhoneNumberAndTypes { repeated Type types = 1; Phone number = 2; } And when I added the types using .addTypes() and printed the object in console, it came out like below: phone_numbers { types:…
xploreraj
  • 3,792
  • 12
  • 33
  • 51
1
vote
1 answer

Proto3: How do I define map of a generic json

I am writing a gRPC service that fetches exchange rates within a given date range from this API and the response is partitioned day by day, you can see response format here. To parse this response, I need to have a proto message with a field…
thisguy
  • 39
  • 6
1
vote
0 answers

determine client identity in mTLS gRPC server

I am writing a mTLS gRPC server in Golang. Peers can be uniquely identified via Common Name of their certificate. My question is how can I access the client certificate, client certificate subject or client certificate common name in the…
milaniez
  • 1,051
  • 1
  • 9
  • 21
1
vote
1 answer

Unknown field error when unmarshaling a message with changed embedded type

Given a proto like this: message Request { uint64 account_id = 1; message Foo{ uint64 foo_id = 1; } repeated Foo foos = 2; when I added a field called bar_id message Request { uint64 account_id = 1; message Foo{ …
Roman Dvoskin
  • 384
  • 4
  • 16
1
vote
1 answer

Generating a proto3 file from graphql schema

Meanwhile in my world - I have a graphql schema from my front-end team and I want to generate some proto file from it. There are a lot of interface A implements B & C {} and type Query {F(id: ID!): G} statements in this graphql schema. Do human…
donutello
  • 633
  • 1
  • 5
  • 16
1
vote
1 answer

proto3-lexer3.c : No such file or directory

I was trying to build noise-c project using description below. https://rweather.github.io/noise-c/index.html And I got the error with a message like below: gcc: error: proto3-lexer.c: No such file or directory gcc: fatal error: no input files I…
Cprogrammer
  • 153
  • 9