All Questions
Tagged with protobuf-java kotlin
11 questions
0
votes
1
answer
65
views
List of protobuf messages to JSON array
I have a protobuf message definition like this:
message MyThing {
string foo = 1;
int32 bar = 2;
}
And a Java/Kotlin API that returns a List<MyThing>
I need to format this as a JSON string, ...
0
votes
1
answer
66
views
Skip Proto file Binding classes generation if already present in AAR file or any other source
I have one AAR file added inside the libs directory in Android Studio project. I have added a proto compiler configurations inside the build.gradle file. I am trying to add a proto file inside the app ...
4
votes
1
answer
485
views
Does Protobuf JavaLite support google.protobuf.Struct / google.protobuf.Value?
Here is the proto message that we trying to send.
message Cta {
string title = 1;
string pid = 2;
google.protobuf.Struct params = 3;
}
Does protobuf-lite library which is recommended for ...
8
votes
0
answers
620
views
Protobuf (version3) optional field are not nullable in kotlin generated code
I don't understand why an optional field (like middle_name in the example below), is not nullable in the Kotlin generated representation while in Golang and Rust it is properly nullable (or optional).
...
0
votes
2
answers
336
views
How to: ProtoBuf: get the parent message
Given a message (b of type B), nested in another (a of type A); how does one get ‘a’?
I was hoping for something like ‘b.getParent()’.
message B { optional string name = 1; repeated B b = 2; }
...
0
votes
1
answer
1k
views
grpc kotlin plugin is not generating dsl code
I have an existing project which is using gradle with kotlin DSL. I have setup protobuf code auto-generation with gradle build.
Kotlin grpc code is generated and I am able to implement my backend ...
3
votes
0
answers
2k
views
Once I added firebase dependency and got duplicated protobuf classes error
Everything is working fine once I added the below dependencies in the Gradle getting the below error
dependency :
implementation 'com.google.firebase:firebase-perf:19.1.0'
Error:
Duplicate class com....
2
votes
1
answer
965
views
In protobuf can I constrain a map's key to certain values?
So protobuf does not allow string enums to be keys in a map
I want to constrain a map to only have the keys a, b, or c.
I'm working in Kotlin and can use validators like [(validate.rules).string = {...
5
votes
1
answer
2k
views
Protobuf "Unresolved reference" with generated classes in Android Studio using Kotlin
it's my first time diving in with protobuf and jetpack's DataStore but I've encountered an issue which is quite confusing.
I've created my .proto file in src/main/java/proto, it's really simple:
...
3
votes
1
answer
1k
views
NoSuchMethod error on dealing with protobuf classes in a unit test
I'm trying to write unit tests of classes with using protobuf models and run them in Android Studio.
For example this is a simple converter test
class UpdateConfigConverterTest {
private val ...
1
vote
2
answers
8k
views
Kotlin Data Classes support in Protobuf
I am implementing protobuf recently in our kotlin project.
I am receiving the binary data and deserialising it to Proto object using the proto file.
But I would like have that converted to data ...