1
0

Refactor {List|Namespace}{User|Team} to not expose unneded values via json (#52)

This commit is contained in:
konrad
2019-01-14 22:32:56 +00:00
committed by Gitea
parent cf0b0a2853
commit 19218b28a2
12 changed files with 87 additions and 164 deletions

View File

@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2019-01-10 00:01:27.123040428 +0100 CET m=+0.110268080
// 2019-01-14 23:02:47.994258682 +0100 CET m=+0.170768570
package docs
@ -14,7 +14,7 @@ import (
var doc = `{
"swagger": "2.0",
"info": {
"description": "This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. \u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e\n# Authorization\n**JWT-Auth:** Main authorization method, used for most of the requests. Needs ` + "`" + `Authorization: Bearer \u003cjwt-token\u003e` + "`" + `-header to authenticate successfully.\n\n**BasicAuth:** Only used when requesting tasks via caldav.\n\u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e",
"description": "\u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e",
"title": "Vikunja API",
"contact": {
"name": "General Vikunja contact",
@ -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"
}
}
},
@ -3799,6 +3799,7 @@ var doc = `{
"maxLength": 250
},
"done": {
"description": "Whether a task is done or not.",
"type": "boolean"
},
"dueDate": {
@ -3820,10 +3821,6 @@ var doc = `{
"$ref": "#/definitions/models.Label"
}
},
"listID": {
"description": "The list this task belongs to.",
"type": "integer"
},
"parentTaskID": {
"description": "If the task is a subtask, this is the id of its parent.",
"type": "integer"
@ -3997,6 +3994,7 @@ var doc = `{
"maxLength": 250
},
"done": {
"description": "Whether a task is done or not.",
"type": "boolean"
},
"dueDate": {
@ -4018,10 +4016,6 @@ var doc = `{
"$ref": "#/definitions/models.Label"
}
},
"listID": {
"description": "The list this task belongs to.",
"type": "integer"
},
"parentTaskID": {
"description": "If the task is a subtask, this is the id of its parent.",
"type": "integer"
@ -4086,10 +4080,6 @@ var doc = `{
"description": "The unique, numeric id of this list \u003c-\u003e user relation.",
"type": "integer"
},
"list_id": {
"description": "The list id.",
"type": "integer"
},
"right": {
"description": "The right this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.",
"type": "integer",
@ -4100,7 +4090,7 @@ var doc = `{
"description": "A unix timestamp when this relation was last updated. You cannot change this value.",
"type": "integer"
},
"user_id": {
"userID": {
"description": "The user id.",
"type": "integer"
}
@ -4159,10 +4149,6 @@ var doc = `{
"description": "The unique, numeric id of this namespace \u003c-\u003e user relation.",
"type": "integer"
},
"namespace_id": {
"description": "The namespace id",
"type": "integer"
},
"right": {
"description": "The right this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.",
"type": "integer",
@ -4173,7 +4159,7 @@ var doc = `{
"description": "A unix timestamp when this relation was last updated. You cannot change this value.",
"type": "integer"
},
"user_id": {
"userID": {
"description": "The user id.",
"type": "integer"
}
@ -4247,7 +4233,7 @@ var doc = `{
"description": "A unix timestamp when this relation was created. You cannot change this value.",
"type": "integer"
},
"created_by": {
"createdBy": {
"description": "The user who created this team.",
"type": "object",
"$ref": "#/definitions/models.User"
@ -4292,17 +4278,13 @@ var doc = `{
"description": "The unique, numeric id of this list \u003c-\u003e team relation.",
"type": "integer"
},
"list_id": {
"description": "The list id.",
"type": "integer"
},
"right": {
"description": "The right this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.",
"type": "integer",
"default": 0,
"maximum": 2
},
"team_id": {
"teamID": {
"description": "The team id.",
"type": "integer"
},
@ -4327,11 +4309,7 @@ var doc = `{
"description": "The unique, numeric id of this team member relation.",
"type": "integer"
},
"team_id": {
"description": "The team id.",
"type": "integer"
},
"user_id": {
"userID": {
"description": "The id of the member.",
"type": "integer"
}
@ -4348,17 +4326,13 @@ var doc = `{
"description": "The unique, numeric id of this namespace \u003c-\u003e team relation.",
"type": "integer"
},
"namespace_id": {
"description": "The namespace id.",
"type": "integer"
},
"right": {
"description": "The right this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.",
"type": "integer",
"default": 0,
"maximum": 2
},
"team_id": {
"teamID": {
"description": "The team id.",
"type": "integer"
},
@ -4380,7 +4354,7 @@ var doc = `{
"type": "integer"
},
"email": {
"description": "The user's email address",
"description": "The user's email address.",
"type": "string",
"maxLength": 250
},
@ -4393,7 +4367,7 @@ var doc = `{
"type": "integer"
},
"username": {
"description": "The username of the username. Is always unique.",
"description": "The username of the user. Is always unique.",
"type": "string",
"maxLength": 250,
"minLength": 3
@ -4407,7 +4381,7 @@ var doc = `{
"description": "A unix timestamp when this relation was created. You cannot change this value.",
"type": "integer"
},
"created_by": {
"createdBy": {
"description": "The user who created this team.",
"type": "object",
"$ref": "#/definitions/models.User"
@ -4452,7 +4426,7 @@ var doc = `{
"type": "integer"
},
"email": {
"description": "The user's email address",
"description": "The user's email address.",
"type": "string",
"maxLength": 250
},
@ -4465,7 +4439,7 @@ var doc = `{
"type": "integer"
},
"username": {
"description": "The username of the username. Is always unique.",
"description": "The username of the user. Is always unique.",
"type": "string",
"maxLength": 250,
"minLength": 3
@ -4493,7 +4467,7 @@ var doc = `{
"type": "integer"
},
"email": {
"description": "The user's email address",
"description": "The user's email address.",
"type": "string",
"maxLength": 250
},
@ -4509,7 +4483,7 @@ var doc = `{
"type": "integer"
},
"username": {
"description": "The username of the username. Is always unique.",
"description": "The username of the user. Is always unique.",
"type": "string",
"maxLength": 250,
"minLength": 3

View File

@ -1,7 +1,7 @@
{
"swagger": "2.0",
"info": {
"description": "This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. \u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e\n# Authorization\n**JWT-Auth:** Main authorization method, used for most of the requests. Needs ` + \"`\" + `Authorization: Bearer \u003cjwt-token\u003e` + \"`\" + `-header to authenticate successfully.\n\n**BasicAuth:** Only used when requesting tasks via caldav.\n\u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e",
"description": "\u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e",
"title": "Vikunja API",
"contact": {
"name": "General Vikunja contact",
@ -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"
}
}
},
@ -3785,6 +3785,7 @@
"maxLength": 250
},
"done": {
"description": "Whether a task is done or not.",
"type": "boolean"
},
"dueDate": {
@ -3806,10 +3807,6 @@
"$ref": "#/definitions/models.Label"
}
},
"listID": {
"description": "The list this task belongs to.",
"type": "integer"
},
"parentTaskID": {
"description": "If the task is a subtask, this is the id of its parent.",
"type": "integer"
@ -3983,6 +3980,7 @@
"maxLength": 250
},
"done": {
"description": "Whether a task is done or not.",
"type": "boolean"
},
"dueDate": {
@ -4004,10 +4002,6 @@
"$ref": "#/definitions/models.Label"
}
},
"listID": {
"description": "The list this task belongs to.",
"type": "integer"
},
"parentTaskID": {
"description": "If the task is a subtask, this is the id of its parent.",
"type": "integer"
@ -4072,10 +4066,6 @@
"description": "The unique, numeric id of this list \u003c-\u003e user relation.",
"type": "integer"
},
"list_id": {
"description": "The list id.",
"type": "integer"
},
"right": {
"description": "The right this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.",
"type": "integer",
@ -4086,7 +4076,7 @@
"description": "A unix timestamp when this relation was last updated. You cannot change this value.",
"type": "integer"
},
"user_id": {
"userID": {
"description": "The user id.",
"type": "integer"
}
@ -4145,10 +4135,6 @@
"description": "The unique, numeric id of this namespace \u003c-\u003e user relation.",
"type": "integer"
},
"namespace_id": {
"description": "The namespace id",
"type": "integer"
},
"right": {
"description": "The right this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.",
"type": "integer",
@ -4159,7 +4145,7 @@
"description": "A unix timestamp when this relation was last updated. You cannot change this value.",
"type": "integer"
},
"user_id": {
"userID": {
"description": "The user id.",
"type": "integer"
}
@ -4233,7 +4219,7 @@
"description": "A unix timestamp when this relation was created. You cannot change this value.",
"type": "integer"
},
"created_by": {
"createdBy": {
"description": "The user who created this team.",
"type": "object",
"$ref": "#/definitions/models.User"
@ -4278,17 +4264,13 @@
"description": "The unique, numeric id of this list \u003c-\u003e team relation.",
"type": "integer"
},
"list_id": {
"description": "The list id.",
"type": "integer"
},
"right": {
"description": "The right this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.",
"type": "integer",
"default": 0,
"maximum": 2
},
"team_id": {
"teamID": {
"description": "The team id.",
"type": "integer"
},
@ -4313,11 +4295,7 @@
"description": "The unique, numeric id of this team member relation.",
"type": "integer"
},
"team_id": {
"description": "The team id.",
"type": "integer"
},
"user_id": {
"userID": {
"description": "The id of the member.",
"type": "integer"
}
@ -4334,17 +4312,13 @@
"description": "The unique, numeric id of this namespace \u003c-\u003e team relation.",
"type": "integer"
},
"namespace_id": {
"description": "The namespace id.",
"type": "integer"
},
"right": {
"description": "The right this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.",
"type": "integer",
"default": 0,
"maximum": 2
},
"team_id": {
"teamID": {
"description": "The team id.",
"type": "integer"
},
@ -4366,7 +4340,7 @@
"type": "integer"
},
"email": {
"description": "The user's email address",
"description": "The user's email address.",
"type": "string",
"maxLength": 250
},
@ -4379,7 +4353,7 @@
"type": "integer"
},
"username": {
"description": "The username of the username. Is always unique.",
"description": "The username of the user. Is always unique.",
"type": "string",
"maxLength": 250,
"minLength": 3
@ -4393,7 +4367,7 @@
"description": "A unix timestamp when this relation was created. You cannot change this value.",
"type": "integer"
},
"created_by": {
"createdBy": {
"description": "The user who created this team.",
"type": "object",
"$ref": "#/definitions/models.User"
@ -4438,7 +4412,7 @@
"type": "integer"
},
"email": {
"description": "The user's email address",
"description": "The user's email address.",
"type": "string",
"maxLength": 250
},
@ -4451,7 +4425,7 @@
"type": "integer"
},
"username": {
"description": "The username of the username. Is always unique.",
"description": "The username of the user. Is always unique.",
"type": "string",
"maxLength": 250,
"minLength": 3
@ -4479,7 +4453,7 @@
"type": "integer"
},
"email": {
"description": "The user's email address",
"description": "The user's email address.",
"type": "string",
"maxLength": 250
},
@ -4495,7 +4469,7 @@
"type": "integer"
},
"username": {
"description": "The username of the username. Is always unique.",
"description": "The username of the user. Is always unique.",
"type": "string",
"maxLength": 250,
"minLength": 3

View File

@ -49,6 +49,7 @@ definitions:
maxLength: 250
type: string
done:
description: Whether a task is done or not.
type: boolean
dueDate:
description: A unix timestamp when the task is due.
@ -64,9 +65,6 @@ definitions:
items:
$ref: '#/definitions/models.Label'
type: array
listID:
description: The list this task belongs to.
type: integer
parentTaskID:
description: If the task is a subtask, this is the id of its parent.
type: integer
@ -207,6 +205,7 @@ definitions:
maxLength: 250
type: string
done:
description: Whether a task is done or not.
type: boolean
dueDate:
description: A unix timestamp when the task is due.
@ -222,9 +221,6 @@ definitions:
items:
$ref: '#/definitions/models.Label'
type: array
listID:
description: The list this task belongs to.
type: integer
parentTaskID:
description: If the task is a subtask, this is the id of its parent.
type: integer
@ -277,9 +273,6 @@ definitions:
id:
description: The unique, numeric id of this list <-> user relation.
type: integer
list_id:
description: The list id.
type: integer
right:
default: 0
description: The right this user has. 0 = Read only, 1 = Read & Write, 2 =
@ -290,7 +283,7 @@ definitions:
description: A unix timestamp when this relation was last updated. You cannot
change this value.
type: integer
user_id:
userID:
description: The user id.
type: integer
type: object
@ -336,9 +329,6 @@ definitions:
id:
description: The unique, numeric id of this namespace <-> user relation.
type: integer
namespace_id:
description: The namespace id
type: integer
right:
default: 0
description: The right this user has. 0 = Read only, 1 = Read & Write, 2 =
@ -349,7 +339,7 @@ definitions:
description: A unix timestamp when this relation was last updated. You cannot
change this value.
type: integer
user_id:
userID:
description: The user id.
type: integer
type: object
@ -405,7 +395,7 @@ definitions:
description: A unix timestamp when this relation was created. You cannot change
this value.
type: integer
created_by:
createdBy:
$ref: '#/definitions/models.User'
description: The user who created this team.
type: object
@ -441,16 +431,13 @@ definitions:
id:
description: The unique, numeric id of this list <-> team relation.
type: integer
list_id:
description: The list id.
type: integer
right:
default: 0
description: The right this team has. 0 = Read only, 1 = Read & Write, 2 =
Admin. See the docs for more details.
maximum: 2
type: integer
team_id:
teamID:
description: The team id.
type: integer
updated:
@ -471,10 +458,7 @@ definitions:
id:
description: The unique, numeric id of this team member relation.
type: integer
team_id:
description: The team id.
type: integer
user_id:
userID:
description: The id of the member.
type: integer
type: object
@ -487,16 +471,13 @@ definitions:
id:
description: The unique, numeric id of this namespace <-> team relation.
type: integer
namespace_id:
description: The namespace id.
type: integer
right:
default: 0
description: The right this team has. 0 = Read only, 1 = Read & Write, 2 =
Admin. See the docs for more details.
maximum: 2
type: integer
team_id:
teamID:
description: The team id.
type: integer
updated:
@ -515,7 +496,7 @@ definitions:
this value.
type: integer
email:
description: The user's email address
description: The user's email address.
maxLength: 250
type: string
id:
@ -526,7 +507,7 @@ definitions:
change this value.
type: integer
username:
description: The username of the username. Is always unique.
description: The username of the user. Is always unique.
maxLength: 250
minLength: 3
type: string
@ -537,7 +518,7 @@ definitions:
description: A unix timestamp when this relation was created. You cannot change
this value.
type: integer
created_by:
createdBy:
$ref: '#/definitions/models.User'
description: The user who created this team.
type: object
@ -573,7 +554,7 @@ definitions:
this value.
type: integer
email:
description: The user's email address
description: The user's email address.
maxLength: 250
type: string
id:
@ -584,7 +565,7 @@ definitions:
change this value.
type: integer
username:
description: The username of the username. Is always unique.
description: The username of the user. Is always unique.
maxLength: 250
minLength: 3
type: string
@ -605,7 +586,7 @@ definitions:
this value.
type: integer
email:
description: The user's email address
description: The user's email address.
maxLength: 250
type: string
id:
@ -618,7 +599,7 @@ definitions:
change this value.
type: integer
username:
description: The username of the username. Is always unique.
description: The username of the user. Is always unique.
maxLength: 250
minLength: 3
type: string
@ -641,13 +622,7 @@ info:
email: hello@vikunja.io
name: General Vikunja contact
url: http://vikunja.io/en/contact/
description: |-
This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> -->
# Authorization
**JWT-Auth:** Main authorization method, used for most of the requests. Needs ` + "`" + `Authorization: Bearer <jwt-token>` + "`" + `-header to authenticate successfully.
**BasicAuth:** Only used when requesting tasks via caldav.
<!-- ReDoc-Inject: <security-definitions> -->
description: '<!-- ReDoc-Inject: <security-definitions> -->'
license:
name: GPLv3
url: http://code.vikunja.io/api/src/branch/master/LICENSE
@ -658,15 +633,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
@ -674,10 +648,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
@ -686,9 +660,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