{"action":"created","issue":{"url":"https://api.github.com/repos/plone/plone.restapi/issues/71","repository_url":"https://api.github.com/repos/plone/plone.restapi","labels_url":"https://api.github.com/repos/plone/plone.restapi/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/plone/plone.restapi/issues/71/comments","events_url":"https://api.github.com/repos/plone/plone.restapi/issues/71/events","html_url":"https://github.com/plone/plone.restapi/pull/71","id":144270250,"number":71,"title":"Make summary representations customizable","user":{"login":"lukasgraf","id":405124,"avatar_url":"https://avatars.githubusercontent.com/u/405124?v=3","gravatar_id":"","url":"https://api.github.com/users/lukasgraf","html_url":"https://github.com/lukasgraf","followers_url":"https://api.github.com/users/lukasgraf/followers","following_url":"https://api.github.com/users/lukasgraf/following{/other_user}","gists_url":"https://api.github.com/users/lukasgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/lukasgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukasgraf/subscriptions","organizations_url":"https://api.github.com/users/lukasgraf/orgs","repos_url":"https://api.github.com/users/lukasgraf/repos","events_url":"https://api.github.com/users/lukasgraf/events{/privacy}","received_events_url":"https://api.github.com/users/lukasgraf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/plone/plone.restapi/labels/32%20needs:%20review","name":"32 needs: review","color":"00fafa"},{"url":"https://api.github.com/repos/plone/plone.restapi/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-29T13:48:20Z","updated_at":"2016-03-30T12:23:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/plone/plone.restapi/pulls/71","html_url":"https://github.com/plone/plone.restapi/pull/71","diff_url":"https://github.com/plone/plone.restapi/pull/71.diff","patch_url":"https://github.com/plone/plone.restapi/pull/71.patch"},"body":"This **unifies** the implementation for producing **summary representations** of objects, and makes it **customizable** by introducing an `ISerializeToJsonSummary` adapter (adapts `context` and `request`).\r\n\r\nIn addition to unifying the implementation (which doesn't change the behavior, pure refactoring), I also used the summary representation for serializing relation values - this means their representation now also includes `title` and `description` instead of just the URL.\r\n\r\nThe `ISerializeToJsonSummary` adapter is used to create representations in the following places:\r\n\r\n- Children of the Plone site root\r\n- Children of folderish AT objects\r\n- Children of folderish DX objects\r\n- Parent of AT objects\r\n- Parent of DX objects\r\n- Members of collections\r\n- Relation values\r\n\r\nOnce search is implemented, this will also be used for catalog brains.\r\n\r\nSupersedes #68"},"comment":{"url":"https://api.github.com/repos/plone/plone.restapi/issues/comments/203405340","html_url":"https://github.com/plone/plone.restapi/pull/71#issuecomment-203405340","issue_url":"https://api.github.com/repos/plone/plone.restapi/issues/71","id":203405340,"user":{"login":"lukasgraf","id":405124,"avatar_url":"https://avatars.githubusercontent.com/u/405124?v=3","gravatar_id":"","url":"https://api.github.com/users/lukasgraf","html_url":"https://github.com/lukasgraf","followers_url":"https://api.github.com/users/lukasgraf/followers","following_url":"https://api.github.com/users/lukasgraf/following{/other_user}","gists_url":"https://api.github.com/users/lukasgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/lukasgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukasgraf/subscriptions","organizations_url":"https://api.github.com/users/lukasgraf/orgs","repos_url":"https://api.github.com/users/lukasgraf/repos","events_url":"https://api.github.com/users/lukasgraf/events{/privacy}","received_events_url":"https://api.github.com/users/lukasgraf/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T12:23:17Z","updated_at":"2016-03-30T12:23:17Z","body":"@buchi correct - this is a more limited approach in order to keep it simple for now. Customizing the *listing* for a type right now would require to overwrite the serialization adapter.\r\n\r\nIn order to be able to customize the listing separately, we would need an adapter that sits in between serialization and the summary representation of a single object, like I attempted in #68 - however, such an adapter wouldn't do anything more than calling the `ISerializeToJsonSummary` adapter for each item in a sequence and build a list of results for now.\r\n\r\nBecause I currently didn't have a clear use case for that, but do for customizing summary representations on a global level (including `@type` for example), I left that out for now. But I'm happy to add in yet another level of indirection at a later point ;) Just wanted to have something with a clear scope that we can get merged quickly because I'll be needing this for my search PR (catalog brain summaries)."}}