[release/7.0] gRPC JSON transcoding: Support deserializing non-nested enum from string #45411
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #45273 to release/7.0
/cc @JamesNK
gRPC JSON transcoding: Support deserializing non-nested enum from string
gRPC JSON transcoding allows gRPC endpoints to be called as RESTful APIs with JSON.
Description
There is a bug in the serializer that means root scope enum values can't be deserialized from strings. This PR adds a type registry that stores the enum types and can be checked by the serializer.
Fixes #45270
Customer Impact
The bug prevents customers from having incoming messages with root scope enum values. An error is thrown.
Regression?
[If yes, specify the version the behavior has regressed from]
Risk
This change only impacts gRPC JSON transcoding. The change has been added so that only the deserialization of a root scope enum uses the new registry in .NET 7.
Verification
Packaging changes reviewed?