JsonSubTypes icon indicating copy to clipboard operation
JsonSubTypes copied to clipboard

Support for System.Text.Json

Open brechtvhb opened this issue 5 years ago • 11 comments

Could you update the application so it supports the default json formatter in .Net core 3?

brechtvhb avatar Sep 27 '19 08:09 brechtvhb

+1 would be useful to support System.Text.Json. However I'm not sure if that library has the ability to do this yet.

chinwobble avatar Sep 29 '19 04:09 chinwobble

First of all, Hi

Then yes it something that may comes some day, it needs some time to dig into the new api, I may look into into it in the future

manuc66 avatar Oct 11 '19 22:10 manuc66

Hi ;) This would actually be quite useful since System.Text.Json doesn't support anything like that at the moment :)

siewers avatar Oct 24 '19 11:10 siewers

@brechtvhb: Could this issue be renamed to "Support System.Text.Json", since JsonSubTypes supports Json.NET just fine in .NET Core 3?

kimsey0 avatar Oct 28 '19 14:10 kimsey0

If your like me and just updated your project to .netcore 3.1 and now your types wont serialize correctly.

just install https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson and you should be good to go.

voxon2 avatar Jul 10 '20 14:07 voxon2

@manuc66 Just wanted to check what the current roadmap for this feature is and if it still planned?

.NET 5 has enhanced System.Text.Json and it seems to be sufficient for most cases, allowing projects to avoid adding another dependency through Newtonsoft.

Luburic avatar May 18 '21 06:05 Luburic

@manuc66: Do you have an overview of what's missing on https://github.com/manuc66/JsonSubTypes/compare/feature/Text.Json.NETCore3__%238? Perhaps we can contribute to it. :-)

kimsey0 avatar Oct 19 '21 12:10 kimsey0

@kimsey0 If you open the branch https://github.com/manuc66/JsonSubTypes/tree/feature/Text.Json.NETCore3__%238 I've began implementing a new converter agains System.Text.Json in project JsonSubTypes.Text.Json. I've kept 62 tests and there are currently 27 failing.

Using multiple time the deserializer in the same json path/hierachy does not work

manuc66 avatar Oct 22 '21 21:10 manuc66

@kimsey0 The issue with recursive polymorphic deserialization has been solved.

Other feature are still missing (see failing tests)

manuc66 avatar Mar 31 '22 22:03 manuc66

Please note that this kind of feature is coming in System.Text.Json https://github.com/dotnet/runtime/issues/63747

manuc66 avatar Sep 10 '22 22:09 manuc66

Unaware of this package I implemented this: https://github.com/riezebosch/PolymorphicJsonTypeInfoResolver 🤘🏻

riezebosch avatar Apr 20 '23 17:04 riezebosch