Skip to content

[release/6.0-rc1] Support special characters in [JsonPropertyName] - #58075

Merged
mmitche merged 2 commits into
release/6.0-rc1from
backport/pr-58054-to-release/6.0-rc1
Aug 25, 2021
Merged

[release/6.0-rc1] Support special characters in [JsonPropertyName]#58075
mmitche merged 2 commits into
release/6.0-rc1from
backport/pr-58054-to-release/6.0-rc1

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Aug 24, 2021

Copy link
Copy Markdown
Contributor

Backport of #58054 to release/6.0-rc1

/cc @steveharter

Fixes#57836

Customer Impact

Broken scenario: with source-gen, specifying a custom JSON property name through the [JsonPropertyName(name)] attribute will cause a compile-time error if name is not a valid C# identifier, such as $value or Smtp-Id. No feasible workaround although a custom converter could be authored to do that.

Testing

A new test added to verify this scenario and the existing property name tests that run under the reflection-based serializer were modified to also under source-gen.

Risk

Low - changes are local to source-gen support of property names using [JsonPropertyName].

@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @eiriktsarpalis, @layomia
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #58054 to release/6.0-rc1

/cc @steveharter

Customer Impact

Testing

Risk

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

area-System.Text.Json

Milestone:-

@lewinglewing added the Servicing-approved Approved for servicing release label Aug 25, 2021
@lewing

Copy link
Copy Markdown
Member

Approved in email

cc @danmoseley@ericstj

@mmitche
mmitche merged commit 6145251 into release/6.0-rc1Aug 25, 2021
@akoeplinger
akoeplinger deleted the backport/pr-58054-to-release/6.0-rc1 branch August 28, 2021 22:03
@ghostghost locked as resolved and limited conversation to collaborators Sep 27, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Text.JsonServicing-approvedApproved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@lewing@eiriktsarpalis@mmitche@steveharter