Merge pull request '[API] [SEMVER] replace number with version' (#548) from dachary/forgejo:wip-semver into forgejo-development

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/548
This commit is contained in:
Earl Warren 2023-03-18 15:48:19 +00:00
commit 9e74216359
4 changed files with 4 additions and 4 deletions

View file

@ -35,6 +35,6 @@ components:
Version: Version:
type: object type: object
properties: properties:
number: version:
type: string type: string

View file

@ -12,7 +12,7 @@ import (
// Version defines model for Version. // Version defines model for Version.
type Version struct { type Version struct {
Number *string `json:"number,omitempty"` Version *string `json:"version,omitempty"`
} }
// ServerInterface represents all server handlers. // ServerInterface represents all server handlers.

View file

@ -21,5 +21,5 @@ func TestAPIForgejoVersion(t *testing.T) {
var version v1.Version var version v1.Version
DecodeJSON(t, resp, &version) DecodeJSON(t, resp, &version)
assert.Equal(t, "development", *version.Number) assert.Equal(t, "development", *version.Version)
} }

View file

@ -64,7 +64,7 @@ export default {
], ],
forgejoswagger: [ // Forgejo swagger is OpenAPI 3.0.0 and has specific parameters forgejoswagger: [ // Forgejo swagger is OpenAPI 3.0.0 and has specific parameters
fileURLToPath(new URL('web_src/js/standalone/forgejo-swagger.js', import.meta.url)), fileURLToPath(new URL('web_src/js/standalone/forgejo-swagger.js', import.meta.url)),
fileURLToPath(new URL('web_src/less/standalone/swagger.less', import.meta.url)), fileURLToPath(new URL('web_src/css/standalone/swagger.css', import.meta.url)),
], ],
swagger: [ swagger: [
fileURLToPath(new URL('web_src/js/standalone/swagger.js', import.meta.url)), fileURLToPath(new URL('web_src/js/standalone/swagger.js', import.meta.url)),