Skip to content

[release/7.0] gRPC JSON transcoding: Support deserializing non-nested enum from string #45411

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

Merged
merged 6 commits into from
Jan 11, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 1, 2022

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?

  • Yes
  • No

[If yes, specify the version the behavior has regressed from]

Risk

  • High
  • Medium
  • Low

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

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@ghost ghost added the area-grpc Includes: GRPC wire-up, templates label Dec 1, 2022
@JamesNK JamesNK added this to the 7.0.3 milestone Dec 2, 2022
@JamesNK JamesNK added the Servicing-consider Shiproom approval is required for the issue label Dec 2, 2022
@ghost
Copy link

ghost commented Dec 2, 2022

Hi @github-actions[bot]. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

@JamesNK
Copy link
Member

JamesNK commented Dec 2, 2022

Successfully manual verification in a test app. Enum string in JSON is successfully deserialized:

image

@JamesNK JamesNK requested a review from BrennanConroy December 2, 2022 08:31
@JamesNK
Copy link
Member

JamesNK commented Jan 9, 2023

@adityamandaleeka

@JamesNK JamesNK added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Jan 11, 2023
@ghost
Copy link

ghost commented Jan 11, 2023

Hi @github-actions[bot]. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

@JamesNK
Copy link
Member

JamesNK commented Jan 11, 2023

Approved over email.

@dotnet/aspnet-build Could you please merge this PR into release/7.0.

@dougbu dougbu merged commit 0e32ba3 into release/7.0 Jan 11, 2023
@dougbu dougbu deleted the backport/pr-45273-to-release/7.0 branch January 11, 2023 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-grpc Includes: GRPC wire-up, templates Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants