Skip to content

Conversation

@eiriktsarpalis
Copy link
Member

@eiriktsarpalis eiriktsarpalis commented Aug 15, 2023

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
Member Author

/backport to release/8.0-rc1

@github-actions
Copy link
Contributor

@ghost
Copy link

ghost commented Aug 15, 2023

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

Copy link
Member

@tarekgh tarekgh left a comment

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
Copy link

TanvirArjel commented Aug 16, 2023

@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
Copy link
Member Author

eiriktsarpalis commented Aug 16, 2023

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