Fixed swagger docs for bulk label tasks

This commit is contained in:
kolaente 2019-03-21 18:42:21 +01:00
parent 25999d9b69
commit 72e64f7203
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 35 additions and 32 deletions

View File

@ -273,7 +273,7 @@ func (t *ListTask) updateTaskLabels(creator web.Auth, labels []*Label) (err erro
// LabelTaskBulk is a helper struct to update a bunch of labels at once
type LabelTaskBulk struct {
// All labels you want to update at once. Works exactly like you would update labels while updateing a list.
// All labels you want to update at once.
Labels []*Label `json:"labels"`
TaskID int64 `json:"-" param:"listtask"`
@ -282,8 +282,8 @@ type LabelTaskBulk struct {
}
// Create updates a bunch of labels on a task at once
// @Summary Add multiple new labels to a task
// @Description Adds multiple new labels to a task.
// @Summary Update all labels on a task.
// @Description Updates all labels on a task. Every label which is not passed but exists on the task will be deleted. Every label which does not exist on the task will be added. All labels which are passed and already exist on the task won't be touched.
// @tags labels
// @Accept json
// @Produce json

View File

@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2019-03-21 07:40:14.605699742 +0100 CET m=+0.177681498
// 2019-03-21 18:42:06.413170199 +0100 CET m=+0.170405951
package swagger
@ -37,7 +37,7 @@ var doc = `{
"JWTKeyAuth": []
}
],
"description": "Returns an array with all assignees for this task.",
"description": "Returns all labels which are either created by the user or associated with a task the user has at least read-access to.",
"consumes": [
"application/json"
],
@ -45,9 +45,9 @@ var doc = `{
"application/json"
],
"tags": [
"assignees"
"labels"
],
"summary": "Get all assignees for a task",
"summary": "Get all labels a user has access to",
"parameters": [
{
"type": "integer",
@ -57,18 +57,18 @@ var doc = `{
},
{
"type": "string",
"description": "Search assignees by their username.",
"description": "Search labels by label text.",
"name": "s",
"in": "query"
}
],
"responses": {
"200": {
"description": "The assignees",
"description": "The labels",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.User"
"$ref": "#/definitions/models.Label"
}
}
},
@ -2725,7 +2725,7 @@ var doc = `{
"JWTKeyAuth": []
}
],
"description": "Adds multiple new labels to a task.",
"description": "Updates all labels on a task. Every label which is not passed but exists on the task will be deleted. Every label which does not exist on the task will be added. All labels which are passed and already exist on the task won't be touched.",
"consumes": [
"application/json"
],
@ -2735,7 +2735,7 @@ var doc = `{
"tags": [
"labels"
],
"summary": "Add multiple new labels to a task",
"summary": "Update all labels on a task.",
"parameters": [
{
"description": "The array of labels",
@ -3820,7 +3820,7 @@ var doc = `{
"type": "object",
"properties": {
"labels": {
"description": "All labels you want to update at once. Works exactly like you would update labels while updateing a list.",
"description": "All labels you want to update at once.",
"type": "array",
"items": {
"$ref": "#/definitions/models.Label"

View File

@ -24,7 +24,7 @@
"JWTKeyAuth": []
}
],
"description": "Returns an array with all assignees for this task.",
"description": "Returns all labels which are either created by the user or associated with a task the user has at least read-access to.",
"consumes": [
"application/json"
],
@ -32,9 +32,9 @@
"application/json"
],
"tags": [
"assignees"
"labels"
],
"summary": "Get all assignees for a task",
"summary": "Get all labels a user has access to",
"parameters": [
{
"type": "integer",
@ -44,18 +44,18 @@
},
{
"type": "string",
"description": "Search assignees by their username.",
"description": "Search labels by label text.",
"name": "s",
"in": "query"
}
],
"responses": {
"200": {
"description": "The assignees",
"description": "The labels",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.User"
"$ref": "#/definitions/models.Label"
}
}
},
@ -2712,7 +2712,7 @@
"JWTKeyAuth": []
}
],
"description": "Adds multiple new labels to a task.",
"description": "Updates all labels on a task. Every label which is not passed but exists on the task will be deleted. Every label which does not exist on the task will be added. All labels which are passed and already exist on the task won't be touched.",
"consumes": [
"application/json"
],
@ -2722,7 +2722,7 @@
"tags": [
"labels"
],
"summary": "Add multiple new labels to a task",
"summary": "Update all labels on a task.",
"parameters": [
{
"description": "The array of labels",
@ -3806,7 +3806,7 @@
"type": "object",
"properties": {
"labels": {
"description": "All labels you want to update at once. Works exactly like you would update labels while updateing a list.",
"description": "All labels you want to update at once.",
"type": "array",
"items": {
"$ref": "#/definitions/models.Label"

View File

@ -157,8 +157,7 @@ definitions:
models.LabelTaskBulk:
properties:
labels:
description: All labels you want to update at once. Works exactly like you
would update labels while updateing a list.
description: All labels you want to update at once.
items:
$ref: '#/definitions/models.Label'
type: array
@ -649,14 +648,15 @@ paths:
get:
consumes:
- application/json
description: Returns an array with all assignees for this task.
description: Returns all labels which are either created by the user or associated
with a task the user has at least read-access to.
parameters:
- description: The page number. Used for pagination. If not provided, the first
page of results is returned.
in: query
name: p
type: integer
- description: Search assignees by their username.
- description: Search labels by label text.
in: query
name: s
type: string
@ -664,10 +664,10 @@ paths:
- application/json
responses:
"200":
description: The assignees
description: The labels
schema:
items:
$ref: '#/definitions/models.User'
$ref: '#/definitions/models.Label'
type: array
"500":
description: Internal error
@ -676,9 +676,9 @@ paths:
type: object
security:
- JWTKeyAuth: []
summary: Get all assignees for a task
summary: Get all labels a user has access to
tags:
- assignees
- labels
put:
consumes:
- application/json
@ -2490,7 +2490,10 @@ paths:
post:
consumes:
- application/json
description: Adds multiple new labels to a task.
description: Updates all labels on a task. Every label which is not passed but
exists on the task will be deleted. Every label which does not exist on the
task will be added. All labels which are passed and already exist on the task
won't be touched.
parameters:
- description: The array of labels
in: body
@ -2524,7 +2527,7 @@ paths:
type: object
security:
- JWTKeyAuth: []
summary: Add multiple new labels to a task
summary: Update all labels on a task.
tags:
- labels
/tasks/all: