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

Tuple support in System.Text.Json.Serializer? #552

Closed
kaamil1984 opened this issue Dec 5, 2019 · 3 comments
Closed

Tuple support in System.Text.Json.Serializer? #552

kaamil1984 opened this issue Dec 5, 2019 · 3 comments

Comments

@kaamil1984
Copy link

Can we have tuple support in System.Text.Json.Serializer?

General

Is there any chance, that we can have tuple support in System.Text.Json.Serializer?

I would like to serialize and deserialize object like this:

(int Result, string SuccessMessage, string ErrorMessage) MyTuple;

@scalablecory scalablecory transferred this issue from dotnet/core Dec 5, 2019
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Text.Json untriaged New issue has not been triaged by the area owner labels Dec 5, 2019
@GrabYourPitchforks
Copy link
Member

Possibly related to feature work to allow serializing fields, not just properties? Though one could certainly imagine a custom converter for ValueTuple<...> that doesn't need a full-fledged field serialization feature.

@layomia layomia added this to the 5.0 milestone Dec 5, 2019
@layomia layomia removed the untriaged New issue has not been triaged by the area owner label Dec 14, 2019
@layomia
Copy link
Contributor

layomia commented Dec 14, 2019

Closing this as this will be achieved with public field support - https://github.com/dotnet/corefx/issues/36505.

@ahsonkhan
Copy link
Member

I mention a workaround for ValueTuples (up to 3) based on custom converters if folks need it.
#1519 (comment)

@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
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

5 participants