Skip to content

feat(NewtonsoftJson): Unions backstop #96

@bartelink

Description

@bartelink

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions