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

System.Text.Json: Custom Constructor Support #30615

Closed
endeffects opened this issue Aug 18, 2019 · 7 comments
Closed

System.Text.Json: Custom Constructor Support #30615

endeffects opened this issue Aug 18, 2019 · 7 comments
Labels
area-System.Text.Json enhancement Product code improvement that does NOT require public API changes/additions
Milestone

Comments

@endeffects
Copy link

Please provide support for custom constructors and allow to specify the constructor with an attribute.

@ahsonkhan
Copy link
Member

cc @steveharter

@Gnbrkm41
Copy link
Contributor

https://github.com/dotnet/corefx/issues/38569#issuecomment-503566048

For the 3.0 release, there is no planned additional support for calling a non-default constructor during deserialization. That would have to be done by a custom converter.

oschwald referenced this issue in maxmind/GeoIP2-dotnet Nov 22, 2019
This was abandoned for the time being due to the requirement that all
of the setters be made public. Related issues upstream:

https://github.com/dotnet/corefx/issues/38163
https://github.com/dotnet/corefx/issues/40399

The second would be preferable.
@layomia
Copy link
Contributor

layomia commented Nov 23, 2019

Sufficiently similar to https://github.com/dotnet/corefx/issues/40399 - closing as duplicate.

Edit: similar to #29895.

@layomia layomia closed this as completed Nov 23, 2019
@gfoidl
Copy link
Member

gfoidl commented Nov 23, 2019

@layomia you created a endless-loop 😉
(the link points to the current issue itself)
Did you mean #29895?

@layomia
Copy link
Contributor

layomia commented Nov 25, 2019

@gfoidl yes, thank you!

@etghanibahman
Copy link

Is there any temporary solution for this ?!

@manne
Copy link
Contributor

manne commented Jan 28, 2020

@etghanibahman I have implemented a functionality supporting "custom" constructors. For details read https://github.com/dotnet/corefx/issues/38569#issuecomment-574886051

@msftgits msftgits transferred this issue from dotnet/corefx Feb 1, 2020
@msftgits msftgits added this to the 5.0 milestone Feb 1, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Text.Json enhancement Product code improvement that does NOT require public API changes/additions
Projects
None yet
Development

No branches or pull requests

8 participants