Skip to content

[System.Text.Json] The JsonSerializer should Have "Try" method variants #36452

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
frankhaugen opened this issue May 14, 2020 · 1 comment
Closed

Comments

@frankhaugen
Copy link

Simply put: The Serializer should have build-in Try -methods, to simplify handling of bad data. This should work just like Guid.TryParse();

So something like:

bool success = JsonSerializer.TryDeserializeObject<User>(jsonString, out var user);

Searched for issues using "System.Text.Json JsonSerializer try is:open " and found nothing, so this should not be a duplicate

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Text.Json untriaged New issue has not been triaged by the area owner labels May 14, 2020
@layomia layomia removed the untriaged New issue has not been triaged by the area owner label May 15, 2020
@layomia layomia added this to the 5.0 milestone May 15, 2020
@layomia
Copy link
Contributor

layomia commented May 15, 2020

This is a duplicate of #29902.

@layomia layomia closed this as completed May 15, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants