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
No known key found for this signature in database
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 // LabelTaskBulk is a helper struct to update a bunch of labels at once
type LabelTaskBulk struct { 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"` Labels []*Label `json:"labels"`
TaskID int64 `json:"-" param:"listtask"` TaskID int64 `json:"-" param:"listtask"`
@ -282,8 +282,8 @@ type LabelTaskBulk struct {
} }
// Create updates a bunch of labels on a task at once // Create updates a bunch of labels on a task at once
// @Summary Add multiple new labels to a task // @Summary Update all labels on a task.
// @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.
// @tags labels // @tags labels
// @Accept json // @Accept json
// @Produce json // @Produce json

View file

@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at // 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 package swagger
@ -37,7 +37,7 @@ var doc = `{
"JWTKeyAuth": [] "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": [ "consumes": [
"application/json" "application/json"
], ],
@ -45,9 +45,9 @@ var doc = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"assignees" "labels"
], ],
"summary": "Get all assignees for a task", "summary": "Get all labels a user has access to",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
@ -57,18 +57,18 @@ var doc = `{
}, },
{ {
"type": "string", "type": "string",
"description": "Search assignees by their username.", "description": "Search labels by label text.",
"name": "s", "name": "s",
"in": "query" "in": "query"
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "The assignees", "description": "The labels",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/models.User" "$ref": "#/definitions/models.Label"
} }
} }
}, },
@ -2725,7 +2725,7 @@ var doc = `{
"JWTKeyAuth": [] "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": [ "consumes": [
"application/json" "application/json"
], ],
@ -2735,7 +2735,7 @@ var doc = `{
"tags": [ "tags": [
"labels" "labels"
], ],
"summary": "Add multiple new labels to a task", "summary": "Update all labels on a task.",
"parameters": [ "parameters": [
{ {
"description": "The array of labels", "description": "The array of labels",
@ -3820,7 +3820,7 @@ var doc = `{
"type": "object", "type": "object",
"properties": { "properties": {
"labels": { "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", "type": "array",
"items": { "items": {
"$ref": "#/definitions/models.Label" "$ref": "#/definitions/models.Label"

View file

@ -24,7 +24,7 @@
"JWTKeyAuth": [] "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": [ "consumes": [
"application/json" "application/json"
], ],
@ -32,9 +32,9 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"assignees" "labels"
], ],
"summary": "Get all assignees for a task", "summary": "Get all labels a user has access to",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
@ -44,18 +44,18 @@
}, },
{ {
"type": "string", "type": "string",
"description": "Search assignees by their username.", "description": "Search labels by label text.",
"name": "s", "name": "s",
"in": "query" "in": "query"
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "The assignees", "description": "The labels",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/models.User" "$ref": "#/definitions/models.Label"
} }
} }
}, },
@ -2712,7 +2712,7 @@
"JWTKeyAuth": [] "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": [ "consumes": [
"application/json" "application/json"
], ],
@ -2722,7 +2722,7 @@
"tags": [ "tags": [
"labels" "labels"
], ],
"summary": "Add multiple new labels to a task", "summary": "Update all labels on a task.",
"parameters": [ "parameters": [
{ {
"description": "The array of labels", "description": "The array of labels",
@ -3806,7 +3806,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"labels": { "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", "type": "array",
"items": { "items": {
"$ref": "#/definitions/models.Label" "$ref": "#/definitions/models.Label"

View file

@ -157,8 +157,7 @@ definitions:
models.LabelTaskBulk: models.LabelTaskBulk:
properties: properties:
labels: labels:
description: All labels you want to update at once. Works exactly like you description: All labels you want to update at once.
would update labels while updateing a list.
items: items:
$ref: '#/definitions/models.Label' $ref: '#/definitions/models.Label'
type: array type: array
@ -649,14 +648,15 @@ paths:
get: get:
consumes: consumes:
- application/json - 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: parameters:
- description: The page number. Used for pagination. If not provided, the first - description: The page number. Used for pagination. If not provided, the first
page of results is returned. page of results is returned.
in: query in: query
name: p name: p
type: integer type: integer
- description: Search assignees by their username. - description: Search labels by label text.
in: query in: query
name: s name: s
type: string type: string
@ -664,10 +664,10 @@ paths:
- application/json - application/json
responses: responses:
"200": "200":
description: The assignees description: The labels
schema: schema:
items: items:
$ref: '#/definitions/models.User' $ref: '#/definitions/models.Label'
type: array type: array
"500": "500":
description: Internal error description: Internal error
@ -676,9 +676,9 @@ paths:
type: object type: object
security: security:
- JWTKeyAuth: [] - JWTKeyAuth: []
summary: Get all assignees for a task summary: Get all labels a user has access to
tags: tags:
- assignees - labels
put: put:
consumes: consumes:
- application/json - application/json
@ -2490,7 +2490,10 @@ paths:
post: post:
consumes: consumes:
- application/json - 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: parameters:
- description: The array of labels - description: The array of labels
in: body in: body
@ -2524,7 +2527,7 @@ paths:
type: object type: object
security: security:
- JWTKeyAuth: [] - JWTKeyAuth: []
summary: Add multiple new labels to a task summary: Update all labels on a task.
tags: tags:
- labels - labels
/tasks/all: /tasks/all: