{"action":"created","issue":{"url":"https://api.github.com/repos/plone/plone.restapi/issues/462","repository_url":"https://api.github.com/repos/plone/plone.restapi","labels_url":"https://api.github.com/repos/plone/plone.restapi/issues/462/labels{/name}","comments_url":"https://api.github.com/repos/plone/plone.restapi/issues/462/comments","events_url":"https://api.github.com/repos/plone/plone.restapi/issues/462/events","html_url":"https://github.com/plone/plone.restapi/issues/462","id":281297528,"number":462,"title":"\"related_items\" attribute in GET response does not follow our best practices","user":{"login":"tisto","id":632105,"avatar_url":"https://avatars0.githubusercontent.com/u/632105?v=4","gravatar_id":"","url":"https://api.github.com/users/tisto","html_url":"https://github.com/tisto","followers_url":"https://api.github.com/users/tisto/followers","following_url":"https://api.github.com/users/tisto/following{/other_user}","gists_url":"https://api.github.com/users/tisto/gists{/gist_id}","starred_url":"https://api.github.com/users/tisto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tisto/subscriptions","organizations_url":"https://api.github.com/users/tisto/orgs","repos_url":"https://api.github.com/users/tisto/repos","events_url":"https://api.github.com/users/tisto/events{/privacy}","received_events_url":"https://api.github.com/users/tisto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/plone/plone.restapi/milestones/14","html_url":"https://github.com/plone/plone.restapi/milestone/14","labels_url":"https://api.github.com/repos/plone/plone.restapi/milestones/14/labels","id":2464721,"number":14,"title":"1.0b1","description":"","creator":{"login":"tisto","id":632105,"avatar_url":"https://avatars0.githubusercontent.com/u/632105?v=4","gravatar_id":"","url":"https://api.github.com/users/tisto","html_url":"https://github.com/tisto","followers_url":"https://api.github.com/users/tisto/followers","following_url":"https://api.github.com/users/tisto/following{/other_user}","gists_url":"https://api.github.com/users/tisto/gists{/gist_id}","starred_url":"https://api.github.com/users/tisto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tisto/subscriptions","organizations_url":"https://api.github.com/users/tisto/orgs","repos_url":"https://api.github.com/users/tisto/repos","events_url":"https://api.github.com/users/tisto/events{/privacy}","received_events_url":"https://api.github.com/users/tisto/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":8,"state":"open","created_at":"2017-04-18T18:04:27Z","updated_at":"2017-12-12T08:31:25Z","due_on":"2017-11-30T08:00:00Z","closed_at":null},"comments":0,"created_at":"2017-12-12T08:30:02Z","updated_at":"2017-12-12T08:52:14Z","closed_at":null,"author_association":"OWNER","body":"If you add related items to a Plone page (e.g. the front-page), this is what plone.restapi currently returns:\r\n\r\nGET http://localhost:8080/Plone/front-page\r\n  ```\r\n   \"relatedItems\": [\r\n        \"http://localhost:8080/Plone/news\",\r\n        \"http://localhost:8080/Plone/events\"\r\n    ],\r\n```\r\n\r\nThis response does not include any hypermedia links, does not follow the JSON-LD convention and does not include the title of the related items.\r\n\r\nThis is how the response should look like:\r\n\r\n ```\r\n   \"relatedItems\": [\r\n        {\r\n            \"@id\": \"http://localhost:8080/Plone/news\",\r\n            \"title\": \"News\"\r\n        },\r\n        {\r\n            \"@id\": \"http://localhost:8080/Plone/events\",\r\n            \"title\": \"Events\"\r\n        }\r\n    ],\r\n```\r\n\r\nIn the future, we might even make this attribute expandable. Though, this would require a refactoring of our expansion mechanism.\r\n"},"comment":{"url":"https://api.github.com/repos/plone/plone.restapi/issues/comments/350985350","html_url":"https://github.com/plone/plone.restapi/issues/462#issuecomment-350985350","issue_url":"https://api.github.com/repos/plone/plone.restapi/issues/462","id":350985350,"user":{"login":"tisto","id":632105,"avatar_url":"https://avatars0.githubusercontent.com/u/632105?v=4","gravatar_id":"","url":"https://api.github.com/users/tisto","html_url":"https://github.com/tisto","followers_url":"https://api.github.com/users/tisto/followers","following_url":"https://api.github.com/users/tisto/following{/other_user}","gists_url":"https://api.github.com/users/tisto/gists{/gist_id}","starred_url":"https://api.github.com/users/tisto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tisto/subscriptions","organizations_url":"https://api.github.com/users/tisto/orgs","repos_url":"https://api.github.com/users/tisto/repos","events_url":"https://api.github.com/users/tisto/events{/privacy}","received_events_url":"https://api.github.com/users/tisto/received_events","type":"User","site_admin":false},"created_at":"2017-12-12T08:52:14Z","updated_at":"2017-12-12T08:52:14Z","author_association":"OWNER","body":"We have a relation choice and relation list test:\r\n\r\nhttps://github.com/plone/plone.restapi/blob/master/src/plone/restapi/tests/test_dxfield_serializer.py#L293\r\n\r\nI wonder why this isn't used. The relation field in Dexterity is indeed a relation list:\r\n\r\nhttps://github.com/plone/plone.app.relationfield/blob/570395ae611aa34f91992bfd8ed90aae7ca5d9d5/plone/app/relationfield/behavior.py#L18\r\n\r\nAny insights @buchi @lukasgraf ?"}}
{"actor":{"display_login":"tisto"}}