Fixed generation of swagger docs (#29)

This commit is contained in:
konrad 2018-12-01 01:59:17 +00:00 committed by Gitea
parent 1b24cdf164
commit 007d8ec375
47 changed files with 590 additions and 411 deletions

View file

@ -1,22 +1,6 @@
// Vikunja is a todo-list application to facilitate your life.
// Copyright 2018 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// 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
// 2018-11-26 18:08:08.504247606 +0100 CET m=+0.124662709 // 2018-12-01 02:54:44.444779863 +0100 CET m=+0.257728460
package docs package docs
@ -87,7 +71,7 @@ var doc = `{
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -139,7 +123,7 @@ var doc = `{
"description": "The user does not have access to the team", "description": "The user does not have access to the team",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -199,14 +183,14 @@ var doc = `{
"description": "Invalid task object provided.", "description": "Invalid task object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -266,14 +250,14 @@ var doc = `{
"description": "Invalid list object provided.", "description": "Invalid list object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -320,14 +304,14 @@ var doc = `{
"description": "Invalid list object provided.", "description": "Invalid list object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -393,7 +377,7 @@ var doc = `{
"description": "No right to see the list.", "description": "No right to see the list.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -453,21 +437,21 @@ var doc = `{
"description": "Invalid team list object provided.", "description": "Invalid team list object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "The team does not exist.", "description": "The team does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -533,7 +517,7 @@ var doc = `{
"description": "No right to see the list.", "description": "No right to see the list.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -593,21 +577,21 @@ var doc = `{
"description": "Invalid user list object provided.", "description": "Invalid user list object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "The user does not exist.", "description": "The user does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -676,14 +660,14 @@ var doc = `{
"description": "The user does not have admin-access to the list", "description": "The user does not have admin-access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "Team or list does not exist.", "description": "Team or list does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -737,14 +721,14 @@ var doc = `{
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "Team or list does not exist.", "description": "Team or list does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -813,14 +797,14 @@ var doc = `{
"description": "The user does not have admin-access to the list", "description": "The user does not have admin-access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "User or list does not exist.", "description": "User or list does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -874,14 +858,14 @@ var doc = `{
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "user or list does not exist.", "description": "user or list does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -993,14 +977,14 @@ var doc = `{
"description": "Invalid namespace object provided.", "description": "Invalid namespace object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the namespace", "description": "The user does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1105,14 +1089,14 @@ var doc = `{
"description": "Invalid namespace object provided.", "description": "Invalid namespace object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the namespace", "description": "The user does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1164,7 +1148,7 @@ var doc = `{
"description": "The user does not have access to that namespace.", "description": "The user does not have access to that namespace.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1211,14 +1195,14 @@ var doc = `{
"description": "Invalid namespace object provided.", "description": "Invalid namespace object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the namespace", "description": "The user does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1345,7 +1329,7 @@ var doc = `{
"description": "No right to see the namespace.", "description": "No right to see the namespace.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1405,21 +1389,21 @@ var doc = `{
"description": "Invalid team namespace object provided.", "description": "Invalid team namespace object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The team does not have access to the namespace", "description": "The team does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "The team does not exist.", "description": "The team does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1485,7 +1469,7 @@ var doc = `{
"description": "No right to see the namespace.", "description": "No right to see the namespace.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1545,21 +1529,21 @@ var doc = `{
"description": "Invalid user namespace object provided.", "description": "Invalid user namespace object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the namespace", "description": "The user does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "The user does not exist.", "description": "The user does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1621,14 +1605,14 @@ var doc = `{
"description": "Invalid list object provided.", "description": "Invalid list object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1697,14 +1681,14 @@ var doc = `{
"description": "The team does not have admin-access to the namespace", "description": "The team does not have admin-access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "Team or namespace does not exist.", "description": "Team or namespace does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1758,14 +1742,14 @@ var doc = `{
"description": "The team does not have access to the namespace", "description": "The team does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "team or namespace does not exist.", "description": "team or namespace does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1834,14 +1818,14 @@ var doc = `{
"description": "The user does not have admin-access to the namespace", "description": "The user does not have admin-access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "User or namespace does not exist.", "description": "User or namespace does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1895,14 +1879,14 @@ var doc = `{
"description": "The user does not have access to the namespace", "description": "The user does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "user or namespace does not exist.", "description": "user or namespace does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1952,7 +1936,7 @@ var doc = `{
"description": "No or invalid user register object provided / User already exists.", "description": "No or invalid user register object provided / User already exists.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2097,14 +2081,14 @@ var doc = `{
"description": "Invalid task object provided.", "description": "Invalid task object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the task (aka its list)", "description": "The user does not have access to the task (aka its list)",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2151,14 +2135,14 @@ var doc = `{
"description": "Invalid task ID provided.", "description": "Invalid task ID provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2263,7 +2247,7 @@ var doc = `{
"description": "Invalid team object provided.", "description": "Invalid team object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2325,7 +2309,7 @@ var doc = `{
"description": "Invalid team object provided.", "description": "Invalid team object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2372,7 +2356,7 @@ var doc = `{
"description": "Invalid team object provided.", "description": "Invalid team object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2434,14 +2418,14 @@ var doc = `{
"description": "Invalid member object provided.", "description": "Invalid member object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the team", "description": "The user does not have access to the team",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2533,7 +2517,7 @@ var doc = `{
"description": "User does not exist.", "description": "User does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2583,7 +2567,7 @@ var doc = `{
"description": "Bad token provided.", "description": "Bad token provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2638,14 +2622,14 @@ var doc = `{
"description": "Something's invalid.", "description": "Something's invalid.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "User does not exist.", "description": "User does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2695,7 +2679,7 @@ var doc = `{
"description": "Bad token provided.", "description": "Bad token provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2745,7 +2729,7 @@ var doc = `{
"description": "The user does not exist.", "description": "The user does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2798,7 +2782,7 @@ var doc = `{
"description": "Something's invalid.", "description": "Something's invalid.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2838,17 +2822,6 @@ var doc = `{
} }
} }
}, },
"models.HTTPError": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
}
}
},
"models.List": { "models.List": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -58,7 +58,7 @@
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -110,7 +110,7 @@
"description": "The user does not have access to the team", "description": "The user does not have access to the team",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -170,14 +170,14 @@
"description": "Invalid task object provided.", "description": "Invalid task object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -237,14 +237,14 @@
"description": "Invalid list object provided.", "description": "Invalid list object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -291,14 +291,14 @@
"description": "Invalid list object provided.", "description": "Invalid list object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -364,7 +364,7 @@
"description": "No right to see the list.", "description": "No right to see the list.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -424,21 +424,21 @@
"description": "Invalid team list object provided.", "description": "Invalid team list object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "The team does not exist.", "description": "The team does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -504,7 +504,7 @@
"description": "No right to see the list.", "description": "No right to see the list.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -564,21 +564,21 @@
"description": "Invalid user list object provided.", "description": "Invalid user list object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "The user does not exist.", "description": "The user does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -647,14 +647,14 @@
"description": "The user does not have admin-access to the list", "description": "The user does not have admin-access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "Team or list does not exist.", "description": "Team or list does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -708,14 +708,14 @@
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "Team or list does not exist.", "description": "Team or list does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -784,14 +784,14 @@
"description": "The user does not have admin-access to the list", "description": "The user does not have admin-access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "User or list does not exist.", "description": "User or list does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -845,14 +845,14 @@
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "user or list does not exist.", "description": "user or list does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -964,14 +964,14 @@
"description": "Invalid namespace object provided.", "description": "Invalid namespace object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the namespace", "description": "The user does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1076,14 +1076,14 @@
"description": "Invalid namespace object provided.", "description": "Invalid namespace object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the namespace", "description": "The user does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1135,7 +1135,7 @@
"description": "The user does not have access to that namespace.", "description": "The user does not have access to that namespace.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1182,14 +1182,14 @@
"description": "Invalid namespace object provided.", "description": "Invalid namespace object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the namespace", "description": "The user does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1316,7 +1316,7 @@
"description": "No right to see the namespace.", "description": "No right to see the namespace.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1376,21 +1376,21 @@
"description": "Invalid team namespace object provided.", "description": "Invalid team namespace object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The team does not have access to the namespace", "description": "The team does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "The team does not exist.", "description": "The team does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1456,7 +1456,7 @@
"description": "No right to see the namespace.", "description": "No right to see the namespace.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1516,21 +1516,21 @@
"description": "Invalid user namespace object provided.", "description": "Invalid user namespace object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the namespace", "description": "The user does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "The user does not exist.", "description": "The user does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1592,14 +1592,14 @@
"description": "Invalid list object provided.", "description": "Invalid list object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1668,14 +1668,14 @@
"description": "The team does not have admin-access to the namespace", "description": "The team does not have admin-access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "Team or namespace does not exist.", "description": "Team or namespace does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1729,14 +1729,14 @@
"description": "The team does not have access to the namespace", "description": "The team does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "team or namespace does not exist.", "description": "team or namespace does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1805,14 +1805,14 @@
"description": "The user does not have admin-access to the namespace", "description": "The user does not have admin-access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "User or namespace does not exist.", "description": "User or namespace does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1866,14 +1866,14 @@
"description": "The user does not have access to the namespace", "description": "The user does not have access to the namespace",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "user or namespace does not exist.", "description": "user or namespace does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -1923,7 +1923,7 @@
"description": "No or invalid user register object provided / User already exists.", "description": "No or invalid user register object provided / User already exists.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2068,14 +2068,14 @@
"description": "Invalid task object provided.", "description": "Invalid task object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the task (aka its list)", "description": "The user does not have access to the task (aka its list)",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2122,14 +2122,14 @@
"description": "Invalid task ID provided.", "description": "Invalid task ID provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the list", "description": "The user does not have access to the list",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2234,7 +2234,7 @@
"description": "Invalid team object provided.", "description": "Invalid team object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2296,7 +2296,7 @@
"description": "Invalid team object provided.", "description": "Invalid team object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2343,7 +2343,7 @@
"description": "Invalid team object provided.", "description": "Invalid team object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2405,14 +2405,14 @@
"description": "Invalid member object provided.", "description": "Invalid member object provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"403": { "403": {
"description": "The user does not have access to the team", "description": "The user does not have access to the team",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2504,7 +2504,7 @@
"description": "User does not exist.", "description": "User does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2554,7 +2554,7 @@
"description": "Bad token provided.", "description": "Bad token provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2609,14 +2609,14 @@
"description": "Something's invalid.", "description": "Something's invalid.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"404": { "404": {
"description": "User does not exist.", "description": "User does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2666,7 +2666,7 @@
"description": "Bad token provided.", "description": "Bad token provided.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2716,7 +2716,7 @@
"description": "The user does not exist.", "description": "The user does not exist.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2769,7 +2769,7 @@
"description": "Something's invalid.", "description": "Something's invalid.",
"schema": { "schema": {
"type": "object", "type": "object",
"$ref": "#/definitions/models.HTTPError" "$ref": "#/definitions/code.vikunja.io/web.HTTPError"
} }
}, },
"500": { "500": {
@ -2809,17 +2809,6 @@
} }
} }
}, },
"models.HTTPError": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
}
}
},
"models.List": { "models.List": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -16,13 +16,6 @@ definitions:
token: token:
type: string type: string
type: object type: object
models.HTTPError:
properties:
code:
type: integer
message:
type: string
type: object
models.List: models.List:
properties: properties:
created: created:
@ -339,7 +332,7 @@ paths:
"403": "403":
description: The user does not have access to the list description: The user does not have access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -371,12 +364,12 @@ paths:
"400": "400":
description: Invalid list object provided. description: Invalid list object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the list description: The user does not have access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -409,7 +402,7 @@ paths:
"403": "403":
description: The user does not have access to the team description: The user does not have access to the team
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -449,12 +442,12 @@ paths:
"400": "400":
description: Invalid list object provided. description: Invalid list object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the list description: The user does not have access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -494,12 +487,12 @@ paths:
"400": "400":
description: Invalid task object provided. description: Invalid task object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the list description: The user does not have access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -543,7 +536,7 @@ paths:
"403": "403":
description: No right to see the list. description: No right to see the list.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -583,17 +576,17 @@ paths:
"400": "400":
description: Invalid team list object provided. description: Invalid team list object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the list description: The user does not have access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: The team does not exist. description: The team does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -637,7 +630,7 @@ paths:
"403": "403":
description: No right to see the list. description: No right to see the list.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -677,17 +670,17 @@ paths:
"400": "400":
description: Invalid user list object provided. description: Invalid user list object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the list description: The user does not have access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: The user does not exist. description: The user does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -725,12 +718,12 @@ paths:
"403": "403":
description: The user does not have access to the list description: The user does not have access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: Team or list does not exist. description: Team or list does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -776,12 +769,12 @@ paths:
"403": "403":
description: The user does not have admin-access to the list description: The user does not have admin-access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: Team or list does not exist. description: Team or list does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -819,12 +812,12 @@ paths:
"403": "403":
description: The user does not have access to the list description: The user does not have access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: user or list does not exist. description: user or list does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -870,12 +863,12 @@ paths:
"403": "403":
description: The user does not have admin-access to the list description: The user does not have admin-access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: User or list does not exist. description: User or list does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -950,12 +943,12 @@ paths:
"400": "400":
description: Invalid namespace object provided. description: Invalid namespace object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the namespace description: The user does not have access to the namespace
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1024,12 +1017,12 @@ paths:
"400": "400":
description: Invalid namespace object provided. description: Invalid namespace object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the namespace description: The user does not have access to the namespace
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1061,12 +1054,12 @@ paths:
"400": "400":
description: Invalid namespace object provided. description: Invalid namespace object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the namespace description: The user does not have access to the namespace
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1099,7 +1092,7 @@ paths:
"403": "403":
description: The user does not have access to that namespace. description: The user does not have access to that namespace.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1184,7 +1177,7 @@ paths:
"403": "403":
description: No right to see the namespace. description: No right to see the namespace.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1224,17 +1217,17 @@ paths:
"400": "400":
description: Invalid team namespace object provided. description: Invalid team namespace object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The team does not have access to the namespace description: The team does not have access to the namespace
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: The team does not exist. description: The team does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1279,7 +1272,7 @@ paths:
"403": "403":
description: No right to see the namespace. description: No right to see the namespace.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1319,17 +1312,17 @@ paths:
"400": "400":
description: Invalid user namespace object provided. description: Invalid user namespace object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the namespace description: The user does not have access to the namespace
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: The user does not exist. description: The user does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1371,12 +1364,12 @@ paths:
"400": "400":
description: Invalid list object provided. description: Invalid list object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the list description: The user does not have access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1414,12 +1407,12 @@ paths:
"403": "403":
description: The team does not have access to the namespace description: The team does not have access to the namespace
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: team or namespace does not exist. description: team or namespace does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1465,12 +1458,12 @@ paths:
"403": "403":
description: The team does not have admin-access to the namespace description: The team does not have admin-access to the namespace
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: Team or namespace does not exist. description: Team or namespace does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1508,12 +1501,12 @@ paths:
"403": "403":
description: The user does not have access to the namespace description: The user does not have access to the namespace
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: user or namespace does not exist. description: user or namespace does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1559,12 +1552,12 @@ paths:
"403": "403":
description: The user does not have admin-access to the namespace description: The user does not have admin-access to the namespace
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: User or namespace does not exist. description: User or namespace does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1601,7 +1594,7 @@ paths:
description: No or invalid user register object provided / User already description: No or invalid user register object provided / User already
exists. exists.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1665,12 +1658,12 @@ paths:
"400": "400":
description: Invalid task ID provided. description: Invalid task ID provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the list description: The user does not have access to the list
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1710,12 +1703,12 @@ paths:
"400": "400":
description: Invalid task object provided. description: Invalid task object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"403": "403":
description: The user does not have access to the task (aka its list) description: The user does not have access to the task (aka its list)
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1806,7 +1799,7 @@ paths:
"400": "400":
description: Invalid team object provided. description: Invalid team object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1839,7 +1832,7 @@ paths:
"400": "400":
description: Invalid team object provided. description: Invalid team object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1879,7 +1872,7 @@ paths:
"400": "400":
description: Invalid team object provided. description: Invalid team object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1920,12 +1913,12 @@ paths:
"400": "400":
description: Invalid member object provided. description: Invalid member object provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
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 team
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -1986,7 +1979,7 @@ paths:
"404": "404":
description: User does not exist. description: User does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal server error. description: Internal server error.
@ -2022,7 +2015,7 @@ paths:
"412": "412":
description: Bad token provided. description: Bad token provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -2056,12 +2049,12 @@ paths:
"400": "400":
description: Something's invalid. description: Something's invalid.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"404": "404":
description: User does not exist. description: User does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal server error. description: Internal server error.
@ -2097,7 +2090,7 @@ paths:
"400": "400":
description: Bad token provided. description: Bad token provided.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -2132,7 +2125,7 @@ paths:
"404": "404":
description: The user does not exist. description: The user does not exist.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal error description: Internal error
@ -2165,7 +2158,7 @@ paths:
"400": "400":
description: Something's invalid. description: Something's invalid.
schema: schema:
$ref: '#/definitions/models.HTTPError' $ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object type: object
"500": "500":
description: Internal server error. description: Internal server error.

2
go.mod
View file

@ -54,7 +54,7 @@ require (
github.com/swaggo/echo-swagger v0.0.0-20180315045949-97f46bb9e5a5 github.com/swaggo/echo-swagger v0.0.0-20180315045949-97f46bb9e5a5
github.com/swaggo/files v0.0.0-20180215091130-49c8a91ea3fa // indirect github.com/swaggo/files v0.0.0-20180215091130-49c8a91ea3fa // indirect
github.com/swaggo/gin-swagger v1.0.0 // indirect github.com/swaggo/gin-swagger v1.0.0 // indirect
github.com/swaggo/swag v1.3.3-0.20181109030545-8f09470d62b2 github.com/swaggo/swag v1.4.1-0.20181129020348-1c8533a91397
github.com/urfave/cli v1.20.0 // indirect github.com/urfave/cli v1.20.0 // indirect
github.com/ziutek/mymysql v1.5.4 // indirect github.com/ziutek/mymysql v1.5.4 // indirect
golang.org/x/crypto v0.0.0-20181127143415-eb0de9b17e85 golang.org/x/crypto v0.0.0-20181127143415-eb0de9b17e85

6
go.sum
View file

@ -109,8 +109,10 @@ github.com/swaggo/files v0.0.0-20180215091130-49c8a91ea3fa h1:194s4modF+3X3POBfG
github.com/swaggo/files v0.0.0-20180215091130-49c8a91ea3fa/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E= github.com/swaggo/files v0.0.0-20180215091130-49c8a91ea3fa/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E=
github.com/swaggo/gin-swagger v1.0.0 h1:k6Nn1jV49u+SNIWt7kejQS/iENZKZVMCNQrKOYatNF8= github.com/swaggo/gin-swagger v1.0.0 h1:k6Nn1jV49u+SNIWt7kejQS/iENZKZVMCNQrKOYatNF8=
github.com/swaggo/gin-swagger v1.0.0/go.mod h1:Mt37wE46iUaTAOv+HSnHbJYssKGqbS25X19lNF4YpBo= github.com/swaggo/gin-swagger v1.0.0/go.mod h1:Mt37wE46iUaTAOv+HSnHbJYssKGqbS25X19lNF4YpBo=
github.com/swaggo/swag v1.3.3-0.20181109030545-8f09470d62b2 h1:HMUGTfTJJZ2fRHar570Q2SdUhiCEGwcRRJ2doOOnCJE= github.com/swaggo/swag v1.4.0 h1:exX5ES4CdJWCCKmVPE+FAIN66cnHeMHU3i2SCMibBZc=
github.com/swaggo/swag v1.3.3-0.20181109030545-8f09470d62b2/go.mod h1:hog2WgeMOrQ/LvQ+o1YGTeT+vWVrbi0SiIslBtxKTyM= github.com/swaggo/swag v1.4.0/go.mod h1:hog2WgeMOrQ/LvQ+o1YGTeT+vWVrbi0SiIslBtxKTyM=
github.com/swaggo/swag v1.4.1-0.20181129020348-1c8533a91397 h1:xhlin3d0mSsxQlwxS+fHILT6PgG4Cmc2OZgzZL2bemI=
github.com/swaggo/swag v1.4.1-0.20181129020348-1c8533a91397/go.mod h1:hog2WgeMOrQ/LvQ+o1YGTeT+vWVrbi0SiIslBtxKTyM=
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=

View file

@ -55,7 +55,7 @@ func GetListsByNamespaceID(nID int64) (lists []*List, err error) {
// @Param s query string false "Search lists by title." // @Param s query string false "Search lists by title."
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {array} models.List "The lists" // @Success 200 {array} models.List "The lists"
// @Failure 403 {object} models.HTTPError "The user does not have access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists [get] // @Router /lists [get]
func (l *List) ReadAll(search string, a web.Auth, page int) (interface{}, error) { func (l *List) ReadAll(search string, a web.Auth, page int) (interface{}, error) {
@ -84,7 +84,7 @@ func (l *List) ReadAll(search string, a web.Auth, page int) (interface{}, error)
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Param id path int true "List ID" // @Param id path int true "List ID"
// @Success 200 {object} models.List "The list" // @Success 200 {object} models.List "The list"
// @Failure 403 {object} models.HTTPError "The user does not have access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{id} [get] // @Router /lists/{id} [get]
func (l *List) ReadOne() (err error) { func (l *List) ReadOne() (err error) {

View file

@ -59,8 +59,8 @@ func CreateOrUpdateList(list *List) (err error) {
// @Param id path int true "List ID" // @Param id path int true "List ID"
// @Param list body models.List true "The list with updated values you want to update." // @Param list body models.List true "The list with updated values you want to update."
// @Success 200 {object} models.List "The updated list." // @Success 200 {object} models.List "The updated list."
// @Failure 400 {object} models.HTTPError "Invalid list object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid list object provided."
// @Failure 403 {object} models.HTTPError "The user does not have access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{id} [post] // @Router /lists/{id} [post]
func (l *List) Update() (err error) { func (l *List) Update() (err error) {
@ -82,8 +82,8 @@ func (l *List) Update() (err error) {
// @Param namespaceID path int true "Namespace ID" // @Param namespaceID path int true "Namespace ID"
// @Param list body models.List true "The list you want to create." // @Param list body models.List true "The list you want to create."
// @Success 200 {object} models.List "The created list." // @Success 200 {object} models.List "The created list."
// @Failure 400 {object} models.HTTPError "Invalid list object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid list object provided."
// @Failure 403 {object} models.HTTPError "The user does not have access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces/{namespaceID}/lists [put] // @Router /namespaces/{namespaceID}/lists [put]
func (l *List) Create(a web.Auth) (err error) { func (l *List) Create(a web.Auth) (err error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Delete implements the delete method of CRUDable // Delete implements the delete method of CRUDable
// @Summary Deletes a list // @Summary Deletes a list
// @Description Delets a list // @Description Delets a list
@ -24,8 +26,8 @@ package models
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Param id path int true "List ID" // @Param id path int true "List ID"
// @Success 200 {object} models.Message "The list was successfully deleted." // @Success 200 {object} models.Message "The list was successfully deleted."
// @Failure 400 {object} models.HTTPError "Invalid list object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid list object provided."
// @Failure 403 {object} models.HTTPError "The user does not have access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{id} [delete] // @Router /lists/{id} [delete]
func (l *List) Delete() (err error) { func (l *List) Delete() (err error) {

View file

@ -31,8 +31,8 @@ import (
// @Param id path int true "List ID" // @Param id path int true "List ID"
// @Param task body models.ListTask true "The task object" // @Param task body models.ListTask true "The task object"
// @Success 200 {object} models.ListTask "The created task object." // @Success 200 {object} models.ListTask "The created task object."
// @Failure 400 {object} models.HTTPError "Invalid task object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task object provided."
// @Failure 403 {object} models.HTTPError "The user does not have access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{id} [put] // @Router /lists/{id} [put]
func (i *ListTask) Create(a web.Auth) (err error) { func (i *ListTask) Create(a web.Auth) (err error) {
@ -75,8 +75,8 @@ func (i *ListTask) Create(a web.Auth) (err error) {
// @Param id path int true "Task ID" // @Param id path int true "Task ID"
// @Param task body models.ListTask true "The task object" // @Param task body models.ListTask true "The task object"
// @Success 200 {object} models.ListTask "The updated task object." // @Success 200 {object} models.ListTask "The updated task object."
// @Failure 400 {object} models.HTTPError "Invalid task object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task object provided."
// @Failure 403 {object} models.HTTPError "The user does not have access to the task (aka its list)" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the task (aka its list)"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{id} [post] // @Router /tasks/{id} [post]
func (i *ListTask) Update() (err error) { func (i *ListTask) Update() (err error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Delete implements the delete method for listTask // Delete implements the delete method for listTask
// @Summary Delete a task // @Summary Delete a task
// @Description Deletes a task from a list. This does not mean "mark it done". // @Description Deletes a task from a list. This does not mean "mark it done".
@ -24,8 +26,8 @@ package models
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Param id path int true "Task ID" // @Param id path int true "Task ID"
// @Success 200 {object} models.Message "The created task object." // @Success 200 {object} models.Message "The created task object."
// @Failure 400 {object} models.HTTPError "Invalid task ID provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task ID provided."
// @Failure 403 {object} models.HTTPError "The user does not have access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{id} [delete] // @Router /tasks/{id} [delete]
func (i *ListTask) Delete() (err error) { func (i *ListTask) Delete() (err error) {

View file

@ -28,9 +28,9 @@ import "code.vikunja.io/web"
// @Param id path int true "List ID" // @Param id path int true "List ID"
// @Param list body models.ListUser true "The user you want to add to the list." // @Param list body models.ListUser true "The user you want to add to the list."
// @Success 200 {object} models.ListUser "The created user<->list relation." // @Success 200 {object} models.ListUser "The created user<->list relation."
// @Failure 400 {object} models.HTTPError "Invalid user list object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid user list object provided."
// @Failure 404 {object} models.HTTPError "The user does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "The user does not exist."
// @Failure 403 {object} models.HTTPError "The user does not have access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{id}/users [put] // @Router /lists/{id}/users [put]
func (ul *ListUser) Create(a web.Auth) (err error) { func (ul *ListUser) Create(a web.Auth) (err error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Delete deletes a list <-> user relation // Delete deletes a list <-> user relation
// @Summary Delete a user from a list // @Summary Delete a user from a list
// @Description Delets a user from a list. The user won't have access to the list anymore. // @Description Delets a user from a list. The user won't have access to the list anymore.
@ -25,8 +27,8 @@ package models
// @Param listID path int true "List ID" // @Param listID path int true "List ID"
// @Param userID path int true "User ID" // @Param userID path int true "User ID"
// @Success 200 {object} models.Message "The user was successfully removed from the list." // @Success 200 {object} models.Message "The user was successfully removed from the list."
// @Failure 403 {object} models.HTTPError "The user does not have access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list"
// @Failure 404 {object} models.HTTPError "user or list does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "user or list does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{listID}/users/{userID} [delete] // @Router /lists/{listID}/users/{userID} [delete]
func (lu *ListUser) Delete() (err error) { func (lu *ListUser) Delete() (err error) {

View file

@ -29,7 +29,7 @@ import "code.vikunja.io/web"
// @Param s query string false "Search users by its name." // @Param s query string false "Search users by its name."
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {array} models.UserWithRight "The users with the right they have." // @Success 200 {array} models.UserWithRight "The users with the right they have."
// @Failure 403 {object} models.HTTPError "No right to see the list." // @Failure 403 {object} code.vikunja.io/web.HTTPError "No right to see the list."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{id}/users [get] // @Router /lists/{id}/users [get]
func (ul *ListUser) ReadAll(search string, a web.Auth, page int) (interface{}, error) { func (ul *ListUser) ReadAll(search string, a web.Auth, page int) (interface{}, error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Update updates a user <-> list relation // Update updates a user <-> list relation
// @Summary Update a user <-> list relation // @Summary Update a user <-> list relation
// @Description Update a user <-> list relation. Mostly used to update the right that user has. // @Description Update a user <-> list relation. Mostly used to update the right that user has.
@ -27,8 +29,8 @@ package models
// @Param list body models.ListUser true "The user you want to update." // @Param list body models.ListUser true "The user you want to update."
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {object} models.ListUser "The updated user <-> list relation." // @Success 200 {object} models.ListUser "The updated user <-> list relation."
// @Failure 403 {object} models.HTTPError "The user does not have admin-access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have admin-access to the list"
// @Failure 404 {object} models.HTTPError "User or list does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "User or list does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{listID}/users/{userID} [post] // @Router /lists/{listID}/users/{userID} [post]
func (lu *ListUser) Update() (err error) { func (lu *ListUser) Update() (err error) {

View file

@ -76,7 +76,7 @@ func GetNamespaceByID(id int64) (namespace Namespace, err error) {
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Param id path int true "Namespace ID" // @Param id path int true "Namespace ID"
// @Success 200 {object} models.Namespace "The Namespace" // @Success 200 {object} models.Namespace "The Namespace"
// @Failure 403 {object} models.HTTPError "The user does not have access to that namespace." // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to that namespace."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces/{id} [get] // @Router /namespaces/{id} [get]
func (n *Namespace) ReadOne() (err error) { func (n *Namespace) ReadOne() (err error) {

View file

@ -27,8 +27,8 @@ import "code.vikunja.io/web"
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Param namespace body models.Namespace true "The namespace you want to create." // @Param namespace body models.Namespace true "The namespace you want to create."
// @Success 200 {object} models.Namespace "The created namespace." // @Success 200 {object} models.Namespace "The created namespace."
// @Failure 400 {object} models.HTTPError "Invalid namespace object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid namespace object provided."
// @Failure 403 {object} models.HTTPError "The user does not have access to the namespace" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces [put] // @Router /namespaces [put]
func (n *Namespace) Create(a web.Auth) (err error) { func (n *Namespace) Create(a web.Auth) (err error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Delete deletes a namespace // Delete deletes a namespace
// @Summary Deletes a namespace // @Summary Deletes a namespace
// @Description Delets a namespace // @Description Delets a namespace
@ -24,8 +26,8 @@ package models
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Param id path int true "Namespace ID" // @Param id path int true "Namespace ID"
// @Success 200 {object} models.Message "The namespace was successfully deleted." // @Success 200 {object} models.Message "The namespace was successfully deleted."
// @Failure 400 {object} models.HTTPError "Invalid namespace object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid namespace object provided."
// @Failure 403 {object} models.HTTPError "The user does not have access to the namespace" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces/{id} [delete] // @Router /namespaces/{id} [delete]
func (n *Namespace) Delete() (err error) { func (n *Namespace) Delete() (err error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Update implements the update method via the interface // Update implements the update method via the interface
// @Summary Updates a namespace // @Summary Updates a namespace
// @Description Updates a namespace. // @Description Updates a namespace.
@ -26,8 +28,8 @@ package models
// @Param id path int true "Namespace ID" // @Param id path int true "Namespace ID"
// @Param namespace body models.Namespace true "The namespace with updated values you want to update." // @Param namespace body models.Namespace true "The namespace with updated values you want to update."
// @Success 200 {object} models.Namespace "The updated namespace." // @Success 200 {object} models.Namespace "The updated namespace."
// @Failure 400 {object} models.HTTPError "Invalid namespace object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid namespace object provided."
// @Failure 403 {object} models.HTTPError "The user does not have access to the namespace" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespace/{id} [post] // @Router /namespace/{id} [post]
func (n *Namespace) Update() (err error) { func (n *Namespace) Update() (err error) {

View file

@ -28,9 +28,9 @@ import "code.vikunja.io/web"
// @Param id path int true "Namespace ID" // @Param id path int true "Namespace ID"
// @Param namespace body models.NamespaceUser true "The user you want to add to the namespace." // @Param namespace body models.NamespaceUser true "The user you want to add to the namespace."
// @Success 200 {object} models.NamespaceUser "The created user<->namespace relation." // @Success 200 {object} models.NamespaceUser "The created user<->namespace relation."
// @Failure 400 {object} models.HTTPError "Invalid user namespace object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid user namespace object provided."
// @Failure 404 {object} models.HTTPError "The user does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "The user does not exist."
// @Failure 403 {object} models.HTTPError "The user does not have access to the namespace" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces/{id}/users [put] // @Router /namespaces/{id}/users [put]
func (un *NamespaceUser) Create(a web.Auth) (err error) { func (un *NamespaceUser) Create(a web.Auth) (err error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Delete deletes a namespace <-> user relation // Delete deletes a namespace <-> user relation
// @Summary Delete a user from a namespace // @Summary Delete a user from a namespace
// @Description Delets a user from a namespace. The user won't have access to the namespace anymore. // @Description Delets a user from a namespace. The user won't have access to the namespace anymore.
@ -25,8 +27,8 @@ package models
// @Param namespaceID path int true "Namespace ID" // @Param namespaceID path int true "Namespace ID"
// @Param userID path int true "user ID" // @Param userID path int true "user ID"
// @Success 200 {object} models.Message "The user was successfully deleted." // @Success 200 {object} models.Message "The user was successfully deleted."
// @Failure 403 {object} models.HTTPError "The user does not have access to the namespace" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace"
// @Failure 404 {object} models.HTTPError "user or namespace does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "user or namespace does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces/{namespaceID}/users/{userID} [delete] // @Router /namespaces/{namespaceID}/users/{userID} [delete]
func (nu *NamespaceUser) Delete() (err error) { func (nu *NamespaceUser) Delete() (err error) {

View file

@ -29,7 +29,7 @@ import "code.vikunja.io/web"
// @Param s query string false "Search users by its name." // @Param s query string false "Search users by its name."
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {array} models.UserWithRight "The users with the right they have." // @Success 200 {array} models.UserWithRight "The users with the right they have."
// @Failure 403 {object} models.HTTPError "No right to see the namespace." // @Failure 403 {object} code.vikunja.io/web.HTTPError "No right to see the namespace."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces/{id}/users [get] // @Router /namespaces/{id}/users [get]
func (un *NamespaceUser) ReadAll(search string, a web.Auth, page int) (interface{}, error) { func (un *NamespaceUser) ReadAll(search string, a web.Auth, page int) (interface{}, error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Update updates a user <-> namespace relation // Update updates a user <-> namespace relation
// @Summary Update a user <-> namespace relation // @Summary Update a user <-> namespace relation
// @Description Update a user <-> namespace relation. Mostly used to update the right that user has. // @Description Update a user <-> namespace relation. Mostly used to update the right that user has.
@ -27,8 +29,8 @@ package models
// @Param namespace body models.NamespaceUser true "The user you want to update." // @Param namespace body models.NamespaceUser true "The user you want to update."
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {object} models.NamespaceUser "The updated user <-> namespace relation." // @Success 200 {object} models.NamespaceUser "The updated user <-> namespace relation."
// @Failure 403 {object} models.HTTPError "The user does not have admin-access to the namespace" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have admin-access to the namespace"
// @Failure 404 {object} models.HTTPError "User or namespace does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "User or namespace does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces/{namespaceID}/users/{userID} [post] // @Router /namespaces/{namespaceID}/users/{userID} [post]
func (nu *NamespaceUser) Update() (err error) { func (nu *NamespaceUser) Update() (err error) {

View file

@ -28,9 +28,9 @@ import "code.vikunja.io/web"
// @Param id path int true "List ID" // @Param id path int true "List ID"
// @Param list body models.TeamList true "The team you want to add to the list." // @Param list body models.TeamList true "The team you want to add to the list."
// @Success 200 {object} models.TeamList "The created team<->list relation." // @Success 200 {object} models.TeamList "The created team<->list relation."
// @Failure 400 {object} models.HTTPError "Invalid team list object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid team list object provided."
// @Failure 404 {object} models.HTTPError "The team does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "The team does not exist."
// @Failure 403 {object} models.HTTPError "The user does not have access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{id}/teams [put] // @Router /lists/{id}/teams [put]
func (tl *TeamList) Create(a web.Auth) (err error) { func (tl *TeamList) Create(a web.Auth) (err error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Delete deletes a team <-> list relation based on the list & team id // Delete deletes a team <-> list relation based on the list & team id
// @Summary Delete a team from a list // @Summary Delete a team from a list
// @Description Delets a team from a list. The team won't have access to the list anymore. // @Description Delets a team from a list. The team won't have access to the list anymore.
@ -25,8 +27,8 @@ package models
// @Param listID path int true "List ID" // @Param listID path int true "List ID"
// @Param teamID path int true "Team ID" // @Param teamID path int true "Team ID"
// @Success 200 {object} models.Message "The team was successfully deleted." // @Success 200 {object} models.Message "The team was successfully deleted."
// @Failure 403 {object} models.HTTPError "The user does not have access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list"
// @Failure 404 {object} models.HTTPError "Team or list does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "Team or list does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{listID}/teams/{teamID} [delete] // @Router /lists/{listID}/teams/{teamID} [delete]
func (tl *TeamList) Delete() (err error) { func (tl *TeamList) Delete() (err error) {

View file

@ -29,7 +29,7 @@ import "code.vikunja.io/web"
// @Param s query string false "Search teams by its name." // @Param s query string false "Search teams by its name."
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {array} models.TeamWithRight "The teams with their right." // @Success 200 {array} models.TeamWithRight "The teams with their right."
// @Failure 403 {object} models.HTTPError "No right to see the list." // @Failure 403 {object} code.vikunja.io/web.HTTPError "No right to see the list."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{id}/teams [get] // @Router /lists/{id}/teams [get]
func (tl *TeamList) ReadAll(search string, a web.Auth, page int) (interface{}, error) { func (tl *TeamList) ReadAll(search string, a web.Auth, page int) (interface{}, error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Update updates a team <-> list relation // Update updates a team <-> list relation
// @Summary Update a team <-> list relation // @Summary Update a team <-> list relation
// @Description Update a team <-> list relation. Mostly used to update the right that team has. // @Description Update a team <-> list relation. Mostly used to update the right that team has.
@ -27,8 +29,8 @@ package models
// @Param list body models.TeamList true "The team you want to update." // @Param list body models.TeamList true "The team you want to update."
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {object} models.TeamList "The updated team <-> list relation." // @Success 200 {object} models.TeamList "The updated team <-> list relation."
// @Failure 403 {object} models.HTTPError "The user does not have admin-access to the list" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have admin-access to the list"
// @Failure 404 {object} models.HTTPError "Team or list does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "Team or list does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{listID}/teams/{teamID} [post] // @Router /lists/{listID}/teams/{teamID} [post]
func (tl *TeamList) Update() (err error) { func (tl *TeamList) Update() (err error) {

View file

@ -28,8 +28,8 @@ import "code.vikunja.io/web"
// @Param id path int true "Team ID" // @Param id path int true "Team ID"
// @Param team body models.TeamMember true "The user to be added to a team." // @Param team body models.TeamMember true "The user to be added to a team."
// @Success 200 {object} models.TeamMember "The newly created member object" // @Success 200 {object} models.TeamMember "The newly created member object"
// @Failure 400 {object} models.HTTPError "Invalid member object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid member object provided."
// @Failure 403 {object} models.HTTPError "The user does not have access to the team" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the team"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /teams/{id}/members [put] // @Router /teams/{id}/members [put]
func (tm *TeamMember) Create(a web.Auth) (err error) { func (tm *TeamMember) Create(a web.Auth) (err error) {

View file

@ -28,9 +28,9 @@ import "code.vikunja.io/web"
// @Param id path int true "Namespace ID" // @Param id path int true "Namespace ID"
// @Param namespace body models.TeamNamespace true "The team you want to add to the namespace." // @Param namespace body models.TeamNamespace true "The team you want to add to the namespace."
// @Success 200 {object} models.TeamNamespace "The created team<->namespace relation." // @Success 200 {object} models.TeamNamespace "The created team<->namespace relation."
// @Failure 400 {object} models.HTTPError "Invalid team namespace object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid team namespace object provided."
// @Failure 404 {object} models.HTTPError "The team does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "The team does not exist."
// @Failure 403 {object} models.HTTPError "The team does not have access to the namespace" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The team does not have access to the namespace"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces/{id}/teams [put] // @Router /namespaces/{id}/teams [put]
func (tn *TeamNamespace) Create(a web.Auth) (err error) { func (tn *TeamNamespace) Create(a web.Auth) (err error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Delete deletes a team <-> namespace relation based on the namespace & team id // Delete deletes a team <-> namespace relation based on the namespace & team id
// @Summary Delete a team from a namespace // @Summary Delete a team from a namespace
// @Description Delets a team from a namespace. The team won't have access to the namespace anymore. // @Description Delets a team from a namespace. The team won't have access to the namespace anymore.
@ -25,8 +27,8 @@ package models
// @Param namespaceID path int true "Namespace ID" // @Param namespaceID path int true "Namespace ID"
// @Param teamID path int true "team ID" // @Param teamID path int true "team ID"
// @Success 200 {object} models.Message "The team was successfully deleted." // @Success 200 {object} models.Message "The team was successfully deleted."
// @Failure 403 {object} models.HTTPError "The team does not have access to the namespace" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The team does not have access to the namespace"
// @Failure 404 {object} models.HTTPError "team or namespace does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "team or namespace does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces/{namespaceID}/teams/{teamID} [delete] // @Router /namespaces/{namespaceID}/teams/{teamID} [delete]
func (tn *TeamNamespace) Delete() (err error) { func (tn *TeamNamespace) Delete() (err error) {

View file

@ -29,7 +29,7 @@ import "code.vikunja.io/web"
// @Param s query string false "Search teams by its name." // @Param s query string false "Search teams by its name."
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {array} models.TeamWithRight "The teams with the right they have." // @Success 200 {array} models.TeamWithRight "The teams with the right they have."
// @Failure 403 {object} models.HTTPError "No right to see the namespace." // @Failure 403 {object} code.vikunja.io/web.HTTPError "No right to see the namespace."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces/{id}/teams [get] // @Router /namespaces/{id}/teams [get]
func (tn *TeamNamespace) ReadAll(search string, a web.Auth, page int) (interface{}, error) { func (tn *TeamNamespace) ReadAll(search string, a web.Auth, page int) (interface{}, error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Update updates a team <-> namespace relation // Update updates a team <-> namespace relation
// @Summary Update a team <-> namespace relation // @Summary Update a team <-> namespace relation
// @Description Update a team <-> namespace relation. Mostly used to update the right that team has. // @Description Update a team <-> namespace relation. Mostly used to update the right that team has.
@ -27,8 +29,8 @@ package models
// @Param namespace body models.TeamNamespace true "The team you want to update." // @Param namespace body models.TeamNamespace true "The team you want to update."
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {object} models.TeamNamespace "The updated team <-> namespace relation." // @Success 200 {object} models.TeamNamespace "The updated team <-> namespace relation."
// @Failure 403 {object} models.HTTPError "The team does not have admin-access to the namespace" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The team does not have admin-access to the namespace"
// @Failure 404 {object} models.HTTPError "Team or namespace does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "Team or namespace does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /namespaces/{namespaceID}/teams/{teamID} [post] // @Router /namespaces/{namespaceID}/teams/{teamID} [post]
func (tl *TeamNamespace) Update() (err error) { func (tl *TeamNamespace) Update() (err error) {

View file

@ -104,7 +104,7 @@ func GetTeamByID(id int64) (team Team, err error) {
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Param id path int true "Team ID" // @Param id path int true "Team ID"
// @Success 200 {object} models.Team "The team" // @Success 200 {object} models.Team "The team"
// @Failure 403 {object} models.HTTPError "The user does not have access to the team" // @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the team"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{id} [get] // @Router /lists/{id} [get]
func (t *Team) ReadOne() (err error) { func (t *Team) ReadOne() (err error) {

View file

@ -27,7 +27,7 @@ import "code.vikunja.io/web"
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Param team body models.Team true "The team you want to create." // @Param team body models.Team true "The team you want to create."
// @Success 200 {object} models.Team "The created team." // @Success 200 {object} models.Team "The created team."
// @Failure 400 {object} models.HTTPError "Invalid team object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid team object provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /teams [put] // @Router /teams [put]
func (t *Team) Create(a web.Auth) (err error) { func (t *Team) Create(a web.Auth) (err error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Delete deletes a team // Delete deletes a team
// @Summary Deletes a team // @Summary Deletes a team
// @Description Delets a team. This will also remove the access for all users in that team. // @Description Delets a team. This will also remove the access for all users in that team.
@ -24,7 +26,7 @@ package models
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Param id path int true "Team ID" // @Param id path int true "Team ID"
// @Success 200 {object} models.Message "The team was successfully deleted." // @Success 200 {object} models.Message "The team was successfully deleted."
// @Failure 400 {object} models.HTTPError "Invalid team object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid team object provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /teams/{id} [delete] // @Router /teams/{id} [delete]
func (t *Team) Delete() (err error) { func (t *Team) Delete() (err error) {

View file

@ -16,6 +16,8 @@
package models package models
import _ "code.vikunja.io/web" // For swaggerdocs generation
// Update is the handler to create a team // Update is the handler to create a team
// @Summary Updates a team // @Summary Updates a team
// @Description Updates a team. // @Description Updates a team.
@ -26,7 +28,7 @@ package models
// @Param id path int true "Team ID" // @Param id path int true "Team ID"
// @Param team body models.Team true "The team with updated values you want to update." // @Param team body models.Team true "The team with updated values you want to update."
// @Success 200 {object} models.Team "The updated team." // @Success 200 {object} models.Team "The updated team."
// @Failure 400 {object} models.HTTPError "Invalid team object provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid team object provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /teams/{id} [post] // @Router /teams/{id} [post]
func (t *Team) Update() (err error) { func (t *Team) Update() (err error) {

View file

@ -31,7 +31,7 @@ import (
// @Produce json // @Produce json
// @Param credentials body models.APIUserPassword true "The user credentials" // @Param credentials body models.APIUserPassword true "The user credentials"
// @Success 200 {object} models.User // @Success 200 {object} models.User
// @Failure 400 {object} models.HTTPError "No or invalid user register object provided / User already exists." // @Failure 400 {object} code.vikunja.io/web.HTTPError "No or invalid user register object provided / User already exists."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /register [post] // @Router /register [post]
func RegisterUser(c echo.Context) error { func RegisterUser(c echo.Context) error {

View file

@ -31,7 +31,7 @@ import (
// @Produce json // @Produce json
// @Param credentials body models.EmailConfirm true "The token." // @Param credentials body models.EmailConfirm true "The token."
// @Success 200 {object} models.Message // @Success 200 {object} models.Message
// @Failure 412 {object} models.HTTPError "Bad token provided." // @Failure 412 {object} code.vikunja.io/web.HTTPError "Bad token provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /user/confirm [post] // @Router /user/confirm [post]
func UserConfirmEmail(c echo.Context) error { func UserConfirmEmail(c echo.Context) error {

View file

@ -32,7 +32,7 @@ import (
// @Param s query string false "Search for a user by its name." // @Param s query string false "Search for a user by its name."
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {array} models.User "All (found) users." // @Success 200 {array} models.User "All (found) users."
// @Failure 400 {object} models.HTTPError "Something's invalid." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid."
// @Failure 500 {object} models.Message "Internal server error." // @Failure 500 {object} models.Message "Internal server error."
// @Router /users [get] // @Router /users [get]
func UserList(c echo.Context) error { func UserList(c echo.Context) error {

View file

@ -31,7 +31,7 @@ import (
// @Produce json // @Produce json
// @Param credentials body models.PasswordReset true "The token with the new password." // @Param credentials body models.PasswordReset true "The token with the new password."
// @Success 200 {object} models.Message // @Success 200 {object} models.Message
// @Failure 400 {object} models.HTTPError "Bad token provided." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Bad token provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /user/password/reset [post] // @Router /user/password/reset [post]
func UserResetPassword(c echo.Context) error { func UserResetPassword(c echo.Context) error {
@ -57,7 +57,7 @@ func UserResetPassword(c echo.Context) error {
// @Produce json // @Produce json
// @Param credentials body models.PasswordTokenRequest true "The username of the user to request a token for." // @Param credentials body models.PasswordTokenRequest true "The username of the user to request a token for."
// @Success 200 {object} models.Message // @Success 200 {object} models.Message
// @Failure 404 {object} models.HTTPError "The user does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "The user does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /user/password/token [post] // @Router /user/password/token [post]
func UserRequestResetPasswordToken(c echo.Context) error { func UserRequestResetPasswordToken(c echo.Context) error {

View file

@ -31,7 +31,7 @@ import (
// @Produce json // @Produce json
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {object} models.User // @Success 200 {object} models.User
// @Failure 404 {object} models.HTTPError "User does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist."
// @Failure 500 {object} models.Message "Internal server error." // @Failure 500 {object} models.Message "Internal server error."
// @Router /user [get] // @Router /user [get]
func UserShow(c echo.Context) error { func UserShow(c echo.Context) error {

View file

@ -38,8 +38,8 @@ type UserPassword struct {
// @Param userPassword body v1.UserPassword true "The current and new password." // @Param userPassword body v1.UserPassword true "The current and new password."
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Success 200 {object} models.Message // @Success 200 {object} models.Message
// @Failure 400 {object} models.HTTPError "Something's invalid." // @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid."
// @Failure 404 {object} models.HTTPError "User does not exist." // @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist."
// @Failure 500 {object} models.Message "Internal server error." // @Failure 500 {object} models.Message "Internal server error."
// @Router /user/password [post] // @Router /user/password [post]
func UserChangePassword(c echo.Context) error { func UserChangePassword(c echo.Context) error {

View file

@ -1,4 +1,3 @@
swag
testdata/simple/docs testdata/simple/docs
cover.out cover.out

View file

@ -22,7 +22,7 @@
- [Getting started](#getting-started) - [Getting started](#getting-started)
- [Go web frameworks](#supported-web-frameworks) - [Go web frameworks](#supported-web-frameworks)
- [Supported Web Frameworks](#supported-web-frameworks) - [Supported Web Frameworks](#supported-web-frameworks)
- [How to use it with `gin`?](#how-to-use-it-with-`gin`?) - [How to use it with Gin](#how-to-use-it-with-gin)
- [Implementation Status](#implementation-status) - [Implementation Status](#implementation-status)
- [swag cli](#swag-cli) - [swag cli](#swag-cli)
- [General API Info](#general-api-info) - [General API Info](#general-api-info)
@ -72,7 +72,7 @@ $ swag init
- [echo](http://github.com/swaggo/echo-swagger) - [echo](http://github.com/swaggo/echo-swagger)
- [net/http](https://github.com/swaggo/http-swagger) - [net/http](https://github.com/swaggo/http-swagger)
## How to use it with `gin`? ## How to use it with Gin
Find the example source code [here](https://github.com/swaggo/swag/tree/master/example/celler). Find the example source code [here](https://github.com/swaggo/swag/tree/master/example/celler).
@ -307,19 +307,23 @@ OPTIONS:
**Example** **Example**
[celler/main.go](https://github.com/swaggo/swag/blob/master/example/celler/main.go) [celler/main.go](https://github.com/swaggo/swag/blob/master/example/celler/main.go)
| annotation | description | example | | annotation | description | example |
|--------------------|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------| |-----------------------|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| title | **Required.** The title of the application. | // @title Swagger Example API | | title | **Required.** The title of the application. | // @title Swagger Example API |
| version | **Required.** Provides the version of the application API. | // @version 1.0 | | version | **Required.** Provides the version of the application API. | // @version 1.0 |
| description | A short description of the application. | // @description This is a sample server celler server. | | description | A short description of the application. | // @description This is a sample server celler server. |
| termsOfService | The Terms of Service for the API. | // @termsOfService http://swagger.io/terms/ | | tag.name | Name of a tag. | // @tag.name This is the name of the tag |
| contact.name | The contact information for the exposed API. | // @contact.name API Support | | tag.description | Description of the tag | // @tag.description Cool Description |
| contact.url | The URL pointing to the contact information. MUST be in the format of a URL. | // @contact.url http://www.swagger.io/support | | tag.docs.url | Url of the external Documentation of the tag | // @tag.docs.url https://example.com |
| contact.email | The email address of the contact person/organization. MUST be in the format of an email address.| // @contact.email support@swagger.io | | tag.docs.descripiton | Description of the external Documentation of the tag | // @tag.docs.descirption Best example documentation |
| license.name | **Required.** The license name used for the API. | // @license.name Apache 2.0 | | termsOfService | The Terms of Service for the API. | // @termsOfService http://swagger.io/terms/ |
| license.url | A URL to the license used for the API. MUST be in the format of a URL. | // @license.url http://www.apache.org/licenses/LICENSE-2.0.html | | contact.name | The contact information for the exposed API. | // @contact.name API Support |
| host | The host (name or ip) serving the API. | // @host localhost:8080 | | contact.url | The URL pointing to the contact information. MUST be in the format of a URL. | // @contact.url http://www.swagger.io/support |
| BasePath | The base path on which the API is served. | // @BasePath /api/v1 | | contact.email | The email address of the contact person/organization. MUST be in the format of an email address.| // @contact.email support@swagger.io |
| license.name | **Required.** The license name used for the API. | // @license.name Apache 2.0 |
| license.url | A URL to the license used for the API. MUST be in the format of a URL. | // @license.url http://www.apache.org/licenses/LICENSE-2.0.html |
| host | The host (name or ip) serving the API. | // @host localhost:8080 |
| BasePath | The base path on which the API is served. | // @BasePath /api/v1 |
## Security ## Security

65
vendor/github.com/swaggo/swag/cmd/swag/main.go generated vendored Normal file
View file

@ -0,0 +1,65 @@
package main
import (
"log"
"os"
"github.com/pkg/errors"
"github.com/swaggo/swag"
"github.com/swaggo/swag/gen"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Version = swag.Version
app.Usage = "Automatically generate RESTful API documentation with Swagger 2.0 for Go."
app.Commands = []cli.Command{
{
Name: "init",
Aliases: []string{"i"},
Usage: "Create docs.go",
Action: func(c *cli.Context) error {
dir := c.String("dir")
mainAPIFile := c.String("generalInfo")
swaggerConfDir := c.String("swagger")
strategy := c.String("propertyStrategy")
switch strategy {
case swag.CamelCase, swag.SnakeCase, swag.PascalCase:
default:
return errors.Errorf("not supported %s propertyStrategy", strategy)
}
gen.New().Build(dir, mainAPIFile, swaggerConfDir, strategy)
return nil
},
Flags: []cli.Flag{
cli.StringFlag{
Name: "generalInfo, g",
Value: "main.go",
Usage: "Go file path in which 'swagger general API Info' is written",
},
cli.StringFlag{
Name: "dir, d",
Value: "./",
Usage: "Directory you want to parse",
},
cli.StringFlag{
Name: "swagger, s",
Value: "./docs/swagger",
Usage: "Output the swagger conf for json and yaml",
},
cli.StringFlag{
Name: "propertyStrategy, p",
Value: "camelcase",
Usage: "Property Naming Strategy like snakecase,camelcase,pascalcase",
},
},
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}

View file

@ -50,6 +50,9 @@ type Parser struct {
registerTypes map[string]*ast.TypeSpec registerTypes map[string]*ast.TypeSpec
PropNamingStrategy string PropNamingStrategy string
// structStack stores full names of the structures that were already parsed or are being parsed now
structStack []string
} }
// New creates a new Parser with default properties. // New creates a new Parser with default properties.
@ -146,6 +149,34 @@ func (parser *Parser) ParseGeneralAPIInfo(mainAPIFile string) error {
parser.swagger.BasePath = strings.TrimSpace(commentLine[len(attribute):]) parser.swagger.BasePath = strings.TrimSpace(commentLine[len(attribute):])
case "@schemes": case "@schemes":
parser.swagger.Schemes = GetSchemes(commentLine) parser.swagger.Schemes = GetSchemes(commentLine)
case "@tag.name":
commentInfo := strings.TrimSpace(commentLine[len(attribute):])
parser.swagger.Tags = append(parser.swagger.Tags, spec.Tag{
TagProps: spec.TagProps{
Name: strings.TrimSpace(commentInfo),
},
})
case "@tag.description":
commentInfo := strings.TrimSpace(commentLine[len(attribute):])
tag := parser.swagger.Tags[len(parser.swagger.Tags)-1]
tag.TagProps.Description = commentInfo
replaceLastTag(parser.swagger.Tags, tag)
case "@tag.docs.url":
commentInfo := strings.TrimSpace(commentLine[len(attribute):])
tag := parser.swagger.Tags[len(parser.swagger.Tags)-1]
tag.TagProps.ExternalDocs = &spec.ExternalDocumentation{
URL: commentInfo,
}
replaceLastTag(parser.swagger.Tags, tag)
case "@tag.docs.description":
commentInfo := strings.TrimSpace(commentLine[len(attribute):])
tag := parser.swagger.Tags[len(parser.swagger.Tags)-1]
if tag.TagProps.ExternalDocs == nil {
log.Panic("@tag.docs.description needs to come after a @tags.docs.url")
}
tag.TagProps.ExternalDocs.Description = commentInfo
replaceLastTag(parser.swagger.Tags, tag)
} }
} }
@ -365,47 +396,46 @@ func (parser *Parser) ParseType(astFile *ast.File) {
} }
} }
func (parser *Parser) isInStructStack(refTypeName string) bool {
for _, structName := range parser.structStack {
if refTypeName == structName {
return true
}
}
return false
}
// ParseDefinitions parses Swagger Api definitions. // ParseDefinitions parses Swagger Api definitions.
func (parser *Parser) ParseDefinitions() { func (parser *Parser) ParseDefinitions() {
for refTypeName, typeSpec := range parser.registerTypes { for refTypeName, typeSpec := range parser.registerTypes {
ss := strings.Split(refTypeName, ".") ss := strings.Split(refTypeName, ".")
pkgName := ss[0] pkgName := ss[0]
parser.ParseDefinition(pkgName, typeSpec, typeSpec.Name.Name) parser.structStack = nil
parser.ParseDefinition(pkgName, typeSpec.Name.Name, typeSpec)
} }
} }
var structStacks []string // ParseDefinition parses given type spec that corresponds to the type under
// given name and package, and populates swagger schema definitions registry
// isNotRecurringNestStruct check if a structure that is not a not repeating // with a schema for the given type
func isNotRecurringNestStruct(refTypeName string, structStacks []string) bool { func (parser *Parser) ParseDefinition(pkgName, typeName string, typeSpec *ast.TypeSpec) {
for _, v := range structStacks { refTypeName := fullTypeName(pkgName, typeName)
if refTypeName == v { if _, isParsed := parser.swagger.Definitions[refTypeName]; isParsed {
return false log.Println("Skipping '" + refTypeName + "', already parsed.")
}
}
return true
}
// ParseDefinition TODO: NEEDS COMMENT INFO
func (parser *Parser) ParseDefinition(pkgName string, typeSpec *ast.TypeSpec, typeName string) {
var refTypeName string
if len(pkgName) > 0 {
refTypeName = pkgName + "." + typeName
} else {
refTypeName = typeName
}
if _, already := parser.swagger.Definitions[refTypeName]; already {
log.Println("Skipping '" + refTypeName + "', already present.")
return return
} }
properties := make(map[string]spec.Schema)
// stop repetitive structural parsing
if isNotRecurringNestStruct(refTypeName, structStacks) {
structStacks = append(structStacks, refTypeName)
parser.parseTypeSpec(pkgName, typeSpec, properties)
}
structStacks = []string{}
if parser.isInStructStack(refTypeName) {
log.Println("Skipping '" + refTypeName + "', recursion detected.")
return
}
parser.structStack = append(parser.structStack, refTypeName)
log.Println("Generating " + refTypeName)
parser.swagger.Definitions[refTypeName] = parser.parseTypeExpr(pkgName, typeName, typeSpec.Type)
}
func (parser *Parser) collectRequiredFields(pkgName string, properties map[string]spec.Schema) (requiredFields []string) {
// created sorted list of properties keys so when we iterate over them it's deterministic // created sorted list of properties keys so when we iterate over them it's deterministic
ks := make([]string, 0, len(properties)) ks := make([]string, 0, len(properties))
for k := range properties { for k := range properties {
@ -413,7 +443,7 @@ func (parser *Parser) ParseDefinition(pkgName string, typeSpec *ast.TypeSpec, ty
} }
sort.Strings(ks) sort.Strings(ks)
requiredFields := make([]string, 0) requiredFields = make([]string, 0)
// iterate over keys list instead of map to avoid the random shuffle of the order that go does for maps // iterate over keys list instead of map to avoid the random shuffle of the order that go does for maps
for _, k := range ks { for _, k := range ks {
@ -423,7 +453,7 @@ func (parser *Parser) ParseDefinition(pkgName string, typeSpec *ast.TypeSpec, ty
tname := prop.SchemaProps.Type[0] tname := prop.SchemaProps.Type[0]
if _, ok := parser.TypeDefinitions[pkgName][tname]; ok { if _, ok := parser.TypeDefinitions[pkgName][tname]; ok {
tspec := parser.TypeDefinitions[pkgName][tname] tspec := parser.TypeDefinitions[pkgName][tname]
parser.ParseDefinition(pkgName, tspec, tname) parser.ParseDefinition(pkgName, tname, tspec)
} }
if tname != "object" { if tname != "object" {
requiredFields = append(requiredFields, prop.SchemaProps.Required...) requiredFields = append(requiredFields, prop.SchemaProps.Required...)
@ -431,39 +461,98 @@ func (parser *Parser) ParseDefinition(pkgName string, typeSpec *ast.TypeSpec, ty
} }
properties[k] = prop properties[k] = prop
} }
log.Println("Generating " + refTypeName)
parser.swagger.Definitions[refTypeName] = spec.Schema{ return
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: properties,
Required: requiredFields,
},
}
} }
func (parser *Parser) parseTypeSpec(pkgName string, typeSpec *ast.TypeSpec, properties map[string]spec.Schema) { func fullTypeName(pkgName, typeName string) string {
switch typeSpec.Type.(type) { if pkgName != "" {
case *ast.StructType: return pkgName + "." + typeName
structDecl := typeSpec.Type.(*ast.StructType) }
fields := structDecl.Fields.List return typeName
}
for _, field := range fields { // parseTypeExpr parses given type expression that corresponds to the type under
if field.Names == nil { //anonymous field // given name and package, and returns swagger schema for it.
parser.parseAnonymousField(pkgName, field, properties) func (parser *Parser) parseTypeExpr(pkgName, typeName string, typeExpr ast.Expr) spec.Schema {
switch expr := typeExpr.(type) {
// type Foo struct {...}
case *ast.StructType:
refTypeName := fullTypeName(pkgName, typeName)
if schema, isParsed := parser.swagger.Definitions[refTypeName]; isParsed {
return schema
}
properties := make(map[string]spec.Schema)
for _, field := range expr.Fields.List {
var fieldProps map[string]spec.Schema
if field.Names == nil {
fieldProps = parser.parseAnonymousField(pkgName, field)
} else { } else {
props := parser.parseStruct(pkgName, field) fieldProps = parser.parseStruct(pkgName, field)
for k, v := range props { }
properties[k] = v
} for k, v := range fieldProps {
properties[k] = v
} }
} }
return spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: properties,
Required: parser.collectRequiredFields(pkgName, properties),
},
}
// type Foo Baz
case *ast.Ident:
refTypeName := fullTypeName(pkgName, expr.Name)
if _, isParsed := parser.swagger.Definitions[refTypeName]; !isParsed {
typedef := parser.TypeDefinitions[pkgName][expr.Name]
parser.ParseDefinition(pkgName, expr.Name, typedef)
}
return parser.swagger.Definitions[refTypeName]
// type Foo *Baz
case *ast.StarExpr:
return parser.parseTypeExpr(pkgName, typeName, expr.X)
// type Foo []Baz
case *ast.ArrayType: case *ast.ArrayType:
log.Println("ParseDefinitions not supported 'Array' yet.") itemSchema := parser.parseTypeExpr(pkgName, "", expr.Elt)
case *ast.InterfaceType: return spec.Schema{
log.Println("ParseDefinitions not supported 'Interface' yet.") SchemaProps: spec.SchemaProps{
case *ast.MapType: Type: []string{"array"},
log.Println("ParseDefinitions not supported 'Map' yet.") Items: &spec.SchemaOrArray{
Schema: &itemSchema,
},
},
}
// type Foo pkg.Bar
case *ast.SelectorExpr:
if xIdent, ok := expr.X.(*ast.Ident); ok {
pkgName = xIdent.Name
typeName = expr.Sel.Name
refTypeName := fullTypeName(pkgName, typeName)
if _, isParsed := parser.swagger.Definitions[refTypeName]; !isParsed {
typedef := parser.TypeDefinitions[pkgName][typeName]
parser.ParseDefinition(pkgName, typeName, typedef)
}
return parser.swagger.Definitions[refTypeName]
}
// type Foo map[string]Bar
// ...
default:
log.Printf("Type definition of type '%T' is not supported yet. Using 'object' instead.\n", typeExpr)
}
return spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
},
} }
} }
@ -500,7 +589,8 @@ func (parser *Parser) parseStruct(pkgName string, field *ast.Field) (properties
} }
if _, ok := parser.TypeDefinitions[pkgName][structField.schemaType]; ok { // user type field if _, ok := parser.TypeDefinitions[pkgName][structField.schemaType]; ok { // user type field
// write definition if not yet present // write definition if not yet present
parser.ParseDefinition(pkgName, parser.TypeDefinitions[pkgName][structField.schemaType], structField.schemaType) parser.ParseDefinition(pkgName, structField.schemaType,
parser.TypeDefinitions[pkgName][structField.schemaType])
properties[structField.name] = spec.Schema{ properties[structField.name] = spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Type: []string{"object"}, // to avoid swagger validation error Type: []string{"object"}, // to avoid swagger validation error
@ -513,7 +603,8 @@ func (parser *Parser) parseStruct(pkgName string, field *ast.Field) (properties
} else if structField.schemaType == "array" { // array field type } else if structField.schemaType == "array" { // array field type
// if defined -- ref it // if defined -- ref it
if _, ok := parser.TypeDefinitions[pkgName][structField.arrayType]; ok { // user type in array if _, ok := parser.TypeDefinitions[pkgName][structField.arrayType]; ok { // user type in array
parser.ParseDefinition(pkgName, parser.TypeDefinitions[pkgName][structField.arrayType], structField.arrayType) parser.ParseDefinition(pkgName, structField.arrayType,
parser.TypeDefinitions[pkgName][structField.arrayType])
properties[structField.name] = spec.Schema{ properties[structField.name] = spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Type: []string{structField.schemaType}, Type: []string{structField.schemaType},
@ -620,30 +711,48 @@ func (parser *Parser) parseStruct(pkgName string, field *ast.Field) (properties
return return
} }
func (parser *Parser) parseAnonymousField(pkgName string, field *ast.Field, properties map[string]spec.Schema) { func (parser *Parser) parseAnonymousField(pkgName string, field *ast.Field) map[string]spec.Schema {
// check if ast Field is Ident type properties := make(map[string]spec.Schema)
astTypeIdent, okTypeIdent := field.Type.(*ast.Ident)
// if ast Field is not Ident type we check if it's StarExpr fullTypeName := ""
// because it might be a pointer to an Ident switch ftype := field.Type.(type) {
if !okTypeIdent { case *ast.Ident:
if astTypeStar, okTypeStar := field.Type.(*ast.StarExpr); okTypeStar { fullTypeName = ftype.Name
astTypeIdent, okTypeIdent = astTypeStar.X.(*ast.Ident) case *ast.StarExpr:
if ftypeX, ok := ftype.X.(*ast.Ident); ok {
fullTypeName = ftypeX.Name
} }
default:
log.Printf("Field type of '%T' is unsupported. Skipping", ftype)
return properties
} }
if okTypeIdent { typeName := fullTypeName
findPgkName := pkgName if splits := strings.Split(fullTypeName, "."); len(splits) > 1 {
findBaseTypeName := astTypeIdent.Name pkgName = splits[0]
ss := strings.Split(astTypeIdent.Name, ".") typeName = splits[1]
if len(ss) > 1 {
findPgkName = ss[0]
findBaseTypeName = ss[1]
}
baseTypeSpec := parser.TypeDefinitions[findPgkName][findBaseTypeName]
parser.parseTypeSpec(findPgkName, baseTypeSpec, properties)
} }
typeSpec := parser.TypeDefinitions[pkgName][typeName]
schema := parser.parseTypeExpr(pkgName, typeName, typeSpec.Type)
schemaType := "unknown"
if len(schema.SchemaProps.Type) > 0 {
schemaType = schema.SchemaProps.Type[0]
}
switch schemaType {
case "object":
for k, v := range schema.SchemaProps.Properties {
properties[k] = v
}
case "array":
properties[typeName] = schema
default:
log.Printf("Can't extract properties from a schema of type '%s'", schemaType)
}
return properties
} }
func (parser *Parser) parseField(field *ast.Field) *structField { func (parser *Parser) parseField(field *ast.Field) *structField {
@ -755,6 +864,11 @@ func (parser *Parser) parseField(field *ast.Field) *structField {
return structField return structField
} }
func replaceLastTag(slice []spec.Tag, element spec.Tag) {
slice = slice[:len(slice)-1]
slice = append(slice, element)
}
func getFloatTag(structTag reflect.StructTag, tagName string) *float64 { func getFloatTag(structTag reflect.StructTag, tagName string) *float64 {
strValue := structTag.Get(tagName) strValue := structTag.Get(tagName)
if strValue == "" { if strValue == "" {

View file

@ -4,6 +4,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"go/ast" "go/ast"
"log"
"strings" "strings"
) )
@ -52,7 +53,7 @@ func parseFieldSelectorExpr(astTypeSelectorExpr *ast.SelectorExpr, parser *Parse
if pkgName, ok := astTypeSelectorExpr.X.(*ast.Ident); ok { if pkgName, ok := astTypeSelectorExpr.X.(*ast.Ident); ok {
if typeDefinitions, ok := parser.TypeDefinitions[pkgName.Name][astTypeSelectorExpr.Sel.Name]; ok { if typeDefinitions, ok := parser.TypeDefinitions[pkgName.Name][astTypeSelectorExpr.Sel.Name]; ok {
parser.ParseDefinition(pkgName.Name, typeDefinitions, astTypeSelectorExpr.Sel.Name) parser.ParseDefinition(pkgName.Name, astTypeSelectorExpr.Sel.Name, typeDefinitions)
return propertyNewFunc(astTypeSelectorExpr.Sel.Name, pkgName.Name) return propertyNewFunc(astTypeSelectorExpr.Sel.Name, pkgName.Name)
} }
if actualPrimitiveType, isCustomType := parser.CustomPrimitiveTypes[astTypeSelectorExpr.Sel.Name]; isCustomType { if actualPrimitiveType, isCustomType := parser.CustomPrimitiveTypes[astTypeSelectorExpr.Sel.Name]; isCustomType {
@ -60,7 +61,7 @@ func parseFieldSelectorExpr(astTypeSelectorExpr *ast.SelectorExpr, parser *Parse
} }
} }
fmt.Printf("%s is not supported. but it will be set with string temporary. Please report any problems.", astTypeSelectorExpr.Sel.Name) log.Printf("%s is not supported. but it will be set with string temporary. Please report any problems.\n", astTypeSelectorExpr.Sel.Name)
return propertyName{SchemaType: "string", ArrayType: "string"} return propertyName{SchemaType: "string", ArrayType: "string"}
} }
@ -86,6 +87,14 @@ func getPropertyName(field *ast.Field, parser *Parser) propertyName {
if astTypeSelectorExpr, ok := ptr.X.(*ast.SelectorExpr); ok { if astTypeSelectorExpr, ok := ptr.X.(*ast.SelectorExpr); ok {
return parseFieldSelectorExpr(astTypeSelectorExpr, parser, newProperty) return parseFieldSelectorExpr(astTypeSelectorExpr, parser, newProperty)
} }
// TODO support custom pointer type?
if _, ok := ptr.X.(*ast.MapType); ok { // if map
//TODO support map
return propertyName{SchemaType: "object", ArrayType: "object"}
}
if _, ok := ptr.X.(*ast.StructType); ok { // if struct
return propertyName{SchemaType: "object", ArrayType: "object"}
}
if astTypeIdent, ok := ptr.X.(*ast.Ident); ok { if astTypeIdent, ok := ptr.X.(*ast.Ident); ok {
name := astTypeIdent.Name name := astTypeIdent.Name
schemeType := TransToValidSchemeType(name) schemeType := TransToValidSchemeType(name)
@ -106,6 +115,9 @@ func getPropertyName(field *ast.Field, parser *Parser) propertyName {
return parseFieldSelectorExpr(astTypeArrayExpr, parser, newArrayProperty) return parseFieldSelectorExpr(astTypeArrayExpr, parser, newArrayProperty)
} }
if astTypeArrayExpr, ok := astTypeArray.Elt.(*ast.StarExpr); ok { if astTypeArrayExpr, ok := astTypeArray.Elt.(*ast.StarExpr); ok {
if astTypeArraySel, ok := astTypeArrayExpr.X.(*ast.SelectorExpr); ok {
return parseFieldSelectorExpr(astTypeArraySel, parser, newArrayProperty)
}
if astTypeArrayIdent, ok := astTypeArrayExpr.X.(*ast.Ident); ok { if astTypeArrayIdent, ok := astTypeArrayExpr.X.(*ast.Ident); ok {
name := TransToValidSchemeType(astTypeArrayIdent.Name) name := TransToValidSchemeType(astTypeArrayIdent.Name)
return propertyName{SchemaType: "array", ArrayType: name} return propertyName{SchemaType: "array", ArrayType: name}

2
vendor/modules.txt vendored
View file

@ -108,7 +108,7 @@ github.com/stretchr/testify/assert
github.com/swaggo/echo-swagger github.com/swaggo/echo-swagger
# github.com/swaggo/files v0.0.0-20180215091130-49c8a91ea3fa # github.com/swaggo/files v0.0.0-20180215091130-49c8a91ea3fa
github.com/swaggo/files github.com/swaggo/files
# github.com/swaggo/swag v1.3.3-0.20181109030545-8f09470d62b2 # github.com/swaggo/swag v1.4.1-0.20181129020348-1c8533a91397
github.com/swaggo/swag/cmd/swag github.com/swaggo/swag/cmd/swag
github.com/swaggo/swag github.com/swaggo/swag
github.com/swaggo/swag/gen github.com/swaggo/swag/gen