weldr: return version as string from api/status
This is what lorax-composer does and composer-cli expects.
This commit is contained in:
parent
42f46a5992
commit
57aea4160d
2 changed files with 3 additions and 3 deletions
|
|
@ -198,7 +198,7 @@ func statusResponseError(writer http.ResponseWriter, code int, errors ...respons
|
|||
|
||||
func (api *API) statusHandler(writer http.ResponseWriter, request *http.Request, _ httprouter.Params) {
|
||||
type reply struct {
|
||||
API uint `json:"api"`
|
||||
API string `json:"api"`
|
||||
DBSupported bool `json:"db_supported"`
|
||||
DBVersion string `json:"db_version"`
|
||||
SchemaVersion string `json:"schema_version"`
|
||||
|
|
@ -208,7 +208,7 @@ func (api *API) statusHandler(writer http.ResponseWriter, request *http.Request,
|
|||
}
|
||||
|
||||
json.NewEncoder(writer).Encode(reply{
|
||||
API: 1,
|
||||
API: "1",
|
||||
DBSupported: true,
|
||||
DBVersion: "0",
|
||||
SchemaVersion: "0",
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ func TestBasic(t *testing.T) {
|
|||
ExpectedStatus int
|
||||
ExpectedJSON string
|
||||
}{
|
||||
{"/api/status", http.StatusOK, `{"api":1,"db_supported":true,"db_version":"0","schema_version":"0","backend":"osbuild-composer","build":"devel","messages":[]}`},
|
||||
{"/api/status", http.StatusOK, `{"api":"1","db_supported":true,"db_version":"0","schema_version":"0","backend":"osbuild-composer","build":"devel","messages":[]}`},
|
||||
|
||||
{"/api/v0/projects/source/list", http.StatusOK, `{"sources":["test"]}`},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue