Fixed swaggerdocs of description fields

This commit is contained in:
kolaente 2019-07-21 23:57:19 +02:00
parent 8d76280811
commit 208eb4e68c
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
8 changed files with 61 additions and 92 deletions

View file

@ -28,7 +28,7 @@ type Label struct {
// The title of the lable. You'll see this one on tasks associated with it.
Title string `xorm:"varchar(250) not null" json:"title" valid:"runelength(3|250)" minLength:"3" maxLength:"250"`
// The label description.
Description string `xorm:"longtext null" json:"description" valid:"runelength(0|250)" maxLength:"250"`
Description string `xorm:"longtext null" json:"description"`
// The color this label has
HexColor string `xorm:"varchar(6) null" json:"hex_color" valid:"runelength(0|6)" maxLength:"6"`

View file

@ -28,7 +28,7 @@ type List struct {
// The title of the list. You'll see this in the namespace overview.
Title string `xorm:"varchar(250) not null" json:"title" valid:"required,runelength(3|250)" minLength:"3" maxLength:"250"`
// The description of the list.
Description string `xorm:"longtext null" json:"description" valid:"runelength(0|1000)" maxLength:"1000"`
Description string `xorm:"longtext null" json:"description"`
OwnerID int64 `xorm:"int(11) INDEX not null" json:"-"`
NamespaceID int64 `xorm:"int(11) INDEX not null" json:"-" param:"namespace"`

View file

@ -32,7 +32,7 @@ type ListTask struct {
// The task text. This is what you'll see in the list.
Text string `xorm:"varchar(250) not null" json:"text" valid:"runelength(3|250)" minLength:"3" maxLength:"250"`
// The task description.
Description string `xorm:"longtext null" json:"description" valid:"runelength(0|250)" maxLength:"250"`
Description string `xorm:"longtext null" json:"description"`
// Whether a task is done or not.
Done bool `xorm:"INDEX null" json:"done"`
// The unix timestamp when a task was marked as done.

View file

@ -30,7 +30,7 @@ type Namespace struct {
// The name of this namespace.
Name string `xorm:"varchar(250) not null" json:"name" valid:"required,runelength(5|250)" minLength:"5" maxLength:"250"`
// The description of the namespace
Description string `xorm:"longtext null" json:"description" valid:"runelength(0|250)" maxLength:"250"`
Description string `xorm:"longtext null" json:"description"`
OwnerID int64 `xorm:"int(11) not null INDEX" json:"-"`
// The user who owns this namespace

View file

@ -28,7 +28,7 @@ type Team struct {
// The name of this team.
Name string `xorm:"varchar(250) not null" json:"name" valid:"required,runelength(5|250)" minLength:"5" maxLength:"250"`
// The team's description.
Description string `xorm:"longtext null" json:"description" valid:"runelength(0|250)" minLength:"0" maxLength:"250"`
Description string `xorm:"longtext null" json:"description"`
CreatedByID int64 `xorm:"int(11) not null INDEX" json:"-"`
// The user who created this team.

View file

@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2019-07-18 18:18:32.365544639 +0200 CEST m=+0.166364676
// 2019-07-21 23:56:59.485456403 +0200 CEST m=+0.091837160
package swagger
@ -58,7 +58,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"
],
@ -66,9 +66,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",
@ -78,18 +78,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"
}
}
},
@ -412,7 +412,7 @@ var doc = `{
"JWTKeyAuth": []
}
],
"description": "Returns a team by its ID.",
"description": "Returns a list by its ID.",
"consumes": [
"application/json"
],
@ -420,13 +420,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
@ -434,14 +434,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"
@ -3738,8 +3738,7 @@ var doc = `{
},
"description": {
"description": "The task description.",
"type": "string",
"maxLength": 250
"type": "string"
},
"done": {
"description": "Whether a task is done or not.",
@ -3849,8 +3848,7 @@ var doc = `{
},
"description": {
"description": "The label description.",
"type": "string",
"maxLength": 250
"type": "string"
},
"hex_color": {
"description": "The color this label has",
@ -3907,8 +3905,7 @@ var doc = `{
},
"description": {
"description": "The description of the list.",
"type": "string",
"maxLength": 1000
"type": "string"
},
"id": {
"description": "The unique, numeric id of this list.",
@ -3959,8 +3956,7 @@ var doc = `{
},
"description": {
"description": "The task description.",
"type": "string",
"maxLength": 250
"type": "string"
},
"done": {
"description": "Whether a task is done or not.",
@ -4096,8 +4092,7 @@ var doc = `{
},
"description": {
"description": "The description of the namespace",
"type": "string",
"maxLength": 250
"type": "string"
},
"id": {
"description": "The unique, numeric id of this namespace.",
@ -4156,8 +4151,7 @@ var doc = `{
},
"description": {
"description": "The description of the namespace",
"type": "string",
"maxLength": 250
"type": "string"
},
"id": {
"description": "The unique, numeric id of this namespace.",
@ -4222,9 +4216,7 @@ var doc = `{
},
"description": {
"description": "The team's description.",
"type": "string",
"maxLength": 250,
"minLength": 0
"type": "string"
},
"id": {
"description": "The unique, numeric id of this team.",
@ -4374,9 +4366,7 @@ var doc = `{
},
"description": {
"description": "The team's description.",
"type": "string",
"maxLength": 250,
"minLength": 0
"type": "string"
},
"id": {
"description": "The unique, numeric id of this team.",

View file

@ -45,7 +45,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"
],
@ -53,9 +53,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",
@ -65,18 +65,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"
}
}
},
@ -399,7 +399,7 @@
"JWTKeyAuth": []
}
],
"description": "Returns a team by its ID.",
"description": "Returns a list by its ID.",
"consumes": [
"application/json"
],
@ -407,13 +407,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
@ -421,14 +421,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"
@ -3724,8 +3724,7 @@
},
"description": {
"description": "The task description.",
"type": "string",
"maxLength": 250
"type": "string"
},
"done": {
"description": "Whether a task is done or not.",
@ -3835,8 +3834,7 @@
},
"description": {
"description": "The label description.",
"type": "string",
"maxLength": 250
"type": "string"
},
"hex_color": {
"description": "The color this label has",
@ -3893,8 +3891,7 @@
},
"description": {
"description": "The description of the list.",
"type": "string",
"maxLength": 1000
"type": "string"
},
"id": {
"description": "The unique, numeric id of this list.",
@ -3945,8 +3942,7 @@
},
"description": {
"description": "The task description.",
"type": "string",
"maxLength": 250
"type": "string"
},
"done": {
"description": "Whether a task is done or not.",
@ -4082,8 +4078,7 @@
},
"description": {
"description": "The description of the namespace",
"type": "string",
"maxLength": 250
"type": "string"
},
"id": {
"description": "The unique, numeric id of this namespace.",
@ -4142,8 +4137,7 @@
},
"description": {
"description": "The description of the namespace",
"type": "string",
"maxLength": 250
"type": "string"
},
"id": {
"description": "The unique, numeric id of this namespace.",
@ -4208,9 +4202,7 @@
},
"description": {
"description": "The team's description.",
"type": "string",
"maxLength": 250,
"minLength": 0
"type": "string"
},
"id": {
"description": "The unique, numeric id of this team.",
@ -4360,9 +4352,7 @@
},
"description": {
"description": "The team's description.",
"type": "string",
"maxLength": 250,
"minLength": 0
"type": "string"
},
"id": {
"description": "The unique, numeric id of this team.",

View file

@ -46,7 +46,6 @@ definitions:
type: object
description:
description: The task description.
maxLength: 250
type: string
done:
description: Whether a task is done or not.
@ -134,7 +133,6 @@ definitions:
type: object
description:
description: The label description.
maxLength: 250
type: string
hex_color:
description: The color this label has
@ -180,7 +178,6 @@ definitions:
type: integer
description:
description: The description of the list.
maxLength: 1000
type: string
id:
description: The unique, numeric id of this list.
@ -221,7 +218,6 @@ definitions:
type: object
description:
description: The task description.
maxLength: 250
type: string
done:
description: Whether a task is done or not.
@ -330,7 +326,6 @@ definitions:
type: integer
description:
description: The description of the namespace
maxLength: 250
type: string
id:
description: The unique, numeric id of this namespace.
@ -380,7 +375,6 @@ definitions:
type: integer
description:
description: The description of the namespace
maxLength: 250
type: string
id:
description: The unique, numeric id of this namespace.
@ -430,8 +424,6 @@ definitions:
type: object
description:
description: The team's description.
maxLength: 250
minLength: 0
type: string
id:
description: The unique, numeric id of this team.
@ -558,8 +550,6 @@ definitions:
type: object
description:
description: The team's description.
maxLength: 250
minLength: 0
type: string
id:
description: The unique, numeric id of this team.
@ -704,15 +694,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
@ -720,10 +709,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
@ -732,9 +721,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
@ -978,9 +967,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
@ -989,12 +978,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
@ -1005,9 +994,9 @@ paths:
type: object
security:
- JWTKeyAuth: []
summary: Gets one team
summary: Gets one list
tags:
- team
- list
post:
consumes:
- application/json