{"action":"opened","issue":{"url":"https://api.github.com/repos/octokit/routes/issues/280","repository_url":"https://api.github.com/repos/octokit/routes","labels_url":"https://api.github.com/repos/octokit/routes/issues/280/labels{/name}","comments_url":"https://api.github.com/repos/octokit/routes/issues/280/comments","events_url":"https://api.github.com/repos/octokit/routes/issues/280/events","html_url":"https://github.com/octokit/routes/issues/280","id":368459587,"node_id":"MDU6SXNzdWUzNjg0NTk1ODc=","number":280,"title":"Add parameter for endpoints that expect input to be sent in body root","user":{"login":"gr2m","id":39992,"node_id":"MDQ6VXNlcjM5OTky","avatar_url":"https://avatars3.githubusercontent.com/u/39992?v=4","gravatar_id":"","url":"https://api.github.com/users/gr2m","html_url":"https://github.com/gr2m","followers_url":"https://api.github.com/users/gr2m/followers","following_url":"https://api.github.com/users/gr2m/following{/other_user}","gists_url":"https://api.github.com/users/gr2m/gists{/gist_id}","starred_url":"https://api.github.com/users/gr2m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gr2m/subscriptions","organizations_url":"https://api.github.com/users/gr2m/orgs","repos_url":"https://api.github.com/users/gr2m/repos","events_url":"https://api.github.com/users/gr2m/events{/privacy}","received_events_url":"https://api.github.com/users/gr2m/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"gr2m","id":39992,"node_id":"MDQ6VXNlcjM5OTky","avatar_url":"https://avatars3.githubusercontent.com/u/39992?v=4","gravatar_id":"","url":"https://api.github.com/users/gr2m","html_url":"https://github.com/gr2m","followers_url":"https://api.github.com/users/gr2m/followers","following_url":"https://api.github.com/users/gr2m/following{/other_user}","gists_url":"https://api.github.com/users/gr2m/gists{/gist_id}","starred_url":"https://api.github.com/users/gr2m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gr2m/subscriptions","organizations_url":"https://api.github.com/users/gr2m/orgs","repos_url":"https://api.github.com/users/gr2m/repos","events_url":"https://api.github.com/users/gr2m/events{/privacy}","received_events_url":"https://api.github.com/users/gr2m/received_events","type":"User","site_admin":false},"assignees":[{"login":"gr2m","id":39992,"node_id":"MDQ6VXNlcjM5OTky","avatar_url":"https://avatars3.githubusercontent.com/u/39992?v=4","gravatar_id":"","url":"https://api.github.com/users/gr2m","html_url":"https://github.com/gr2m","followers_url":"https://api.github.com/users/gr2m/followers","following_url":"https://api.github.com/users/gr2m/following{/other_user}","gists_url":"https://api.github.com/users/gr2m/gists{/gist_id}","starred_url":"https://api.github.com/users/gr2m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gr2m/subscriptions","organizations_url":"https://api.github.com/users/gr2m/orgs","repos_url":"https://api.github.com/users/gr2m/repos","events_url":"https://api.github.com/users/gr2m/events{/privacy}","received_events_url":"https://api.github.com/users/gr2m/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-10-10T01:33:35Z","updated_at":"2018-10-10T01:33:35Z","closed_at":null,"author_association":"COLLABORATOR","body":"For example, the [Add labels to an issue](https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue) endpoint expects an array to be sent in the root of the request body\r\n\r\n```json\r\n[\r\n  \"Label1\",\r\n  \"Label2\"\r\n]\r\n```\r\n\r\nThat is not coherent with most of the other endpoints, so the API team is currently looking into accept a namespace parameter as well (without introducing a breaking change of the API). That would turn above request body example into\r\n\r\n```json\r\n{\r\n  \"labels\": [\r\n    \"Label1\",\r\n    \"Label2\"\r\n  ]\r\n}\r\n```\r\n\r\nThat way the `labels` parameter can be described in a Parameters table like in most of the other endpoints that accept query or input parameters. It also allows the Octokit libraries to accept a named parameter. \r\n\r\n```js\r\n// with labels parameter\r\noctokit.issues.addLabels({owner, repo, number, labels})\r\n// without labels parameter\r\noctokit.issues.addLabels({owner, repo, number, input})\r\n```\r\n\r\nInstead of having the Octokit Libraries such as [octokit/rest](https://github.com/octokit/rest.js) keeping track of mapping parameter names ([example](https://github.com/octokit/rest.js/blob/89ab4854279f68033b077cd10fe3430dcd033df7/lib/routes.json#L2783-L2787)), it would make more sense to keep track of them in here in octokit/routes until they become obsolete.\r\n\r\n### Endpoints that expect data to be sent in the root\r\n\r\n- [ ] https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue\r\n- [ ] https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue\r\n- [ ] https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode\r\n- [ ] https://developer.github.com/v3/repos/branches/#replace-required-status-checks-contexts-of-protected-branch\r\n- [ ] https://developer.github.com/v3/repos/branches/#add-required-status-checks-contexts-of-protected-branch\r\n- [ ] https://developer.github.com/v3/repos/branches/#remove-required-status-checks-contexts-of-protected-branch\r\n- [ ] https://developer.github.com/v3/repos/branches/#replace-team-restrictions-of-protected-branch\r\n- [ ] https://developer.github.com/v3/repos/branches/#add-team-restrictions-of-protected-branch\r\n- [ ] https://developer.github.com/v3/repos/branches/#remove-team-restrictions-of-protected-branch\r\n- [ ] https://developer.github.com/v3/repos/branches/#replace-user-restrictions-of-protected-branch\r\n- [ ] https://developer.github.com/v3/repos/branches/#add-user-restrictions-of-protected-branch\r\n- [ ] https://developer.github.com/v3/repos/branches/#remove-user-restrictions-of-protected-branch\r\n- [ ] https://developer.github.com/v3/repos/releases/#upload-a-release-asset\r\n- [ ] https://developer.github.com/v3/users/emails/#add-email-addresses\r\n- [ ] https://developer.github.com/v3/users/emails/#delete-email-addresses\r\n"}}
{"actor":{"display_login":"gr2m"}}