From 28587013468992e590bbdbb9ff81b76fd6f17450 Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 13:01:49 -0700 Subject: [PATCH 01/12] Add 'not' param to CommitsByRange --- modules/git/commit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/git/commit.go b/modules/git/commit.go index 610d27c68ac05..f28c315cb5724 100644 --- a/modules/git/commit.go +++ b/modules/git/commit.go @@ -187,8 +187,8 @@ func (c *Commit) CommitsCount() (int64, error) { } // CommitsByRange returns the specific page commits before current revision, every page's number default by CommitsRangeSize -func (c *Commit) CommitsByRange(page, pageSize int) ([]*Commit, error) { - return c.repo.commitsByRange(c.ID, page, pageSize) +func (c *Commit) CommitsByRange(page, pageSize int, not string) ([]*Commit, error) { + return c.repo.commitsByRange(c.ID, page, pageSize, not) } // CommitsBefore returns all the commits before current revision From a8bfddcb06edf37b29fcf92caaf4c60302410efc Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 13:03:17 -0700 Subject: [PATCH 02/12] Pass not to commitsByRange --- modules/git/repo_commit.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go index 153a116b06183..9084862822f55 100644 --- a/modules/git/repo_commit.go +++ b/modules/git/repo_commit.go @@ -90,14 +90,22 @@ func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) { return commits[0], nil } -func (repo *Repository) commitsByRange(id SHA1, page, pageSize int) ([]*Commit, error) { - stdout, _, err := NewCommand(repo.Ctx, "log"). - AddOptionFormat("--skip=%d", (page-1)*pageSize).AddOptionFormat("--max-count=%d", pageSize).AddArguments(prettyLogFormat). - AddDynamicArguments(id.String()). - RunStdBytes(&RunOpts{Dir: repo.Path}) +func (repo *Repository) commitsByRange(id SHA1, page, pageSize int, not string) ([]*Commit, error) { + cmd := NewCommand(repo.Ctx, "log") + if not != "" { + cmd.AddOptionFormat("--not=%s", not) + } + + cmd.AddOptionFormat("--skip=%d", (page-1)*pageSize). + AddOptionFormat("--max-count=%d", pageSize). + AddArguments(prettyLogFormat). + AddDynamicArguments(id.String()) + + stdout, _, err := cmd.RunStdBytes(&RunOpts{Dir: repo.Path}) if err != nil { return nil, err } + return repo.parsePrettyFormatLogToList(stdout) } From c3fec60fab99e6bf85b6bc678a3f23ef7ce4f15e Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 13:04:55 -0700 Subject: [PATCH 03/12] Don't use = --- modules/git/repo_commit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go index 9084862822f55..34bbd719a0240 100644 --- a/modules/git/repo_commit.go +++ b/modules/git/repo_commit.go @@ -93,7 +93,7 @@ func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) { func (repo *Repository) commitsByRange(id SHA1, page, pageSize int, not string) ([]*Commit, error) { cmd := NewCommand(repo.Ctx, "log") if not != "" { - cmd.AddOptionFormat("--not=%s", not) + cmd.AddOptionFormat("--not %s", not) } cmd.AddOptionFormat("--skip=%d", (page-1)*pageSize). From 8723135db3ccc78fc1d53003ab51d606f43f62ab Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 13:07:58 -0700 Subject: [PATCH 04/12] Fix command order --- modules/git/repo_commit.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go index 34bbd719a0240..1f6d5b77401dc 100644 --- a/modules/git/repo_commit.go +++ b/modules/git/repo_commit.go @@ -91,16 +91,16 @@ func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) { } func (repo *Repository) commitsByRange(id SHA1, page, pageSize int, not string) ([]*Commit, error) { - cmd := NewCommand(repo.Ctx, "log") + cmd := NewCommand(repo.Ctx, "log"). + AddOptionFormat("--skip=%d", (page-1)*pageSize). + AddOptionFormat("--max-count=%d", pageSize). + AddArguments(prettyLogFormat). + AddDynamicArguments(id.String()) + if not != "" { cmd.AddOptionFormat("--not %s", not) } - cmd.AddOptionFormat("--skip=%d", (page-1)*pageSize). - AddOptionFormat("--max-count=%d", pageSize). - AddArguments(prettyLogFormat). - AddDynamicArguments(id.String()) - stdout, _, err := cmd.RunStdBytes(&RunOpts{Dir: repo.Path}) if err != nil { return nil, err From 1ca800e7f999fea76c6fd5eade36dce0d6da1ff3 Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 13:14:55 -0700 Subject: [PATCH 05/12] Pass not to call --- routers/api/v1/repo/commits.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/routers/api/v1/repo/commits.go b/routers/api/v1/repo/commits.go index 22b013e7dc3b8..401403c83dee3 100644 --- a/routers/api/v1/repo/commits.go +++ b/routers/api/v1/repo/commits.go @@ -115,6 +115,10 @@ func GetAllCommits(ctx *context.APIContext) { // in: query // description: page size of results (ignored if used with 'path') // type: integer + // - name: not + // in: query + // description: commits that match the given specifier will not be listed. + // type: string // responses: // "200": // "$ref": "#/responses/CommitList" @@ -181,7 +185,8 @@ func GetAllCommits(ctx *context.APIContext) { } // Query commits - commits, err = baseCommit.CommitsByRange(listOptions.Page, listOptions.PageSize) + not := ctx.FormString("not") + commits, err = baseCommit.CommitsByRange(listOptions.Page, listOptions.PageSize, not) if err != nil { ctx.Error(http.StatusInternalServerError, "CommitsByRange", err) return From a12044982626ab3738ec73d0abe2afb587a77d69 Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 13:15:31 -0700 Subject: [PATCH 06/12] Pass empty string --- routers/web/repo/commit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/repo/commit.go b/routers/web/repo/commit.go index 7439c2411b908..93294f8dddb83 100644 --- a/routers/web/repo/commit.go +++ b/routers/web/repo/commit.go @@ -70,7 +70,7 @@ func Commits(ctx *context.Context) { } // Both `git log branchName` and `git log commitId` work. - commits, err := ctx.Repo.Commit.CommitsByRange(page, pageSize) + commits, err := ctx.Repo.Commit.CommitsByRange(page, pageSize, "") if err != nil { ctx.ServerError("CommitsByRange", err) return From 919478aedb24ccc9c457d0e8c131b20e57f66e2f Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 13:27:39 -0700 Subject: [PATCH 07/12] Pass param to CommitsByRange --- routers/web/feed/branch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/feed/branch.go b/routers/web/feed/branch.go index 22b6e2f14b0ea..f13038ff9b42e 100644 --- a/routers/web/feed/branch.go +++ b/routers/web/feed/branch.go @@ -16,7 +16,7 @@ import ( // ShowBranchFeed shows tags and/or releases on the repo as RSS / Atom feed func ShowBranchFeed(ctx *context.Context, repo *repo.Repository, formatType string) { - commits, err := ctx.Repo.Commit.CommitsByRange(0, 10) + commits, err := ctx.Repo.Commit.CommitsByRange(0, 10, "") if err != nil { ctx.ServerError("ShowBranchFeed", err) return From 1722273207d477a27232542189de46ab04c29b73 Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 13:45:33 -0700 Subject: [PATCH 08/12] Use addOptionValue --- modules/git/repo_commit.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go index 1f6d5b77401dc..30a82eb2970e5 100644 --- a/modules/git/repo_commit.go +++ b/modules/git/repo_commit.go @@ -92,13 +92,13 @@ func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) { func (repo *Repository) commitsByRange(id SHA1, page, pageSize int, not string) ([]*Commit, error) { cmd := NewCommand(repo.Ctx, "log"). - AddOptionFormat("--skip=%d", (page-1)*pageSize). - AddOptionFormat("--max-count=%d", pageSize). - AddArguments(prettyLogFormat). - AddDynamicArguments(id.String()) + AddOptionFormat("--skip=%d", (page-1)*pageSize). + AddOptionFormat("--max-count=%d", pageSize). + AddArguments(prettyLogFormat). + AddDynamicArguments(id.String()) if not != "" { - cmd.AddOptionFormat("--not %s", not) + cmd.AddOptionValues("--not", not) } stdout, _, err := cmd.RunStdBytes(&RunOpts{Dir: repo.Path}) From 3da34adcbccc22353de28f322c961ca4c1bcc90c Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 14:20:49 -0700 Subject: [PATCH 09/12] Add 'not' param to swagger --- templates/swagger/v1_json.tmpl | 237 ++++++--------------------------- 1 file changed, 40 insertions(+), 197 deletions(-) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 2db950b57a706..7cda967b686aa 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -297,31 +297,6 @@ } } }, - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Delete a hook", - "operationId": "adminDeleteHook", - "parameters": [ - { - "type": "integer", - "format": "int64", - "description": "id of the hook to delete", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "$ref": "#/responses/empty" - } - } - }, "patch": { "consumes": [ "application/json" @@ -883,94 +858,29 @@ } } }, - "/gitignore/templates": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "miscellaneous" - ], - "summary": "Returns a list of all gitignore templates", - "operationId": "listGitignoresTemplates", - "responses": { - "200": { - "$ref": "#/responses/GitignoreTemplateList" - } - } - } - }, - "/gitignore/templates/{name}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "miscellaneous" - ], - "summary": "Returns information about a gitignore template", - "operationId": "getGitignoreTemplateInfo", - "parameters": [ - { - "type": "string", - "description": "name of the template", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/GitignoreTemplateInfo" - }, - "404": { - "$ref": "#/responses/notFound" - } - } - } - }, - "/licenses": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "miscellaneous" - ], - "summary": "Returns a list of all license templates", - "operationId": "listLicenseTemplates", - "responses": { - "200": { - "$ref": "#/responses/LicenseTemplateList" - } - } - } - }, - "/licenses/{name}": { - "get": { + "/amdin/hooks/{id}": { + "delete": { "produces": [ "application/json" ], "tags": [ - "miscellaneous" + "admin" ], - "summary": "Returns information about a license template", - "operationId": "getLicenseTemplateInfo", + "summary": "Delete a hook", + "operationId": "adminDeleteHook", "parameters": [ { - "type": "string", - "description": "name of the license", - "name": "name", + "type": "integer", + "format": "int64", + "description": "id of the hook to delete", + "name": "id", "in": "path", "required": true } ], "responses": { - "200": { - "$ref": "#/responses/LicenseTemplateInfo" - }, - "404": { - "$ref": "#/responses/notFound" + "204": { + "$ref": "#/responses/empty" } } } @@ -15594,6 +15504,10 @@ "type": "string", "x-go-name": "Filename" }, + "has_conflict": { + "type": "boolean", + "x-go-name": "HasConflict" + }, "html_url": { "type": "string", "x-go-name": "HTMLURL" @@ -15750,6 +15664,10 @@ "stats": { "$ref": "#/definitions/CommitStats" }, + "string": { + "type": "string", + "x-go-name": "Branch" + }, "url": { "type": "string", "x-go-name": "URL" @@ -18388,21 +18306,6 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, - "GitignoreTemplateInfo": { - "description": "GitignoreTemplateInfo name and text of a gitignore template", - "type": "object", - "properties": { - "name": { - "type": "string", - "x-go-name": "Name" - }, - "source": { - "type": "string", - "x-go-name": "Source" - } - }, - "x-go-package": "code.gitea.io/gitea/modules/structs" - }, "Hook": { "description": "Hook a hook is a web hook when one repository changed", "type": "object", @@ -18811,52 +18714,6 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, - "LicenseTemplateInfo": { - "description": "LicensesInfo contains information about a License", - "type": "object", - "properties": { - "body": { - "type": "string", - "x-go-name": "Body" - }, - "implementation": { - "type": "string", - "x-go-name": "Implementation" - }, - "key": { - "type": "string", - "x-go-name": "Key" - }, - "name": { - "type": "string", - "x-go-name": "Name" - }, - "url": { - "type": "string", - "x-go-name": "URL" - } - }, - "x-go-package": "code.gitea.io/gitea/modules/structs" - }, - "LicensesTemplateListEntry": { - "description": "LicensesListEntry is used for the API", - "type": "object", - "properties": { - "key": { - "type": "string", - "x-go-name": "Key" - }, - "name": { - "type": "string", - "x-go-name": "Name" - }, - "url": { - "type": "string", - "x-go-name": "URL" - } - }, - "x-go-package": "code.gitea.io/gitea/modules/structs" - }, "MarkdownOption": { "description": "MarkdownOption markdown options", "type": "object", @@ -18945,6 +18802,13 @@ "type": "string", "x-go-name": "HeadCommitID" }, + "merge_strategy": { + "type": "array", + "items": { + "$ref": "#/definitions/MergeStrategy" + }, + "x-go-name": "Strategy" + }, "merge_when_checks_succeed": { "type": "boolean", "x-go-name": "MergeWhenChecksSucceed" @@ -18953,6 +18817,20 @@ "x-go-name": "MergePullRequestForm", "x-go-package": "code.gitea.io/gitea/services/forms" }, + "MergeStrategy": { + "type": "object", + "properties": { + "path": { + "type": "string", + "x-go-name": "Path" + }, + "strategy": { + "type": "string", + "x-go-name": "Strategy" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "MigrateRepoOptions": { "description": "MigrateRepoOptions options for migrating repository's\nthis is used to interact with api v1", "type": "object", @@ -20282,11 +20160,6 @@ "type": "boolean", "x-go-name": "Archived" }, - "archived_at": { - "type": "string", - "format": "date-time", - "x-go-name": "ArchivedAt" - }, "avatar_url": { "type": "string", "x-go-name": "AvatarURL" @@ -21675,21 +21548,6 @@ "$ref": "#/definitions/GitTreeResponse" } }, - "GitignoreTemplateInfo": { - "description": "GitignoreTemplateInfo", - "schema": { - "$ref": "#/definitions/GitignoreTemplateInfo" - } - }, - "GitignoreTemplateList": { - "description": "GitignoreTemplateList", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, "Hook": { "description": "Hook", "schema": { @@ -21760,21 +21618,6 @@ } } }, - "LicenseTemplateInfo": { - "description": "LicenseTemplateInfo", - "schema": { - "$ref": "#/definitions/LicenseTemplateInfo" - } - }, - "LicenseTemplateList": { - "description": "LicenseTemplateList", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/LicensesTemplateListEntry" - } - } - }, "MarkdownRender": { "description": "MarkdownRender is a rendered markdown document", "schema": { From c24cd3afa40eb244aae25c5830dbf44fff2ecd19 Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 14:43:32 -0700 Subject: [PATCH 10/12] Update v1_json.tmpl --- templates/swagger/v1_json.tmpl | 243 +++++++++++++++++++++++++++------ 1 file changed, 203 insertions(+), 40 deletions(-) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 7cda967b686aa..5fa8c9ebce8f4 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -297,6 +297,31 @@ } } }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Delete a hook", + "operationId": "adminDeleteHook", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "id of the hook to delete", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + }, "patch": { "consumes": [ "application/json" @@ -858,29 +883,94 @@ } } }, - "/amdin/hooks/{id}": { - "delete": { + "/gitignore/templates": { + "get": { "produces": [ "application/json" ], "tags": [ - "admin" + "miscellaneous" ], - "summary": "Delete a hook", - "operationId": "adminDeleteHook", + "summary": "Returns a list of all gitignore templates", + "operationId": "listGitignoresTemplates", + "responses": { + "200": { + "$ref": "#/responses/GitignoreTemplateList" + } + } + } + }, + "/gitignore/templates/{name}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "miscellaneous" + ], + "summary": "Returns information about a gitignore template", + "operationId": "getGitignoreTemplateInfo", "parameters": [ { - "type": "integer", - "format": "int64", - "description": "id of the hook to delete", - "name": "id", + "type": "string", + "description": "name of the template", + "name": "name", "in": "path", "required": true } ], "responses": { - "204": { - "$ref": "#/responses/empty" + "200": { + "$ref": "#/responses/GitignoreTemplateInfo" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/licenses": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "miscellaneous" + ], + "summary": "Returns a list of all license templates", + "operationId": "listLicenseTemplates", + "responses": { + "200": { + "$ref": "#/responses/LicenseTemplateList" + } + } + } + }, + "/licenses/{name}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "miscellaneous" + ], + "summary": "Returns information about a license template", + "operationId": "getLicenseTemplateInfo", + "parameters": [ + { + "type": "string", + "description": "name of the license", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/LicenseTemplateInfo" + }, + "404": { + "$ref": "#/responses/notFound" } } } @@ -3771,6 +3861,12 @@ "description": "page size of results", "name": "limit", "in": "query" + }, + { + "type": "string", + "description": "commits that match the given specifier will not be listed.", + "name": "not", + "in": "query" } ], "responses": { @@ -15504,10 +15600,6 @@ "type": "string", "x-go-name": "Filename" }, - "has_conflict": { - "type": "boolean", - "x-go-name": "HasConflict" - }, "html_url": { "type": "string", "x-go-name": "HTMLURL" @@ -15664,10 +15756,6 @@ "stats": { "$ref": "#/definitions/CommitStats" }, - "string": { - "type": "string", - "x-go-name": "Branch" - }, "url": { "type": "string", "x-go-name": "URL" @@ -18306,6 +18394,21 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "GitignoreTemplateInfo": { + "description": "GitignoreTemplateInfo name and text of a gitignore template", + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "source": { + "type": "string", + "x-go-name": "Source" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "Hook": { "description": "Hook a hook is a web hook when one repository changed", "type": "object", @@ -18714,6 +18817,52 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "LicenseTemplateInfo": { + "description": "LicensesInfo contains information about a License", + "type": "object", + "properties": { + "body": { + "type": "string", + "x-go-name": "Body" + }, + "implementation": { + "type": "string", + "x-go-name": "Implementation" + }, + "key": { + "type": "string", + "x-go-name": "Key" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "LicensesTemplateListEntry": { + "description": "LicensesListEntry is used for the API", + "type": "object", + "properties": { + "key": { + "type": "string", + "x-go-name": "Key" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "MarkdownOption": { "description": "MarkdownOption markdown options", "type": "object", @@ -18802,13 +18951,6 @@ "type": "string", "x-go-name": "HeadCommitID" }, - "merge_strategy": { - "type": "array", - "items": { - "$ref": "#/definitions/MergeStrategy" - }, - "x-go-name": "Strategy" - }, "merge_when_checks_succeed": { "type": "boolean", "x-go-name": "MergeWhenChecksSucceed" @@ -18817,20 +18959,6 @@ "x-go-name": "MergePullRequestForm", "x-go-package": "code.gitea.io/gitea/services/forms" }, - "MergeStrategy": { - "type": "object", - "properties": { - "path": { - "type": "string", - "x-go-name": "Path" - }, - "strategy": { - "type": "string", - "x-go-name": "Strategy" - } - }, - "x-go-package": "code.gitea.io/gitea/modules/structs" - }, "MigrateRepoOptions": { "description": "MigrateRepoOptions options for migrating repository's\nthis is used to interact with api v1", "type": "object", @@ -20160,6 +20288,11 @@ "type": "boolean", "x-go-name": "Archived" }, + "archived_at": { + "type": "string", + "format": "date-time", + "x-go-name": "ArchivedAt" + }, "avatar_url": { "type": "string", "x-go-name": "AvatarURL" @@ -21548,6 +21681,21 @@ "$ref": "#/definitions/GitTreeResponse" } }, + "GitignoreTemplateInfo": { + "description": "GitignoreTemplateInfo", + "schema": { + "$ref": "#/definitions/GitignoreTemplateInfo" + } + }, + "GitignoreTemplateList": { + "description": "GitignoreTemplateList", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, "Hook": { "description": "Hook", "schema": { @@ -21618,6 +21766,21 @@ } } }, + "LicenseTemplateInfo": { + "description": "LicenseTemplateInfo", + "schema": { + "$ref": "#/definitions/LicenseTemplateInfo" + } + }, + "LicenseTemplateList": { + "description": "LicenseTemplateList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/LicensesTemplateListEntry" + } + } + }, "MarkdownRender": { "description": "MarkdownRender is a rendered markdown document", "schema": { From 92419dfe35093062dbaeb8f42bc6dff60f5c5797 Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 14:59:12 -0700 Subject: [PATCH 11/12] Update v1_json.tmpl --- templates/swagger/v1_json.tmpl | 42 +++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 5fa8c9ebce8f4..04c5b36f7ae89 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -2415,6 +2415,7 @@ "conan", "conda", "container", + "debian", "generic", "helm", "maven", @@ -3803,6 +3804,12 @@ "description": "page size of results (ignored if used with 'path')", "name": "limit", "in": "query" + }, + { + "type": "string", + "description": "commits that match the given specifier will not be listed.", + "name": "not", + "in": "query" } ], "responses": { @@ -3861,12 +3868,6 @@ "description": "page size of results", "name": "limit", "in": "query" - }, - { - "type": "string", - "description": "commits that match the given specifier will not be listed.", - "name": "not", - "in": "query" } ], "responses": { @@ -15600,6 +15601,10 @@ "type": "string", "x-go-name": "Filename" }, + "has_conflict": { + "type": "boolean", + "x-go-name": "HasConflict" + }, "html_url": { "type": "string", "x-go-name": "HTMLURL" @@ -15756,6 +15761,10 @@ "stats": { "$ref": "#/definitions/CommitStats" }, + "string": { + "type": "string", + "x-go-name": "Branch" + }, "url": { "type": "string", "x-go-name": "URL" @@ -18951,6 +18960,13 @@ "type": "string", "x-go-name": "HeadCommitID" }, + "merge_strategy": { + "type": "array", + "items": { + "$ref": "#/definitions/MergeStrategy" + }, + "x-go-name": "Strategy" + }, "merge_when_checks_succeed": { "type": "boolean", "x-go-name": "MergeWhenChecksSucceed" @@ -18959,6 +18975,20 @@ "x-go-name": "MergePullRequestForm", "x-go-package": "code.gitea.io/gitea/services/forms" }, + "MergeStrategy": { + "type": "object", + "properties": { + "path": { + "type": "string", + "x-go-name": "Path" + }, + "strategy": { + "type": "string", + "x-go-name": "Strategy" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "MigrateRepoOptions": { "description": "MigrateRepoOptions options for migrating repository's\nthis is used to interact with api v1", "type": "object", From 759fad9bd556d4a61df42ba9c868bfa4da56d773 Mon Sep 17 00:00:00 2001 From: Matthew Walowski Date: Fri, 28 Apr 2023 15:05:13 -0700 Subject: [PATCH 12/12] Update v1_json.tmpl --- templates/swagger/v1_json.tmpl | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 04c5b36f7ae89..34a4101ed33fe 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -15601,10 +15601,6 @@ "type": "string", "x-go-name": "Filename" }, - "has_conflict": { - "type": "boolean", - "x-go-name": "HasConflict" - }, "html_url": { "type": "string", "x-go-name": "HTMLURL" @@ -15761,10 +15757,6 @@ "stats": { "$ref": "#/definitions/CommitStats" }, - "string": { - "type": "string", - "x-go-name": "Branch" - }, "url": { "type": "string", "x-go-name": "URL" @@ -18960,13 +18952,6 @@ "type": "string", "x-go-name": "HeadCommitID" }, - "merge_strategy": { - "type": "array", - "items": { - "$ref": "#/definitions/MergeStrategy" - }, - "x-go-name": "Strategy" - }, "merge_when_checks_succeed": { "type": "boolean", "x-go-name": "MergeWhenChecksSucceed" @@ -18975,20 +18960,6 @@ "x-go-name": "MergePullRequestForm", "x-go-package": "code.gitea.io/gitea/services/forms" }, - "MergeStrategy": { - "type": "object", - "properties": { - "path": { - "type": "string", - "x-go-name": "Path" - }, - "strategy": { - "type": "string", - "x-go-name": "Strategy" - } - }, - "x-go-package": "code.gitea.io/gitea/modules/structs" - }, "MigrateRepoOptions": { "description": "MigrateRepoOptions options for migrating repository's\nthis is used to interact with api v1", "type": "object",