diff options
author | 6543 <6543@obermui.de> | 2019-12-27 21:30:58 +0100 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-12-27 20:30:58 +0000 |
commit | f2d03cda96eb5febbf9801f6b6cf5daa37220bc9 (patch) | |
tree | 8906922ca58d47634ec2b6237f00a87389dd8316 /templates/swagger | |
parent | 0bcf644da4c3d21fad3ce8f33ccc26f8110568d6 (diff) | |
download | gitea-f2d03cda96eb5febbf9801f6b6cf5daa37220bc9.tar.gz gitea-f2d03cda96eb5febbf9801f6b6cf5daa37220bc9.zip |
[API] Extend times API (#9200)
Extensively extend the times API.
close #8833; close #8513; close #8559
Diffstat (limited to 'templates/swagger')
-rw-r--r-- | templates/swagger/v1_json.tmpl | 323 |
1 files changed, 224 insertions, 99 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index c4fa1f3112..7f08b939cc 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -3242,105 +3242,6 @@ } } }, - "/repos/{owner}/{repo}/issues/{id}/times": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "issue" - ], - "summary": "List an issue's tracked times", - "operationId": "issueTrackedTimes", - "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": "integer", - "format": "int64", - "description": "index of the issue", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/TrackedTimeList" - }, - "404": { - "$ref": "#/responses/notFound" - } - } - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "issue" - ], - "summary": "Add a tracked time to a issue", - "operationId": "issueAddTime", - "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": "integer", - "format": "int64", - "description": "index of the issue to add tracked time to", - "name": "id", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/AddTimeOption" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/TrackedTime" - }, - "400": { - "$ref": "#/responses/error" - }, - "403": { - "$ref": "#/responses/forbidden" - } - } - } - }, "/repos/{owner}/{repo}/issues/{index}": { "get": { "produces": [ @@ -4425,6 +4326,211 @@ } } }, + "/repos/{owner}/{repo}/issues/{index}/times": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "List an issue's tracked times", + "operationId": "issueTrackedTimes", + "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": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/TrackedTimeList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Add tracked time to a issue", + "operationId": "issueAddTime", + "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": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/AddTimeOption" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/TrackedTime" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Reset a tracked time of an issue", + "operationId": "issueResetTime", + "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": "integer", + "format": "int64", + "description": "index of the issue to add tracked time to", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/times/{id}": { + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Delete specific tracked time", + "operationId": "issueDeleteTime", + "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": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "id of time to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/error" + } + } + } + }, "/repos/{owner}/{repo}/keys": { "get": { "produces": [ @@ -8047,11 +8153,21 @@ "time" ], "properties": { + "created": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, "time": { "description": "time in seconds", "type": "integer", "format": "int64", "x-go-name": "Time" + }, + "user_name": { + "description": "User who spent the time (optional)", + "type": "string", + "x-go-name": "User" } }, "x-go-package": "code.gitea.io/gitea/modules/structs" @@ -11283,7 +11399,11 @@ "format": "int64", "x-go-name": "ID" }, + "issue": { + "$ref": "#/definitions/Issue" + }, "issue_id": { + "description": "deprecated (only for backwards compatibility)", "type": "integer", "format": "int64", "x-go-name": "IssueID" @@ -11295,9 +11415,14 @@ "x-go-name": "Time" }, "user_id": { + "description": "deprecated (only for backwards compatibility)", "type": "integer", "format": "int64", "x-go-name": "UserID" + }, + "user_name": { + "type": "string", + "x-go-name": "UserName" } }, "x-go-package": "code.gitea.io/gitea/modules/structs" |