fsprojects / FSharp.Json

F# JSON Reflection based serialization library
Apache License 2.0
222 stars 26 forks source link

Improve union case serialization & added tests #29

Open realvictorprm opened 4 years ago

realvictorprm commented 4 years ago

I prefer this way of serialization of union cases. It's well usable from other languages like C#.

realvictorprm commented 4 years ago

The major change in here is that union cases are now serialized as objects with fields. This can be done because the tuple of a union case can contain field names and if they don't contain a field name it is always there because the compiler autogenerates these.

vsapronov commented 4 years ago

I will consider this change. Though it's a breaking change (and not a breaking bugfix) to current logic. So such change in logic should be either under config flag or introduced in major release.

realvictorprm commented 4 years ago

I did this minimal change during company time. I'm not using it anymore there but I'm willing to polish it in my private time, however this will take some time