Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
37 views

how to define a nested slices in proto3

I use proto3 to generate api, my proto3 looks like message CreateSRPolicyDataRequest { repeated Path idc_paths = 1; } message Path { repeated string path = 1; } and it turns out "...
SimpleMiant's user avatar
0 votes
0 answers
60 views

Enforce requiredness with email validation rules?

I'm using the protoc-gen-validate extensions to Protocol Buffer. I came across some other answers here but they didn't completely answer my question. I'm trying to validate that the value passed into ...
AKang123.'s user avatar
  • 475
0 votes
1 answer
175 views

Protobuf partial serialization of common fields in Java

I have a protobuf message which I need to send to multiple clients. The message has the same data for each client except for one field (a sequence number) which is different for each client. Now I can ...
Fexl's user avatar
  • 69
1 vote
0 answers
229 views

Proto3 implicit field presence

In the proto3 guide (https://protobuf.dev/programming-guides/proto3/) it says: If no explicit field label is applied, the default field label, called “implicit field presence,” is assumed. (You ...
Fexl's user avatar
  • 69
0 votes
1 answer
91 views

gRPC and Protobuf - How and Where the Efficiency is Achieved as part of Building/Binding?

I am very new to gRPC and Protobuf (Java Binding). I tried to read the documentation and found the below diagram helpful (from protobuf official guide) https://protobuf.dev/overview/#work What I've ...
ha9u63a7's user avatar
  • 6,758
1 vote
1 answer
163 views

protobuf webhook with no fixed request structure

I am using Golang as my backend and proto3 as my API definitions. I have grpc-gateway to support http along with grpc. My use case is To have a webhook API which gets in some payload and processes it. ...
Tilak Raj's user avatar
  • 1,499
0 votes
2 answers
97 views

Do we have Future Datatype in Protobuf

I am exploring on grpc My sample application fetches few records from Database + reads a file from S3(very small file) and returns the combined result. Since the file size is very less, i am not using ...
Jeevi's user avatar
  • 3,032
0 votes
1 answer
243 views

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 ...
tutu056's user avatar
  • 83
2 votes
1 answer
4k views

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 ...
Andrew Cheong's user avatar
2 votes
1 answer
1k views

How to collate several protobuf messages into one object

I have a a protobuf message in the form of: message CustomMessage { SubMessageTypeA a_msg = 1; SubMessageTypeB b_msg = 2; SubMessageTypeC c_msg = 3; } I have several objects (assume 3)...
Amir's user avatar
  • 541
3 votes
1 answer
3k views

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": &...
Yyh's user avatar
  • 113
0 votes
2 answers
887 views

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 ...
Miss Yoimiya's puppy's user avatar
1 vote
1 answer
2k views

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 ...
Gary's user avatar
  • 31
5 votes
1 answer
29k views

rpc error: code = Unavailable desc = error reading from server: EOF resulting in a panic runtime error: invalid memory address error on goland

I am new Stack Overflow and this is my first question so I'm very open and happy to make any improvements to it :) I'm having an issue when I run a test method to unlike an artwork. I have a method ...
Michael Altshuler's user avatar
0 votes
0 answers
1k views

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: ...
Imperator Romanorum's user avatar
1 vote
1 answer
3k views

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 ...
Justin Iurman's user avatar
1 vote
1 answer
2k views

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....
Aleksandr T's user avatar
0 votes
2 answers
4k views

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 ...
CodeMonkey's user avatar
  • 12.4k
0 votes
1 answer
640 views

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's user avatar
0 votes
1 answer
4k views

Protobuf - Object with optional arrays

I have an object that is something like this: { "colorRestrictions": { "availableColors":[ ... ], "excludedColors": [ ... ] } } How do I translate this into ...
Mido's user avatar
  • 139
1 vote
1 answer
781 views

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 <string, int32> mapfield = 1; } Suppose as a c++ ...
Invictus's user avatar
  • 4,294
2 votes
1 answer
4k views

Getting Expected top-level statement (e.g. "message") when trying to create 2D array in Protobuf

I am using trying to create a 2d array in .proto file like this: message Foo { repeated int32 items = 1; } repeated Foo items= 1; but on generating the .pb.go file, getting the error for this ...
Sharoon Austin's user avatar
1 vote
0 answers
146 views

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; ...
Andrew Cheong's user avatar
2 votes
0 answers
182 views

How to use Hive 2.4.6 to read protobuf encoded sequence file

I have a sequence file that value is proto3 encoded byte array. I looked into elephant-bird, which is very old and only support proto 2.x version. https://github.com/kevinweil/elephant-bird Also it ...
user2289345's user avatar
1 vote
0 answers
2k views

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....
kadina's user avatar
  • 5,336
0 votes
1 answer
926 views

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", &...
lucas's user avatar
  • 79
0 votes
1 answer
350 views

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 ...
Mihir's user avatar
  • 3
0 votes
0 answers
302 views

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; ...
Kamal Panhwar's user avatar
0 votes
1 answer
575 views

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 }, ...
Alex Sparrow's user avatar
1 vote
1 answer
4k views

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 ...
ujwal dhakal's user avatar
  • 2,439
4 votes
1 answer
3k views

proto3 can't support isStringEmpty()

This is my .proto file syntax = "proto3"; package testing; option java_multiple_files = true; option java_package = "com.api.commons.proto"; option java_outer_classname = "...
Alex Sparrow's user avatar
1 vote
1 answer
272 views

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 ...
xploreraj's user avatar
  • 4,322
5 votes
1 answer
8k views

Optional support in Proto3 for Go

Does optional supports in proto3 while working with Go? I tried with this: protoc person.proto --go_out=. --experimental_allow_proto3_optional but got this error person.proto: is a proto3 file that ...
Khushi's user avatar
  • 49
1 vote
1 answer
405 views

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 ...
thisguy's user avatar
  • 39
0 votes
1 answer
183 views

How to create a protocol buffer for a client server in ballerina?

We wish to build a repository of functions that a developer can assemble to build a complex program. There can exist several versions of a function, each with its metadata. ...
Peter's user avatar
  • 1
0 votes
2 answers
2k views

How to get a list of methods from a particular gRPC service in C++?

I have a proto3 gRPC service with these methods: syntax = "proto3"; Service MyService { rpc Foo (FooRequest) returns (FooResponse) {} rpc Bar (BarRequest) returns (BarResponse) {} ...
Harry Williams's user avatar
1 vote
0 answers
35 views

determine client identity in mTLS gRPC server [duplicate]

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 ...
milaniez's user avatar
  • 1,101
0 votes
0 answers
1k views

grpcurl to send a message of type 'Any'

How to send a message of type 'Any' using grpcurl? I have this proto: message MyRequest { string request_id = 1; repeated google.protobuf.Any payload = 2; } I am sending this request: { "...
Olga's user avatar
  • 359
1 vote
1 answer
5k views

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 { ...
Roman Dvoskin's user avatar
0 votes
1 answer
239 views

Where is the canonical specification for proto3 that allows JavaScript-like object assignment to an option?

In the Protocol Buffers Version 3 Language Specification The EBNF syntax for an option is option = "option" optionName "=" constant ";" optionName = ( ident | "(&...
Jeff's user avatar
  • 2,215
3 votes
1 answer
4k views

Can you assign multiple different value types to one field in a repeated Protobuf message?

I'm trying to reverse engineer a client that uploads an audio file to a server, and then uploads the file's metadata in a separate request afterwards. The metadata is serialized in Protobuf, and it ...
twentythousand's user avatar
1 vote
1 answer
642 views

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!):...
donutello's user avatar
  • 653
2 votes
1 answer
856 views

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 ...
Cprogrammer's user avatar
1 vote
0 answers
568 views

Is there a way to recursively get all FieldDescriptors in protobuf?

I am trying to implement a way to check if all nontrivial fields in proto3 message are set (since presence is not encoded for trivial types like int). I have code like this namespace pb = google::...
NoSenseEtAl's user avatar
  • 29.9k
2 votes
2 answers
3k views

Is there a way to have an array of multiple types in proto3?

I want to design a proto3 message from this Cesium class:Cesium Class. It is an array containing [string, double, double, double]. Is there anyway to do this?
stephenjk41's user avatar
3 votes
0 answers
1k views

Node gRPC (proto3) how to convert AsObject type back to gRPC class

I'm using node to communicate with a gRPC server, here is an example of generated request ts export class GetUserByFQDNRequest extends jspb.Message { getEnvironmentId(): string; ...
Or Yaacov's user avatar
  • 3,880
1 vote
1 answer
419 views

Can I use proto2 generated code stubs with libprotobuf3.x?

I have a legacy application using proto2 with libprotobuf2.x. There is another application application that I would like this application to talk to with proto3. I checked on possible solutions and ...
user2813650's user avatar
4 votes
1 answer
618 views

How to use protobuf reflection to guarantee deterministic serialisation

Proto3 release notes states: The deterministic serialization is, however, NOT canonical across languages; it is also unstable across different builds with schema changes due to unknown fields. Users ...
ischepin's user avatar
3 votes
1 answer
904 views

Ordering of Protobuf maps

I am creating message objects in proto3 and using auto-generated java classes. I want to have unique key assigned to each of the message object. message Obj { ... string unique_key = 1; ......
Raj's user avatar
  • 674
3 votes
1 answer
229 views

Can I define an ordered mixed message array in proto3?

I want to define in proto3 an ordered list of unrelated classes (messages) like this: Frog Dirt Air Computer 1 Computer 2 Politics Is it possible? I can also live with having a base class (base ...
visc's user avatar
  • 4,959