{"action":"created","issue":{"url":"https://api.github.com/repos/codecutout/JsonApiSerializer/issues/53","repository_url":"https://api.github.com/repos/codecutout/JsonApiSerializer","labels_url":"https://api.github.com/repos/codecutout/JsonApiSerializer/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/codecutout/JsonApiSerializer/issues/53/comments","events_url":"https://api.github.com/repos/codecutout/JsonApiSerializer/issues/53/events","html_url":"https://github.com/codecutout/JsonApiSerializer/pull/53","id":312249235,"number":53,"title":"Serialization refactoring","user":{"login":"codecutout","id":4279588,"avatar_url":"https://avatars1.githubusercontent.com/u/4279588?v=4","gravatar_id":"","url":"https://api.github.com/users/codecutout","html_url":"https://github.com/codecutout","followers_url":"https://api.github.com/users/codecutout/followers","following_url":"https://api.github.com/users/codecutout/following{/other_user}","gists_url":"https://api.github.com/users/codecutout/gists{/gist_id}","starred_url":"https://api.github.com/users/codecutout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codecutout/subscriptions","organizations_url":"https://api.github.com/users/codecutout/orgs","repos_url":"https://api.github.com/users/codecutout/repos","events_url":"https://api.github.com/users/codecutout/events{/privacy}","received_events_url":"https://api.github.com/users/codecutout/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-04-07T22:35:08Z","updated_at":"2018-04-08T23:30:25Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/codecutout/JsonApiSerializer/pulls/53","html_url":"https://github.com/codecutout/JsonApiSerializer/pull/53","diff_url":"https://github.com/codecutout/JsonApiSerializer/pull/53.diff","patch_url":"https://github.com/codecutout/JsonApiSerializer/pull/53.patch"},"body":"Changes involved\r\n* Add `ResourceRelationshipConverter` to allow easier identification of relationships without any data\r\n* Significant clean up the `ResourceObjectConvertor` logic removing the dependency on probes.\r\n* Relationship/Attribute distinction is now done up front removing necessity of `JsonWriterCapture`\r\n* Add non generic `Relationship` to allow definition of relationship with data (e.g. only links)\r\n* Add checks that will throw an error if a explicitly defined relationship or document-root does not contain resource objects\r\n\r\nFeatures this allows\r\n* It is now possible to define dataless relationships. previously relationships had to have a null data now it is possible not to define one at all\r\n```csharp\r\n            var root = new Article\r\n            {\r\n                Id = \"1234\",\r\n                Title = \"My Article\",\r\n                Comments = new Relationship //new non-generic relationship\r\n                {\r\n                    //No Data property define and no value is serialized out\r\n                    Links = new Links\r\n                    {\r\n                        { \"related\", new Link {  Href = \"http://example.com/articles/1/comments\" } }\r\n                    }\r\n                }\r\n            };\r\n```\r\n* `object[]` type relationships can be serialized. Previously it was impossible to serialize an `object[]` as a relationship, you first needed to cast it into `SomeTypeWithAnId[]`, this made mixed type arrays difficult to serialize. Now as long as you specify the list in a relationship object it will attempt to serialize all objects as resource objects. Note that deserialization still requires `Type` information and will still be unable to deserialize `object` types\r\n```csharp\r\n            var article = new\r\n            {\r\n                Id = \"1234\",\r\n                Type = \"articles\",\r\n                Title = \"My Article\",\r\n                Comments = new\r\n                {\r\n                    Data = new object[] {\r\n                        new Comment() { Id = \"c1\", Body=\"Regular comment\" },\r\n                        new { Id = \"c2\", Type = \"moderator-comments\", Body=\"Special moderator comment\" },\r\n                   }\r\n                }\r\n            };\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/codecutout/JsonApiSerializer/issues/comments/379591493","html_url":"https://github.com/codecutout/JsonApiSerializer/pull/53#issuecomment-379591493","issue_url":"https://api.github.com/repos/codecutout/JsonApiSerializer/issues/53","id":379591493,"user":{"login":"jonnii","id":2197,"avatar_url":"https://avatars0.githubusercontent.com/u/2197?v=4","gravatar_id":"","url":"https://api.github.com/users/jonnii","html_url":"https://github.com/jonnii","followers_url":"https://api.github.com/users/jonnii/followers","following_url":"https://api.github.com/users/jonnii/following{/other_user}","gists_url":"https://api.github.com/users/jonnii/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnii/subscriptions","organizations_url":"https://api.github.com/users/jonnii/orgs","repos_url":"https://api.github.com/users/jonnii/repos","events_url":"https://api.github.com/users/jonnii/events{/privacy}","received_events_url":"https://api.github.com/users/jonnii/received_events","type":"User","site_admin":false},"created_at":"2018-04-08T23:30:25Z","updated_at":"2018-04-08T23:30:25Z","author_association":"CONTRIBUTOR","body":"@codecutout i think regardless lets merge this _as is_ and then we re-evaluate that decision if anyone else finds it surprising, but I'm ok with having to be specific about a document root in my applications. "}}
{"actor":{"display_login":"jonnii"}}