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

Can we enable to set non-public properties on System.Text.Json #6095

Closed
hikalkan opened this issue Nov 6, 2020 · 8 comments · Fixed by #13357
Closed

Can we enable to set non-public properties on System.Text.Json #6095

hikalkan opened this issue Nov 6, 2020 · 8 comments · Fixed by #13357

Comments

@hikalkan
Copy link
Member

hikalkan commented Nov 6, 2020

System.Text.Json doesn't set non-public properties by default on deserialization.
Is there an option to enable to set them (dotnet/runtime#29743 ?)? If so, it is better to enable it.

@hikalkan hikalkan added this to the 4.0-preview milestone Nov 6, 2020
@hikalkan hikalkan changed the title Can we enable to set private/protected properties on System.Text.Json Can we enable to set non-public properties on System.Text.Json Nov 6, 2020
@mehmetuken
Copy link
Contributor

@maliming
Copy link
Member

maliming commented Nov 6, 2020

Using attribute is not a good solution. : )

@mehmetuken
Copy link
Contributor

Using attribute is not a good solution. : )

I think so :D But this is the approved solution now :(

@maliming maliming modified the milestones: 4.0-preview, 4.1-preview Nov 9, 2020
@maliming
Copy link
Member

maliming commented Nov 9, 2020

There is currently no good solution, move to 4.1 .

@mehmetuken
Copy link
Contributor

dotnet/runtime#42399 maybe help this.

@maliming
Copy link
Member

maliming commented Dec 2, 2020

We need wait for dotnet/runtime#36785

@maliming
Copy link
Member

.NET 7.0 dotnet/runtime#31511

@maliming maliming modified the milestones: backlog, 7.0-preview Aug 15, 2022
@maliming
Copy link
Member

https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-preview-6/#json-contract-customization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants