From c17dec7954ddb283c5604b21eeca8a8902ebb6e8 Mon Sep 17 00:00:00 2001 From: konrad Date: Wed, 29 Aug 2018 15:13:54 +0200 Subject: [PATCH] Updated swagger docs --- public/swagger/swagger.v1.json | 726 ++++++++++++++++++++++++++++- routes/api/v1/oldhandlers.go | 298 ------------ routes/api/v1/swagger/options.go | 12 + routes/api/v1/swagger/responses.go | 33 ++ routes/api/v1/swaggerdocs.go | 635 +++++++++++++++++++++++++ 5 files changed, 1398 insertions(+), 306 deletions(-) delete mode 100644 routes/api/v1/oldhandlers.go create mode 100644 routes/api/v1/swaggerdocs.go diff --git a/public/swagger/swagger.v1.json b/public/swagger/swagger.v1.json index 4816b5c63..510847452 100644 --- a/public/swagger/swagger.v1.json +++ b/public/swagger/swagger.v1.json @@ -2,8 +2,8 @@ "swagger": "2.0", "info": {}, "paths": { - "/item/{itemID}": { - "put": { + "/items/{itemID}": { + "post": { "consumes": [ "application/json" ], @@ -263,6 +263,123 @@ } } }, + "/lists/{listID}/teams": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "gets all teams which have access to the list", + "operationId": "getTeamsByList", + "parameters": [ + { + "type": "string", + "description": "ID of the list to show", + "name": "listID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Team" + }, + "400": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "adds a team to a list", + "operationId": "addTeamToList", + "parameters": [ + { + "type": "string", + "description": "ID of the list to show", + "name": "listID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/TeamList" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/TeamList" + }, + "400": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + } + }, + "/lists/{listID}/teams/{teamID}": { + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "removes a team from a list", + "operationId": "deleteTeamFromList", + "parameters": [ + { + "type": "string", + "description": "ID of the list", + "name": "listID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ID of the team to remove", + "name": "teamID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Message" + }, + "400": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + } + }, "/login": { "post": { "consumes": [ @@ -483,14 +600,14 @@ "application/json" ], "tags": [ - "namespaces" + "lists" ], - "summary": "gets all lists belonging to that namespace", - "operationId": "getListsByNamespace", + "summary": "gets all lists in that namespace", + "operationId": "getNamespaceLists", "parameters": [ { "type": "string", - "description": "ID of the namespace", + "description": "ID of the namespace to show", "name": "namespaceID", "in": "path", "required": true @@ -498,7 +615,7 @@ ], "responses": { "200": { - "$ref": "#/responses/Namespace" + "$ref": "#/responses/List" }, "400": { "$ref": "#/responses/Message" @@ -553,6 +670,130 @@ } } }, + "/namespaces/{namespaceID}/teams": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "gets all teams which have access to that namespace", + "operationId": "getNamespaceTeams", + "parameters": [ + { + "type": "string", + "description": "ID of the namespace to show", + "name": "namespaceID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Team" + }, + "400": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "Gives a team access to a namespace", + "operationId": "addTeamToNamespace", + "parameters": [ + { + "type": "string", + "description": "ID of the namespace that list should belong to", + "name": "namespaceID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TeamNamespace" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/TeamNamespace" + }, + "400": { + "$ref": "#/responses/Message" + }, + "403": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + } + }, + "/namespaces/{namespaceID}/teams/{teamID}": { + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "Removes a team from a namespace", + "operationId": "removeTeamFromNamespace", + "parameters": [ + { + "type": "string", + "description": "ID of the namespace", + "name": "namespaceID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ID of the team you want to remove", + "name": "teamID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Message" + }, + "400": { + "$ref": "#/responses/Message" + }, + "403": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + } + }, "/register": { "post": { "consumes": [ @@ -587,6 +828,275 @@ } } } + }, + "/teams": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "gets all teams the current user is part of", + "operationId": "getTeams", + "responses": { + "200": { + "$ref": "#/responses/Team" + }, + "400": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + }, + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "Creates a team", + "operationId": "createTeam", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Team" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Team" + }, + "400": { + "$ref": "#/responses/Message" + }, + "403": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + } + }, + "/teams/{teamID}": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "gets infos about the team", + "operationId": "getTeamByID", + "parameters": [ + { + "type": "string", + "description": "ID of the team", + "name": "teamID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Team" + }, + "400": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "Updates a team", + "operationId": "updateTeam", + "parameters": [ + { + "type": "string", + "description": "ID of the team you want to update", + "name": "teamID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Team" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/Team" + }, + "400": { + "$ref": "#/responses/Message" + }, + "403": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "Deletes a team", + "operationId": "deleteTeam", + "parameters": [ + { + "type": "string", + "description": "ID of the team you want to delete", + "name": "teamID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Message" + }, + "400": { + "$ref": "#/responses/Message" + }, + "403": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + } + }, + "/teams/{teamID}/members": { + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "Adds a member to a team", + "operationId": "addTeamMember", + "parameters": [ + { + "type": "string", + "description": "ID of the team you want to add a member to", + "name": "teamID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TeamMember" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/TeamMember" + }, + "400": { + "$ref": "#/responses/Message" + }, + "403": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + } + }, + "/teams/{teamID}/members/{userID}": { + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "teams" + ], + "summary": "Removes a member from a team", + "operationId": "removeTeamMember", + "parameters": [ + { + "type": "string", + "description": "ID of the team you want to delete a member", + "name": "teamID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ID of the user you want to remove from the team", + "name": "userID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Message" + }, + "400": { + "$ref": "#/responses/Message" + }, + "403": { + "$ref": "#/responses/Message" + }, + "500": { + "$ref": "#/responses/Message" + } + } + } } }, "definitions": { @@ -750,6 +1260,182 @@ }, "x-go-package": "code.vikunja.io/api/models" }, + "Team": { + "description": "Team holds a team object", + "type": "object", + "properties": { + "created": { + "type": "integer", + "format": "int64", + "x-go-name": "Created" + }, + "created_by": { + "$ref": "#/definitions/User" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamUser" + }, + "x-go-name": "Members" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "updated": { + "type": "integer", + "format": "int64", + "x-go-name": "Updated" + } + }, + "x-go-package": "code.vikunja.io/api/models" + }, + "TeamList": { + "description": "TeamList defines the relation between a team and a list", + "type": "object", + "properties": { + "created": { + "type": "integer", + "format": "int64", + "x-go-name": "Created" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "list_id": { + "type": "integer", + "format": "int64", + "x-go-name": "ListID" + }, + "right": { + "$ref": "#/definitions/TeamRight" + }, + "team_id": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID" + }, + "updated": { + "type": "integer", + "format": "int64", + "x-go-name": "Updated" + } + }, + "x-go-package": "code.vikunja.io/api/models" + }, + "TeamMember": { + "description": "TeamMember defines the relationship between a user and a team", + "type": "object", + "properties": { + "admin": { + "type": "boolean", + "x-go-name": "Admin" + }, + "created": { + "type": "integer", + "format": "int64", + "x-go-name": "Created" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "team_id": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID" + }, + "updated": { + "type": "integer", + "format": "int64", + "x-go-name": "Updated" + }, + "user_id": { + "type": "integer", + "format": "int64", + "x-go-name": "UserID" + } + }, + "x-go-package": "code.vikunja.io/api/models" + }, + "TeamNamespace": { + "description": "TeamNamespace defines the relationship between a Team and a Namespace", + "type": "object", + "properties": { + "created": { + "type": "integer", + "format": "int64", + "x-go-name": "Created" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "namespace_id": { + "type": "integer", + "format": "int64", + "x-go-name": "NamespaceID" + }, + "right": { + "$ref": "#/definitions/TeamRight" + }, + "team_id": { + "type": "integer", + "format": "int64", + "x-go-name": "TeamID" + }, + "updated": { + "type": "integer", + "format": "int64", + "x-go-name": "Updated" + } + }, + "x-go-package": "code.vikunja.io/api/models" + }, + "TeamRight": { + "description": "TeamRight defines the rights teams can have for lists/namespaces", + "type": "integer", + "format": "int64", + "x-go-package": "code.vikunja.io/api/models" + }, + "TeamUser": { + "description": "TeamUser is the team member type", + "type": "object", + "properties": { + "admin": { + "type": "boolean", + "x-go-name": "Admin" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "username": { + "type": "string", + "x-go-name": "Username" + } + }, + "x-go-package": "code.vikunja.io/api/models" + }, "User": { "description": "User holds information about an user", "type": "object", @@ -811,6 +1497,30 @@ "$ref": "#/definitions/Namespace" } }, + "Team": { + "description": "Team", + "schema": { + "$ref": "#/definitions/Team" + } + }, + "TeamList": { + "description": "TeamList", + "schema": { + "$ref": "#/definitions/TeamList" + } + }, + "TeamMember": { + "description": "TeamMember", + "schema": { + "$ref": "#/definitions/TeamMember" + } + }, + "TeamNamespace": { + "description": "TeamNamespace", + "schema": { + "$ref": "#/definitions/TeamNamespace" + } + }, "Token": { "description": "Token", "schema": { @@ -836,7 +1546,7 @@ "parameterBodies": { "description": "parameterBodies", "schema": { - "$ref": "#/definitions/Namespace" + "$ref": "#/definitions/TeamNamespace" } } } diff --git a/routes/api/v1/oldhandlers.go b/routes/api/v1/oldhandlers.go deleted file mode 100644 index 597dee00e..000000000 --- a/routes/api/v1/oldhandlers.go +++ /dev/null @@ -1,298 +0,0 @@ -package v1 - -// swagger:operation DELETE /item/{itemID} lists deleteListItem -// --- -// summary: Deletes a list item -// consumes: -// - application/json -// produces: -// - application/json -// parameters: -// - name: itemID -// in: path -// description: ID of the list item to delete -// type: string -// required: true -// responses: -// "200": -// "$ref": "#/responses/Message" -// "400": -// "$ref": "#/responses/Message" -// "403": -// "$ref": "#/responses/Message" -// "404": -// "$ref": "#/responses/Message" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation DELETE /lists/{listID} lists deleteList -// --- -// summary: Deletes a list with all items on it -// consumes: -// - application/json -// produces: -// - application/json -// parameters: -// - name: listID -// in: path -// description: ID of the list to delete -// type: string -// required: true -// responses: -// "200": -// "$ref": "#/responses/Message" -// "400": -// "$ref": "#/responses/Message" -// "403": -// "$ref": "#/responses/Message" -// "404": -// "$ref": "#/responses/Message" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation PUT /lists/{listID} lists addListItem -// --- -// summary: Adds an item to a list -// consumes: -// - application/json -// produces: -// - application/json -// parameters: -// - name: listID -// in: path -// description: ID of the list to use -// type: string -// required: true -// - name: body -// in: body -// schema: -// "$ref": "#/definitions/ListItem" -// responses: -// "200": -// "$ref": "#/responses/ListItem" -// "400": -// "$ref": "#/responses/Message" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation PUT /item/{itemID} lists updateListItem -// --- -// summary: Updates a list item -// consumes: -// - application/json -// produces: -// - application/json -// parameters: -// - name: itemID -// in: path -// description: ID of the item to update -// type: string -// required: true -// - name: body -// in: body -// schema: -// "$ref": "#/definitions/ListItem" -// responses: -// "200": -// "$ref": "#/responses/ListItem" -// "400": -// "$ref": "#/responses/Message" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation GET /lists/{listID} lists getList -// --- -// summary: gets one list with all todo items -// consumes: -// - application/json -// produces: -// - application/json -// parameters: -// - name: listID -// in: path -// description: ID of the list to show -// type: string -// required: true -// responses: -// "200": -// "$ref": "#/responses/List" -// "400": -// "$ref": "#/responses/Message" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation PUT /namespaces/{namespaceID}/lists lists addList -// --- -// summary: Creates a new list owned by the currently logged in user in that namespace -// consumes: -// - application/json -// produces: -// - application/json -// parameters: -// - name: namespaceID -// in: path -// description: ID of the namespace that list should belong to -// type: string -// required: true -// - name: body -// in: body -// required: true -// schema: -// "$ref": "#/definitions/List" -// responses: -// "200": -// "$ref": "#/responses/List" -// "400": -// "$ref": "#/responses/Message" -// "403": -// "$ref": "#/responses/Message" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation POST /lists/{listID} lists upadteList -// --- -// summary: Updates a list -// consumes: -// - application/json -// produces: -// - application/json -// parameters: -// - name: listID -// in: path -// description: ID of the list to update -// type: string -// required: true -// - name: body -// in: body -// schema: -// "$ref": "#/definitions/List" -// responses: -// "200": -// "$ref": "#/responses/List" -// "400": -// "$ref": "#/responses/Message" -// "403": -// "$ref": "#/responses/Message" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation GET /lists lists getLists -// --- -// summary: Gets all lists owned by the current user -// consumes: -// - application/json -// produces: -// - application/json -// responses: -// "200": -// "$ref": "#/responses/List" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation PUT /namespaces namespaces addNamespace -// --- -// summary: Creates a new namespace owned by the currently logged in user -// consumes: -// - application/json -// produces: -// - application/json -// parameters: -// - name: body -// in: body -// schema: -// "$ref": "#/definitions/Namespace" -// responses: -// "200": -// "$ref": "#/responses/Namespace" -// "400": -// "$ref": "#/responses/Message" -// "403": -// "$ref": "#/responses/Message" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation POST /namespaces/{namespaceID} namespaces upadteNamespace -// --- -// summary: Updates a namespace -// consumes: -// - application/json -// produces: -// - application/json -// parameters: -// - name: namespaceID -// in: path -// description: ID of the namespace to update -// type: string -// required: true -// - name: body -// in: body -// schema: -// "$ref": "#/definitions/Namespace" -// responses: -// "200": -// "$ref": "#/responses/Namespace" -// "400": -// "$ref": "#/responses/Message" -// "403": -// "$ref": "#/responses/Message" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation DELETE /namespaces/{namespaceID} namespaces deleteNamespace -// --- -// summary: Deletes a namespace with all lists -// consumes: -// - application/json -// produces: -// - application/json -// parameters: -// - name: namespaceID -// in: path -// description: ID of the namespace to delete -// type: string -// required: true -// responses: -// "200": -// "$ref": "#/responses/Message" -// "400": -// "$ref": "#/responses/Message" -// "403": -// "$ref": "#/responses/Message" -// "404": -// "$ref": "#/responses/Message" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation GET /namespaces/{namespaceID} namespaces getNamespace -// --- -// summary: gets one namespace with all todo items -// consumes: -// - application/json -// produces: -// - application/json -// parameters: -// - name: namespaceID -// in: path -// description: ID of the namespace to show -// type: string -// required: true -// responses: -// "200": -// "$ref": "#/responses/Namespace" -// "400": -// "$ref": "#/responses/Message" -// "500": -// "$ref": "#/responses/Message" - -// swagger:operation GET /namespaces namespaces getNamespaces -// --- -// summary: Get all namespaces the currently logged in user has at least read access -// consumes: -// - application/json -// produces: -// - application/json -// responses: -// "200": -// "$ref": "#/responses/Namespace" -// "500": -// "$ref": "#/responses/Message" diff --git a/routes/api/v1/swagger/options.go b/routes/api/v1/swagger/options.go index b42f2c488..42f15bf01 100644 --- a/routes/api/v1/swagger/options.go +++ b/routes/api/v1/swagger/options.go @@ -22,4 +22,16 @@ type swaggerParameterBodies struct { // in:body Namespace models.Namespace + + // in:body + Team models.Team + + // in:body + TeamMember models.TeamMember + + // in:body + TeamList models.TeamList + + // in:body + TeamNamespace models.TeamNamespace } diff --git a/routes/api/v1/swagger/responses.go b/routes/api/v1/swagger/responses.go index 25d2253b0..e5a7be01a 100644 --- a/routes/api/v1/swagger/responses.go +++ b/routes/api/v1/swagger/responses.go @@ -61,3 +61,36 @@ type swaggerResponseNamespace struct { // in:body Body models.Namespace `json:"body"` } + +// ================ +// Team definitions +// ================ + +// Team +// swagger:response Team +type swaggerResponseTeam struct { + // in:body + Body models.Team `json:"body"` +} + +// TeamMember +// swagger:response TeamMember +type swaggerResponseTeamMember struct { + // in:body + Body models.TeamMember `json:"body"` +} + +// TeamList +// swagger:response TeamList +type swaggerResponseTeamList struct { + // in:body + Body models.TeamList `json:"body"` +} + +// TeamNamespace +// swagger:response TeamNamespace +type swaggerResponseTeamNamespace struct { + // in:body + Body models.TeamNamespace `json:"body"` +} + diff --git a/routes/api/v1/swaggerdocs.go b/routes/api/v1/swaggerdocs.go new file mode 100644 index 000000000..194b21e37 --- /dev/null +++ b/routes/api/v1/swaggerdocs.go @@ -0,0 +1,635 @@ +package v1 + +// swagger:operation DELETE /items/{itemID} lists deleteListItem +// --- +// summary: Deletes a list item +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: itemID +// in: path +// description: ID of the list item to delete +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/Message" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "404": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation DELETE /lists/{listID} lists deleteList +// --- +// summary: Deletes a list with all items on it +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: listID +// in: path +// description: ID of the list to delete +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/Message" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "404": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation PUT /lists/{listID} lists addListItem +// --- +// summary: Adds an item to a list +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: listID +// in: path +// description: ID of the list to use +// type: string +// required: true +// - name: body +// in: body +// schema: +// "$ref": "#/definitions/ListItem" +// responses: +// "200": +// "$ref": "#/responses/ListItem" +// "400": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation POST /items/{itemID} lists updateListItem +// --- +// summary: Updates a list item +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: itemID +// in: path +// description: ID of the item to update +// type: string +// required: true +// - name: body +// in: body +// schema: +// "$ref": "#/definitions/ListItem" +// responses: +// "200": +// "$ref": "#/responses/ListItem" +// "400": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation GET /lists/{listID} lists getList +// --- +// summary: gets one list with all todo items +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: listID +// in: path +// description: ID of the list to show +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/List" +// "400": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation PUT /namespaces/{namespaceID}/lists lists addList +// --- +// summary: Creates a new list owned by the currently logged in user in that namespace +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: namespaceID +// in: path +// description: ID of the namespace that list should belong to +// type: string +// required: true +// - name: body +// in: body +// required: true +// schema: +// "$ref": "#/definitions/List" +// responses: +// "200": +// "$ref": "#/responses/List" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation PUT /namespaces/{namespaceID}/teams teams addTeamToNamespace +// --- +// summary: Gives a team access to a namespace +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: namespaceID +// in: path +// description: ID of the namespace that list should belong to +// type: string +// required: true +// - name: body +// in: body +// required: true +// schema: +// "$ref": "#/definitions/TeamNamespace" +// responses: +// "200": +// "$ref": "#/responses/TeamNamespace" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation DELETE /namespaces/{namespaceID}/teams/{teamID} teams removeTeamFromNamespace +// --- +// summary: Removes a team from a namespace +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: namespaceID +// in: path +// description: ID of the namespace +// type: string +// required: true +// - name: teamID +// in: path +// description: ID of the team you want to remove +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/Message" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation POST /lists/{listID} lists upadteList +// --- +// summary: Updates a list +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: listID +// in: path +// description: ID of the list to update +// type: string +// required: true +// - name: body +// in: body +// schema: +// "$ref": "#/definitions/List" +// responses: +// "200": +// "$ref": "#/responses/List" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation GET /lists lists getLists +// --- +// summary: Gets all lists owned by the current user +// consumes: +// - application/json +// produces: +// - application/json +// responses: +// "200": +// "$ref": "#/responses/List" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation PUT /namespaces namespaces addNamespace +// --- +// summary: Creates a new namespace owned by the currently logged in user +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: body +// in: body +// schema: +// "$ref": "#/definitions/Namespace" +// responses: +// "200": +// "$ref": "#/responses/Namespace" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation POST /namespaces/{namespaceID} namespaces upadteNamespace +// --- +// summary: Updates a namespace +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: namespaceID +// in: path +// description: ID of the namespace to update +// type: string +// required: true +// - name: body +// in: body +// schema: +// "$ref": "#/definitions/Namespace" +// responses: +// "200": +// "$ref": "#/responses/Namespace" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation DELETE /namespaces/{namespaceID} namespaces deleteNamespace +// --- +// summary: Deletes a namespace with all lists +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: namespaceID +// in: path +// description: ID of the namespace to delete +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/Message" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "404": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation GET /namespaces/{namespaceID} namespaces getNamespace +// --- +// summary: gets one namespace with all todo items +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: namespaceID +// in: path +// description: ID of the namespace to show +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/Namespace" +// "400": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation GET /namespaces/{namespaceID}/lists lists getNamespaceLists +// --- +// summary: gets all lists in that namespace +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: namespaceID +// in: path +// description: ID of the namespace to show +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/List" +// "400": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation GET /namespaces/{namespaceID}/teams teams getNamespaceTeams +// --- +// summary: gets all teams which have access to that namespace +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: namespaceID +// in: path +// description: ID of the namespace to show +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/Team" +// "400": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation GET /namespaces namespaces getNamespaces +// --- +// summary: Get all namespaces the currently logged in user has at least read access +// consumes: +// - application/json +// produces: +// - application/json +// responses: +// "200": +// "$ref": "#/responses/Namespace" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation GET /lists/{listID}/teams teams getTeamsByList +// --- +// summary: gets all teams which have access to the list +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: listID +// in: path +// description: ID of the list to show +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/Team" +// "400": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation PUT /lists/{listID}/teams teams addTeamToList +// --- +// summary: adds a team to a list +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: listID +// in: path +// description: ID of the list to show +// type: string +// required: true +// - name: body +// in: body +// schema: +// "$ref": "#/definitions/TeamList" +// responses: +// "200": +// "$ref": "#/responses/TeamList" +// "400": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation DELETE /lists/{listID}/teams/{teamID} teams deleteTeamFromList +// --- +// summary: removes a team from a list +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: listID +// in: path +// description: ID of the list +// type: string +// required: true +// - name: teamID +// in: path +// description: ID of the team to remove +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/Message" +// "400": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation GET /teams teams getTeams +// --- +// summary: gets all teams the current user is part of +// consumes: +// - application/json +// produces: +// - application/json +// responses: +// "200": +// "$ref": "#/responses/Team" +// "400": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation GET /teams/{teamID} teams getTeamByID +// --- +// summary: gets infos about the team +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: teamID +// in: path +// description: ID of the team +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/Team" +// "400": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation PUT /teams teams createTeam +// --- +// summary: Creates a team +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: body +// in: body +// required: true +// schema: +// "$ref": "#/definitions/Team" +// responses: +// "200": +// "$ref": "#/responses/Team" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation POST /teams/{teamID} teams updateTeam +// --- +// summary: Updates a team +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: teamID +// in: path +// description: ID of the team you want to update +// type: string +// required: true +// - name: body +// in: body +// required: true +// schema: +// "$ref": "#/definitions/Team" +// responses: +// "200": +// "$ref": "#/responses/Team" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation DELETE /teams/{teamID} teams deleteTeam +// --- +// summary: Deletes a team +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: teamID +// in: path +// description: ID of the team you want to delete +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/Message" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation PUT /teams/{teamID}/members teams addTeamMember +// --- +// summary: Adds a member to a team +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: teamID +// in: path +// description: ID of the team you want to add a member to +// type: string +// required: true +// - name: body +// in: body +// required: true +// schema: +// "$ref": "#/definitions/TeamMember" +// responses: +// "200": +// "$ref": "#/responses/TeamMember" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" + +// swagger:operation DELETE /teams/{teamID}/members/{userID} teams removeTeamMember +// --- +// summary: Removes a member from a team +// consumes: +// - application/json +// produces: +// - application/json +// parameters: +// - name: teamID +// in: path +// description: ID of the team you want to delete a member +// type: string +// required: true +// - name: userID +// in: path +// description: ID of the user you want to remove from the team +// type: string +// required: true +// responses: +// "200": +// "$ref": "#/responses/Message" +// "400": +// "$ref": "#/responses/Message" +// "403": +// "$ref": "#/responses/Message" +// "500": +// "$ref": "#/responses/Message" +