api/pkg/swagger/docs.go

9175 lines
340 KiB
Go
Raw Permalink Normal View History

// Package swagger GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
2020-06-28 16:25:46 +02:00
// This file was generated by swaggo/swag
2019-02-17 19:53:04 +00:00
package swagger
import (
"bytes"
2019-10-16 20:52:29 +00:00
"encoding/json"
"strings"
"text/template"
"github.com/swaggo/swag"
)
var doc = `{
2019-10-16 20:52:29 +00:00
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
2019-10-16 20:52:29 +00:00
"title": "{{.Title}}",
2019-01-03 22:22:06 +00:00
"contact": {
"name": "General Vikunja contact",
"url": "http://vikunja.io/en/contact/",
"email": "hello@vikunja.io"
},
"license": {
2019-01-03 22:22:06 +00:00
"name": "GPLv3",
"url": "http://code.vikunja.io/api/src/branch/master/LICENSE"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
2019-10-16 20:52:29 +00:00
"basePath": "{{.BasePath}}",
"paths": {
"/auth/openid/{provider}/callback": {
"post": {
"security": [
{
"JWTKeyAuth": []
}
],
"description": "After a redirect from the OpenID Connect provider to the frontend has been made with the authentication ` + "`" + `code` + "`" + `, this endpoint can be used to obtain a jwt token for that user and thus log them in.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Authenticate a user with OpenID Connect",
"parameters": [
{
"description": "The openid callback",
"name": "callback",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/openid.Callback"
}
},
{
"type": "integer",
"description": "The OpenID Connect provider key as returned by the /info endpoint",
"name": "provider",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/auth.Token"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
2020-06-28 16:25:46 +02:00
"/backgrounds/unsplash/image/{image}": {
"get": {
"security": [
{
"JWTKeyAuth": []
}
],
"description": "Get an unsplash image. **Returns json on error.**",
"produces": [
"application/octet-stream"
],
"tags": [
"list"
],
"summary": "Get an unsplash image",
"parameters": [
{
"type": "integer",
"description": "Unsplash Image ID",
"name": "thumb",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The image",
"schema": {
"type": ""
}
},
"404": {
"description": "The image does not exist.",
"schema": {
"$ref": "#/definitions/models.Message"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/backgrounds/unsplash/image/{image}/thumb": {
"get": {
"security": [
{
"JWTKeyAuth": []
}
],
"description": "Get an unsplash thumbnail image. The thumbnail is cropped to a max width of 200px. **Returns json on error.**",
"produces": [
"application/octet-stream"
],
"tags": [
"list"
],
"summary": "Get an unsplash thumbnail image",
"parameters": [
{
"type": "integer",
"description": "Unsplash Image ID",
"name": "thumb",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The thumbnail",
"schema": {
"type": ""
}
},
"404": {
"description": "The image does not exist.",
"schema": {
"$ref": "#/definitions/models.Message"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/backgrounds/unsplash/search": {
"get": {
"security": [
{
"JWTKeyAuth": []
}
],
"description": "Search for a list background from unsplash",
"produces": [
"application/json"
],
"tags": [
"list"
],
"summary": "Search for a background from unsplash",
"parameters": [
{
"type": "string",
"description": "Search backgrounds from unsplash with this search term.",
"name": "s",
"in": "query"
},
{
"type": "integer",
"description": "The page number. Used for pagination. If not provided, the first page of results is returned.",
"name": "p",
"in": "query"
}
],
"responses": {
"200": {
"description": "An array with photos",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/background.Image"
}
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/filters": {
"put": {
"security": [
{
"JWTKeyAuth": []
}
],
"description": "Creates a new saved filter",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"filter"
],
"summary": "Creates a new saved filter",
"responses": {
2021-05-26 21:56:31 +02:00
"201": {
"description": "The Saved Filter",
"schema": {
"$ref": "#/definitions/models.SavedFilter"
}
},
"403": {
"description": "The user does not have access to that saved filter.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/filters/{id}": {
"get": {
"security": [
{
"JWTKeyAuth": []
}
],
"description": "Returns a saved filter by its ID.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"filter"
],
"summary": "Gets one saved filter",
"parameters": [
{
"type": "integer",
"description": "Filter ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The Saved Filter",
"schema": {
"$ref": "#/definitions/models.SavedFilter"
}
},
"403": {
"description": "The user does not have access to that saved filter.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
},
"post": {
"security": [
{
"JWTKeyAuth": []
}
],
"description": "Updates a saved filter by its ID.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"filter"
],
"summary": "Updates a saved filter",
"parameters": [
{
"type": "integer",
"description": "Filter ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The Saved Filter",
"schema": {
"$ref": "#/definitions/models.SavedFilter"
}
},
"403": {
"description": "The user does not have access to that saved filter.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"404": {
"description": "The saved filter does not exist.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
},
"delete": {
"security": [
{
"JWTKeyAuth": []
}
],
"description": "Removes a saved filter by its ID.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"filter"
],
"summary": "Removes a saved filter",
"parameters": [
{
"type": "integer",
"description": "Filter ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The Saved Filter",
"schema": {
"$ref": "#/definitions/models.SavedFilter"
}
},
"403": {
"description": "The user does not have access to that saved filter.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"404": {
"description": "The saved filter does not exist.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
2019-07-15 22:54:38 +00:00
"/info": {
"get": {
"description": "Returns the version, frontendurl, motd and various settings of Vikunja",
2019-07-15 22:54:38 +00:00
"produces": [
"application/json"
],
"tags": [
"service"
],
"summary": "Info",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v1.vikunjaInfos"
}
}
}
}
},
2018-12-31 01:18:41 +00:00
"/labels": {
"get": {
"security": [
{
2019-01-03 22:22:06 +00:00
"JWTKeyAuth": []
2018-12-31 01:18:41 +00:00
}
],
"description": "Returns all labels which are either created by the user or associated with a task the user has at least read-access to.",
2018-12-31 01:18:41 +00:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"labels"
2018-12-31 01:18:41 +00:00
],
"summary": "Get all labels a user has access to",
2018-12-31 01:18:41 +00:00
"parameters": [
{
"type": "integer",
"description": "The page number. Used for pagination. If not provided, the first page of results is returned.",
2019-10-23 21:11:40 +00:00
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.",
"name": "per_page",
2018-12-31 01:18:41 +00:00
"in": "query"
},
{
"type": "string",
"description": "Search labels by label text.",
2018-12-31 01:18:41 +00:00
"name": "s",
"in": "query"
}
],
"responses": {
"200": {
"description": "The labels",
2018-12-31 01:18:41 +00:00
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Label"
2018-12-31 01:18:41 +00:00
}
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
},
"put": {
"security": [
{
2019-01-03 22:22:06 +00:00
"JWTKeyAuth": []
2018-12-31 01:18:41 +00:00
}
],
"description": "Creates a new label.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"labels"
],
"summary": "Create a label",
"parameters": [
{
"description": "The label object",
"name": "label",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Label"
}
}
],
"responses": {
2021-05-26 21:56:31 +02:00
"201": {
2018-12-31 01:18:41 +00:00
"description": "The created label object.",
"schema": {
"$ref": "#/definitions/models.Label"
}
},
"400": {
"description": "Invalid label object provided.",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
2018-12-31 01:18:41 +00:00
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/labels/{id}": {
"get": {
"security": [
{
2019-01-03 22:22:06 +00:00
"JWTKeyAuth": []
2018-12-31 01:18:41 +00:00
}
],
"description": "Returns one label by its ID.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"labels"
],
"summary": "Gets one label",
"parameters": [
{
"type": "integer",
"description": "Label ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The label",
"schema": {
"$ref": "#/definitions/models.Label"
}
},
"403": {
"description": "The user does not have access to the label",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
2018-12-31 01:18:41 +00:00
}
},
"404": {
"description": "Label not found",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
2018-12-31 01:18:41 +00:00
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
},
"put": {
"security": [
{
2019-01-03 22:22:06 +00:00
"JWTKeyAuth": []
2018-12-31 01:18:41 +00:00
}
],
"description": "Update an existing label. The user needs to be the creator of the label to be able to do this.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"labels"
],
"summary": "Update a label",
"parameters": [
{
"type": "integer",
"description": "Label ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "The label object",
"name": "label",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Label"
}
}
],
"responses": {
"200": {
"description": "The created label object.",
"schema": {
"$ref": "#/definitions/models.Label"
}
},
"400": {
"description": "Invalid label object provided.",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
2018-12-31 01:18:41 +00:00
}
},
"403": {
"description": "Not allowed to update the label.",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
2018-12-31 01:18:41 +00:00
}
},
"404": {
"description": "Label not found.",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
2018-12-31 01:18:41 +00:00
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
},
"delete": {
"security": [
{
2019-01-03 22:22:06 +00:00
"JWTKeyAuth": []
2018-12-31 01:18:41 +00:00
}
],
"description": "Delete an existing label. The user needs to be the creator of the label to be able to do this.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"labels"
],
"summary": "Delete a label",
"parameters": [
{
"type": "integer",
"description": "Label ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The label was successfully deleted.",
"schema": {
"$ref": "#/definitions/models.Label"
}
},
"403": {
"description": "Not allowed to delete the label.",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
2018-12-31 01:18:41 +00:00
}
},
"404": {
"description": "Label not found.",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
2018-12-31 01:18:41 +00:00
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/lists": {
"get": {
"security": [
{
2019-01-03 22:22:06 +00:00
"JWTKeyAuth": []
}
],
"description": "Returns all lists a user has access to.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"list"
],
"summary": "Get all lists a user has access to",
"parameters": [
{
"type": "integer",
"description": "The page number. Used for pagination. If not provided, the first page of results is returned.",
2019-10-23 21:11:40 +00:00
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.",
"name": "per_page",
"in": "query"
},
{
"type": "string",
"description": "Search lists by title.",
"name": "s",
"in": "query"
2020-06-28 16:25:46 +02:00
},
{
"type": "boolean",
"description": "If true, also returns all archived lists.",
"name": "is_archived",
"in": "query"
}
],
"responses": {
"200": {
"description": "The lists",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.List"
}
}
},
"403": {
"description": "The user does not have access to the list",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/lists/{id}": {
"get": {
"security": [
{
2019-01-03 22:22:06 +00:00
"JWTKeyAuth": []
}
],
2019-12-07 19:52:04 +00:00
"description": "Returns a list by its ID.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2019-12-07 19:52:04 +00:00
"list"
],
2019-12-07 19:52:04 +00:00
"summary": "Gets one list",
"parameters": [
{
"type": "integer",
2019-12-07 19:52:04 +00:00
"description": "List ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
2019-12-07 19:52:04 +00:00
"description": "The list",
"schema": {
2019-12-07 19:52:04 +00:00
"$ref": "#/definitions/models.List"
}
},
"403": {
2019-12-07 19:52:04 +00:00
"description": "The user does not have access to the list",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
},
"put": {
"security": [
{
2019-01-03 22:22:06 +00:00
"JWTKeyAuth": []
}
],
"description": "Inserts a task into a list.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"task"
],
"summary": "Create a task",
"parameters": [
{
"type": "integer",
"description": "List ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "The task object",
"name": "task",
"in": "body",
"required": true,
"schema": {
2019-08-14 20:19:04 +00:00
"$ref": "#/definitions/models.Task"
}
}
],
"responses": {
2021-05-26 21:56:31 +02:00
"201": {
"description": "The created task object.",
"schema": {
2019-08-14 20:19:04 +00:00
"$ref": "#/definitions/models.Task"
}
},
"400": {
"description": "Invalid task object provided.",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
}
},
"403": {
"description": "The user does not have access to the list",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
},
"post": {
"security": [
{
2019-01-03 22:22:06 +00:00
"JWTKeyAuth": []
}
],
"description": "Updates a list. This does not include adding a task (see below).",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"list"
],
"summary": "Updates a list",
"parameters": [
{
"type": "integer",
"description": "List ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "The list with updated values you want to update.",
"name": "list",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.List"
}
}
],
"responses": {
"200": {
"description": "The updated list.",
"schema": {
"$ref": "#/definitions/models.List"
}
},
"400": {
"description": "Invalid list object provided.",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
}
},
"403": {
"description": "The user does not have access to the list",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
},
"delete": {
"security": [
{
2019-01-03 22:22:06 +00:00
"JWTKeyAuth": []
}
],
"description": "Delets a list",
"produces": [
"application/json"
],
"tags": [
"list"
],
"summary": "Deletes a list",
"parameters": [
{
"type": "integer",
"description": "List ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "The list was successfully deleted.",
"schema": {
"$ref": "#/definitions/models.Message"
}
},
"400": {
"description": "Invalid list object provided.",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
}
},
"403": {
"description": "The user does not have access to the list",
"schema": {
2020-06-28 16:25:46 +02:00
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
2020-06-28 16:25:46 +02:00
"/lists/{id}/background": {
"get": {
"security": [
{
"JWTKeyAuth": []
}
],
2020-06-28 16:25:46 +02:00
"description": "Get the list background of a specific list. **Returns json on error.**",