Fixed swagger docs for task labels

This commit is contained in:
kolaente 2019-03-21 07:40:56 +01:00
parent eb4d38b5b8
commit 25999d9b69
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
4 changed files with 88 additions and 53 deletions

View file

@ -49,7 +49,7 @@ func (LabelTask) TableName() string {
// @Security JWTKeyAuth
// @Param task path int true "Task ID"
// @Param label path int true "Label ID"
// @Success 200 {object} models.Label "The label was successfully removed."
// @Success 200 {object} models.Message "The label was successfully removed."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to remove the label."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "Label not found."
// @Failure 500 {object} models.Message "Internal error"
@ -67,8 +67,8 @@ func (lt *LabelTask) Delete() (err error) {
// @Produce json
// @Security JWTKeyAuth
// @Param task path int true "Task ID"
// @Param label body models.Label true "The label object"
// @Success 200 {object} models.Label "The created label relation object."
// @Param label body models.LabelTask true "The label object"
// @Success 200 {object} models.LabelTask "The created label relation object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid label object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to add the label."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The label does not exist."

View file

@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2019-03-08 15:41:16.787899662 +0100 CET m=+0.154547316
// 2019-03-21 07:40:14.605699742 +0100 CET m=+0.177681498
package swagger
@ -37,7 +37,7 @@ var doc = `{
"JWTKeyAuth": []
}
],
"description": "Returns all labels which are either created by the user or associated with a task the user has at least read-access to.",
"description": "Returns an array with all assignees for this task.",
"consumes": [
"application/json"
],
@ -45,9 +45,9 @@ var doc = `{
"application/json"
],
"tags": [
"labels"
"assignees"
],
"summary": "Get all labels a user has access to",
"summary": "Get all assignees for a task",
"parameters": [
{
"type": "integer",
@ -57,18 +57,18 @@ var doc = `{
},
{
"type": "string",
"description": "Search labels by label text.",
"description": "Search assignees by their username.",
"name": "s",
"in": "query"
}
],
"responses": {
"200": {
"description": "The labels",
"description": "The assignees",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Label"
"$ref": "#/definitions/models.User"
}
}
},
@ -391,7 +391,7 @@ var doc = `{
"JWTKeyAuth": []
}
],
"description": "Returns a team by its ID.",
"description": "Returns a list by its ID.",
"consumes": [
"application/json"
],
@ -399,13 +399,13 @@ var doc = `{
"application/json"
],
"tags": [
"team"
"list"
],
"summary": "Gets one team",
"summary": "Gets one list",
"parameters": [
{
"type": "integer",
"description": "Team ID",
"description": "List ID",
"name": "id",
"in": "path",
"required": true
@ -413,14 +413,14 @@ var doc = `{
],
"responses": {
"200": {
"description": "The team",
"description": "The list",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Team"
"$ref": "#/definitions/models.List"
}
},
"403": {
"description": "The user does not have access to the team",
"description": "The user does not have access to the list",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io.web.HTTPError"
@ -2870,7 +2870,7 @@ var doc = `{
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.Label"
"$ref": "#/definitions/models.LabelTask"
}
}
],
@ -2879,7 +2879,7 @@ var doc = `{
"description": "The created label relation object.",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Label"
"$ref": "#/definitions/models.LabelTask"
}
},
"400": {
@ -2952,7 +2952,7 @@ var doc = `{
"description": "The label was successfully removed.",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Label"
"$ref": "#/definitions/models.Message"
}
},
"403": {
@ -3803,6 +3803,19 @@ var doc = `{
}
}
},
"models.LabelTask": {
"type": "object",
"properties": {
"created": {
"description": "A unix timestamp when this task was created. You cannot change this value.",
"type": "integer"
},
"label_id": {
"description": "The label id you want to associate with a task.",
"type": "integer"
}
}
},
"models.LabelTaskBulk": {
"type": "object",
"properties": {

View file

@ -24,7 +24,7 @@
"JWTKeyAuth": []
}
],
"description": "Returns all labels which are either created by the user or associated with a task the user has at least read-access to.",
"description": "Returns an array with all assignees for this task.",
"consumes": [
"application/json"
],
@ -32,9 +32,9 @@
"application/json"
],
"tags": [
"labels"
"assignees"
],
"summary": "Get all labels a user has access to",
"summary": "Get all assignees for a task",
"parameters": [
{
"type": "integer",
@ -44,18 +44,18 @@
},
{
"type": "string",
"description": "Search labels by label text.",
"description": "Search assignees by their username.",
"name": "s",
"in": "query"
}
],
"responses": {
"200": {
"description": "The labels",
"description": "The assignees",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Label"
"$ref": "#/definitions/models.User"
}
}
},
@ -378,7 +378,7 @@
"JWTKeyAuth": []
}
],
"description": "Returns a team by its ID.",
"description": "Returns a list by its ID.",
"consumes": [
"application/json"
],
@ -386,13 +386,13 @@
"application/json"
],
"tags": [
"team"
"list"
],
"summary": "Gets one team",
"summary": "Gets one list",
"parameters": [
{
"type": "integer",
"description": "Team ID",
"description": "List ID",
"name": "id",
"in": "path",
"required": true
@ -400,14 +400,14 @@
],
"responses": {
"200": {
"description": "The team",
"description": "The list",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Team"
"$ref": "#/definitions/models.List"
}
},
"403": {
"description": "The user does not have access to the team",
"description": "The user does not have access to the list",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io/web.HTTPError"
@ -2857,7 +2857,7 @@
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.Label"
"$ref": "#/definitions/models.LabelTask"
}
}
],
@ -2866,7 +2866,7 @@
"description": "The created label relation object.",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Label"
"$ref": "#/definitions/models.LabelTask"
}
},
"400": {
@ -2939,7 +2939,7 @@
"description": "The label was successfully removed.",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Label"
"$ref": "#/definitions/models.Message"
}
},
"403": {
@ -3789,6 +3789,19 @@
}
}
},
"models.LabelTask": {
"type": "object",
"properties": {
"created": {
"description": "A unix timestamp when this task was created. You cannot change this value.",
"type": "integer"
},
"label_id": {
"description": "The label id you want to associate with a task.",
"type": "integer"
}
}
},
"models.LabelTaskBulk": {
"type": "object",
"properties": {

View file

@ -144,6 +144,16 @@ definitions:
change this value.
type: integer
type: object
models.LabelTask:
properties:
created:
description: A unix timestamp when this task was created. You cannot change
this value.
type: integer
label_id:
description: The label id you want to associate with a task.
type: integer
type: object
models.LabelTaskBulk:
properties:
labels:
@ -639,15 +649,14 @@ paths:
get:
consumes:
- application/json
description: Returns all labels which are either created by the user or associated
with a task the user has at least read-access to.
description: Returns an array with all assignees for this task.
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 labels by label text.
- description: Search assignees by their username.
in: query
name: s
type: string
@ -655,10 +664,10 @@ paths:
- application/json
responses:
"200":
description: The labels
description: The assignees
schema:
items:
$ref: '#/definitions/models.Label'
$ref: '#/definitions/models.User'
type: array
"500":
description: Internal error
@ -667,9 +676,9 @@ paths:
type: object
security:
- JWTKeyAuth: []
summary: Get all labels a user has access to
summary: Get all assignees for a task
tags:
- labels
- assignees
put:
consumes:
- application/json
@ -913,9 +922,9 @@ paths:
get:
consumes:
- application/json
description: Returns a team by its ID.
description: Returns a list by its ID.
parameters:
- description: Team ID
- description: List ID
in: path
name: id
required: true
@ -924,12 +933,12 @@ paths:
- application/json
responses:
"200":
description: The team
description: The list
schema:
$ref: '#/definitions/models.Team'
$ref: '#/definitions/models.List'
type: object
"403":
description: The user does not have access to the team
description: The user does not have access to the list
schema:
$ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object
@ -940,9 +949,9 @@ paths:
type: object
security:
- JWTKeyAuth: []
summary: Gets one team
summary: Gets one list
tags:
- team
- list
post:
consumes:
- application/json
@ -2272,7 +2281,7 @@ paths:
name: label
required: true
schema:
$ref: '#/definitions/models.Label'
$ref: '#/definitions/models.LabelTask'
type: object
produces:
- application/json
@ -2280,7 +2289,7 @@ paths:
"200":
description: The created label relation object.
schema:
$ref: '#/definitions/models.Label'
$ref: '#/definitions/models.LabelTask'
type: object
"400":
description: Invalid label object provided.
@ -2330,7 +2339,7 @@ paths:
"200":
description: The label was successfully removed.
schema:
$ref: '#/definitions/models.Label'
$ref: '#/definitions/models.Message'
type: object
"403":
description: Not allowed to remove the label.