Questions tagged [proto]

Related to Google Protocol Buffers, borrows its name from the .proto file extension containing a protocol schema.

564 questions
4
votes
2 answers

How do you remove all elements from a repeated Proto field in Python?

Suppose I have the .proto file: message Bar { } message Foo { repeated Bar bars = 1; } How can you delete all of the elements in the field bar?
michaelrbock
  • 1,160
  • 1
  • 11
  • 20
4
votes
3 answers

--proto_path passed empty directory name

I'm trying to compile a proto file with the following command: protoc -I=. --python_out=. ./message.proto --proto_path=. But I'm getting this error: --proto_path passed empty directory name. (Use "." for current directory.) What to do?
General Gravicius
  • 181
  • 1
  • 2
  • 10
4
votes
1 answer

Protobuf Importing Message from another proto C# projects

I'm using Google.Protobuf.Tools in a C# .NET Standard project MyProject. I have multiple proto definitions. MyProject/Protos/Requests/SampleRequest.proto syntax = "proto3"; option csharp_namespace = "My.Projects.Protos.Requests"; package…
Jins Peter
  • 2,368
  • 1
  • 18
  • 37
4
votes
1 answer

How to avoid nested imports when compiling proto files from a java project into python modules

e.g. in a java project myapp └── src └── main └── proto └── com └── abc └── myapp └── api ├── common.proto …
zyxue
  • 7,904
  • 5
  • 48
  • 74
4
votes
1 answer

Trouble saving repeated protobuf object to file (Python)

I'm new to protobuf, so I don't know how to frame the question correctly. Anyways, I'm using this Model Config proto file. I converted it into python using this command protoc -I=. --python_out=. ./model_server_config.proto from Protocol Buffer…
krxat
  • 513
  • 4
  • 16
4
votes
0 answers

C++: grpc send data with proto defined on runtime

I have the need to define proto fields of a message on runtime and send data along with them. So what I've done is I've defined them on runtime using FieldDescriptorProto and send it from server to client. My proto file looks like this: syntax =…
4
votes
1 answer

TypeError: graph_def must be a GraphDef proto

I convert keras model.h5 to frozen_graph.pb inorder to optimize and run on jetson. But optimizing the frozen_graph.pb shots error. raise TypeError('graph_def must be a GraphDef proto.') TypeError: graph_def must be a GraphDef proto. Code :…
Sai Krishnadas
  • 2,863
  • 9
  • 36
  • 69
4
votes
1 answer

Proto 3: A way to add metadata at field level

I am using protobuf-gradle-plugin to generate java class from the proto files. My proto file looks like syntax = "proto3"; package com.address; option java_package = "com.address"; message AddressesMessage { int32 id = 1; string address_line_1…
JDev
  • 1,662
  • 4
  • 25
  • 55
4
votes
1 answer

Using import in proto file with Visual Studio/Rider

I am getting a "File not found" error when using import in a .proto file. I am using Rider but have the same problem when using Visual Studio. First proto File: syntax = "proto3"; import "/fileToImport.proto"; service GreeterAPI { rpc SayHello…
Patrick
  • 341
  • 4
  • 15
4
votes
0 answers

How should HTTP PATCH communicate the removal of resource attributes when using a FieldMask

TL,DR; How should HTTP PATCH communicate the removal of resource attributes when using a FieldMask? Google's API Design Guide for implementing standard methods states that a partial update should be achieved using a FieldMask. Below is my own…
Jack
  • 10,313
  • 15
  • 75
  • 118
4
votes
2 answers

Messages defined in proto file are not available in final dotnet assembly

I'm using dotnet standard 2.0 (Visual Studio 2017) for gRPC. This is how my whole project looks like: Messages.proto syntax = "proto3"; package Messages; message IdRequest{ int32 id = 1; } message NameResponse{ string…
Simple Fellow
  • 4,315
  • 2
  • 31
  • 44
4
votes
1 answer

gRPC repeated field vs stream

Hi im currently looking into grpc and im curious about the use usage of a repeated field vs a stream. For example let's say i want to implement a reservation service for movie seats. The issue im facing is, that i want to inform the service for…
Felix Stumvoll
  • 122
  • 4
  • 16
4
votes
2 answers

Java class generated from protobuf has compilation errors

I'm trying to generated java classes from protobuf. Below is my protobuf - syntax = "proto2"; package part2; option java_package = "part2"; message OnlineStoreUser { required int32 userid = 1; required string username = 2; optional…
user51
  • 8,843
  • 21
  • 79
  • 158
4
votes
1 answer

Can the .proto file be generated from the server by any client?

I have seen that Evans CLI can be used to determine the exposed messages and sessions on the server from the client setup. Is it possible that the .proto file being used by the server (containing messages and session details), can be generated on…
shrey khare
  • 155
  • 2
  • 6
4
votes
1 answer

How can I use a gRPC "oneof" proto structure in python?

I am building a file storage client/server using python for the client, go for the server, along with gRPC. I have already successfully built the client in go and it works! I am trying to do the same in python now. Today, I have been working on it…
88jayto
  • 659
  • 1
  • 5
  • 20