diff options
Diffstat (limited to 'templates/swagger/v1_json.tmpl')
-rw-r--r-- | templates/swagger/v1_json.tmpl | 272 |
1 files changed, 201 insertions, 71 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 6eb53a3d70..aa31b3f078 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -2867,7 +2867,7 @@ } } }, - "/repos/{owner}/{repo}/commits/{ref}/statuses": { + "/repos/{owner}/{repo}/commits/{ref}/status": { "get": { "produces": [ "application/json" @@ -2901,14 +2901,101 @@ }, { "type": "integer", - "description": "page number of results", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/CombinedStatus" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/commits/{ref}/statuses": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a commit's statuses, by branch/tag/commit reference", + "operationId": "repoListStatusesByRef", + "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": "name of branch/tag/commit", + "name": "ref", + "in": "path", + "required": true + }, + { + "enum": [ + "oldest", + "recentupdate", + "leastupdate", + "leastindex", + "highestindex" + ], + "type": "string", + "description": "type of sort", + "name": "sort", + "in": "query" + }, + { + "enum": [ + "pending", + "success", + "error", + "failure", + "warning" + ], + "type": "string", + "description": "type of state", + "name": "state", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", "name": "page", "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" } ], "responses": { "200": { - "$ref": "#/responses/Status" + "$ref": "#/responses/CommitStatusList" }, "400": { "$ref": "#/responses/error" @@ -8462,7 +8549,7 @@ ], "responses": { "200": { - "$ref": "#/responses/StatusList" + "$ref": "#/responses/CommitStatusList" }, "400": { "$ref": "#/responses/error" @@ -8510,7 +8597,7 @@ ], "responses": { "201": { - "$ref": "#/responses/Status" + "$ref": "#/responses/CommitStatus" }, "400": { "$ref": "#/responses/error" @@ -11431,6 +11518,43 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "CombinedStatus": { + "description": "CombinedStatus holds the combined state of several statuses for a single commit", + "type": "object", + "properties": { + "commit_url": { + "type": "string", + "x-go-name": "CommitURL" + }, + "repository": { + "$ref": "#/definitions/Repository" + }, + "sha": { + "type": "string", + "x-go-name": "SHA" + }, + "state": { + "$ref": "#/definitions/CommitStatusState" + }, + "statuses": { + "type": "array", + "items": { + "$ref": "#/definitions/CommitStatus" + }, + "x-go-name": "Statuses" + }, + "total_count": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "Comment": { "description": "Comment represents a comment on a commit or issue", "type": "object", @@ -11558,6 +11682,55 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "CommitStatus": { + "description": "CommitStatus holds a single status of a single Commit", + "type": "object", + "properties": { + "context": { + "type": "string", + "x-go-name": "Context" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, + "creator": { + "$ref": "#/definitions/User" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "status": { + "$ref": "#/definitions/CommitStatusState" + }, + "target_url": { + "type": "string", + "x-go-name": "TargetURL" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CommitStatusState": { + "description": "CommitStatusState holds the state of a CommitStatus\nIt can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\"", + "type": "string", + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "CommitUser": { "type": "object", "title": "CommitUser contains information of a user in the context of a commit.", @@ -12341,7 +12514,7 @@ "x-go-package": "code.gitea.io/gitea/modules/structs" }, "CreateStatusOption": { - "description": "CreateStatusOption holds the information needed to create a new Status for a Commit", + "description": "CreateStatusOption holds the information needed to create a new CommitStatus for a Commit", "type": "object", "properties": { "context": { @@ -12353,7 +12526,7 @@ "x-go-name": "Description" }, "state": { - "$ref": "#/definitions/StatusState" + "$ref": "#/definitions/CommitStatusState" }, "target_url": { "type": "string", @@ -15251,55 +15424,6 @@ "type": "string", "x-go-package": "code.gitea.io/gitea/modules/structs" }, - "Status": { - "description": "Status holds a single Status of a single Commit", - "type": "object", - "properties": { - "context": { - "type": "string", - "x-go-name": "Context" - }, - "created_at": { - "type": "string", - "format": "date-time", - "x-go-name": "Created" - }, - "creator": { - "$ref": "#/definitions/User" - }, - "description": { - "type": "string", - "x-go-name": "Description" - }, - "id": { - "type": "integer", - "format": "int64", - "x-go-name": "ID" - }, - "status": { - "$ref": "#/definitions/StatusState" - }, - "target_url": { - "type": "string", - "x-go-name": "TargetURL" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "x-go-name": "Updated" - }, - "url": { - "type": "string", - "x-go-name": "URL" - } - }, - "x-go-package": "code.gitea.io/gitea/modules/structs" - }, - "StatusState": { - "description": "StatusState holds the state of a Status\nIt can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\"", - "type": "string", - "x-go-package": "code.gitea.io/gitea/modules/structs" - }, "StopWatch": { "description": "StopWatch represent a running stopwatch", "type": "object", @@ -15773,6 +15897,12 @@ } } }, + "CombinedStatus": { + "description": "CombinedStatus", + "schema": { + "$ref": "#/definitions/CombinedStatus" + } + }, "Comment": { "description": "Comment", "schema": { @@ -15829,6 +15959,21 @@ } } }, + "CommitStatus": { + "description": "CommitStatus", + "schema": { + "$ref": "#/definitions/CommitStatus" + } + }, + "CommitStatusList": { + "description": "CommitStatusList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/CommitStatus" + } + } + }, "ContentsListResponse": { "description": "ContentsListResponse", "schema": { @@ -16235,21 +16380,6 @@ "$ref": "#/definitions/ServerVersion" } }, - "Status": { - "description": "Status", - "schema": { - "$ref": "#/definitions/Status" - } - }, - "StatusList": { - "description": "StatusList", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Status" - } - } - }, "StopWatch": { "description": "StopWatch", "schema": { |