-
Notifications
You must be signed in to change notification settings - Fork 690
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
ctxtags TagBasedRequestFieldExtractor does not extract tags from fields in a oneof #326
Comments
It looks like what's missing is go-grpc-middleware/tags/fieldextractor.go Line 67 in b4e7e96
Changing it to also check for reflect.Interface seems to do the trick there, for example:
Note that noting that once field.Interface() is called on a field where kind==reflect.Interface, the returned value when passed to reflect.ValueOf().Kind() becomes reflect.Ptr again. So the earlier check here is doesn't need updating: go-grpc-middleware/tags/fieldextractor.go Line 57 in b4e7e96
Edit: Looks like I had an old version of gogoproto, the current version does support setting tags on oneof fields. |
With the following message and interceptor configuration:
On messages that has either Bar or Baz set, they do not appear in the ctxtags. Other fields outside of oneof's works as expected.
The text was updated successfully, but these errors were encountered: