Skip to content

[release/8.0] Fix deserializing null properties to Protobuf types #52468

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 1 commit into from
Jan 4, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 30, 2023

Backport of #52398 to release/8.0

/cc @JamesNK

Fix deserializing null properties to Protobuf types

gRPC JSON transcoding incorrectly doesn't support deserializing null values. The protobuf JSON spec says that parsing null values is supported and the default value should be set.

When parsing JSON-encoded data into a protocol buffer, if a value is missing or if its value is null, it will be interpreted as the corresponding default value.

The fix is to allow deserializing null values and to reset a property to its default value.

Fixes #51742

Customer Impact

Apps are unable to send null values to a gRPC JSON transcoding server. They are either forced to change the client or are stuck if they can't.

There isn't a workaround.

Regression?

  • Yes
  • No

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

Risk

  • High
  • Medium
  • Low

This is a minor change to the Microsoft.AspNetCore.Grpc.JsonTranscoding package. Nothing else in .NET depends on it.
Null values previously errored. This PR changes their behavior to set a property to its default value instead.

Verification

  • Manual (required)
  • Automated

After:
image

Note: null values in JSON payload.

Packaging changes reviewed?

  • Yes
  • No
  • N/A

When servicing release/2.1

  • Make necessary changes in eng/PatchConfig.props

@ghost ghost added the area-grpc Includes: GRPC wire-up, templates label Nov 30, 2023
@ghost ghost added this to the 8.0.x milestone Nov 30, 2023
@ghost
Copy link

ghost commented Nov 30, 2023

Hi @github-actions[bot]. If this is not a tell-mode PR, please make sure to follow the instructions laid out in the servicing process document.
Otherwise, please add tell-mode label.

@JamesNK JamesNK added the Servicing-consider Shiproom approval is required for the issue label Nov 30, 2023
@ghost
Copy link

ghost commented Nov 30, 2023

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 JamesNK added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Nov 30, 2023
@ghost
Copy link

ghost commented Nov 30, 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 Nov 30, 2023

Email approval

@ghost
Copy link

ghost commented Dec 7, 2023

Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.

@ghost ghost added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Dec 7, 2023
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Jan 3, 2024
@ghost ghost added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jan 3, 2024
@wtgodbe
Copy link
Member

wtgodbe commented Jan 3, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@wtgodbe wtgodbe merged commit c655f85 into release/8.0 Jan 4, 2024
@wtgodbe wtgodbe deleted the backport/pr-52398-to-release/8.0 branch January 4, 2024 04:52
@ghost ghost modified the milestones: 8.0.x, 8.0.2 Jan 4, 2024
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 area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework Servicing-approved Shiproom has approved the issue
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants