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

LanguageExt.Fin fails to serialise using Newtonsoft.Json #1230

Open
davesmith9088 opened this issue Jul 11, 2023 · 0 comments
Open

LanguageExt.Fin fails to serialise using Newtonsoft.Json #1230

davesmith9088 opened this issue Jul 11, 2023 · 0 comments

Comments

@davesmith9088
Copy link

I originally ran into this when using LanguageExt.Fin with Echo.Process. The type fails to serialise, the following code reproduces the problem:

using LanguageExt;
using Newtonsoft.Json;

var finVal = Fin<string>.Succ("hello");
var json = JsonConvert.SerializeObject(finVal);

The exception thrown is:

Newtonsoft.Json.JsonSerializationException: 'Self referencing loop detected with type 'LanguageExt.Fin1[System.String]'. Path ''.'`

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