FSharp.Json icon indicating copy to clipboard operation
FSharp.Json copied to clipboard

Is there any fundamental reason why standard .NET collections are not among supported types?

Open voroninp opened this issue 4 years ago • 2 comments

I tried to serilize result returned by C# code - that is List<T> - and got an exception that List is not supported. Just curioius why? =)

voroninp avatar Aug 22 '20 14:08 voroninp

Hi, some types I could support but keep in mind that competing with Newtonsoft was never a goal of this library. One of the complexities would be provide/not to provide null-safely depending on where type is coming from.

Could you please be more specific about List that you refer to. What is the full name of the class? From quick look at this it seems that List should be supported: https://github.com/vsapronov/FSharp.Json/blob/227a04799cf3216178dcafbc3297ac4b559f194e/FSharp.Json/Reflection.fs#L18-L19 Do you think you could code a little pure F# example where you create instance of List and getting the "not supported" error?

vsapronov avatar Aug 24 '20 19:08 vsapronov

Sorry, F# calls it ResizeArray that is System.Collections.Generic.List<T>

voroninp avatar Aug 24 '20 19:08 voroninp