forked from grpc-ecosystem/grpc-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime: Use protobuf enum name instead of (reflect.Type).String
This adds pass-through of the *proto.Properties for fields so that the fields being populated can be addressed by their enum name when the type is an enum (i.e., (*proto.Properties).Enum is set). As a result of this, the tests now pass, using the protobuf enum name as registered (i.e., fully qualified package name) instead of the Go package name derived by calling (reflect.Type).String. This should have no real impact on existing use, but it may be justified to re-add a fallback case for that reflect.Type name for hand-written protobuf types. Even then, however, it seems unlikely that it should be expected for enums-by-name to work when registering the enum map under a name other than the one it's referred to in protobuf.
- Loading branch information
Showing
1 changed file
with
12 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters