Updated swagger docs
This commit is contained in:
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user