[API] Get a single commit via Ref (#10915)

* GET /repos/:owner/:repo/commits/:ref

* add Validation Checks

* Fix & Extend TEST

* add two new tast cases
This commit is contained in:
6543 2020-04-08 04:54:46 +02:00 committed by GitHub
parent 71979d9663
commit 3d63caa542
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 172 additions and 33 deletions

View file

@ -2511,6 +2511,52 @@
}
}
},
"/repos/{owner}/{repo}/commits/{ref}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"repository"
],
"summary": "Get a single commit from a repository",
"operationId": "repoGetSingleCommitByRef",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "a git ref",
"name": "ref",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/Commit"
},
"404": {
"$ref": "#/responses/notFound"
},
"422": {
"$ref": "#/responses/validationError"
}
}
}
},
"/repos/{owner}/{repo}/commits/{ref}/statuses": {
"get": {
"produces": [
@ -2976,7 +3022,7 @@
"repository"
],
"summary": "Get a single commit from a repository",
"operationId": "repoGetSingleCommit",
"operationId": "repoGetSingleCommitBySHA",
"parameters": [
{
"type": "string",
@ -3006,6 +3052,9 @@
},
"404": {
"$ref": "#/responses/notFound"
},
"422": {
"$ref": "#/responses/validationError"
}
}
}