diff --git a/openapi/index.json b/openapi/index.json index 0d12decbf5..069b3c4545 100644 --- a/openapi/index.json +++ b/openapi/index.json @@ -53,6 +53,14 @@ "patch": { "$ref": "operations/issues/update.json" } + }, + "/repos/{owner}/{repo}/issues/{number}/lock": { + "put": { + "$ref": "operations/issues/lock.json" + }, + "delete": { + "$ref": "operations/issues/unlock.json" + } } } } diff --git a/openapi/operations/issues/lock.json b/openapi/operations/issues/lock.json new file mode 100644 index 0000000000..3f5616f2e8 --- /dev/null +++ b/openapi/operations/issues/lock.json @@ -0,0 +1,58 @@ +{ + "summary": "Lock an issue", + "description": "Users with push access can lock an issue or pull request's conversation.\n\nNote that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://developer.github.com/v3/#http-verbs).\"", + "operationId": "lock", + "tags": [ + "issues" + ], + "externalDocs": { + "description": "API method documentation", + "url": "https://developer.github.com/v3/issues/#lock-an-issue" + }, + "parameters": [{ + "$ref": "../../parameters.json#/owner" + }, + { + "$ref": "../../parameters.json#/repo" + }, + { + "$ref": "../../parameters.json#/number" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "lock_reason": { + "type": "string", + "enum": [ + "off-topic", + "too heated", + "resolved", + "spam" + ], + "description": "The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: \n\\* `off-topic` \n\\* `too heated` \n\\* `resolved` \n\\* `spam`" + } + } + } + } + } + }, + "x-code-samples": [ + { + "lang": "Shell", + "source": "curl -X PUT https://api.github.com/repos/octocat/hello-world/issues/1/lock" + }, + { + "lang": "JS", + "source": "client.issues.lock({\n owner: 'octocat',\n repo: 'hello-world',\n number: 1\n})" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } +} diff --git a/openapi/operations/issues/unlock.json b/openapi/operations/issues/unlock.json new file mode 100644 index 0000000000..b852f987a9 --- /dev/null +++ b/openapi/operations/issues/unlock.json @@ -0,0 +1,37 @@ +{ + "summary": "Unlock an issue", + "description": "Users with push access can unlock an issue's conversation.", + "operationId": "lock", + "tags": [ + "issues" + ], + "externalDocs": { + "description": "API method documentation", + "url": "https://developer.github.com/v3/issues/#unlock-an-issue" + }, + "parameters": [{ + "$ref": "../../parameters.json#/owner" + }, + { + "$ref": "../../parameters.json#/repo" + }, + { + "$ref": "../../parameters.json#/number" + } + ], + "x-code-samples": [ + { + "lang": "Shell", + "source": "curl -X DELETE https://api.github.com/repos/octocat/hello-world/issues/1/lock" + }, + { + "lang": "JS", + "source": "client.issues.unlock({\n owner: 'octocat',\n repo: 'hello-world',\n number: 1\n})" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } +}