{"action":"created","issue":{"url":"https://api.github.com/repos/Scalr/scalr-apiv2-mockups/issues/4","labels_url":"https://api.github.com/repos/Scalr/scalr-apiv2-mockups/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/Scalr/scalr-apiv2-mockups/issues/4/comments","events_url":"https://api.github.com/repos/Scalr/scalr-apiv2-mockups/issues/4/events","html_url":"https://github.com/Scalr/scalr-apiv2-mockups/pull/4","id":65408630,"number":4,"title":"Related collections v2","user":{"login":"krallin","id":1737686,"avatar_url":"https://avatars.githubusercontent.com/u/1737686?v=3","gravatar_id":"","url":"https://api.github.com/users/krallin","html_url":"https://github.com/krallin","followers_url":"https://api.github.com/users/krallin/followers","following_url":"https://api.github.com/users/krallin/following{/other_user}","gists_url":"https://api.github.com/users/krallin/gists{/gist_id}","starred_url":"https://api.github.com/users/krallin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krallin/subscriptions","organizations_url":"https://api.github.com/users/krallin/orgs","repos_url":"https://api.github.com/users/krallin/repos","events_url":"https://api.github.com/users/krallin/events{/privacy}","received_events_url":"https://api.github.com/users/krallin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-31T09:32:27Z","updated_at":"2015-03-31T12:19:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Scalr/scalr-apiv2-mockups/pulls/4","html_url":"https://github.com/Scalr/scalr-apiv2-mockups/pull/4","diff_url":"https://github.com/Scalr/scalr-apiv2-mockups/pull/4.diff","patch_url":"https://github.com/Scalr/scalr-apiv2-mockups/pull/4.patch"},"body":"@DicsyDel, @recipe,\r\n\r\nPlease see the changes to `swagger.yaml` (note that I have also included the resulting auto-generated `swagger-complete.yaml` file so you can copy and paste that one into the swagger editor).\r\n\r\nThe main change here is that we no longer add Images directly to a Role, but instead have an intermediary `RoleImage` object (which probably better reflects the underlying M2M relation), as was discussed in the spec and seemed to be a point of contention. \r\n\r\nWhile this makes more sense in practice (Images have their own dedicated endpoint, so they shouldn't have an endpoint below Roles as well), one concern is that without nesting the information returned by `/roles/{roleId}/images/` isn't very useful (i.e. you still have to make one call per Image to figure out what's in it). \r\n\r\nOne other thing to keep in mind here is that while the spec recommends not passing the `role` when adding a `RoleImage` to a `Role`, we can't really make that apparent in the mockup.\r\n\r\n--\r\n\r\nAlso, do you want me to continue using the `...ForeignKey` objects, which are basically denatured version of the original objects (only the `\"id\"` field is kept). \r\n\r\nThose were added to avoid confusion about needing to pass a full or return object when only the ID was needed, but on the other hand if we attempt to auto-generate a client, they will become a problem."},"comment":{"url":"https://api.github.com/repos/Scalr/scalr-apiv2-mockups/issues/comments/88064768","html_url":"https://github.com/Scalr/scalr-apiv2-mockups/pull/4#issuecomment-88064768","issue_url":"https://api.github.com/repos/Scalr/scalr-apiv2-mockups/issues/4","id":88064768,"user":{"login":"krallin","id":1737686,"avatar_url":"https://avatars.githubusercontent.com/u/1737686?v=3","gravatar_id":"","url":"https://api.github.com/users/krallin","html_url":"https://github.com/krallin","followers_url":"https://api.github.com/users/krallin/followers","following_url":"https://api.github.com/users/krallin/following{/other_user}","gists_url":"https://api.github.com/users/krallin/gists{/gist_id}","starred_url":"https://api.github.com/users/krallin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krallin/subscriptions","organizations_url":"https://api.github.com/users/krallin/orgs","repos_url":"https://api.github.com/users/krallin/repos","events_url":"https://api.github.com/users/krallin/events{/privacy}","received_events_url":"https://api.github.com/users/krallin/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T12:19:46Z","updated_at":"2015-03-31T12:19:46Z","body":"@recipe ,\r\n\r\nIf we POST to `/roles/{roleId}/images/`, would it make sense to let the user skip the `role` field? They've already provided it in the URL.\r\n\r\nIf we don't want to do this just now, this is something we can add afterwards. Let's just keep in mind that this will show in a variety of other places (e.g. Farm Roles, Script Versions, etc.), so we'll have to be consistent.\r\n\r\nCheers, "}}