Skip to content

Fix support for non-public default constructors using JsonIncludeAttribute#90612

Merged
eiriktsarpalis merged 2 commits into
dotnet:mainfrom
eiriktsarpalis:fix/json-constructor-nonpublic-default-ctors
Aug 16, 2023
Merged

Fix support for non-public default constructors using JsonIncludeAttribute#90612
eiriktsarpalis merged 2 commits into
dotnet:mainfrom
eiriktsarpalis:fix/json-constructor-nonpublic-default-ctors

Conversation

@eiriktsarpalis

@eiriktsarpalis eiriktsarpalis commented Aug 15, 2023

Copy link
Copy Markdown
Member

PR #88452 added support for non-public constructors using JsonIncludeAttribute, however it didn't account for default constructors, which use a different path when being populated in the reflection serializer.

Fix #90577

Should be backported to release/8.0-rc1

@eiriktsarpalis eiriktsarpalis self-assigned this Aug 15, 2023
@eiriktsarpalis eiriktsarpalis added this to the 8.0.0 milestone Aug 15, 2023
@eiriktsarpalis

Copy link
Copy Markdown
Member Author

/backport to release/8.0-rc1

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/8.0-rc1: https://github.com/dotnet/runtime/actions/runs/5869872173

@ghost

ghost commented Aug 15, 2023

Copy link
Copy Markdown

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

Issue Details

PR #88452 added support for non-public constructors using JsonIncludeAttribute, however it didn't account for default constructors, which use a different path when being populated in the reflection serializer.

Fix #90577

Should be backported to release/8.0-rc1

Author: eiriktsarpalis
Assignees: eiriktsarpalis
Labels:

area-System.Text.Json

Milestone: 8.0.0

@tarekgh tarekgh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eiriktsarpalis eiriktsarpalis merged commit 227e882 into dotnet:main Aug 16, 2023
@eiriktsarpalis eiriktsarpalis deleted the fix/json-constructor-nonpublic-default-ctors branch August 16, 2023 05:59
@TanvirArjel

TanvirArjel commented Aug 16, 2023

Copy link
Copy Markdown

@eiriktsarpalis Title looks misleading. It should be "Fix support for non-public default constructors using JsonConstructorAttribute " isn't it? Please confirm you have made the fix for JsonConstructorAttribute, not JsonIncludeAttribute!

@eiriktsarpalis

eiriktsarpalis commented Aug 16, 2023

Copy link
Copy Markdown
Member Author

Yes that's a typo, it is in fact addressing the issue with JsonConstructorAttribute. PR has been merged now, so not much can be done. 🤷

@ghost ghost locked as resolved and limited conversation to collaborators Sep 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JsonConstructorAttribute not working for private/internal ctor in .NET 8.0 preview7

3 participants