Fixed swaggerdocs of description fields

This commit is contained in:
kolaente 2019-07-21 23:57:19 +02:00
parent 8d76280811
commit 208eb4e68c
Signed by untrusted user: konrad
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. // 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"` Title string `xorm:"varchar(250) not null" json:"title" valid:"runelength(3|250)" minLength:"3" maxLength:"250"`
// The label description. // 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 // The color this label has
HexColor string `xorm:"varchar(6) null" json:"hex_color" valid:"runelength(0|6)" maxLength:"6"` 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. // 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"` Title string `xorm:"varchar(250) not null" json:"title" valid:"required,runelength(3|250)" minLength:"3" maxLength:"250"`
// The description of the list. // 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:"-"` OwnerID int64 `xorm:"int(11) INDEX not null" json:"-"`
NamespaceID int64 `xorm:"int(11) INDEX not null" json:"-" param:"namespace"` 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. // 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"` Text string `xorm:"varchar(250) not null" json:"text" valid:"runelength(3|250)" minLength:"3" maxLength:"250"`
// The task description. // 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. // Whether a task is done or not.
Done bool `xorm:"INDEX null" json:"done"` Done bool `xorm:"INDEX null" json:"done"`
// The unix timestamp when a task was marked as 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. // The name of this namespace.
Name string `xorm:"varchar(250) not null" json:"name" valid:"required,runelength(5|250)" minLength:"5" maxLength:"250"` Name string `xorm:"varchar(250) not null" json:"name" valid:"required,runelength(5|250)" minLength:"5" maxLength:"250"`
// The description of the namespace // 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:"-"` OwnerID int64 `xorm:"int(11) not null INDEX" json:"-"`
// The user who owns this namespace // The user who owns this namespace

View File

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

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-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 package swagger
@ -58,7 +58,7 @@ var doc = `{
"JWTKeyAuth": [] "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": [ "consumes": [
"application/json" "application/json"
], ],
@ -66,9 +66,9 @@ var doc = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"labels" "assignees"
], ],
"summary": "Get all labels a user has access to", "summary": "Get all assignees for a task",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
@ -78,18 +78,18 @@ var doc = `{
}, },
{ {
"type": "string", "type": "string",
"description": "Search labels by label text.", "description": "Search assignees by their username.",
"name": "s", "name": "s",
"in": "query" "in": "query"
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "The labels", "description": "The assignees",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/models.Label" "$ref": "#/definitions/models.User"
} }
} }
}, },
@ -412,7 +412,7 @@ var doc = `{
"JWTKeyAuth": [] "JWTKeyAuth": []
} }
], ],
"description": "Returns a team by its ID.", "description": "Returns a list by its ID.",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@ -420,13 +420,13 @@ var doc = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"team" "list"
], ],
"summary": "Gets one team", "summary": "Gets one list",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
"description": "Team ID", "description": "List ID",
"name": "id", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
@ -434,14 +434,14 @@ var doc = `{
], ],
"responses": { "responses": {
"200": { "200": {
"description": "The team", "description": "The list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.Team" "$ref": "#/definitions/models.List"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the team", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/code.vikunja.io.web.HTTPError" "$ref": "#/definitions/code.vikunja.io.web.HTTPError"
@ -3738,8 +3738,7 @@ var doc = `{
}, },
"description": { "description": {
"description": "The task description.", "description": "The task description.",
"type": "string", "type": "string"
"maxLength": 250
}, },
"done": { "done": {
"description": "Whether a task is done or not.", "description": "Whether a task is done or not.",
@ -3849,8 +3848,7 @@ var doc = `{
}, },
"description": { "description": {
"description": "The label description.", "description": "The label description.",
"type": "string", "type": "string"
"maxLength": 250
}, },
"hex_color": { "hex_color": {
"description": "The color this label has", "description": "The color this label has",
@ -3907,8 +3905,7 @@ var doc = `{
}, },
"description": { "description": {
"description": "The description of the list.", "description": "The description of the list.",
"type": "string", "type": "string"
"maxLength": 1000
}, },
"id": { "id": {
"description": "The unique, numeric id of this list.", "description": "The unique, numeric id of this list.",
@ -3959,8 +3956,7 @@ var doc = `{
}, },
"description": { "description": {
"description": "The task description.", "description": "The task description.",
"type": "string", "type": "string"
"maxLength": 250
}, },
"done": { "done": {
"description": "Whether a task is done or not.", "description": "Whether a task is done or not.",
@ -4096,8 +4092,7 @@ var doc = `{
}, },
"description": { "description": {
"description": "The description of the namespace", "description": "The description of the namespace",
"type": "string", "type": "string"
"maxLength": 250
}, },
"id": { "id": {
"description": "The unique, numeric id of this namespace.", "description": "The unique, numeric id of this namespace.",
@ -4156,8 +4151,7 @@ var doc = `{
}, },
"description": { "description": {
"description": "The description of the namespace", "description": "The description of the namespace",
"type": "string", "type": "string"
"maxLength": 250
}, },
"id": { "id": {
"description": "The unique, numeric id of this namespace.", "description": "The unique, numeric id of this namespace.",
@ -4222,9 +4216,7 @@ var doc = `{
}, },
"description": { "description": {
"description": "The team's description.", "description": "The team's description.",
"type": "string", "type": "string"
"maxLength": 250,
"minLength": 0
}, },
"id": { "id": {
"description": "The unique, numeric id of this team.", "description": "The unique, numeric id of this team.",
@ -4374,9 +4366,7 @@ var doc = `{
}, },
"description": { "description": {
"description": "The team's description.", "description": "The team's description.",
"type": "string", "type": "string"
"maxLength": 250,
"minLength": 0
}, },
"id": { "id": {
"description": "The unique, numeric id of this team.", "description": "The unique, numeric id of this team.",

View File

@ -45,7 +45,7 @@
"JWTKeyAuth": [] "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": [ "consumes": [
"application/json" "application/json"
], ],
@ -53,9 +53,9 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"labels" "assignees"
], ],
"summary": "Get all labels a user has access to", "summary": "Get all assignees for a task",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
@ -65,18 +65,18 @@
}, },
{ {
"type": "string", "type": "string",
"description": "Search labels by label text.", "description": "Search assignees by their username.",
"name": "s", "name": "s",
"in": "query" "in": "query"
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "The labels", "description": "The assignees",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/models.Label" "$ref": "#/definitions/models.User"
} }
} }
}, },
@ -399,7 +399,7 @@
"JWTKeyAuth": [] "JWTKeyAuth": []
} }
], ],
"description": "Returns a team by its ID.", "description": "Returns a list by its ID.",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@ -407,13 +407,13 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"team" "list"
], ],
"summary": "Gets one team", "summary": "Gets one list",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
"description": "Team ID", "description": "List ID",
"name": "id", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
@ -421,14 +421,14 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "The team", "description": "The list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.Team" "$ref": "#/definitions/models.List"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the team", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/code.vikunja.io/web.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
@ -3724,8 +3724,7 @@
}, },
"description": { "description": {
"description": "The task description.", "description": "The task description.",
"type": "string", "type": "string"
"maxLength": 250
}, },
"done": { "done": {
"description": "Whether a task is done or not.", "description": "Whether a task is done or not.",
@ -3835,8 +3834,7 @@
}, },
"description": { "description": {
"description": "The label description.", "description": "The label description.",
"type": "string", "type": "string"
"maxLength": 250
}, },
"hex_color": { "hex_color": {
"description": "The color this label has", "description": "The color this label has",
@ -3893,8 +3891,7 @@
}, },
"description": { "description": {
"description": "The description of the list.", "description": "The description of the list.",
"type": "string", "type": "string"
"maxLength": 1000
}, },
"id": { "id": {
"description": "The unique, numeric id of this list.", "description": "The unique, numeric id of this list.",
@ -3945,8 +3942,7 @@
}, },
"description": { "description": {
"description": "The task description.", "description": "The task description.",
"type": "string", "type": "string"
"maxLength": 250
}, },
"done": { "done": {
"description": "Whether a task is done or not.", "description": "Whether a task is done or not.",
@ -4082,8 +4078,7 @@
}, },
"description": { "description": {
"description": "The description of the namespace", "description": "The description of the namespace",
"type": "string", "type": "string"
"maxLength": 250
}, },
"id": { "id": {
"description": "The unique, numeric id of this namespace.", "description": "The unique, numeric id of this namespace.",
@ -4142,8 +4137,7 @@
}, },
"description": { "description": {
"description": "The description of the namespace", "description": "The description of the namespace",
"type": "string", "type": "string"
"maxLength": 250
}, },
"id": { "id": {
"description": "The unique, numeric id of this namespace.", "description": "The unique, numeric id of this namespace.",
@ -4208,9 +4202,7 @@
}, },
"description": { "description": {
"description": "The team's description.", "description": "The team's description.",
"type": "string", "type": "string"
"maxLength": 250,
"minLength": 0
}, },
"id": { "id": {
"description": "The unique, numeric id of this team.", "description": "The unique, numeric id of this team.",
@ -4360,9 +4352,7 @@
}, },
"description": { "description": {
"description": "The team's description.", "description": "The team's description.",
"type": "string", "type": "string"
"maxLength": 250,
"minLength": 0
}, },
"id": { "id": {
"description": "The unique, numeric id of this team.", "description": "The unique, numeric id of this team.",

View File

@ -46,7 +46,6 @@ definitions:
type: object type: object
description: description:
description: The task description. description: The task description.
maxLength: 250
type: string type: string
done: done:
description: Whether a task is done or not. description: Whether a task is done or not.
@ -134,7 +133,6 @@ definitions:
type: object type: object
description: description:
description: The label description. description: The label description.
maxLength: 250
type: string type: string
hex_color: hex_color:
description: The color this label has description: The color this label has
@ -180,7 +178,6 @@ definitions:
type: integer type: integer
description: description:
description: The description of the list. description: The description of the list.
maxLength: 1000
type: string type: string
id: id:
description: The unique, numeric id of this list. description: The unique, numeric id of this list.
@ -221,7 +218,6 @@ definitions:
type: object type: object
description: description:
description: The task description. description: The task description.
maxLength: 250
type: string type: string
done: done:
description: Whether a task is done or not. description: Whether a task is done or not.
@ -330,7 +326,6 @@ definitions:
type: integer type: integer
description: description:
description: The description of the namespace description: The description of the namespace
maxLength: 250
type: string type: string
id: id:
description: The unique, numeric id of this namespace. description: The unique, numeric id of this namespace.
@ -380,7 +375,6 @@ definitions:
type: integer type: integer
description: description:
description: The description of the namespace description: The description of the namespace
maxLength: 250
type: string type: string
id: id:
description: The unique, numeric id of this namespace. description: The unique, numeric id of this namespace.
@ -430,8 +424,6 @@ definitions:
type: object type: object
description: description:
description: The team's description. description: The team's description.
maxLength: 250
minLength: 0
type: string type: string
id: id:
description: The unique, numeric id of this team. description: The unique, numeric id of this team.
@ -558,8 +550,6 @@ definitions:
type: object type: object
description: description:
description: The team's description. description: The team's description.
maxLength: 250
minLength: 0
type: string type: string
id: id:
description: The unique, numeric id of this team. description: The unique, numeric id of this team.
@ -704,15 +694,14 @@ paths:
get: get:
consumes: consumes:
- application/json - application/json
description: Returns all labels which are either created by the user or associated description: Returns an array with all assignees for this task.
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 labels by label text. - description: Search assignees by their username.
in: query in: query
name: s name: s
type: string type: string
@ -720,10 +709,10 @@ paths:
- application/json - application/json
responses: responses:
"200": "200":
description: The labels description: The assignees
schema: schema:
items: items:
$ref: '#/definitions/models.Label' $ref: '#/definitions/models.User'
type: array type: array
"500": "500":
description: Internal error description: Internal error
@ -732,9 +721,9 @@ paths:
type: object type: object
security: security:
- JWTKeyAuth: [] - JWTKeyAuth: []
summary: Get all labels a user has access to summary: Get all assignees for a task
tags: tags:
- labels - assignees
put: put:
consumes: consumes:
- application/json - application/json
@ -978,9 +967,9 @@ paths:
get: get:
consumes: consumes:
- application/json - application/json
description: Returns a team by its ID. description: Returns a list by its ID.
parameters: parameters:
- description: Team ID - description: List ID
in: path in: path
name: id name: id
required: true required: true
@ -989,12 +978,12 @@ paths:
- application/json - application/json
responses: responses:
"200": "200":
description: The team description: The list
schema: schema:
$ref: '#/definitions/models.Team' $ref: '#/definitions/models.List'
type: object type: object
"403": "403":
description: The user does not have access to the team description: The user does not have access to the list
schema: schema:
$ref: '#/definitions/code.vikunja.io/web.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
@ -1005,9 +994,9 @@ paths:
type: object type: object
security: security:
- JWTKeyAuth: [] - JWTKeyAuth: []
summary: Gets one team summary: Gets one list
tags: tags:
- team - list
post: post:
consumes: consumes:
- application/json - application/json