Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(NewtonsoftJson): Unions backstop #96

Open
bartelink opened this issue Apr 28, 2023 · 0 comments
Open

feat(NewtonsoftJson): Unions backstop #96

bartelink opened this issue Apr 28, 2023 · 0 comments

Comments

@bartelink
Copy link
Collaborator

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)

@bartelink bartelink changed the title Feature: NewtonsoftJson Unions backstop feat (NewtonsoftJson): Unions backstop Aug 8, 2023
@bartelink bartelink changed the title feat (NewtonsoftJson): Unions backstop feat(NewtonsoftJson): Unions backstop Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant