Closed adriansmares closed 4 years ago
Nested oneOf use the wrong sub-paths during SetFields.
oneOf
SetFields
I've encountered while working on SetApplicationPubSub
SetApplicationPubSub
https://github.com/TheThingsNetwork/lorawan-stack/blob/67cc2b31b079f9e9162f997306386a22b4bccf18/api/applicationserver_pubsub.proto#L72-L77
The generated code uses the wrong subfields while recursing on the oneof (subs instead of oneOfSubs). https://github.com/TheThingsNetwork/lorawan-stack/blob/67cc2b31b079f9e9162f997306386a22b4bccf18/pkg/ttnpb/applicationserver_pubsub.pb.setters.fm.go#L362-L385
oneof
subs
oneOfSubs
The subfields of the upper message are used (subs).
The subfields of the oneof message being used (oneOfSubs).
Changing the code generation to respect the correct subs.
Yes
Summary
Nested
oneOf
use the wrong sub-paths duringSetFields
.Steps to Reproduce
SetFields
with a valid field mask.I've encountered while working on
SetApplicationPubSub
https://github.com/TheThingsNetwork/lorawan-stack/blob/67cc2b31b079f9e9162f997306386a22b4bccf18/api/applicationserver_pubsub.proto#L72-L77
The generated code uses the wrong subfields while recursing on the
oneof
(subs
instead ofoneOfSubs
). https://github.com/TheThingsNetwork/lorawan-stack/blob/67cc2b31b079f9e9162f997306386a22b4bccf18/pkg/ttnpb/applicationserver_pubsub.pb.setters.fm.go#L362-L385What do you see now?
The subfields of the upper message are used (
subs
).What do you want to see instead?
The subfields of the oneof message being used (
oneOfSubs
).Environment
How do you propose to implement this?
Changing the code generation to respect the correct
subs
.Can you do this yourself and submit a Pull Request?
Yes