Skip to content
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

[release/6.0] Prevent runtime prop metadata retrieval when [JsonIgnore] is used #60299

Merged
merged 4 commits into from
Oct 12, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 12, 2021

Backport of #60024 to release/6.0

/cc @layomia

Customer Impact

Fixes customer-reported regression from .NET 5.0.

In 5.0 and earlier, [JsonIgnore] could be used ignore members with unsupported types from serialization and also members with invalid configuration (such as incompatible converters). 6.0 PR #56354 (JSON source gen support for parameterized ctors) had a side-effect that changed the serializer's behavior such that this metadata is inspected and validated, rather than ignored (note that the members are still not included during actual (de)serialization). This behavior change has led to new reported failures in user apps due to the serializer throwing exceptions upon validation:

Users are dependent on [JsonIgnore] to suppress errors that could be yielded from the serializer, and those customers can now be broken. This PR reverses the regression to avoid breaking previously working scenarios.

Testing

Tests for the reported breaking scenarios have been added, along with new tests for parameterized ctor support.

Risk

This PR makes product changes and has some risk. Some of the changes relate to parameterized ctor support since that code is dependent on the same underlying infra as the ignore/property handling. We'll be looking out for customer feedback in both [JsonIgnore] and parameterized ctor scenarios.

@ghost
Copy link

ghost commented Oct 12, 2021

Tagging subscribers to this area: @dotnet/area-system-text-json
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #60024 to release/6.0

/cc @layomia

Customer Impact

Testing

Risk

Author: github-actions[bot]
Assignees: -
Labels:

area-System.Text.Json

Milestone: -

@ericstj ericstj added the Servicing-consider Issue for next servicing release review label Oct 12, 2021
@ericstj ericstj added this to the 6.0.0 milestone Oct 12, 2021
@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 12, 2021
@Anipik Anipik merged commit 12fb2c3 into release/6.0 Oct 12, 2021
@jkotas jkotas deleted the backport/pr-60024-to-release/6.0 branch October 23, 2021 13:06
@ghost ghost locked as resolved and limited conversation to collaborators Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Text.Json Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants