-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set multiple Capabilities in a single message when using Java/Kotlin protobuf #121
Labels
required-for-stable
Required to be resolved before 1.0
Comments
This is the setCapabilities method in the java ServerToAgent object builder:
|
I think we need to change the bit fields to uint64. The enum declarations can stay to show what the bit values are. |
tigrannajaryan
added a commit
to tigrannajaryan/opamp-spec
that referenced
this issue
Sep 20, 2022
Resolves open-telemetry#121 In some languages enum fields are strongly typed and it is impossible to assigned OR-ed values to the enum field. This makes impossible to compose the bit fields properly. This changes all bit field declarations from enum to uint64. The enum declarations stay, so that bit definitions are clear.
Yes, thank you! |
tigrannajaryan
added a commit
that referenced
this issue
Sep 22, 2022
Resolves #121 In some languages enum fields are strongly typed and it is impossible to assigned OR-ed values to the enum field. This makes impossible to compose the bit fields properly. This changes all bit field declarations from enum to uint64. The enum declarations stay, so that bit definitions are clear.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AgentCapabilities capabilities = 4;
ServerCapabilities capabilities = 7;
The intent of these fields is to pack multiple flags into a single field. According to the protobuf docs, Enum fields only allow a single value. When compiled to Java or Kotlin the generated objects do not allow for setting multiple capability flags to a single enum.
This can be fixed by changing the field to be an int32 with manual bit packing, or by repeating the enum fields.
The text was updated successfully, but these errors were encountered: