diff --git a/pkg/models/label.go b/pkg/models/label.go index b73796293d..70c34df4ad 100644 --- a/pkg/models/label.go +++ b/pkg/models/label.go @@ -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"` diff --git a/pkg/models/list.go b/pkg/models/list.go index 97ed3132f3..81a8c21890 100644 --- a/pkg/models/list.go +++ b/pkg/models/list.go @@ -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"` diff --git a/pkg/models/list_tasks.go b/pkg/models/list_tasks.go index 4706cf0411..04e6ebe414 100644 --- a/pkg/models/list_tasks.go +++ b/pkg/models/list_tasks.go @@ -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. diff --git a/pkg/models/namespace.go b/pkg/models/namespace.go index aff317e91e..1ef0cf3817 100644 --- a/pkg/models/namespace.go +++ b/pkg/models/namespace.go @@ -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 diff --git a/pkg/models/teams.go b/pkg/models/teams.go index 937a24a4dd..182603ea07 100644 --- a/pkg/models/teams.go +++ b/pkg/models/teams.go @@ -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. diff --git a/pkg/swagger/docs.go b/pkg/swagger/docs.go index 5352d1cbfd..e11594ca06 100644 --- a/pkg/swagger/docs.go +++ b/pkg/swagger/docs.go @@ -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.", diff --git a/pkg/swagger/swagger.json b/pkg/swagger/swagger.json index 8ebc7b218c..094349ce7c 100644 --- a/pkg/swagger/swagger.json +++ b/pkg/swagger/swagger.json @@ -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.", diff --git a/pkg/swagger/swagger.yaml b/pkg/swagger/swagger.yaml index 3027626fe3..8074892161 100644 --- a/pkg/swagger/swagger.yaml +++ b/pkg/swagger/swagger.yaml @@ -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