Questions tagged [protobuf]
Protocol Buffers are a serialization format with an interface description language developed by Google. Source: en.wikipedia.org/wiki/Protobuf
23 questions
1
vote
0
answers
546
views
Recommended generic approach to checking scalar field presence in protobuf 3
There are several questions related to presence field tracking of scalar fields in protobuf 3, but I didn't find any with generic default approach recommendation.
It may be useful to be able to track ...
0
votes
0
answers
183
views
Permissive vs Strict API
This question is similar to Permissive vs. Strict API Message validation. One difference is that we're using Protobuf.
A colleague and I are discussing standard message types for names.
One ...
2
votes
0
answers
574
views
Is non-contiguous protobuf field numbering an anti-pattern?
Is it an anti-pattern to have gaps in field numbers to aid readability?
The need being address by this idea is that metadata fields, which are "aspect" fields, can be placed in the proto ...
1
vote
1
answer
6k
views
Using protobuf to store large array of doubles
For my job, I'm working on a project that involves working with robot sensor data. We've been using protobuf to serialize and transfer data. I'm trying to set up a new protobuf type but this data ...
0
votes
0
answers
899
views
Why does Protobuf generate outer classes for Java?
I googled this and found questions like "How to use Protobuf message as java class without a java outer class?" (https://stackoverflow.com/questions/60312156/how-to-use-protobuf-message-as-...
-2
votes
2
answers
172
views
Prefer passing class or variable as const reference
In my company's code base there are examples of methods which receive some protobuf messages and use them in this fashion:
void doSomething(const A& a) {
// Only data from a.info() is used in ...
1
vote
0
answers
316
views
Separating generated flatbuffer/protobuf files from domain model - best practices
I'm using flatbuffers for the first time. I've generated my java classes and have tested out serializing / deserializaing a message. Now I'm thinking about how to integrate these in to my JavaFx and ...
0
votes
0
answers
103
views
Is it idiomatic to use protobufs as containers within a service?
I love gRPC, but I find every step of the protobuf process rather frustrating (particularly in Python). Even though they are structurally similar to data structures composed of lists and dicts, you ...
1
vote
0
answers
145
views
What's the most intuitive way to organize a set of endpoints to fetch users and their roles in groups?
What's the most intuitive way to organize a set of endpoints to fetch users and their roles in groups? i.e.
Users and their roles in a specified group.
Groups a user is in, and their role in each ...
2
votes
2
answers
783
views
What are the "scalar fields" and "composite fields" in JAVA?
Need to understand the below definition, from the protobuf tutorial:
mergeFrom(Message other): (builder only) merges the contents of other into this message, overwriting singular scalar fields, ...
1
vote
1
answer
1k
views
How to handle adding new field / partial data update for a gRPC API?
Assuming we have following message that will be used to update data and it just got updated to version 2.
message HelloRequest {
string name = 1; // version 1
bool is_valid = 2; // version 2
}
...
1
vote
1
answer
576
views
Why protobuf is said to be in binary format although we write it in text format similar to json
JSON
{
"hello": "world"
}
Protobuf
message HelloWorld {
required string name = 1;
}
Why do we say that protobuf uses binary format during network exchange and json don't, even though network always ...
2
votes
2
answers
759
views
Options for having model, parsers and serializers for a given data-format generated in multiple languages?
I am member of the Apache PLC4X (incubating) project. Here we are currently implementing multiple industry PLC protocols. While we initially focussed on creating Java versions of these, we are ...
2
votes
1
answer
171
views
Protobuf: compile specification once, use generated code everywhere?
Once written, a protobuf specification can be compiled using protoc to a variety of implementations in different languages (e.g. python, c++, go). That's great. But to compile that generated code, you ...
1
vote
0
answers
265
views
Can I add new function for protobuf generated struct
I am using protobuf definitions to define message types.
Structure looks like
message1 {
}
message2 {
bytes msg1 = 1
}
So message2 has a field which is a byte array representation of message1. I ...