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

Constructor decorated with the JsonConstructor attribute should be able to be non-public #38327

Closed
swtrse opened this issue Jun 24, 2020 · 4 comments
Assignees
Milestone

Comments

@swtrse
Copy link

swtrse commented Jun 24, 2020

In general, a constructor decorated with the [JsonConstructor] attribute should be able to be a non-public constructor.

This would address cases where there is a special internal constructor that is solely used for json deserializing and that should not be called from user code.

Category: Design

@swtrse swtrse added the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Jun 24, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Text.Json untriaged New issue has not been triaged by the area owner labels Jun 24, 2020
@danmoseley danmoseley removed the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Jun 25, 2020
@danmoseley
Copy link
Member

Removing label as this is not proposing new API surface.

@layomia layomia removed the untriaged New issue has not been triaged by the area owner label Jun 30, 2020
@layomia layomia added this to the 5.0.0 milestone Jun 30, 2020
@layomia layomia modified the milestones: 5.0.0, Future Jul 16, 2020
@layomia
Copy link
Contributor

layomia commented Jul 16, 2020

We want to hold off on doing this until the ramifications to the ongoing JSON code generation efforts are well understood - https://github.com/dotnet/runtimelab/tree/JsonCodeGen.

@oneolddev
Copy link

We want to hold off on doing this until the ramifications to the ongoing JSON code generation efforts are well understood - https://github.com/dotnet/runtimelab/tree/JsonCodeGen.

The last link does not exist. I believe it should be https://github.com/dotnet/runtimelab/tree/feature/JsonCodeGen.

@layomia
Copy link
Contributor

layomia commented Jul 22, 2021

Merging this into #31511 which considers support for non-public members in general, not just ctors.

@layomia layomia closed this as completed Jul 22, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants