diff --git a/openapi/index.json b/openapi/index.json index d2c5810c78..240944332c 100644 --- a/openapi/index.json +++ b/openapi/index.json @@ -42,6 +42,11 @@ "get": { "$ref": "operations/issues/list-for-repo.json" } + }, + "/repos/{owner}/{repo}/issues/{number}": { + "get": { + "$ref": "operations/issues/get.json" + } } } } diff --git a/openapi/operations/issues/get.json b/openapi/operations/issues/get.json new file mode 100644 index 0000000000..be9e07b698 --- /dev/null +++ b/openapi/operations/issues/get.json @@ -0,0 +1,44 @@ +{ + "summary": "Get a single issue", + "description": "**Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key.\n\nBe aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull request id, use the \"[List pull requests](https://developer.github.com/v3/pulls/#list-pull-requests)\" endpoint.", + "operationId": "get", + "tags": [ + "issues" + ], + "externalDocs": { + "description": "API method documentation", + "url": "https://developer.github.com/v3/issues/#get-a-single-issue" + }, + "parameters": [{ + "$ref": "../../parameters.json#/owner" + }, + { + "$ref": "../../parameters.json#/repo" + }, + { + "$ref": "../../parameters.json#/number" + } + ], + "x-code-samples": [ + { + "lang": "Shell", + "source": "curl https://api.github.com/repos/octocat/hello-world/issues/1" + }, + { + "lang": "JS", + "source": "client.issues.get({\n owner: 'octocat',\n repo: 'hello-world',\n number: 1\n})" + } + ], + "responses": { + "200": { + "description": "Issue", + "content": { + "application/json": { + "schema": { + "$ref": "../../schemas.json#/issue" + } + } + } + } + } +} diff --git a/openapi/operations/issues/list-for-repo.json b/openapi/operations/issues/list-for-repo.json index 0a98bf6041..7ff9391324 100644 --- a/openapi/operations/issues/list-for-repo.json +++ b/openapi/operations/issues/list-for-repo.json @@ -21,7 +21,6 @@ "schema": { "oneOf": [{ "type": "integer", - "format": "int32", "minimum": 1 }, { @@ -128,11 +127,7 @@ }, { "lang": "JS", - "source": "client.issues.getForRepo({\n owner: 'octokat',\n repo: 'hello-world'\n})" - }, - { - "lang": "JS (request)", - "source": "client.request('/repos/{owner}/{repo}/issues', {\n owner: 'octokat',\n repo: 'hello-world'\n})" + "source": "client.issues.getForRepo({\n owner: 'octocat',\n repo: 'hello-world'\n})" } ], "responses": { diff --git a/openapi/parameters.json b/openapi/parameters.json index 421ce6de30..6fa32bb1b2 100644 --- a/openapi/parameters.json +++ b/openapi/parameters.json @@ -17,12 +17,21 @@ "required": true, "description": "Repository name" }, + "number": { + "name": "number", + "in": "path", + "schema": { + "type": "integer", + "minimum": 1 + }, + "required": true, + "description": "Issue number" + }, "per_page": { "name": "per_page", "in": "query", "schema": { "type": "integer", - "format": "int32", "minimum": 1, "maximum": 100, "default": 30 @@ -34,7 +43,6 @@ "in": "query", "schema": { "type": "integer", - "format": "int32", "minimum": 1, "default": 1 }, diff --git a/openapi/schemas.json b/openapi/schemas.json index b2a3286e16..f3d9db389a 100644 --- a/openapi/schemas.json +++ b/openapi/schemas.json @@ -261,6 +261,9 @@ "format": "date-time", "nullable": true }, + "closed_by": { + "$ref": "#/user" + }, "created_at": { "type": "string", "format": "date-time"