Questions tagged [protoc]

protoc is the compiler for .proto files. It generates language bindings for the messages and/or RPC services from .proto files. protoc is a native executable, the scripts under this directory build and publish a protoc executable (a.k.a. artifact) to Maven repositories. The artifact can be used by build automation tools so that users would not need to compile and install protoc for their systems.

taken from google documentation

387 questions
3
votes
0 answers

Jackson deserialization error with List of class generated from proto file: Cannot find a (Map) Key deserializer for type

I am getting an error Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a (Map) Key deserializer for type [simple type, class com.google.protobuf.Descriptors$FieldDescriptor] when I attempt to deserialize the…
James Hutchinson
  • 841
  • 2
  • 13
  • 27
3
votes
1 answer

How to use Value in the python implementation of protobuf

I have a proto file defined as: syntax = "proto3"; import "google/protobuf/struct.proto"; package generic.name; message Message { uint32 increment = 1; google.protobuf.Value payload = 2; } I have figured out how to make this work if I swap…
3
votes
1 answer

Protocol-buffer with Python choose the order of data with SerializeToString

I have buffer that encoded with protocol-buffer , I want to read the buffer and change some data and encode it again. I saw that when I encode the buffer ( SerializeToString) the binary data is not the same so the server that get that buffer can't…
3
votes
1 answer

Why is my protoc not generating gprc service stubs?

I am pulling grpc into my spring-boot-project. I pulled in this dependency: io.github.lognet grpc-spring-boot-starter 4.5.8 Here is my plugins…
jhamm
  • 24,124
  • 39
  • 105
  • 179
3
votes
1 answer

Error: failed post-processing: 820:39: missing ',' in argument list

protoc-gen-validate is a protoc plugin to generate polyglot message validators. The project uses Bazel for builds and has an open pull request to add support for customization of validation error messages. The original code was made in 2020.…
Maria Ines Parnisari
  • 16,584
  • 9
  • 85
  • 130
3
votes
1 answer

How to convert PHP Protobuf Object to a JSON string

I want to convert my Protobuf object to a JSON object using PHP so that I can send it back to the browser. My Protobuf is syntax = "proto3"; package Protobuf.Gen.ProposalTotalModel; option php_generic_services = true; message ProposalTotal { …
srth12
  • 873
  • 9
  • 16
3
votes
1 answer

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 uses a fairly simple and readable structure. Here's…
3
votes
1 answer

Could not find protoc-gen-grpc-kotlin-1.0.0-windows-x86_64.exe (io.grpc:protoc-gen-grpc-kotlin:1.0.0)

I want to use protoc-gen-grpc-kotlin-1.0.0 from protoc-gen-grpc-kotlin and I am getting Execution failed for task ':generateProto'. > Could not resolve all files for configuration ':protobufToolsLocator_grpckt'. > Could not find…
Jim C
  • 3,957
  • 25
  • 85
  • 162
3
votes
1 answer

protoc generates value instead of pointer (Go)

The problem: I have 2 files in the root directory. I use Makefile to generate Go code from .proto files. But the language field in the Video struct is a value not a pointer to the value. And the subtitles field in the Video struct is an array of…
Klimbo
  • 1,308
  • 3
  • 15
  • 34
3
votes
1 answer

Issue with TypeScript definition files when generating proto definitions with protoc-gen-grpc-web

I'm having an issue with my generated proto definitions. I'm using the most up to date version of the protoc-gen-grpc-web which I got from here (version 1.0.7). Note: I've had the same problem on both MacOS and Windows as well as on version…
Barry Michael Doyle
  • 9,333
  • 30
  • 83
  • 143
3
votes
1 answer

protoc-gen-go-rpc: program not found or is not executable - Where do I get protoc-gen-go-rpc?

We are using protoc-gen-go v2 (v2 is google.golang.org/protobuf, v1 is github.com/golang/protobuf) When we are trying to compile our gRPC services, it tells us that plugins is not supported anymore and we should instead use --go-grpc_out: $ protoc…
corgrath
  • 11,673
  • 15
  • 68
  • 99
3
votes
0 answers

ts-protoc-gen appending list to repeated items

I have a proto(3) message like so: message DataAggregated { repeated Data data = 1; } message Data { string example = 1 } When generated types for this proto definition the word 'List' is appended to repeated fields, why is this, is there a…
Jay P
  • 596
  • 7
  • 23
3
votes
2 answers

Using protobuf imports (i.e. google/protobuf/timestamp.proto) with wire

I am trying to generate files using the square's Wire. I could run their sample all good, but as soon as I added import "google/protobuf/timestamp.proto"; to their .proto file to check how wire treats timestamps, compiler broke with this…
aleien
  • 786
  • 1
  • 9
  • 22
3
votes
1 answer

How to compile nanopb .proto file into .h and .c files using nanopb and protobuf (`protoc` compile question)

Old title: How to compile nanopb/examples/simple/simple.proto file into simple.h and simple.c using nanopb and protobuf Regarding this library: https://github.com/nanopb/nanopb My goal is to follow this tutorial:…
Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265
3
votes
2 answers

replace retool with tools.go for multi developer and CI environments using go modules

I'd like to replace retool with go modules tools.go "tools as dependencies". However I'm struggling to understand how this works when my developers and CI env all use different operating systems. I want to make sure each environment uses the exact…
rynop
  • 50,086
  • 26
  • 101
  • 112