-
Notifications
You must be signed in to change notification settings - Fork 41
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
How to serialize a list to a Json object #77
Comments
Oh that's interesting! Sorry i've not got back to you sooner, I was away for the weekend, but that's an interesting question. I'll have to play around with it and have a think about that - but I'll try and get back to you soon 😄 |
Hi kolektiv & felixbecker, May I ask you here? Because I think I am doing something like this issue (not very sure), and my (useless / full of bug) method is e.g. At first I have a Monkey type, and I hope I could ## serialize IDictionary``2[int64, Monkey] Yeah, I guess this is easy to transform to a ## list ^_^
So I define a extension method like this:
But when I tried to serialize it with:
Fsi.exe complains:
Even I add this code, it still not work...
And I take a look at the source code:
But I couldn't understand this syntax... would you please give me some clue / url / doc for understand this syntax? (esp. ((^a or ^b) : (static member ToJson: ^a -> unit Json) a)) Thank you so much!! |
Hi, I got some workaround:
The result is:
|
Hi again, A refinement... no extension method required! (in the fact, extension method way caused another issues.)
|
Hi,
I have a question regarding a list serialization. Since I could not find any pointers in the tests or docs. I would be great if someone could point me in the right direction.
Given I have a type like this:
and a list of posts like this
this would results obviously in this
But how can I write a custom list serialization function that would produce something like this to an object graph:
Thanks for any help.
The text was updated successfully, but these errors were encountered: