Fix swagger docs

This commit is contained in:
kolaente 2020-06-28 16:25:46 +02:00
parent b55b21373c
commit 3b2289c8fa
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
32 changed files with 6406 additions and 2603 deletions

View file

@ -192,7 +192,7 @@ do-the-swag:
@hash swag > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @hash swag > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install $(GOFLAGS) github.com/swaggo/swag/cmd/swag; \ go install $(GOFLAGS) github.com/swaggo/swag/cmd/swag; \
fi fi
swag init -g pkg/routes/routes.go -o ./pkg/swagger; swag init -g pkg/routes/routes.go --parseDependency -o ./pkg/swagger;
# Fix the generated swagger file, currently a workaround until swaggo can properly use go mod # Fix the generated swagger file, currently a workaround until swaggo can properly use go mod
sed -i '/"definitions": {/a "code.vikunja.io.web.HTTPError": {"type": "object","properties": {"code": {"type": "integer"},"message": {"type": "string"}}},' pkg/swagger/docs.go; sed -i '/"definitions": {/a "code.vikunja.io.web.HTTPError": {"type": "object","properties": {"code": {"type": "integer"},"message": {"type": "string"}}},' pkg/swagger/docs.go;
sed -i 's/code.vikunja.io\/web.HTTPError/code.vikunja.io.web.HTTPError/g' pkg/swagger/docs.go; sed -i 's/code.vikunja.io\/web.HTTPError/code.vikunja.io.web.HTTPError/g' pkg/swagger/docs.go;

View file

@ -73,8 +73,8 @@ func (bt *BulkTask) CanUpdate(a web.Auth) (bool, error) {
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Param task body models.BulkTask true "The task object. Looks like a normal task, the only difference is it uses an array of list_ids to update." // @Param task body models.BulkTask true "The task object. Looks like a normal task, the only difference is it uses an array of list_ids to update."
// @Success 200 {object} models.Task "The updated task object." // @Success 200 {object} models.Task "The updated task object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task object provided." // @Failure 400 {object} web.HTTPError "Invalid task object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the task (aka its list)" // @Failure 403 {object} 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/bulk [post] // @Router /tasks/bulk [post]
func (bt *BulkTask) Update() (err error) { func (bt *BulkTask) Update() (err error) {

View file

@ -154,8 +154,8 @@ func (b *Bucket) ReadAll(auth web.Auth, search string, page int, perPage int) (r
// @Param id path int true "List Id" // @Param id path int true "List Id"
// @Param bucket body models.Bucket true "The bucket object" // @Param bucket body models.Bucket true "The bucket object"
// @Success 200 {object} models.Bucket "The created bucket object." // @Success 200 {object} models.Bucket "The created bucket object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid bucket object provided." // @Failure 400 {object} web.HTTPError "Invalid bucket object provided."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The list does not exist." // @Failure 404 {object} web.HTTPError "The list does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{id}/buckets [put] // @Router /lists/{id}/buckets [put]
func (b *Bucket) Create(a web.Auth) (err error) { func (b *Bucket) Create(a web.Auth) (err error) {
@ -176,8 +176,8 @@ func (b *Bucket) Create(a web.Auth) (err error) {
// @Param bucketID path int true "Bucket Id" // @Param bucketID path int true "Bucket Id"
// @Param bucket body models.Bucket true "The bucket object" // @Param bucket body models.Bucket true "The bucket object"
// @Success 200 {object} models.Bucket "The created bucket object." // @Success 200 {object} models.Bucket "The created bucket object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid bucket object provided." // @Failure 400 {object} web.HTTPError "Invalid bucket object provided."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The bucket does not exist." // @Failure 404 {object} web.HTTPError "The bucket does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{listID}/buckets/{bucketID} [post] // @Router /lists/{listID}/buckets/{bucketID} [post]
func (b *Bucket) Update() (err error) { func (b *Bucket) Update() (err error) {
@ -195,7 +195,7 @@ func (b *Bucket) Update() (err error) {
// @Param listID path int true "List Id" // @Param listID path int true "List Id"
// @Param bucketID path int true "Bucket Id" // @Param bucketID path int true "Bucket Id"
// @Success 200 {object} models.Message "Successfully deleted." // @Success 200 {object} models.Message "Successfully deleted."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The bucket does not exist." // @Failure 404 {object} web.HTTPError "The bucket does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{listID}/buckets/{bucketID} [delete] // @Router /lists/{listID}/buckets/{bucketID} [delete]
func (b *Bucket) Delete() (err error) { func (b *Bucket) Delete() (err error) {

View file

@ -60,7 +60,7 @@ func (Label) TableName() string {
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Param label body models.Label true "The label object" // @Param label body models.Label true "The label object"
// @Success 200 {object} models.Label "The created label object." // @Success 200 {object} models.Label "The created label object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid label object provided." // @Failure 400 {object} web.HTTPError "Invalid label object provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /labels [put] // @Router /labels [put]
func (l *Label) Create(a web.Auth) (err error) { func (l *Label) Create(a web.Auth) (err error) {
@ -86,9 +86,9 @@ func (l *Label) Create(a web.Auth) (err error) {
// @Param id path int true "Label ID" // @Param id path int true "Label ID"
// @Param label body models.Label true "The label object" // @Param label body models.Label true "The label object"
// @Success 200 {object} models.Label "The created label object." // @Success 200 {object} models.Label "The created label object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid label object provided." // @Failure 400 {object} web.HTTPError "Invalid label object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to update the label." // @Failure 403 {object} web.HTTPError "Not allowed to update the label."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "Label not found." // @Failure 404 {object} web.HTTPError "Label not found."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /labels/{id} [put] // @Router /labels/{id} [put]
func (l *Label) Update() (err error) { func (l *Label) Update() (err error) {
@ -117,8 +117,8 @@ func (l *Label) Update() (err error) {
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Param id path int true "Label ID" // @Param id path int true "Label ID"
// @Success 200 {object} models.Label "The label was successfully deleted." // @Success 200 {object} models.Label "The label was successfully deleted."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to delete the label." // @Failure 403 {object} web.HTTPError "Not allowed to delete the label."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "Label not found." // @Failure 404 {object} web.HTTPError "Label not found."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /labels/{id} [delete] // @Router /labels/{id} [delete]
func (l *Label) Delete() (err error) { func (l *Label) Delete() (err error) {
@ -172,8 +172,8 @@ func (l *Label) ReadAll(a web.Auth, search string, page int, perPage int) (ls in
// @Param id path int true "Label ID" // @Param id path int true "Label ID"
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {object} models.Label "The label" // @Success 200 {object} models.Label "The label"
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the label" // @Failure 403 {object} web.HTTPError "The user does not have access to the label"
// @Failure 404 {object} code.vikunja.io/web.HTTPError "Label not found" // @Failure 404 {object} web.HTTPError "Label not found"
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /labels/{id} [get] // @Router /labels/{id} [get]
func (l *Label) ReadOne() (err error) { func (l *Label) ReadOne() (err error) {

View file

@ -52,8 +52,8 @@ func (LabelTask) TableName() string {
// @Param task path int true "Task ID" // @Param task path int true "Task ID"
// @Param label path int true "Label ID" // @Param label path int true "Label ID"
// @Success 200 {object} models.Message "The label was successfully removed." // @Success 200 {object} models.Message "The label was successfully removed."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to remove the label." // @Failure 403 {object} web.HTTPError "Not allowed to remove the label."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "Label not found." // @Failure 404 {object} web.HTTPError "Label not found."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{task}/labels/{label} [delete] // @Router /tasks/{task}/labels/{label} [delete]
func (lt *LabelTask) Delete() (err error) { func (lt *LabelTask) Delete() (err error) {
@ -71,9 +71,9 @@ func (lt *LabelTask) Delete() (err error) {
// @Param task path int true "Task ID" // @Param task path int true "Task ID"
// @Param label body models.LabelTask true "The label object" // @Param label body models.LabelTask true "The label object"
// @Success 200 {object} models.LabelTask "The created label relation object." // @Success 200 {object} models.LabelTask "The created label relation object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid label object provided." // @Failure 400 {object} web.HTTPError "Invalid label object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to add the label." // @Failure 403 {object} web.HTTPError "Not allowed to add the label."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The label does not exist." // @Failure 404 {object} web.HTTPError "The label does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{task}/labels [put] // @Router /tasks/{task}/labels [put]
func (lt *LabelTask) Create(a web.Auth) (err error) { func (lt *LabelTask) Create(a web.Auth) (err error) {
@ -332,7 +332,7 @@ type LabelTaskBulk struct {
// @Param label body models.LabelTaskBulk true "The array of labels" // @Param label body models.LabelTaskBulk true "The array of labels"
// @Param taskID path int true "Task ID" // @Param taskID path int true "Task ID"
// @Success 200 {object} models.LabelTaskBulk "The updated labels object." // @Success 200 {object} models.LabelTaskBulk "The updated labels object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid label object provided." // @Failure 400 {object} web.HTTPError "Invalid label object provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{taskID}/labels/bulk [post] // @Router /tasks/{taskID}/labels/bulk [post]
func (ltb *LabelTaskBulk) Create(a web.Auth) (err error) { func (ltb *LabelTaskBulk) Create(a web.Auth) (err error) {

View file

@ -93,9 +93,9 @@ func GetLinkShareFromClaims(claims jwt.MapClaims) (share *LinkSharing, err error
// @Param list path int true "List ID" // @Param list path int true "List ID"
// @Param label body models.LinkSharing true "The new link share object" // @Param label body models.LinkSharing true "The new link share object"
// @Success 200 {object} models.LinkSharing "The created link share object." // @Success 200 {object} models.LinkSharing "The created link share object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid link share object provided." // @Failure 400 {object} web.HTTPError "Invalid link share object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to add the list share." // @Failure 403 {object} web.HTTPError "Not allowed to add the list share."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The list does not exist." // @Failure 404 {object} web.HTTPError "The list does not exist."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{list}/shares [put] // @Router /lists/{list}/shares [put]
func (share *LinkSharing) Create(a web.Auth) (err error) { func (share *LinkSharing) Create(a web.Auth) (err error) {
@ -122,8 +122,8 @@ func (share *LinkSharing) Create(a web.Auth) (err error) {
// @Param share path int true "Share ID" // @Param share path int true "Share ID"
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {object} models.LinkSharing "The share links" // @Success 200 {object} models.LinkSharing "The share links"
// @Failure 403 {object} code.vikunja.io/web.HTTPError "No access to the list" // @Failure 403 {object} web.HTTPError "No access to the list"
// @Failure 404 {object} code.vikunja.io/web.HTTPError "Share Link not found." // @Failure 404 {object} web.HTTPError "Share Link not found."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{list}/shares/{share} [get] // @Router /lists/{list}/shares/{share} [get]
func (share *LinkSharing) ReadOne() (err error) { func (share *LinkSharing) ReadOne() (err error) {
@ -211,8 +211,8 @@ func (share *LinkSharing) ReadAll(a web.Auth, search string, page int, perPage i
// @Param list path int true "List ID" // @Param list path int true "List ID"
// @Param share path int true "Share Link ID" // @Param share path int true "Share Link ID"
// @Success 200 {object} models.Message "The link was successfully removed." // @Success 200 {object} models.Message "The link was successfully removed."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to remove the link." // @Failure 403 {object} web.HTTPError "Not allowed to remove the link."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "Share Link not found." // @Failure 404 {object} web.HTTPError "Share Link not found."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /lists/{list}/shares/{share} [delete] // @Router /lists/{list}/shares/{share} [delete]
func (share *LinkSharing) Delete() (err error) { func (share *LinkSharing) Delete() (err error) {

View file

@ -119,7 +119,7 @@ func GetListsByNamespaceID(nID int64, doer *user.User) (lists []*List, err error
// @Param is_archived query bool false "If true, also returns all archived lists." // @Param is_archived query bool false "If true, also returns all archived lists."
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {array} models.List "The lists" // @Success 200 {array} models.List "The lists"
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} 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(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error) { func (l *List) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error) {
@ -161,7 +161,7 @@ func (l *List) ReadAll(a web.Auth, search string, page int, perPage int) (result
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} 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) {
@ -512,8 +512,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} code.vikunja.io/web.HTTPError "Invalid list object provided." // @Failure 400 {object} web.HTTPError "Invalid list object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} 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) {
@ -545,8 +545,8 @@ func updateListByTaskID(taskID int64) (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} code.vikunja.io/web.HTTPError "Invalid list object provided." // @Failure 400 {object} web.HTTPError "Invalid list object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} 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) {
@ -585,8 +585,8 @@ func (l *List) Create(a web.Auth) (err error) {
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "Invalid list object provided." // @Failure 400 {object} web.HTTPError "Invalid list object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} 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

@ -62,9 +62,9 @@ type TeamWithRight struct {
// @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} code.vikunja.io/web.HTTPError "Invalid team list object provided." // @Failure 400 {object} web.HTTPError "Invalid team list object provided."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The team does not exist." // @Failure 404 {object} web.HTTPError "The team does not exist."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} 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) {
@ -116,8 +116,8 @@ func (tl *TeamList) Create(a web.Auth) (err error) {
// @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} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} web.HTTPError "The user does not have access to the list"
// @Failure 404 {object} code.vikunja.io/web.HTTPError "Team or list does not exist." // @Failure 404 {object} 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) {
@ -162,7 +162,7 @@ func (tl *TeamList) Delete() (err error) {
// @Param s query string false "Search teams by its name." // @Param s query string false "Search teams by its name."
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {array} models.TeamWithRight "The teams with their right." // @Success 200 {array} models.TeamWithRight "The teams with their right."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "No right to see the list." // @Failure 403 {object} 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(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error) { func (tl *TeamList) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error) {
@ -227,8 +227,8 @@ func (tl *TeamList) ReadAll(a web.Auth, search string, page int, perPage int) (r
// @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 JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {object} models.TeamList "The updated team <-> list relation." // @Success 200 {object} models.TeamList "The updated team <-> list relation."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have admin-access to the list" // @Failure 403 {object} web.HTTPError "The user does not have admin-access to the list"
// @Failure 404 {object} code.vikunja.io/web.HTTPError "Team or list does not exist." // @Failure 404 {object} 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

@ -65,9 +65,9 @@ type UserWithRight struct {
// @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} code.vikunja.io/web.HTTPError "Invalid user list object provided." // @Failure 400 {object} web.HTTPError "Invalid user list object provided."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The user does not exist." // @Failure 404 {object} web.HTTPError "The user does not exist."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} 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 (lu *ListUser) Create(a web.Auth) (err error) { func (lu *ListUser) Create(a web.Auth) (err error) {
@ -123,8 +123,8 @@ func (lu *ListUser) Create(a web.Auth) (err error) {
// @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} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} web.HTTPError "The user does not have access to the list"
// @Failure 404 {object} code.vikunja.io/web.HTTPError "user or list does not exist." // @Failure 404 {object} 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) {
@ -168,7 +168,7 @@ func (lu *ListUser) Delete() (err error) {
// @Param s query string false "Search users by its name." // @Param s query string false "Search users by its name."
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "No right to see the list." // @Failure 403 {object} 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 (lu *ListUser) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error) { func (lu *ListUser) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error) {
@ -223,8 +223,8 @@ func (lu *ListUser) ReadAll(a web.Auth, search string, page int, perPage int) (r
// @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 JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {object} models.ListUser "The updated user <-> list relation." // @Success 200 {object} models.ListUser "The updated user <-> list relation."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have admin-access to the list" // @Failure 403 {object} web.HTTPError "The user does not have admin-access to the list"
// @Failure 404 {object} code.vikunja.io/web.HTTPError "User or list does not exist." // @Failure 404 {object} 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

@ -132,7 +132,7 @@ func (n *Namespace) CheckIsArchived() error {
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "The user does not have access to that namespace." // @Failure 403 {object} 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) {
@ -318,8 +318,8 @@ func (n *Namespace) ReadAll(a web.Auth, search string, page int, perPage int) (r
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "Invalid namespace object provided." // @Failure 400 {object} web.HTTPError "Invalid namespace object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace" // @Failure 403 {object} 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) {
@ -353,8 +353,8 @@ func (n *Namespace) Create(a web.Auth) (err error) {
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "Invalid namespace object provided." // @Failure 400 {object} web.HTTPError "Invalid namespace object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace" // @Failure 403 {object} 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) {
@ -411,8 +411,8 @@ func (n *Namespace) Delete() (err error) {
// @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} code.vikunja.io/web.HTTPError "Invalid namespace object provided." // @Failure 400 {object} web.HTTPError "Invalid namespace object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace" // @Failure 403 {object} 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

@ -56,9 +56,9 @@ func (TeamNamespace) TableName() string {
// @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} code.vikunja.io/web.HTTPError "Invalid team namespace object provided." // @Failure 400 {object} web.HTTPError "Invalid team namespace object provided."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The team does not exist." // @Failure 404 {object} web.HTTPError "The team does not exist."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The team does not have access to the namespace" // @Failure 403 {object} 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) {
@ -105,8 +105,8 @@ func (tn *TeamNamespace) Create(a web.Auth) (err error) {
// @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} code.vikunja.io/web.HTTPError "The team does not have access to the namespace" // @Failure 403 {object} web.HTTPError "The team does not have access to the namespace"
// @Failure 404 {object} code.vikunja.io/web.HTTPError "team or namespace does not exist." // @Failure 404 {object} 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) {
@ -147,7 +147,7 @@ func (tn *TeamNamespace) Delete() (err error) {
// @Param s query string false "Search teams by its name." // @Param s query string false "Search teams by its name."
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "No right to see the namespace." // @Failure 403 {object} 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(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error) { func (tn *TeamNamespace) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error) {
@ -208,8 +208,8 @@ func (tn *TeamNamespace) ReadAll(a web.Auth, search string, page int, perPage in
// @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 JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {object} models.TeamNamespace "The updated team <-> namespace relation." // @Success 200 {object} models.TeamNamespace "The updated team <-> namespace relation."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The team does not have admin-access to the namespace" // @Failure 403 {object} web.HTTPError "The team does not have admin-access to the namespace"
// @Failure 404 {object} code.vikunja.io/web.HTTPError "Team or namespace does not exist." // @Failure 404 {object} 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 (tn *TeamNamespace) Update() (err error) { func (tn *TeamNamespace) Update() (err error) {

View file

@ -58,9 +58,9 @@ func (NamespaceUser) TableName() string {
// @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} code.vikunja.io/web.HTTPError "Invalid user namespace object provided." // @Failure 400 {object} web.HTTPError "Invalid user namespace object provided."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The user does not exist." // @Failure 404 {object} web.HTTPError "The user does not exist."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace" // @Failure 403 {object} 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 (nu *NamespaceUser) Create(a web.Auth) (err error) { func (nu *NamespaceUser) Create(a web.Auth) (err error) {
@ -114,8 +114,8 @@ func (nu *NamespaceUser) Create(a web.Auth) (err error) {
// @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} code.vikunja.io/web.HTTPError "The user does not have access to the namespace" // @Failure 403 {object} web.HTTPError "The user does not have access to the namespace"
// @Failure 404 {object} code.vikunja.io/web.HTTPError "user or namespace does not exist." // @Failure 404 {object} 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) {
@ -154,7 +154,7 @@ func (nu *NamespaceUser) Delete() (err error) {
// @Param s query string false "Search users by its name." // @Param s query string false "Search users by its name."
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "No right to see the namespace." // @Failure 403 {object} 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 (nu *NamespaceUser) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error) { func (nu *NamespaceUser) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error) {
@ -210,8 +210,8 @@ func (nu *NamespaceUser) ReadAll(a web.Auth, search string, page int, perPage in
// @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 JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {object} models.NamespaceUser "The updated user <-> namespace relation." // @Success 200 {object} models.NamespaceUser "The updated user <-> namespace relation."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have admin-access to the namespace" // @Failure 403 {object} web.HTTPError "The user does not have admin-access to the namespace"
// @Failure 404 {object} code.vikunja.io/web.HTTPError "User or namespace does not exist." // @Failure 404 {object} 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

@ -162,7 +162,7 @@ func (t *Task) setTaskAssignees(assignees []*user.User) {
// @Param taskID path int true "Task ID" // @Param taskID path int true "Task ID"
// @Param userID path int true "Assignee user ID" // @Param userID path int true "Assignee user ID"
// @Success 200 {object} models.Message "The assignee was successfully deleted." // @Success 200 {object} models.Message "The assignee was successfully deleted."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to delete the assignee." // @Failure 403 {object} web.HTTPError "Not allowed to delete the assignee."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{taskID}/assignees/{userID} [delete] // @Router /tasks/{taskID}/assignees/{userID} [delete]
func (la *TaskAssginee) Delete() (err error) { func (la *TaskAssginee) Delete() (err error) {
@ -185,7 +185,7 @@ func (la *TaskAssginee) Delete() (err error) {
// @Param assignee body models.TaskAssginee true "The assingee object" // @Param assignee body models.TaskAssginee true "The assingee object"
// @Param taskID path int true "Task ID" // @Param taskID path int true "Task ID"
// @Success 200 {object} models.TaskAssginee "The created assingee object." // @Success 200 {object} models.TaskAssginee "The created assingee object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid assignee object provided." // @Failure 400 {object} web.HTTPError "Invalid assignee object provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{taskID}/assignees [put] // @Router /tasks/{taskID}/assignees [put]
func (la *TaskAssginee) Create(a web.Auth) (err error) { func (la *TaskAssginee) Create(a web.Auth) (err error) {
@ -296,7 +296,7 @@ type BulkAssignees struct {
// @Param assignee body models.BulkAssignees true "The array of assignees" // @Param assignee body models.BulkAssignees true "The array of assignees"
// @Param taskID path int true "Task ID" // @Param taskID path int true "Task ID"
// @Success 200 {object} models.TaskAssginee "The created assingees object." // @Success 200 {object} models.TaskAssginee "The created assingees object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid assignee object provided." // @Failure 400 {object} web.HTTPError "Invalid assignee object provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{taskID}/assignees/bulk [post] // @Router /tasks/{taskID}/assignees/bulk [post]
func (ba *BulkAssignees) Create(a web.Auth) (err error) { func (ba *BulkAssignees) Create(a web.Auth) (err error) {

View file

@ -53,7 +53,7 @@ func (tc *TaskComment) TableName() string {
// @Param relation body models.TaskComment true "The task comment object" // @Param relation body models.TaskComment true "The task comment object"
// @Param taskID path int true "Task ID" // @Param taskID path int true "Task ID"
// @Success 200 {object} models.TaskComment "The created task comment object." // @Success 200 {object} models.TaskComment "The created task comment object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task comment object provided." // @Failure 400 {object} web.HTTPError "Invalid task comment object provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{taskID}/comments [put] // @Router /tasks/{taskID}/comments [put]
func (tc *TaskComment) Create(a web.Auth) (err error) { func (tc *TaskComment) Create(a web.Auth) (err error) {
@ -82,8 +82,8 @@ func (tc *TaskComment) Create(a web.Auth) (err error) {
// @Param taskID path int true "Task ID" // @Param taskID path int true "Task ID"
// @Param commentID path int true "Comment ID" // @Param commentID path int true "Comment ID"
// @Success 200 {object} models.Message "The task comment was successfully deleted." // @Success 200 {object} models.Message "The task comment was successfully deleted."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task comment object provided." // @Failure 400 {object} web.HTTPError "Invalid task comment object provided."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The task comment was not found." // @Failure 404 {object} web.HTTPError "The task comment was not found."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{taskID}/comments/{commentID} [delete] // @Router /tasks/{taskID}/comments/{commentID} [delete]
func (tc *TaskComment) Delete() error { func (tc *TaskComment) Delete() error {
@ -104,8 +104,8 @@ func (tc *TaskComment) Delete() error {
// @Param taskID path int true "Task ID" // @Param taskID path int true "Task ID"
// @Param commentID path int true "Comment ID" // @Param commentID path int true "Comment ID"
// @Success 200 {object} models.TaskComment "The updated task comment object." // @Success 200 {object} models.TaskComment "The updated task comment object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task comment object provided." // @Failure 400 {object} web.HTTPError "Invalid task comment object provided."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The task comment was not found." // @Failure 404 {object} web.HTTPError "The task comment was not found."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{taskID}/comments/{commentID} [post] // @Router /tasks/{taskID}/comments/{commentID} [post]
func (tc *TaskComment) Update() error { func (tc *TaskComment) Update() error {
@ -126,8 +126,8 @@ func (tc *TaskComment) Update() error {
// @Param taskID path int true "Task ID" // @Param taskID path int true "Task ID"
// @Param commentID path int true "Comment ID" // @Param commentID path int true "Comment ID"
// @Success 200 {object} models.TaskComment "The task comment object." // @Success 200 {object} models.TaskComment "The task comment object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task comment object provided." // @Failure 400 {object} web.HTTPError "Invalid task comment object provided."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The task comment was not found." // @Failure 404 {object} web.HTTPError "The task comment was not found."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{taskID}/comments/{commentID} [get] // @Router /tasks/{taskID}/comments/{commentID} [get]
func (tc *TaskComment) ReadOne() (err error) { func (tc *TaskComment) ReadOne() (err error) {

View file

@ -113,7 +113,7 @@ type RelatedTaskMap map[RelationKind][]*Task
// @Param relation body models.TaskRelation true "The relation object" // @Param relation body models.TaskRelation true "The relation object"
// @Param taskID path int true "Task ID" // @Param taskID path int true "Task ID"
// @Success 200 {object} models.TaskRelation "The created task relation object." // @Success 200 {object} models.TaskRelation "The created task relation object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task relation object provided." // @Failure 400 {object} web.HTTPError "Invalid task relation object provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{taskID}/relations [put] // @Router /tasks/{taskID}/relations [put]
func (rel *TaskRelation) Create(a web.Auth) error { func (rel *TaskRelation) Create(a web.Auth) error {
@ -193,8 +193,8 @@ func (rel *TaskRelation) Create(a web.Auth) error {
// @Param relation body models.TaskRelation true "The relation object" // @Param relation body models.TaskRelation true "The relation object"
// @Param taskID path int true "Task ID" // @Param taskID path int true "Task ID"
// @Success 200 {object} models.Message "The task relation was successfully deleted." // @Success 200 {object} models.Message "The task relation was successfully deleted."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task relation object provided." // @Failure 400 {object} web.HTTPError "Invalid task relation object provided."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "The task relation was not found." // @Failure 404 {object} web.HTTPError "The task relation was not found."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /tasks/{taskID}/relations [delete] // @Router /tasks/{taskID}/relations [delete]
func (rel *TaskRelation) Delete() error { func (rel *TaskRelation) Delete() error {

View file

@ -569,8 +569,8 @@ func checkBucketAndTaskBelongToSameList(fullTask *Task, bucketID int64) (err err
// @Param id path int true "List ID" // @Param id path int true "List ID"
// @Param task body models.Task true "The task object" // @Param task body models.Task true "The task object"
// @Success 200 {object} models.Task "The created task object." // @Success 200 {object} models.Task "The created task object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task object provided." // @Failure 400 {object} web.HTTPError "Invalid task object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} 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 (t *Task) Create(a web.Auth) (err error) { func (t *Task) Create(a web.Auth) (err error) {
@ -662,8 +662,8 @@ func (t *Task) Create(a web.Auth) (err error) {
// @Param id path int true "Task ID" // @Param id path int true "Task ID"
// @Param task body models.Task true "The task object" // @Param task body models.Task true "The task object"
// @Success 200 {object} models.Task "The updated task object." // @Success 200 {object} models.Task "The updated task object."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task object provided." // @Failure 400 {object} web.HTTPError "Invalid task object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the task (aka its list)" // @Failure 403 {object} 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 (t *Task) Update() (err error) { func (t *Task) Update() (err error) {
@ -1000,8 +1000,8 @@ func (t *Task) updateReminders(reminders []time.Time) (err error) {
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "Invalid task ID provided." // @Failure 400 {object} web.HTTPError "Invalid task ID provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} 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 (t *Task) Delete() (err error) { func (t *Task) Delete() (err error) {

View file

@ -31,8 +31,8 @@ import (
// @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} code.vikunja.io/web.HTTPError "Invalid member object provided." // @Failure 400 {object} web.HTTPError "Invalid member object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the team" // @Failure 403 {object} 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

@ -174,7 +174,7 @@ func addMoreInfoToTeams(teams []*Team) (err error) {
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "The user does not have access to the team" // @Failure 403 {object} 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} [get] // @Router /teams/{id} [get]
func (t *Team) ReadOne() (err error) { func (t *Team) ReadOne() (err error) {
@ -242,7 +242,7 @@ func (t *Team) ReadAll(a web.Auth, search string, page int, perPage int) (result
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "Invalid team object provided." // @Failure 400 {object} 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) {
@ -282,7 +282,7 @@ func (t *Team) Create(a web.Auth) (err error) {
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @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} code.vikunja.io/web.HTTPError "Invalid team object provided." // @Failure 400 {object} 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) {
@ -325,7 +325,7 @@ func (t *Team) Delete() (err error) {
// @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} code.vikunja.io/web.HTTPError "Invalid team object provided." // @Failure 400 {object} 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

@ -229,8 +229,8 @@ func (p *Provider) Search(search string, page int64) (result []*background.Image
// @Param id path int true "List ID" // @Param id path int true "List ID"
// @Param list body background.Image true "The image you want to set as background" // @Param list body background.Image true "The image you want to set as background"
// @Success 200 {object} models.List "The background has been successfully set." // @Success 200 {object} models.List "The background has been successfully set."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid image object provided." // @Failure 400 {object} web.HTTPError "Invalid image object provided."
// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" // @Failure 403 {object} 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}/backgrounds/unsplash [post] // @Router /lists/{id}/backgrounds/unsplash [post]
func (p *Provider) Set(image *background.Image, list *models.List, auth web.Auth) (err error) { func (p *Provider) Set(image *background.Image, list *models.List, auth web.Auth) (err error) {

View file

@ -38,7 +38,7 @@ type LinkShareToken struct {
// @Produce json // @Produce json
// @Param share path string true "The share hash" // @Param share path string true "The share hash"
// @Success 200 {object} v1.Token "The valid jwt auth token." // @Success 200 {object} v1.Token "The valid jwt auth token."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid link share object provided." // @Failure 400 {object} web.HTTPError "Invalid link share object provided."
// @Failure 500 {object} models.Message "Internal error" // @Failure 500 {object} models.Message "Internal error"
// @Router /shares/{share}/auth [post] // @Router /shares/{share}/auth [post]
func AuthenticateLinkShare(c echo.Context) error { func AuthenticateLinkShare(c echo.Context) error {

View file

@ -36,7 +36,7 @@ type Token struct {
// @tags user // @tags user
// @Accept json // @Accept json
// @Produce json // @Produce json
// @Param credentials body user.UserLogin true "The login credentials" // @Param credentials body user.Login true "The login credentials"
// @Success 200 {object} v1.Token // @Success 200 {object} v1.Token
// @Failure 400 {object} models.Message "Invalid user password model." // @Failure 400 {object} models.Message "Invalid user password model."
// @Failure 412 {object} models.Message "Invalid totp passcode." // @Failure 412 {object} models.Message "Invalid totp passcode."

View file

@ -33,7 +33,7 @@ import (
// @Produce json // @Produce json
// @Param credentials body user.APIUserPassword true "The user credentials" // @Param credentials body user.APIUserPassword true "The user credentials"
// @Success 200 {object} user.User // @Success 200 {object} user.User
// @Failure 400 {object} code.vikunja.io/web.HTTPError "No or invalid user register object provided / User already exists." // @Failure 400 {object} 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

@ -30,9 +30,9 @@ import (
// @tags user // @tags user
// @Accept json // @Accept json
// @Produce json // @Produce json
// @Param credentials body models.EmailConfirm true "The token." // @Param credentials body user.EmailConfirm true "The token."
// @Success 200 {object} models.Message // @Success 200 {object} models.Message
// @Failure 412 {object} code.vikunja.io/web.HTTPError "Bad token provided." // @Failure 412 {object} 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

@ -34,7 +34,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 JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {array} user.User "All (found) users." // @Success 200 {array} user.User "All (found) users."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." // @Failure 400 {object} 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 {
@ -62,8 +62,8 @@ func UserList(c echo.Context) error {
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Param id path int true "List ID" // @Param id path int true "List ID"
// @Success 200 {array} user.User "All (found) users." // @Success 200 {array} user.User "All (found) users."
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." // @Failure 400 {object} web.HTTPError "Something's invalid."
// @Failure 401 {object} code.vikunja.io/web.HTTPError "The user does not have the right to see the list." // @Failure 401 {object} web.HTTPError "The user does not have the right to see the list."
// @Failure 500 {object} models.Message "Internal server error." // @Failure 500 {object} models.Message "Internal server error."
// @Router /lists/{id}/listusers [get] // @Router /lists/{id}/listusers [get]
func ListUsersForList(c echo.Context) error { func ListUsersForList(c echo.Context) error {

View file

@ -30,9 +30,9 @@ import (
// @tags user // @tags user
// @Accept json // @Accept json
// @Produce json // @Produce json
// @Param credentials body models.PasswordReset true "The token with the new password." // @Param credentials body user.PasswordReset true "The token with the new password."
// @Success 200 {object} models.Message // @Success 200 {object} models.Message
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Bad token provided." // @Failure 400 {object} 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 {
@ -56,9 +56,9 @@ func UserResetPassword(c echo.Context) error {
// @tags user // @tags user
// @Accept json // @Accept json
// @Produce json // @Produce json
// @Param credentials body models.PasswordTokenRequest true "The username of the user to request a token for." // @Param credentials body user.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} code.vikunja.io/web.HTTPError "The user does not exist." // @Failure 404 {object} 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 JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {object} user.User // @Success 200 {object} user.User
// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." // @Failure 404 {object} 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

@ -36,8 +36,8 @@ import (
// @Produce json // @Produce json
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {object} user.TOTP // @Success 200 {object} user.TOTP
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." // @Failure 400 {object} web.HTTPError "Something's invalid."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." // @Failure 404 {object} web.HTTPError "User does not exist."
// @Failure 500 {object} models.Message "Internal server error." // @Failure 500 {object} models.Message "Internal server error."
// @Router /user/settings/totp/enroll [post] // @Router /user/settings/totp/enroll [post]
func UserTOTPEnroll(c echo.Context) error { func UserTOTPEnroll(c echo.Context) error {
@ -63,9 +63,9 @@ func UserTOTPEnroll(c echo.Context) error {
// @Param totp body user.TOTPPasscode true "The totp passcode." // @Param totp body user.TOTPPasscode true "The totp passcode."
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {object} models.Message "Successfully enabled" // @Success 200 {object} models.Message "Successfully enabled"
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." // @Failure 400 {object} web.HTTPError "Something's invalid."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." // @Failure 404 {object} web.HTTPError "User does not exist."
// @Failure 412 {object} code.vikunja.io/web.HTTPError "TOTP is not enrolled." // @Failure 412 {object} web.HTTPError "TOTP is not enrolled."
// @Failure 500 {object} models.Message "Internal server error." // @Failure 500 {object} models.Message "Internal server error."
// @Router /user/settings/totp/enable [post] // @Router /user/settings/totp/enable [post]
func UserTOTPEnable(c echo.Context) error { func UserTOTPEnable(c echo.Context) error {
@ -102,8 +102,8 @@ func UserTOTPEnable(c echo.Context) error {
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Param totp body user.Login true "The current user's password (only password is enough)." // @Param totp body user.Login true "The current user's password (only password is enough)."
// @Success 200 {object} models.Message "Successfully disabled" // @Success 200 {object} models.Message "Successfully disabled"
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." // @Failure 400 {object} web.HTTPError "Something's invalid."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." // @Failure 404 {object} web.HTTPError "User does not exist."
// @Failure 500 {object} models.Message "Internal server error." // @Failure 500 {object} models.Message "Internal server error."
// @Router /user/settings/totp/disable [post] // @Router /user/settings/totp/disable [post]
func UserTOTPDisable(c echo.Context) error { func UserTOTPDisable(c echo.Context) error {

View file

@ -35,8 +35,8 @@ import (
// @Param userEmailUpdate body user.EmailUpdate true "The new email address and current password." // @Param userEmailUpdate body user.EmailUpdate true "The new email address and current password."
// @Security JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {object} models.Message // @Success 200 {object} models.Message
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." // @Failure 400 {object} web.HTTPError "Something's invalid."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." // @Failure 404 {object} web.HTTPError "User does not exist."
// @Failure 500 {object} models.Message "Internal server error." // @Failure 500 {object} models.Message "Internal server error."
// @Router /user/settings/email [post] // @Router /user/settings/email [post]
func UpdateUserEmail(c echo.Context) (err error) { func UpdateUserEmail(c echo.Context) (err error) {

View file

@ -39,8 +39,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 JWTKeyAuth // @Security JWTKeyAuth
// @Success 200 {object} models.Message // @Success 200 {object} models.Message
// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." // @Failure 400 {object} web.HTTPError "Something's invalid."
// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." // @Failure 404 {object} 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 {

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff