Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Commit

Permalink
WIP: lock/unlock issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Jun 20, 2018
1 parent 9a5d214 commit 862beb8
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
8 changes: 8 additions & 0 deletions openapi/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}
58 changes: 58 additions & 0 deletions openapi/operations/issues/lock.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
37 changes: 37 additions & 0 deletions openapi/operations/issues/unlock.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}

0 comments on commit 862beb8

Please sign in to comment.