From fba48e64977a75e77c9c6cf8e3f8a679a5e7b733 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= <loic@dachary.org>
Date: Sat, 18 Mar 2023 08:38:14 +0100
Subject: [PATCH] [API] [SEMVER] replace number with version

---
 public/forgejo/api.v1.yml                     | 2 +-
 routers/api/forgejo/v1/generated.go           | 2 +-
 tests/integration/api_forgejo_version_test.go | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/public/forgejo/api.v1.yml b/public/forgejo/api.v1.yml
index 903dd659d0..924ea91d7b 100644
--- a/public/forgejo/api.v1.yml
+++ b/public/forgejo/api.v1.yml
@@ -35,6 +35,6 @@ components:
     Version:
       type: object
       properties:
-        number:
+        version:
           type: string
 
diff --git a/routers/api/forgejo/v1/generated.go b/routers/api/forgejo/v1/generated.go
index afec612e85..725ddf572a 100644
--- a/routers/api/forgejo/v1/generated.go
+++ b/routers/api/forgejo/v1/generated.go
@@ -12,7 +12,7 @@ import (
 
 // Version defines model for Version.
 type Version struct {
-	Number *string `json:"number,omitempty"`
+	Version *string `json:"version,omitempty"`
 }
 
 // ServerInterface represents all server handlers.
diff --git a/tests/integration/api_forgejo_version_test.go b/tests/integration/api_forgejo_version_test.go
index cd904338a7..b8b8de8ee1 100644
--- a/tests/integration/api_forgejo_version_test.go
+++ b/tests/integration/api_forgejo_version_test.go
@@ -21,5 +21,5 @@ func TestAPIForgejoVersion(t *testing.T) {
 
 	var version v1.Version
 	DecodeJSON(t, resp, &version)
-	assert.Equal(t, "development", *version.Number)
+	assert.Equal(t, "development", *version.Version)
 }