From 792bf88dcf973548069026d3eca6b50426a1f6f9 Mon Sep 17 00:00:00 2001 From: "Frederick [Bot]" Date: Tue, 12 Mar 2024 19:47:16 +0000 Subject: [PATCH] [skip ci] Updated swagger docs --- pkg/swagger/docs.go | 31 +++++++++++-- pkg/swagger/swagger.json | 26 ++++++++++- pkg/swagger/swagger.yaml | 97 +++++++++++++++++++++++----------------- 3 files changed, 106 insertions(+), 48 deletions(-) diff --git a/pkg/swagger/docs.go b/pkg/swagger/docs.go index 9f805a3e9..a27794f94 100644 --- a/pkg/swagger/docs.go +++ b/pkg/swagger/docs.go @@ -1,5 +1,4 @@ -// Code generated by swaggo/swag. DO NOT EDIT. - +// Package swagger Code generated by swaggo/swag. DO NOT EDIT package swagger import "github.com/swaggo/swag" @@ -7107,6 +7106,7 @@ const docTemplate = `{ "JWTKeyAuth": [] } ], + "description": "Add a reaction to an entity. Will do nothing if the reaction already exists.", "consumes": [ "application/json" ], @@ -7162,8 +7162,10 @@ const docTemplate = `{ } } } - }, - "delete": { + } + }, + "/{kind}/{id}/reactions/delete": { + "post": { "security": [ { "JWTKeyAuth": [] @@ -7591,6 +7593,14 @@ const docTemplate = `{ "description": "The project this task belongs to.", "type": "integer" }, + "reactions": { + "description": "Reactions on that task.", + "allOf": [ + { + "$ref": "#/definitions/models.ReactionMap" + } + ] + }, "related_tasks": { "description": "All related tasks, grouped by their relation kind", "allOf": [ @@ -8239,6 +8249,14 @@ const docTemplate = `{ "description": "The project this task belongs to.", "type": "integer" }, + "reactions": { + "description": "Reactions on that task.", + "allOf": [ + { + "$ref": "#/definitions/models.ReactionMap" + } + ] + }, "related_tasks": { "description": "All related tasks, grouped by their relation kind", "allOf": [ @@ -8362,6 +8380,9 @@ const docTemplate = `{ "id": { "type": "integer" }, + "reactions": { + "$ref": "#/definitions/models.ReactionMap" + }, "updated": { "type": "string" } @@ -9190,6 +9211,8 @@ var SwaggerInfo = &swag.Spec{ Description: "# Pagination\nEvery endpoint capable of pagination will return two headers:\n* `x-pagination-total-pages`: The total number of available pages for this request\n* `x-pagination-result-count`: The number of items returned for this request.\n# Rights\nAll endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`.\nThis can be used to show or hide ui elements based on the rights the user has.\n# Errors\nAll errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code.\nDue to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes.\n# Authorization\n**JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully.\n\n**API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation.\n\n**BasicAuth:** Only used when requesting tasks via CalDAV.\n", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", } func init() { diff --git a/pkg/swagger/swagger.json b/pkg/swagger/swagger.json index b8624844f..d5d89a40b 100644 --- a/pkg/swagger/swagger.json +++ b/pkg/swagger/swagger.json @@ -7098,6 +7098,7 @@ "JWTKeyAuth": [] } ], + "description": "Add a reaction to an entity. Will do nothing if the reaction already exists.", "consumes": [ "application/json" ], @@ -7153,8 +7154,10 @@ } } } - }, - "delete": { + } + }, + "/{kind}/{id}/reactions/delete": { + "post": { "security": [ { "JWTKeyAuth": [] @@ -7582,6 +7585,14 @@ "description": "The project this task belongs to.", "type": "integer" }, + "reactions": { + "description": "Reactions on that task.", + "allOf": [ + { + "$ref": "#/definitions/models.ReactionMap" + } + ] + }, "related_tasks": { "description": "All related tasks, grouped by their relation kind", "allOf": [ @@ -8230,6 +8241,14 @@ "description": "The project this task belongs to.", "type": "integer" }, + "reactions": { + "description": "Reactions on that task.", + "allOf": [ + { + "$ref": "#/definitions/models.ReactionMap" + } + ] + }, "related_tasks": { "description": "All related tasks, grouped by their relation kind", "allOf": [ @@ -8353,6 +8372,9 @@ "id": { "type": "integer" }, + "reactions": { + "$ref": "#/definitions/models.ReactionMap" + }, "updated": { "type": "string" } diff --git a/pkg/swagger/swagger.yaml b/pkg/swagger/swagger.yaml index 1accd27a6..9a9f34822 100644 --- a/pkg/swagger/swagger.yaml +++ b/pkg/swagger/swagger.yaml @@ -237,6 +237,10 @@ definitions: project_id: description: The project this task belongs to. type: integer + reactions: + allOf: + - $ref: '#/definitions/models.ReactionMap' + description: Reactions on that task. related_tasks: allOf: - $ref: '#/definitions/models.RelatedTaskMap' @@ -743,6 +747,10 @@ definitions: project_id: description: The project this task belongs to. type: integer + reactions: + allOf: + - $ref: '#/definitions/models.ReactionMap' + description: Reactions on that task. related_tasks: allOf: - $ref: '#/definitions/models.RelatedTaskMap' @@ -834,6 +842,8 @@ definitions: type: string id: type: integer + reactions: + $ref: '#/definitions/models.ReactionMap' updated: type: string type: object @@ -1461,48 +1471,6 @@ info: title: Vikunja API paths: /{kind}/{id}/reactions: - delete: - consumes: - - application/json - description: Removes the reaction of that user on that entity. - parameters: - - description: Entity ID - in: path - name: id - required: true - type: integer - - description: The kind of the entity. Can be either `tasks` or `comments` for - task comments - in: path - name: kind - required: true - type: integer - - description: The reaction you want to add to the entity. - in: body - name: project - required: true - schema: - $ref: '#/definitions/models.Reaction' - produces: - - application/json - responses: - "200": - description: The reaction was successfully removed. - schema: - $ref: '#/definitions/models.Message' - "403": - description: The user does not have access to the entity - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Removes the user's reaction - tags: - - task get: consumes: - application/json @@ -1544,6 +1512,8 @@ paths: put: consumes: - application/json + description: Add a reaction to an entity. Will do nothing if the reaction already + exists. parameters: - description: Entity ID in: path @@ -1582,6 +1552,49 @@ paths: summary: Add a reaction to an entity tags: - task + /{kind}/{id}/reactions/delete: + post: + consumes: + - application/json + description: Removes the reaction of that user on that entity. + parameters: + - description: Entity ID + in: path + name: id + required: true + type: integer + - description: The kind of the entity. Can be either `tasks` or `comments` for + task comments + in: path + name: kind + required: true + type: integer + - description: The reaction you want to add to the entity. + in: body + name: project + required: true + schema: + $ref: '#/definitions/models.Reaction' + produces: + - application/json + responses: + "200": + description: The reaction was successfully removed. + schema: + $ref: '#/definitions/models.Message' + "403": + description: The user does not have access to the entity + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Removes the user's reaction + tags: + - task /{username}/avatar: get: description: Returns the user avatar as image.