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

Issue: Multiple levels Json Deserialization with System.Text.Json.JsonSerializer API #33376

Closed
Sandeep321 opened this issue Mar 9, 2020 · 1 comment

Comments

@Sandeep321
Copy link

A couple of issues with the current implementation of Serialization/DeSerialization:

  1. We need to specify the JsonSerializerOptions everywhere we do the DeSerialization. It makes migration of existing projects to .Net core 3.1.0 very tricky and cumbersome. I really wonder if it's worth that much refactors. There is a workaround to fix it in one place but it would be nice if that comes from the .Net core team.
  2. Next is even if I use the correct JsonSerializerOptions for DeSerialization, first-level properties get deserialized correctly but not the next level complex JSON objects. It works all fine with Newtonsoft JSON. This could be related to this Issue

Are these known issues and do we have any workaround for these?

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

layomia commented Mar 13, 2020

There's an issue to be able to specify the serializer's global options: #31094. This will solve the issue of specifying the options everywhere.

Populating collections without setters is currently not supported. There's an issue tracking this: #30258.

I'll close this as a duplicate. @Sandeep321 in the future, please create different issues for different concerns so we can properly track issues.

@layomia layomia closed this as completed Mar 13, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 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

3 participants