From b52eac0d3a4143223ec50bbabf230699091f25bc Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 26 Sep 2021 14:34:28 +0200 Subject: [PATCH] fix: generate swagger docs --- pkg/swagger/docs.go | 143 +++++++++++++++++++++++++++------------ pkg/swagger/swagger.json | 129 ++++++++++++++++++++++++----------- pkg/swagger/swagger.yaml | 61 +++++++++++++++-- 3 files changed, 249 insertions(+), 84 deletions(-) diff --git a/pkg/swagger/docs.go b/pkg/swagger/docs.go index fc3f9079c..1f706f2e9 100644 --- a/pkg/swagger/docs.go +++ b/pkg/swagger/docs.go @@ -1,14 +1,13 @@ -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// Package swagger GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag - package swagger import ( "bytes" "encoding/json" "strings" + "text/template" - "github.com/alecthomas/template" "github.com/swaggo/swag" ) @@ -16,7 +15,7 @@ var doc = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { - "description": "{{.Description}}", + "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": { "name": "General Vikunja contact", @@ -7405,8 +7404,7 @@ var doc = `{ "type": "string" }, "info": { - "description": "This can be used to supply extra information from an image provider to clients", - "type": "object" + "description": "This can be used to supply extra information from an image provider to clients" }, "thumb": { "type": "string" @@ -7556,7 +7554,9 @@ var doc = `{ "updated": { "description": "A timestamp when this bucket was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.BulkAssignees": { @@ -7568,7 +7568,9 @@ var doc = `{ "items": { "$ref": "#/definitions/user.User" } - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.BulkTask": { @@ -7710,7 +7712,9 @@ var doc = `{ "updated": { "description": "A timestamp when this task was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.DatabaseNotifications": { @@ -7729,8 +7733,7 @@ var doc = `{ "type": "string" }, "notification": { - "description": "The actual content of the notification.", - "type": "object" + "description": "The actual content of the notification." }, "read": { "description": "Whether or not to mark this notification as read or unread.\nTrue is read, false is unread.", @@ -7739,7 +7742,9 @@ var doc = `{ "read_at": { "description": "When this notification is marked as read, this will be updated with the current timestamp.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.Label": { @@ -7775,7 +7780,9 @@ var doc = `{ "updated": { "description": "A timestamp when this label was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.LabelTask": { @@ -7788,7 +7795,9 @@ var doc = `{ "label_id": { "description": "The label id you want to associate with a task.", "type": "integer" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.LabelTaskBulk": { @@ -7800,7 +7809,9 @@ var doc = `{ "items": { "$ref": "#/definitions/models.Label" } - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.LinkSharing": { @@ -7845,15 +7856,16 @@ var doc = `{ "updated": { "description": "A timestamp when this share was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.List": { "type": "object", "properties": { "background_information": { - "description": "Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /lists/{listID}/background", - "type": "object" + "description": "Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /lists/{listID}/background" }, "created": { "description": "A timestamp when this list was created. You cannot change this value.", @@ -7910,7 +7922,9 @@ var doc = `{ "updated": { "description": "A timestamp when this list was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.ListDuplicate": { @@ -7923,7 +7937,9 @@ var doc = `{ "namespace_id": { "description": "The target namespace ID", "type": "integer" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.ListUser": { @@ -7950,7 +7966,9 @@ var doc = `{ "user_id": { "description": "The username.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.Message": { @@ -8003,7 +8021,9 @@ var doc = `{ "updated": { "description": "A timestamp when this namespace was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.NamespaceUser": { @@ -8030,7 +8050,9 @@ var doc = `{ "user_id": { "description": "The username.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.NamespaceWithLists": { @@ -8080,7 +8102,9 @@ var doc = `{ "updated": { "description": "A timestamp when this namespace was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.RelatedTaskMap": { @@ -8128,7 +8152,9 @@ var doc = `{ "updated": { "description": "A timestamp when this filter was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.Subscription": { @@ -8152,7 +8178,9 @@ var doc = `{ "user": { "description": "The user who made this subscription", "$ref": "#/definitions/user.User" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.Task": { @@ -8287,7 +8315,9 @@ var doc = `{ "updated": { "description": "A timestamp when this task was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TaskAssginee": { @@ -8298,7 +8328,9 @@ var doc = `{ }, "user_id": { "type": "integer" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TaskAttachment": { @@ -8318,7 +8350,9 @@ var doc = `{ }, "task_id": { "type": "integer" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TaskCollection": { @@ -8366,7 +8400,9 @@ var doc = `{ "items": { "type": "string" } - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TaskComment": { @@ -8386,7 +8422,9 @@ var doc = `{ }, "updated": { "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TaskRelation": { @@ -8411,7 +8449,9 @@ var doc = `{ "task_id": { "description": "The ID of the \"base\" task, the task which has a relation to another.", "type": "integer" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.Team": { @@ -8449,7 +8489,9 @@ var doc = `{ "updated": { "description": "A timestamp when this relation was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TeamList": { @@ -8476,7 +8518,9 @@ var doc = `{ "updated": { "description": "A timestamp when this relation was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TeamMember": { @@ -8497,7 +8541,9 @@ var doc = `{ "username": { "description": "The username of the member. We use this to prevent automated user id entering.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TeamNamespace": { @@ -8524,7 +8570,9 @@ var doc = `{ "updated": { "description": "A timestamp when this relation was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TeamUser": { @@ -8560,7 +8608,8 @@ var doc = `{ "type": "string", "maxLength": 250, "minLength": 1 - } + }, + "web.Auth": {} } }, "models.TeamWithRight": { @@ -8601,7 +8650,9 @@ var doc = `{ "updated": { "description": "A timestamp when this relation was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.UserWithRight": { @@ -8636,7 +8687,8 @@ var doc = `{ "type": "string", "maxLength": 250, "minLength": 1 - } + }, + "web.Auth": {} } }, "notifications.DatabaseNotification": { @@ -8655,8 +8707,7 @@ var doc = `{ "type": "string" }, "notification": { - "description": "The actual content of the notification.", - "type": "object" + "description": "The actual content of the notification." }, "read_at": { "description": "When this notification is marked as read, this will be updated with the current timestamp.", @@ -8848,7 +8899,8 @@ var doc = `{ "type": "string", "maxLength": 250, "minLength": 1 - } + }, + "web.Auth": {} } }, "v1.LinkShareAuth": { @@ -9094,6 +9146,13 @@ func (s *s) ReadDoc() string { a, _ := json.Marshal(v) return string(a) }, + "escape": func(v interface{}) string { + // escape tabs + str := strings.Replace(v.(string), "\t", "\\t", -1) + // replace " with \", and if that results in \\", replace that with \\\" + str = strings.Replace(str, "\"", "\\\"", -1) + return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1) + }, }).Parse(doc) if err != nil { return doc diff --git a/pkg/swagger/swagger.json b/pkg/swagger/swagger.json index 7c456a910..24d2fa42c 100644 --- a/pkg/swagger/swagger.json +++ b/pkg/swagger/swagger.json @@ -7388,8 +7388,7 @@ "type": "string" }, "info": { - "description": "This can be used to supply extra information from an image provider to clients", - "type": "object" + "description": "This can be used to supply extra information from an image provider to clients" }, "thumb": { "type": "string" @@ -7539,7 +7538,9 @@ "updated": { "description": "A timestamp when this bucket was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.BulkAssignees": { @@ -7551,7 +7552,9 @@ "items": { "$ref": "#/definitions/user.User" } - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.BulkTask": { @@ -7693,7 +7696,9 @@ "updated": { "description": "A timestamp when this task was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.DatabaseNotifications": { @@ -7712,8 +7717,7 @@ "type": "string" }, "notification": { - "description": "The actual content of the notification.", - "type": "object" + "description": "The actual content of the notification." }, "read": { "description": "Whether or not to mark this notification as read or unread.\nTrue is read, false is unread.", @@ -7722,7 +7726,9 @@ "read_at": { "description": "When this notification is marked as read, this will be updated with the current timestamp.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.Label": { @@ -7758,7 +7764,9 @@ "updated": { "description": "A timestamp when this label was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.LabelTask": { @@ -7771,7 +7779,9 @@ "label_id": { "description": "The label id you want to associate with a task.", "type": "integer" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.LabelTaskBulk": { @@ -7783,7 +7793,9 @@ "items": { "$ref": "#/definitions/models.Label" } - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.LinkSharing": { @@ -7828,15 +7840,16 @@ "updated": { "description": "A timestamp when this share was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.List": { "type": "object", "properties": { "background_information": { - "description": "Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /lists/{listID}/background", - "type": "object" + "description": "Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /lists/{listID}/background" }, "created": { "description": "A timestamp when this list was created. You cannot change this value.", @@ -7893,7 +7906,9 @@ "updated": { "description": "A timestamp when this list was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.ListDuplicate": { @@ -7906,7 +7921,9 @@ "namespace_id": { "description": "The target namespace ID", "type": "integer" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.ListUser": { @@ -7933,7 +7950,9 @@ "user_id": { "description": "The username.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.Message": { @@ -7986,7 +8005,9 @@ "updated": { "description": "A timestamp when this namespace was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.NamespaceUser": { @@ -8013,7 +8034,9 @@ "user_id": { "description": "The username.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.NamespaceWithLists": { @@ -8063,7 +8086,9 @@ "updated": { "description": "A timestamp when this namespace was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.RelatedTaskMap": { @@ -8111,7 +8136,9 @@ "updated": { "description": "A timestamp when this filter was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.Subscription": { @@ -8135,7 +8162,9 @@ "user": { "description": "The user who made this subscription", "$ref": "#/definitions/user.User" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.Task": { @@ -8270,7 +8299,9 @@ "updated": { "description": "A timestamp when this task was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TaskAssginee": { @@ -8281,7 +8312,9 @@ }, "user_id": { "type": "integer" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TaskAttachment": { @@ -8301,7 +8334,9 @@ }, "task_id": { "type": "integer" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TaskCollection": { @@ -8349,7 +8384,9 @@ "items": { "type": "string" } - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TaskComment": { @@ -8369,7 +8406,9 @@ }, "updated": { "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TaskRelation": { @@ -8394,7 +8433,9 @@ "task_id": { "description": "The ID of the \"base\" task, the task which has a relation to another.", "type": "integer" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.Team": { @@ -8432,7 +8473,9 @@ "updated": { "description": "A timestamp when this relation was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TeamList": { @@ -8459,7 +8502,9 @@ "updated": { "description": "A timestamp when this relation was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TeamMember": { @@ -8480,7 +8525,9 @@ "username": { "description": "The username of the member. We use this to prevent automated user id entering.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TeamNamespace": { @@ -8507,7 +8554,9 @@ "updated": { "description": "A timestamp when this relation was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.TeamUser": { @@ -8543,7 +8592,8 @@ "type": "string", "maxLength": 250, "minLength": 1 - } + }, + "web.Auth": {} } }, "models.TeamWithRight": { @@ -8584,7 +8634,9 @@ "updated": { "description": "A timestamp when this relation was last updated. You cannot change this value.", "type": "string" - } + }, + "web.CRUDable": {}, + "web.Rights": {} } }, "models.UserWithRight": { @@ -8619,7 +8671,8 @@ "type": "string", "maxLength": 250, "minLength": 1 - } + }, + "web.Auth": {} } }, "notifications.DatabaseNotification": { @@ -8638,8 +8691,7 @@ "type": "string" }, "notification": { - "description": "The actual content of the notification.", - "type": "object" + "description": "The actual content of the notification." }, "read_at": { "description": "When this notification is marked as read, this will be updated with the current timestamp.", @@ -8831,7 +8883,8 @@ "type": "string", "maxLength": 250, "minLength": 1 - } + }, + "web.Auth": {} } }, "v1.LinkShareAuth": { diff --git a/pkg/swagger/swagger.yaml b/pkg/swagger/swagger.yaml index edc002702..827f67c73 100644 --- a/pkg/swagger/swagger.yaml +++ b/pkg/swagger/swagger.yaml @@ -12,7 +12,6 @@ definitions: info: description: This can be used to supply extra information from an image provider to clients - type: object thumb: type: string url: @@ -125,6 +124,8 @@ definitions: description: A timestamp when this bucket was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.BulkAssignees: properties: @@ -133,6 +134,8 @@ definitions: items: $ref: '#/definitions/user.User' type: array + web.CRUDable: {} + web.Rights: {} type: object models.BulkTask: properties: @@ -259,6 +262,8 @@ definitions: description: A timestamp when this task was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.DatabaseNotifications: properties: @@ -274,7 +279,6 @@ definitions: type: string notification: description: The actual content of the notification. - type: object read: description: |- Whether or not to mark this notification as read or unread. @@ -284,6 +288,8 @@ definitions: description: When this notification is marked as read, this will be updated with the current timestamp. type: string + web.CRUDable: {} + web.Rights: {} type: object models.Label: properties: @@ -314,6 +320,8 @@ definitions: description: A timestamp when this label was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.LabelTask: properties: @@ -324,6 +332,8 @@ definitions: label_id: description: The label id you want to associate with a task. type: integer + web.CRUDable: {} + web.Rights: {} type: object models.LabelTaskBulk: properties: @@ -332,6 +342,8 @@ definitions: items: $ref: '#/definitions/models.Label' type: array + web.CRUDable: {} + web.Rights: {} type: object models.LinkSharing: properties: @@ -372,6 +384,8 @@ definitions: description: A timestamp when this share was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.List: properties: @@ -379,7 +393,6 @@ definitions: description: Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /lists/{listID}/background - type: object created: description: A timestamp when this list was created. You cannot change this value. @@ -429,6 +442,8 @@ definitions: description: A timestamp when this list was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.ListDuplicate: properties: @@ -438,6 +453,8 @@ definitions: namespace_id: description: The target namespace ID type: integer + web.CRUDable: {} + web.Rights: {} type: object models.ListUser: properties: @@ -461,6 +478,8 @@ definitions: user_id: description: The username. type: string + web.CRUDable: {} + web.Rights: {} type: object models.Message: properties: @@ -504,6 +523,8 @@ definitions: description: A timestamp when this namespace was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.NamespaceUser: properties: @@ -527,6 +548,8 @@ definitions: user_id: description: The username. type: string + web.CRUDable: {} + web.Rights: {} type: object models.NamespaceWithLists: properties: @@ -568,6 +591,8 @@ definitions: description: A timestamp when this namespace was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.RelatedTaskMap: additionalProperties: @@ -606,6 +631,8 @@ definitions: description: A timestamp when this filter was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.Subscription: properties: @@ -624,6 +651,8 @@ definitions: user: $ref: '#/definitions/user.User' description: The user who made this subscription + web.CRUDable: {} + web.Rights: {} type: object models.Task: properties: @@ -745,6 +774,8 @@ definitions: description: A timestamp when this task was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.TaskAssginee: properties: @@ -752,6 +783,8 @@ definitions: type: string user_id: type: integer + web.CRUDable: {} + web.Rights: {} type: object models.TaskAttachment: properties: @@ -765,6 +798,8 @@ definitions: type: integer task_id: type: integer + web.CRUDable: {} + web.Rights: {} type: object models.TaskCollection: properties: @@ -802,6 +837,8 @@ definitions: items: type: string type: array + web.CRUDable: {} + web.Rights: {} type: object models.TaskComment: properties: @@ -815,6 +852,8 @@ definitions: type: integer updated: type: string + web.CRUDable: {} + web.Rights: {} type: object models.TaskRelation: properties: @@ -834,6 +873,8 @@ definitions: task_id: description: The ID of the "base" task, the task which has a relation to another. type: integer + web.CRUDable: {} + web.Rights: {} type: object models.Team: properties: @@ -864,6 +905,8 @@ definitions: description: A timestamp when this relation was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.TeamList: properties: @@ -887,6 +930,8 @@ definitions: description: A timestamp when this relation was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.TeamMember: properties: @@ -905,6 +950,8 @@ definitions: description: The username of the member. We use this to prevent automated user id entering. type: string + web.CRUDable: {} + web.Rights: {} type: object models.TeamNamespace: properties: @@ -928,6 +975,8 @@ definitions: description: A timestamp when this relation was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.TeamUser: properties: @@ -958,6 +1007,7 @@ definitions: maxLength: 250 minLength: 1 type: string + web.Auth: {} type: object models.TeamWithRight: properties: @@ -990,6 +1040,8 @@ definitions: description: A timestamp when this relation was last updated. You cannot change this value. type: string + web.CRUDable: {} + web.Rights: {} type: object models.UserWithRight: properties: @@ -1018,6 +1070,7 @@ definitions: maxLength: 250 minLength: 1 type: string + web.Auth: {} type: object notifications.DatabaseNotification: properties: @@ -1033,7 +1086,6 @@ definitions: type: string notification: description: The actual content of the notification. - type: object read_at: description: When this notification is marked as read, this will be updated with the current timestamp. @@ -1172,6 +1224,7 @@ definitions: maxLength: 250 minLength: 1 type: string + web.Auth: {} type: object v1.LinkShareAuth: properties: