diff --git a/build/openapi3gen/convert.go b/build/openapi3gen/convert.go index 922e0558dc2..d1ee1a3a68f 100644 --- a/build/openapi3gen/convert.go +++ b/build/openapi3gen/convert.go @@ -23,8 +23,8 @@ import ( var rxDeprecated = regexp.MustCompile(`(?i)(?:^|[\n.;])\s*deprecated\b`) // Convert parses a Swagger 2.0 spec and returns an OAS3 spec, applying -// Gitea-specific post-processing: server URL, file-schema fixups, URI -// formats, deprecated flags, and shared-enum extraction. +// Gitea-specific post-processing: file-schema fixups, URI formats, +// deprecated flags, and shared-enum extraction. // // astEnumMap is a value-set-key → Go-type-name(s) map (built by // ScanSwaggerEnumTypes). When a value set is shared by multiple Go types, @@ -42,7 +42,6 @@ func Convert(swaggerJSON []byte, astEnumMap map[string][]string) (*openapi3.T, e return nil, fmt.Errorf("converting to openapi 3.0: %w", err) } - oas3.Servers = openapi3.Servers{{URL: swagger2.BasePath}} fixFileSchemas(oas3) addURIFormats(oas3) addDeprecatedFlags(oas3) diff --git a/eslint.config.ts b/eslint.config.ts index 50c1bcecd7f..8f75af2d5d7 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -851,6 +851,7 @@ export default defineConfig([ 'unicorn/no-prevent-default-in-passive-listener': [2], 'unicorn/no-process-exit': [0], 'unicorn/no-redundant-comparison': [2], + 'unicorn/no-repeated-call-wrappers': [0], 'unicorn/no-return-array-push': [2], 'unicorn/no-selector-as-dom-name': [2], 'unicorn/no-shorthand-property-overrides': [0], // only applies to css language @@ -871,6 +872,7 @@ export default defineConfig([ 'unicorn/no-unnecessary-array-splice-count': [2], 'unicorn/no-unnecessary-await': [2], 'unicorn/no-unnecessary-boolean-comparison': [2], + 'unicorn/no-unnecessary-default-arguments': [0], 'unicorn/no-unnecessary-fetch-options': [0], 'unicorn/no-unnecessary-global-this': [0], 'unicorn/no-unnecessary-nested-ternary': [2], diff --git a/templates/swagger/v1-openapi3.generated.json b/templates/swagger/v1-openapi3.generated.json index aba2c1bec2f..a46207dc438 100644 --- a/templates/swagger/v1-openapi3.generated.json +++ b/templates/swagger/v1-openapi3.generated.json @@ -12791,6 +12791,7 @@ }, { "description": "Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \u0026 pinned.", + "explode": true, "in": "query", "name": "status-types", "schema": { @@ -12798,10 +12799,12 @@ "type": "string" }, "type": "array" - } + }, + "style": "form" }, { "description": "filter notifications by subject type", + "explode": true, "in": "query", "name": "subject-type", "schema": { @@ -12815,7 +12818,8 @@ "type": "string" }, "type": "array" - } + }, + "style": "form" }, { "description": "Only show notifications updated after the given time. This is a timestamp in RFC 3339 format", @@ -12884,6 +12888,7 @@ }, { "description": "Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.", + "explode": true, "in": "query", "name": "status-types", "schema": { @@ -12891,7 +12896,8 @@ "type": "string" }, "type": "array" - } + }, + "style": "form" }, { "description": "Status to mark notifications as, Defaults to read.", @@ -19559,6 +19565,7 @@ }, { "description": "subpath of the repository to download", + "explode": true, "in": "query", "name": "path", "schema": { @@ -19566,7 +19573,8 @@ "type": "string" }, "type": "array" - } + }, + "style": "form" } ], "responses": { @@ -27657,6 +27665,7 @@ }, { "description": "Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \u0026 pinned", + "explode": true, "in": "query", "name": "status-types", "schema": { @@ -27664,10 +27673,12 @@ "type": "string" }, "type": "array" - } + }, + "style": "form" }, { "description": "filter notifications by subject type", + "explode": true, "in": "query", "name": "subject-type", "schema": { @@ -27681,7 +27692,8 @@ "type": "string" }, "type": "array" - } + }, + "style": "form" }, { "description": "Only show notifications updated after the given time. This is a timestamp in RFC 3339 format", @@ -27759,6 +27771,7 @@ }, { "description": "Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.", + "explode": true, "in": "query", "name": "status-types", "schema": { @@ -27766,7 +27779,8 @@ "type": "string" }, "type": "array" - } + }, + "style": "form" }, { "description": "Status to mark notifications as. Defaults to read.", @@ -28894,6 +28908,7 @@ }, { "description": "Label IDs", + "explode": true, "in": "query", "name": "labels", "schema": { @@ -28902,7 +28917,8 @@ "type": "integer" }, "type": "array" - } + }, + "style": "form" }, { "description": "Filter by pull request author", diff --git a/web_src/js/features/repo-release.ts b/web_src/js/features/repo-release.ts index 690911d9ed6..f51526a9ef5 100644 --- a/web_src/js/features/repo-release.ts +++ b/web_src/js/features/repo-release.ts @@ -132,10 +132,7 @@ function initGenerateReleaseNotes(elForm: HTMLFormElement) { const $dropdown = fomanticQuery(elModal.querySelector('[name=previous_tag]')!); if (!inited) { inited = true; - const values = []; - for (const tagName of existingTags) { - values.push({name: htmlEscape(tagName), value: tagName}); // ATTENTION: dropdown takes the "name" input as raw HTML - } + const values = existingTags.map((tagName) => ({name: htmlEscape(tagName), value: tagName})); // ATTENTION: dropdown takes the "name" input as raw HTML $dropdown.dropdown('change values', values); } $dropdown.dropdown('set selected', guessPreviousReleaseTag(tagName, existingTags));