diff --git a/Makefile b/Makefile index 2c043ab..ac573a9 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ mocks: --user $$(id -u):$$(id -g) \ -w /work \ -v ${PWD}:/work \ - vektra/mockery:v2.33.2 -r --keeptree --inpackage --dir api/client --output test/mocks --all + vektra/mockery:v2.38.0 -r --keeptree --inpackage --dir api/client --output test/mocks --all go run ./test/client/generate/generate_mock_client.go .PHONY: gofmt diff --git a/api/models/rest_version.go b/api/models/rest_version.go index 17cf0a0..ce559f7 100644 --- a/api/models/rest_version.go +++ b/api/models/rest_version.go @@ -27,6 +27,10 @@ type RestVersion struct { // Required: true Gitsha1 *string `json:"gitsha1" yaml:"gitsha1"` + // min client version + // Required: true + MinClientVersion *string `json:"min_client_version" yaml:"min_client_version"` + // name // Required: true Name *string `json:"name" yaml:"name"` @@ -52,6 +56,10 @@ func (m *RestVersion) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateMinClientVersion(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -88,6 +96,15 @@ func (m *RestVersion) validateGitsha1(formats strfmt.Registry) error { return nil } +func (m *RestVersion) validateMinClientVersion(formats strfmt.Registry) error { + + if err := validate.Required("min_client_version", "body", m.MinClientVersion); err != nil { + return err + } + + return nil +} + func (m *RestVersion) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { diff --git a/metal-api.json b/metal-api.json index 18f34e6..d6181aa 100644 --- a/metal-api.json +++ b/metal-api.json @@ -395,6 +395,9 @@ "gitsha1": { "type": "string" }, + "min_client_version": { + "type": "string" + }, "name": { "type": "string" }, @@ -408,6 +411,7 @@ "required": [ "builddate", "gitsha1", + "min_client_version", "name", "revision", "version"