{"action":"opened","issue":{"url":"https://api.github.com/repos/xyncro/chiron/issues/77","repository_url":"https://api.github.com/repos/xyncro/chiron","labels_url":"https://api.github.com/repos/xyncro/chiron/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/xyncro/chiron/issues/77/comments","events_url":"https://api.github.com/repos/xyncro/chiron/issues/77/events","html_url":"https://github.com/xyncro/chiron/issues/77","id":177522604,"number":77,"title":"How to serialize a list to a Json object","user":{"login":"felixbecker","id":7237082,"avatar_url":"https://avatars.githubusercontent.com/u/7237082?v=3","gravatar_id":"","url":"https://api.github.com/users/felixbecker","html_url":"https://github.com/felixbecker","followers_url":"https://api.github.com/users/felixbecker/followers","following_url":"https://api.github.com/users/felixbecker/following{/other_user}","gists_url":"https://api.github.com/users/felixbecker/gists{/gist_id}","starred_url":"https://api.github.com/users/felixbecker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixbecker/subscriptions","organizations_url":"https://api.github.com/users/felixbecker/orgs","repos_url":"https://api.github.com/users/felixbecker/repos","events_url":"https://api.github.com/users/felixbecker/events{/privacy}","received_events_url":"https://api.github.com/users/felixbecker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-16T21:17:34Z","updated_at":"2016-09-16T21:17:34Z","closed_at":null,"body":"Hi,\r\n\r\nI 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.\r\n\r\nGiven I have a type like this: \r\n\r\n```\r\ntype Post = {\r\n    Id: Guid\r\n    Title: string\r\n    Body: string\r\n} with static member ToJson(x:Post) = json{\r\n        do! Json.write \"id\" x.Id\r\n        do! Json.write \"title\" x.Title\r\n        do! Json.write \"body\" x.Body\r\n}\r\n```\r\nand a list of posts like this\r\n```\r\n let post1 = {Id= Guid.NewGuid();Title=\"Title hello world post 1\";Body=\"My body\"}\r\n let post2 = {Id= Guid.NewGuid();Title=\"Title hello world post 2\";Body=\"My body\"}\r\n let listOfPosts = [post1;post2]\r\n\r\n    listOfPosts\r\n        |> Json.serialize\r\n        |> Json.formatWith JsonFormattingOptions.Pretty\r\n```\r\n\r\nthis would results obviously in this\r\n\r\n```\r\n\"[\r\n  {\r\n    \"body\": \"My body\",\r\n    \"id\": \"0356c901-e1fa-4bae-8fe3-70061d2e05f3\",\r\n    \"title\": \"Title hello world post 1\"\r\n  },\r\n  {\r\n    \"body\": \"My body\",\r\n    \"id\": \"292a275b-960e-46b4-b04b-c3e214c78b0d\",\r\n    \"title\": \"Title hello world post 2\"\r\n  }\r\n]\" \r\n```\r\n\r\nBut how can I write a custom list serialization function that would produce something like this to an object graph:\r\n\r\n```\r\n\"{\r\n  \"0356c901-e1fa-4bae-8fe3-70061d2e05f3\":{\r\n    \"body\": \"My body\",\r\n    \"title\": \"Title hello world post 1\"\r\n  },\r\n  \"292a275b-960e-46b4-b04b-c3e214c78b0d\":{\r\n    \"body\": \"My body\",\r\n    \"title\": \"Title hello world post 2\"\r\n  }\r\n}\"\r\n```\r\n\r\nThanks for any help."}}
{"actor":{"display_login":"felixbecker"}}