From 81c3d0ce34ec988fa2a5197a29ffc7cc32b566ec Mon Sep 17 00:00:00 2001 From: dineshsalunke Date: Wed, 17 Jan 2024 20:16:37 +0530 Subject: [PATCH] fix: add missing swagger tags --- modules/structs/project.go | 2 ++ routers/api/v1/swagger/options.go | 6 ++++ templates/swagger/v1_json.tmpl | 51 ++++++++++++++++++++++++++++++- 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/modules/structs/project.go b/modules/structs/project.go index e70659e5cee..4f1683e96c1 100644 --- a/modules/structs/project.go +++ b/modules/structs/project.go @@ -5,6 +5,7 @@ package structs import "time" +// swagger:model type NewProjectPayload struct { // required:true Title string `json:"title" binding:"Required"` @@ -15,6 +16,7 @@ type NewProjectPayload struct { Description string `json:"description"` } +// swagger:model type UpdateProjectPayload struct { // required:true Title string `json:"title" binding:"Required"` diff --git a/routers/api/v1/swagger/options.go b/routers/api/v1/swagger/options.go index 6f7859df62e..4937d5e99a3 100644 --- a/routers/api/v1/swagger/options.go +++ b/routers/api/v1/swagger/options.go @@ -190,4 +190,10 @@ type swaggerParameterBodies struct { // in:body CreateOrUpdateSecretOption api.CreateOrUpdateSecretOption + + // in:body + NewProjectPayload api.NewProjectPayload + + // in:body + UpdateProjectPayload api.UpdateProjectPayload } diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 2c5e0108a95..044a1703a31 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -21119,6 +21119,35 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "NewProjectPayload": { + "type": "object", + "required": [ + "title", + "board_type", + "card_type" + ], + "properties": { + "board_type": { + "type": "integer", + "format": "uint8", + "x-go-name": "BoardType" + }, + "card_type": { + "type": "integer", + "format": "uint8", + "x-go-name": "CardType" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "title": { + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "NodeInfo": { "description": "NodeInfo contains standardized way of exposing metadata about a server running one of the distributed social networks", "type": "object", @@ -21719,6 +21748,9 @@ "type": "boolean", "x-go-name": "IsClosed" }, + "owner": { + "$ref": "#/definitions/User" + }, "repository": { "$ref": "#/definitions/RepositoryMeta" }, @@ -23111,6 +23143,23 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "UpdateProjectPayload": { + "type": "object", + "required": [ + "title" + ], + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "title": { + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "UpdateRepoAvatarOption": { "description": "UpdateRepoAvatarUserOption options when updating the repo avatar", "type": "object", @@ -24462,7 +24511,7 @@ "parameterBodies": { "description": "parameterBodies", "schema": { - "$ref": "#/definitions/CreateOrUpdateSecretOption" + "$ref": "#/definitions/UpdateProjectPayload" } }, "redirect": {