How to use custom annotations/options in proto messages that are exported to Kotlin pbandk classes? #256
Unanswered
sebaslogen
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My original question is how to use annotations in proto files that will be translated into the kotlin generated code?
Unfortunately, I couldn't find any example of how to do this.
The best pointer I could find was this discussion with a commit adding the feature to pbandk. #173
Here is the response I got from @garyp :
You can see an example proto file here: pbandk/test-types/src/commonMain/proto/pbandk/testpb/custom_options.proto at master · streem/pbandk.
In protobuf terminology these are called "options" rather than "annotations". And here's some Kotlin code (a unit test in this case) that shows an example of how to inspect the option at runtime: pbandk/runtime/src/commonTest/kotlin/pbandk/CustomOptionsTest.kt at 120f51ba6ec7eeecc85d29242841d7011670005c · streem/pbandk.
Beta Was this translation helpful? Give feedback.
All reactions