From a48d6ba4b4be4207a2c78c36b095fb69938e5ae5 Mon Sep 17 00:00:00 2001 From: John Olheiser Date: Tue, 30 Aug 2022 21:15:45 -0500 Subject: Go 1.19 format (#20758) * 1.19 gofumpt Signed-off-by: jolheiser * Change CSV test Signed-off-by: jolheiser * Commit whitespace fixes from @zeripath Co-authored-by: zeripath * Update emoji Signed-off-by: jolheiser * bump swagger & fix generate-swagger Signed-off-by: jolheiser Co-authored-by: zeripath Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH --- routers/api/v1/activitypub/person.go | 1 - routers/api/v1/api.go | 98 +++++++++++++++---------------- routers/api/v1/repo/git_ref.go | 4 +- routers/api/v1/repo/issue_tracked_time.go | 5 +- routers/api/v1/repo/repo.go | 1 - routers/api/v1/user/email.go | 5 -- 6 files changed, 53 insertions(+), 61 deletions(-) (limited to 'routers') diff --git a/routers/api/v1/activitypub/person.go b/routers/api/v1/activitypub/person.go index 7290f1cbd9..542ae7e120 100644 --- a/routers/api/v1/activitypub/person.go +++ b/routers/api/v1/activitypub/person.go @@ -98,7 +98,6 @@ func PersonInbox(ctx *context.APIContext) { // type: string // required: true // responses: - // responses: // "204": // "$ref": "#/responses/empty" diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index b413370ad2..6a98121b73 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -7,59 +7,59 @@ // // This documentation describes the Gitea API. // -// Schemes: http, https -// BasePath: /api/v1 -// Version: {{AppVer | JSEscape | Safe}} -// License: MIT http://opensource.org/licenses/MIT +// Schemes: http, https +// BasePath: /api/v1 +// Version: {{AppVer | JSEscape | Safe}} +// License: MIT http://opensource.org/licenses/MIT // -// Consumes: -// - application/json -// - text/plain +// Consumes: +// - application/json +// - text/plain // -// Produces: -// - application/json -// - text/html +// Produces: +// - application/json +// - text/html // -// Security: -// - BasicAuth : -// - Token : -// - AccessToken : -// - AuthorizationHeaderToken : -// - SudoParam : -// - SudoHeader : -// - TOTPHeader : +// Security: +// - BasicAuth : +// - Token : +// - AccessToken : +// - AuthorizationHeaderToken : +// - SudoParam : +// - SudoHeader : +// - TOTPHeader : // -// SecurityDefinitions: -// BasicAuth: -// type: basic -// Token: -// type: apiKey -// name: token -// in: query -// AccessToken: -// type: apiKey -// name: access_token -// in: query -// AuthorizationHeaderToken: -// type: apiKey -// name: Authorization -// in: header -// description: API tokens must be prepended with "token" followed by a space. -// SudoParam: -// type: apiKey -// name: sudo -// in: query -// description: Sudo API request as the user provided as the key. Admin privileges are required. -// SudoHeader: -// type: apiKey -// name: Sudo -// in: header -// description: Sudo API request as the user provided as the key. Admin privileges are required. -// TOTPHeader: -// type: apiKey -// name: X-GITEA-OTP -// in: header -// description: Must be used in combination with BasicAuth if two-factor authentication is enabled. +// SecurityDefinitions: +// BasicAuth: +// type: basic +// Token: +// type: apiKey +// name: token +// in: query +// AccessToken: +// type: apiKey +// name: access_token +// in: query +// AuthorizationHeaderToken: +// type: apiKey +// name: Authorization +// in: header +// description: API tokens must be prepended with "token" followed by a space. +// SudoParam: +// type: apiKey +// name: sudo +// in: query +// description: Sudo API request as the user provided as the key. Admin privileges are required. +// SudoHeader: +// type: apiKey +// name: Sudo +// in: header +// description: Sudo API request as the user provided as the key. Admin privileges are required. +// TOTPHeader: +// type: apiKey +// name: X-GITEA-OTP +// in: header +// description: Must be used in combination with BasicAuth if two-factor authentication is enabled. // // swagger:meta package v1 diff --git a/routers/api/v1/repo/git_ref.go b/routers/api/v1/repo/git_ref.go index 29b126db9a..47f46df339 100644 --- a/routers/api/v1/repo/git_ref.go +++ b/routers/api/v1/repo/git_ref.go @@ -34,7 +34,7 @@ func GetGitAllRefs(ctx *context.APIContext) { // required: true // responses: // "200": - // "$ref": "#/responses/Reference" + // # "$ref": "#/responses/Reference" TODO: swagger doesnt support different output formats by ref // "$ref": "#/responses/ReferenceList" // "404": // "$ref": "#/responses/notFound" @@ -67,7 +67,7 @@ func GetGitRefs(ctx *context.APIContext) { // required: true // responses: // "200": - // "$ref": "#/responses/Reference" + // # "$ref": "#/responses/Reference" TODO: swagger doesnt support different output formats by ref // "$ref": "#/responses/ReferenceList" // "404": // "$ref": "#/responses/notFound" diff --git a/routers/api/v1/repo/issue_tracked_time.go b/routers/api/v1/repo/issue_tracked_time.go index b9a6c5af64..1e26403ec8 100644 --- a/routers/api/v1/repo/issue_tracked_time.go +++ b/routers/api/v1/repo/issue_tracked_time.go @@ -566,6 +566,8 @@ func ListMyTrackedTimes(ctx *context.APIContext) { // swagger:operation GET /user/times user userCurrentTrackedTimes // --- // summary: List the current user's tracked times + // produces: + // - application/json // parameters: // - name: page // in: query @@ -575,9 +577,6 @@ func ListMyTrackedTimes(ctx *context.APIContext) { // in: query // description: page size of results // type: integer - // produces: - // - application/json - // parameters: // - name: since // in: query // description: Only show times updated after the given time. This is a timestamp in RFC 3339 format diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index d28b56cab6..6f40bb3e42 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -584,7 +584,6 @@ func Edit(ctx *context.APIContext) { // description: name of the repo to edit // type: string // required: true - // required: true // - name: body // in: body // description: "Properties of a repo that you can edit" diff --git a/routers/api/v1/user/email.go b/routers/api/v1/user/email.go index 170ffb7736..31c13172fc 100644 --- a/routers/api/v1/user/email.go +++ b/routers/api/v1/user/email.go @@ -48,11 +48,6 @@ func AddEmail(ctx *context.APIContext) { // produces: // - application/json // parameters: - // - name: options - // in: body - // schema: - // "$ref": "#/definitions/CreateEmailOption" - // parameters: // - name: body // in: body // schema: -- cgit v1.2.3