System.Text.son currently throws a clear exception if you ask it to serialize a F# DU (which IMO is the correct behavior)
NSJ instead uses its quirky encoding; I've seen many get bitten by it
Would happily take a PR that gives FsCodec.NewtonsoftJson the same failsafe behavior as STJ out of the box
The fast follow would be to port the auto* options from the STJ side, i.e. implement a UnionOrTypeSafeEnumConverterFactory to switch (see https://github.com/jet/FsCodec/blob/master/tests/FsCodec.SystemTextJson.Tests/AutoUnionTests.fs for the behavior, see #116)
System.Text.son currently throws a clear exception if you ask it to serialize a F# DU (which IMO is the correct behavior)
NSJ instead uses its quirky encoding; I've seen many get bitten by it
Would happily take a PR that gives FsCodec.NewtonsoftJson the same failsafe behavior as STJ out of the box
The fast follow would be to port the auto* options from the STJ side, i.e. implement a UnionOrTypeSafeEnumConverterFactory to switch (see https://github.com/jet/FsCodec/blob/master/tests/FsCodec.SystemTextJson.Tests/AutoUnionTests.fs for the behavior, see #116)