From 9a12c8f2541b833bf2c70f7a42cb106f880d1e91 Mon Sep 17 00:00:00 2001 From: "Frederick [Bot]" Date: Sat, 11 Apr 2026 21:00:40 +0000 Subject: [PATCH] [skip ci] Updated swagger docs --- pkg/swagger/docs.go | 74 ++++++++++++++++++++++++++++++++++++++++ pkg/swagger/swagger.json | 74 ++++++++++++++++++++++++++++++++++++++++ pkg/swagger/swagger.yaml | 55 +++++++++++++++++++++++++++++ 3 files changed, 203 insertions(+) diff --git a/pkg/swagger/docs.go b/pkg/swagger/docs.go index 7546594b4..fd1c58c1e 100644 --- a/pkg/swagger/docs.go +++ b/pkg/swagger/docs.go @@ -3739,6 +3739,80 @@ const docTemplate = `{ } } }, + "/projects/{project}/tasks/by-index/{index}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a single task identified by its per-project index. Useful when resolving human-readable references like \"PROJ-42\" to a canonical task object. Note that task indexes are reassigned when a task is moved between projects, so long-lived references should use the returned task id instead.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get one task by its per-project index", + "parameters": [ + { + "type": "integer", + "description": "The project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The task's per-project index", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "If set to ` + "`" + `subtasks` + "`" + `, Vikunja will fetch only tasks which do not have subtasks and then in a second step, will fetch all of these subtasks. This may result in more tasks than the pagination limit being returned, but all subtasks will be present in the response. You can only set this to ` + "`" + `subtasks` + "`" + `.", + "name": "expand", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The task", + "schema": { + "$ref": "#/definitions/models.Task" + } + }, + "400": { + "description": "Invalid project ID or index", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the task", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Task not found", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, "/projects/{project}/views": { "get": { "security": [ diff --git a/pkg/swagger/swagger.json b/pkg/swagger/swagger.json index 234462352..a9446d293 100644 --- a/pkg/swagger/swagger.json +++ b/pkg/swagger/swagger.json @@ -3731,6 +3731,80 @@ } } }, + "/projects/{project}/tasks/by-index/{index}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a single task identified by its per-project index. Useful when resolving human-readable references like \"PROJ-42\" to a canonical task object. Note that task indexes are reassigned when a task is moved between projects, so long-lived references should use the returned task id instead.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get one task by its per-project index", + "parameters": [ + { + "type": "integer", + "description": "The project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The task's per-project index", + "name": "index", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "If set to `subtasks`, Vikunja will fetch only tasks which do not have subtasks and then in a second step, will fetch all of these subtasks. This may result in more tasks than the pagination limit being returned, but all subtasks will be present in the response. You can only set this to `subtasks`.", + "name": "expand", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The task", + "schema": { + "$ref": "#/definitions/models.Task" + } + }, + "400": { + "description": "Invalid project ID or index", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the task", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Task not found", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, "/projects/{project}/views": { "get": { "security": [ diff --git a/pkg/swagger/swagger.yaml b/pkg/swagger/swagger.yaml index 4ad3fdc47..cc8b40a4e 100644 --- a/pkg/swagger/swagger.yaml +++ b/pkg/swagger/swagger.yaml @@ -3970,6 +3970,61 @@ paths: summary: Get one link shares for a project tags: - sharing + /projects/{project}/tasks/by-index/{index}: + get: + consumes: + - application/json + description: Returns a single task identified by its per-project index. Useful + when resolving human-readable references like "PROJ-42" to a canonical task + object. Note that task indexes are reassigned when a task is moved between + projects, so long-lived references should use the returned task id instead. + parameters: + - description: The project ID + in: path + name: project + required: true + type: integer + - description: The task's per-project index + in: path + name: index + required: true + type: integer + - description: If set to `subtasks`, Vikunja will fetch only tasks which do + not have subtasks and then in a second step, will fetch all of these subtasks. + This may result in more tasks than the pagination limit being returned, + but all subtasks will be present in the response. You can only set this + to `subtasks`. + in: query + name: expand + type: string + produces: + - application/json + responses: + "200": + description: The task + schema: + $ref: '#/definitions/models.Task' + "400": + description: Invalid project ID or index + schema: + $ref: '#/definitions/web.HTTPError' + "403": + description: The user does not have access to the task + schema: + $ref: '#/definitions/web.HTTPError' + "404": + description: Task not found + schema: + $ref: '#/definitions/models.Message' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Get one task by its per-project index + tags: + - task /projects/{project}/views: get: consumes: