Questions tagged [proto]

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

564 questions
11
votes
4 answers

How to generate swagger3 (OpenAPI3) spec in (.json/.yaml) from protobuf (.proto) files?

My original use-case: I am building an application in GO with a gRPC server (using protobuf), and wrapping it inside an HTTPS server (using gin). Only the HTTPS server is being published to the clients for use (by which I mean that my application…
Krishna Birla
  • 332
  • 2
  • 10
11
votes
1 answer

Google protobuf 3: deprecated a field, but cannot remove the dependencies?

I have a proto A that depends on proto B. Then I deprecated the field protoB: import "protoB.proto"; message ProtoA { string assignmentStatus = 1; protoB proto_b = 2 [deprecated = true]; } I'd think in this case I should be able to remove the…
HeyThere
  • 503
  • 1
  • 5
  • 19
10
votes
1 answer

How to make call to gRPC server over HTTP/1.1 from cURL command or in internet browser

I have added below new code in protobuf file and compiled to get the generated grpc_pb files. service EchoService { rpc Echo(EchoMessage) returns (EchoMessage) { #-----New code start----- option (google.api.http) = { post:…
SOWMITHRA KUMAR G M
  • 1,320
  • 2
  • 11
  • 17
10
votes
3 answers

grpc organization in microservices

I'm creating a system using a microservices architecture. There are two microservices A and B, each living in their own repository. There is a user.proto file containing protobuf definition and gRPC method signatures. A uses generated user.pb.go as…
kkyr
  • 3,785
  • 3
  • 29
  • 59
10
votes
3 answers

How to determine the geom type of each layer of a ggplot2 object?

As part of an effort to remove a specific geom from a plot I've already created (SO link here), I'd like to dynamically determine the geom type of each layer of a ggplot2 object. Assuming I don't know the order in which I added layers, is there a…
Erik Shilts
  • 4,389
  • 2
  • 26
  • 51
9
votes
1 answer

Cannot import external proto file - Works in commandline but not in .net core 3 RC1

I'm moving my gRPC app from .net framework to .net core I have two main proto files as follows /Proto/common/common.proto /Proto/my-service.proto my-service.proto importing common.proto as simple as this: common.proto syntax="proto3"; package…
bunjeeb
  • 1,096
  • 1
  • 17
  • 32
8
votes
2 answers

proto: file is already registered with different packages

I have 2 proto compiled under different go packages but when I register them in a a server and run it, I get : panic: proto: file "common.proto" is already registered previously from: "github.com/soft/test-platform.go/common" currently from:…
Antonin
  • 879
  • 2
  • 10
  • 27
7
votes
1 answer

Should I use Get methods to get values or should I use fields directly?

I'm using protobuf (and protoc) for the first time with Go. message MyProtoStruct { string description = 1; } I'm a little bit confused: should I use methods to get values (like MyProtoStruct.GetDescription()) or should I use fields directly…
Fred Hors
  • 3,258
  • 3
  • 25
  • 71
7
votes
3 answers

Importing proto files from different package causes 'missing method protoreflect'

I am new to Go and Protobufs hence this might be a very noob question. Sorry for that. I have several packages in my go project and I wanted to create a seperate package which contains all my .proto (also .pb.go) files and then I can import those…
Ahsan Nasir
  • 147
  • 1
  • 2
  • 7
7
votes
1 answer

How do I convert from 'Google.Protobuf.WellKnownTypes.Timestamp to 'System.DateTime'

I want to map datetime in c# datetime in protobuf . Do you have any suggestion to do this?
7
votes
2 answers

Converting Stream to ByteString

I have Stream that I need to return through a protobuf message as bytes. How do I convert the Stream into the ByteString that is expected by protobuf? Is it as simple as it appears in the documentation Serialization? Due to the nature of the project…
koshi
  • 311
  • 3
  • 8
7
votes
2 answers

perl6 Need help to understand more about proto regex/token/rule

The following code is taken from the Perl 6 documentation, and I am trying to learn more about it before more experimentation: proto token command {*} token command:sym { } token command:sym { } …
lisprogtor
  • 5,677
  • 11
  • 17
6
votes
1 answer

/* in transcoding from HTTP to gRPC

rpc CreateBook(CreateBookRequest) returns (Book) { option (google.api.http) = { post: "/v1/{parent=publishers/*}/books" body: "book" }; } message CreateBookRequest { // The publisher who will publish this book. // When using…
Stacy Lin
  • 75
  • 3
6
votes
2 answers

Is it a good practice in protobuf3 using optional to check nullability?

I noticed that they bring optional back in protobuf 3.15. I'm trying to use optional to check field presence. But I'm still unclear regarding the philosophy behind this. Here is my usecase: I'm providing some services that accept protobuf as my…
Ziqi Liu
  • 2,931
  • 5
  • 31
  • 64
6
votes
3 answers

Run protoc command into docker container

I'm trying to run protoc command into a docker container. I've tried using the gRPC image but protoc command is not found: /bin/sh: 1: protoc: not found So I assume I have to install manually using RUN instructions, but is there a better solution?…
J.F.
  • 13,927
  • 9
  • 27
  • 65
1
2
3
37 38