From c50bdbbac8375e4bb1afa2634a0f01cbbab6512e Mon Sep 17 00:00:00 2001 From: Andy Stoneberg Date: Thu, 31 Jul 2025 13:48:49 -0400 Subject: [PATCH] chore(ws): update swag to 1.16.6 for required fields (#489) - Updated swaggo/swag from v1.16.4 to v1.16.6 in go.mod and Makefile. - Added required fields to various OpenAPI definitions in docs.go and swagger.json for better validation via `--requiredByDefault` flag - `swag` `v1.16.6` contains a commit we authored to treat `json:omitempty` as `required: false`. That, in conjunction with `--requiredByDefault` flag, allows us to generate models with proper _required-ness_ Signed-off-by: Andy Stoneberg --- workspaces/backend/Makefile | 6 +- workspaces/backend/go.mod | 3 +- workspaces/backend/go.sum | 4 +- workspaces/backend/openapi/docs.go | 229 ++++++++++++++++++++++++ workspaces/backend/openapi/swagger.json | 229 ++++++++++++++++++++++++ 5 files changed, 465 insertions(+), 6 deletions(-) diff --git a/workspaces/backend/Makefile b/workspaces/backend/Makefile index 55925977..d139d313 100644 --- a/workspaces/backend/Makefile +++ b/workspaces/backend/Makefile @@ -74,7 +74,7 @@ SWAG_DIRS := cmd,$(ALL_GO_DIRS_NO_CMD) .PHONY: swag swag: SWAGGER $(SWAGGER) fmt -g main.go -d $(SWAG_DIRS) - $(SWAGGER) init --parseDependency -q -g main.go -d $(SWAG_DIRS) --output openapi --outputTypes go,json + $(SWAGGER) init --parseDependency -q -g main.go -d $(SWAG_DIRS) --output openapi --outputTypes go,json --requiredByDefault ##@ Build @@ -82,7 +82,7 @@ swag: SWAGGER build: fmt vet swag ## Build backend binary. go build -o bin/backend cmd/main.go -.PHONY: run +.PHONY: run run: fmt vet swag ## Run a backend from your host. go run ./cmd/main.go --port=$(PORT) @@ -131,7 +131,7 @@ SWAGGER = $(LOCALBIN)/swag ## Tool Versions ENVTEST_VERSION ?= release-0.19 GOLANGCI_LINT_VERSION ?= v1.61.0 -SWAGGER_VERSION ?= v1.16.4 +SWAGGER_VERSION ?= v1.16.6 .PHONY: SWAGGER SWAGGER: $(SWAGGER) diff --git a/workspaces/backend/go.mod b/workspaces/backend/go.mod index ab546a80..ef15dbbc 100644 --- a/workspaces/backend/go.mod +++ b/workspaces/backend/go.mod @@ -10,7 +10,7 @@ require ( github.com/onsi/ginkgo/v2 v2.19.0 github.com/onsi/gomega v1.33.1 github.com/swaggo/http-swagger/v2 v2.0.2 - github.com/swaggo/swag v1.16.4 + github.com/swaggo/swag v1.16.6 k8s.io/api v0.31.0 k8s.io/apimachinery v0.31.0 k8s.io/apiserver v0.31.0 @@ -80,6 +80,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect + golang.org/x/mod v0.23.0 // indirect golang.org/x/net v0.35.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sync v0.11.0 // indirect diff --git a/workspaces/backend/go.sum b/workspaces/backend/go.sum index 4e67123c..8d0397b1 100644 --- a/workspaces/backend/go.sum +++ b/workspaces/backend/go.sum @@ -128,8 +128,8 @@ github.com/swaggo/files/v2 v2.0.2 h1:Bq4tgS/yxLB/3nwOMcul5oLEUKa877Ykgz3CJMVbQKU github.com/swaggo/files/v2 v2.0.2/go.mod h1:TVqetIzZsO9OhHX1Am9sRf9LdrFZqoK49N37KON/jr0= github.com/swaggo/http-swagger/v2 v2.0.2 h1:FKCdLsl+sFCx60KFsyM0rDarwiUSZ8DqbfSyIKC9OBg= github.com/swaggo/http-swagger/v2 v2.0.2/go.mod h1:r7/GBkAWIfK6E/OLnE8fXnviHiDeAHmgIyooa4xm3AQ= -github.com/swaggo/swag v1.16.4 h1:clWJtd9LStiG3VeijiCfOVODP6VpHtKdQy9ELFG3s1A= -github.com/swaggo/swag v1.16.4/go.mod h1:VBsHJRsDvfYvqoiMKnsdwhNV9LEMHgEDZcyVYX0sxPg= +github.com/swaggo/swag v1.16.6 h1:qBNcx53ZaX+M5dxVyTrgQ0PJ/ACK+NzhwcbieTt+9yI= +github.com/swaggo/swag v1.16.6/go.mod h1:ngP2etMK5a0P3QBizic5MEwpRmluJZPHjXcMoj4Xesg= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/workspaces/backend/openapi/docs.go b/workspaces/backend/openapi/docs.go index 616bb409..d0b29075 100644 --- a/workspaces/backend/openapi/docs.go +++ b/workspaces/backend/openapi/docs.go @@ -697,6 +697,9 @@ const docTemplate = `{ "definitions": { "actions.WorkspaceActionPause": { "type": "object", + "required": [ + "paused" + ], "properties": { "paused": { "type": "boolean" @@ -716,6 +719,9 @@ const docTemplate = `{ }, "api.ErrorEnvelope": { "type": "object", + "required": [ + "error" + ], "properties": { "error": { "$ref": "#/definitions/api.HTTPError" @@ -724,6 +730,10 @@ const docTemplate = `{ }, "api.HTTPError": { "type": "object", + "required": [ + "code", + "message" + ], "properties": { "cause": { "$ref": "#/definitions/api.ErrorCause" @@ -738,6 +748,9 @@ const docTemplate = `{ }, "api.NamespaceListEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -749,6 +762,11 @@ const docTemplate = `{ }, "api.ValidationError": { "type": "object", + "required": [ + "field", + "message", + "type" + ], "properties": { "field": { "type": "string" @@ -763,6 +781,9 @@ const docTemplate = `{ }, "api.WorkspaceActionPauseEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "$ref": "#/definitions/actions.WorkspaceActionPause" @@ -771,6 +792,9 @@ const docTemplate = `{ }, "api.WorkspaceCreateEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "$ref": "#/definitions/workspaces.WorkspaceCreate" @@ -779,6 +803,9 @@ const docTemplate = `{ }, "api.WorkspaceEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "$ref": "#/definitions/workspaces.Workspace" @@ -787,6 +814,9 @@ const docTemplate = `{ }, "api.WorkspaceKindEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "$ref": "#/definitions/workspacekinds.WorkspaceKind" @@ -795,6 +825,9 @@ const docTemplate = `{ }, "api.WorkspaceKindListEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -806,6 +839,9 @@ const docTemplate = `{ }, "api.WorkspaceListEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -844,6 +880,10 @@ const docTemplate = `{ }, "health_check.HealthCheck": { "type": "object", + "required": [ + "status", + "systemInfo" + ], "properties": { "status": { "$ref": "#/definitions/health_check.ServiceStatus" @@ -866,6 +906,9 @@ const docTemplate = `{ }, "health_check.SystemInfo": { "type": "object", + "required": [ + "version" + ], "properties": { "version": { "type": "string" @@ -874,6 +917,9 @@ const docTemplate = `{ }, "namespaces.Namespace": { "type": "object", + "required": [ + "name" + ], "properties": { "name": { "type": "string" @@ -882,6 +928,10 @@ const docTemplate = `{ }, "workspacekinds.ImageConfig": { "type": "object", + "required": [ + "default", + "values" + ], "properties": { "default": { "type": "string" @@ -896,6 +946,13 @@ const docTemplate = `{ }, "workspacekinds.ImageConfigValue": { "type": "object", + "required": [ + "description", + "displayName", + "hidden", + "id", + "labels" + ], "properties": { "clusterMetrics": { "$ref": "#/definitions/workspacekinds.clusterMetrics" @@ -925,6 +982,9 @@ const docTemplate = `{ }, "workspacekinds.ImageRef": { "type": "object", + "required": [ + "url" + ], "properties": { "url": { "type": "string" @@ -933,6 +993,10 @@ const docTemplate = `{ }, "workspacekinds.OptionLabel": { "type": "object", + "required": [ + "key", + "value" + ], "properties": { "key": { "type": "string" @@ -944,6 +1008,9 @@ const docTemplate = `{ }, "workspacekinds.OptionRedirect": { "type": "object", + "required": [ + "to" + ], "properties": { "message": { "$ref": "#/definitions/workspacekinds.RedirectMessage" @@ -955,6 +1022,10 @@ const docTemplate = `{ }, "workspacekinds.PodConfig": { "type": "object", + "required": [ + "default", + "values" + ], "properties": { "default": { "type": "string" @@ -969,6 +1040,13 @@ const docTemplate = `{ }, "workspacekinds.PodConfigValue": { "type": "object", + "required": [ + "description", + "displayName", + "hidden", + "id", + "labels" + ], "properties": { "clusterMetrics": { "$ref": "#/definitions/workspacekinds.clusterMetrics" @@ -998,6 +1076,10 @@ const docTemplate = `{ }, "workspacekinds.PodMetadata": { "type": "object", + "required": [ + "annotations", + "labels" + ], "properties": { "annotations": { "type": "object", @@ -1015,6 +1097,11 @@ const docTemplate = `{ }, "workspacekinds.PodTemplate": { "type": "object", + "required": [ + "options", + "podMetadata", + "volumeMounts" + ], "properties": { "options": { "$ref": "#/definitions/workspacekinds.PodTemplateOptions" @@ -1029,6 +1116,10 @@ const docTemplate = `{ }, "workspacekinds.PodTemplateOptions": { "type": "object", + "required": [ + "imageConfig", + "podConfig" + ], "properties": { "imageConfig": { "$ref": "#/definitions/workspacekinds.ImageConfig" @@ -1040,6 +1131,9 @@ const docTemplate = `{ }, "workspacekinds.PodVolumeMounts": { "type": "object", + "required": [ + "home" + ], "properties": { "home": { "type": "string" @@ -1048,6 +1142,10 @@ const docTemplate = `{ }, "workspacekinds.RedirectMessage": { "type": "object", + "required": [ + "level", + "text" + ], "properties": { "level": { "$ref": "#/definitions/workspacekinds.RedirectMessageLevel" @@ -1072,6 +1170,17 @@ const docTemplate = `{ }, "workspacekinds.WorkspaceKind": { "type": "object", + "required": [ + "deprecated", + "deprecationMessage", + "description", + "displayName", + "hidden", + "icon", + "logo", + "name", + "podTemplate" + ], "properties": { "clusterMetrics": { "$ref": "#/definitions/workspacekinds.clusterMetrics" @@ -1107,6 +1216,9 @@ const docTemplate = `{ }, "workspacekinds.clusterMetrics": { "type": "object", + "required": [ + "workspacesCount" + ], "properties": { "workspacesCount": { "type": "integer" @@ -1115,6 +1227,10 @@ const docTemplate = `{ }, "workspaces.Activity": { "type": "object", + "required": [ + "lastActivity", + "lastUpdate" + ], "properties": { "lastActivity": { "description": "Unix Epoch time", @@ -1131,6 +1247,10 @@ const docTemplate = `{ }, "workspaces.HttpService": { "type": "object", + "required": [ + "displayName", + "httpPath" + ], "properties": { "displayName": { "type": "string" @@ -1142,6 +1262,9 @@ const docTemplate = `{ }, "workspaces.ImageConfig": { "type": "object", + "required": [ + "current" + ], "properties": { "current": { "$ref": "#/definitions/workspaces.OptionInfo" @@ -1159,6 +1282,9 @@ const docTemplate = `{ }, "workspaces.ImageRef": { "type": "object", + "required": [ + "url" + ], "properties": { "url": { "type": "string" @@ -1167,6 +1293,12 @@ const docTemplate = `{ }, "workspaces.LastProbeInfo": { "type": "object", + "required": [ + "endTimeMs", + "message", + "result", + "startTimeMs" + ], "properties": { "endTimeMs": { "description": "Unix Epoch time in milliseconds", @@ -1186,6 +1318,12 @@ const docTemplate = `{ }, "workspaces.OptionInfo": { "type": "object", + "required": [ + "description", + "displayName", + "id", + "labels" + ], "properties": { "description": { "type": "string" @@ -1206,6 +1344,10 @@ const docTemplate = `{ }, "workspaces.OptionLabel": { "type": "object", + "required": [ + "key", + "value" + ], "properties": { "key": { "type": "string" @@ -1217,6 +1359,9 @@ const docTemplate = `{ }, "workspaces.PodConfig": { "type": "object", + "required": [ + "current" + ], "properties": { "current": { "$ref": "#/definitions/workspaces.OptionInfo" @@ -1234,6 +1379,10 @@ const docTemplate = `{ }, "workspaces.PodMetadata": { "type": "object", + "required": [ + "annotations", + "labels" + ], "properties": { "annotations": { "type": "object", @@ -1251,6 +1400,10 @@ const docTemplate = `{ }, "workspaces.PodMetadataMutate": { "type": "object", + "required": [ + "annotations", + "labels" + ], "properties": { "annotations": { "type": "object", @@ -1268,6 +1421,10 @@ const docTemplate = `{ }, "workspaces.PodSecretInfo": { "type": "object", + "required": [ + "mountPath", + "secretName" + ], "properties": { "defaultMode": { "type": "integer" @@ -1282,6 +1439,10 @@ const docTemplate = `{ }, "workspaces.PodSecretMount": { "type": "object", + "required": [ + "mountPath", + "secretName" + ], "properties": { "defaultMode": { "type": "integer" @@ -1296,6 +1457,11 @@ const docTemplate = `{ }, "workspaces.PodTemplate": { "type": "object", + "required": [ + "options", + "podMetadata", + "volumes" + ], "properties": { "options": { "$ref": "#/definitions/workspaces.PodTemplateOptions" @@ -1310,6 +1476,11 @@ const docTemplate = `{ }, "workspaces.PodTemplateMutate": { "type": "object", + "required": [ + "options", + "podMetadata", + "volumes" + ], "properties": { "options": { "$ref": "#/definitions/workspaces.PodTemplateOptionsMutate" @@ -1324,6 +1495,10 @@ const docTemplate = `{ }, "workspaces.PodTemplateOptions": { "type": "object", + "required": [ + "imageConfig", + "podConfig" + ], "properties": { "imageConfig": { "$ref": "#/definitions/workspaces.ImageConfig" @@ -1335,6 +1510,10 @@ const docTemplate = `{ }, "workspaces.PodTemplateOptionsMutate": { "type": "object", + "required": [ + "imageConfig", + "podConfig" + ], "properties": { "imageConfig": { "type": "string" @@ -1346,6 +1525,11 @@ const docTemplate = `{ }, "workspaces.PodVolumeInfo": { "type": "object", + "required": [ + "mountPath", + "pvcName", + "readOnly" + ], "properties": { "mountPath": { "type": "string" @@ -1360,6 +1544,10 @@ const docTemplate = `{ }, "workspaces.PodVolumeMount": { "type": "object", + "required": [ + "mountPath", + "pvcName" + ], "properties": { "mountPath": { "type": "string" @@ -1374,6 +1562,9 @@ const docTemplate = `{ }, "workspaces.PodVolumes": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -1394,6 +1585,9 @@ const docTemplate = `{ }, "workspaces.PodVolumesMutate": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -1427,6 +1621,10 @@ const docTemplate = `{ }, "workspaces.RedirectMessage": { "type": "object", + "required": [ + "level", + "text" + ], "properties": { "level": { "$ref": "#/definitions/workspaces.RedirectMessageLevel" @@ -1451,6 +1649,10 @@ const docTemplate = `{ }, "workspaces.RedirectStep": { "type": "object", + "required": [ + "sourceId", + "targetId" + ], "properties": { "message": { "$ref": "#/definitions/workspaces.RedirectMessage" @@ -1473,6 +1675,20 @@ const docTemplate = `{ }, "workspaces.Workspace": { "type": "object", + "required": [ + "activity", + "deferUpdates", + "name", + "namespace", + "paused", + "pausedTime", + "pendingRestart", + "podTemplate", + "services", + "state", + "stateMessage", + "workspaceKind" + ], "properties": { "activity": { "$ref": "#/definitions/workspaces.Activity" @@ -1517,6 +1733,13 @@ const docTemplate = `{ }, "workspaces.WorkspaceCreate": { "type": "object", + "required": [ + "deferUpdates", + "kind", + "name", + "paused", + "podTemplate" + ], "properties": { "deferUpdates": { "type": "boolean" @@ -1537,6 +1760,12 @@ const docTemplate = `{ }, "workspaces.WorkspaceKindInfo": { "type": "object", + "required": [ + "icon", + "logo", + "missing", + "name" + ], "properties": { "icon": { "$ref": "#/definitions/workspaces.ImageRef" diff --git a/workspaces/backend/openapi/swagger.json b/workspaces/backend/openapi/swagger.json index 6260cf1b..33669b8a 100644 --- a/workspaces/backend/openapi/swagger.json +++ b/workspaces/backend/openapi/swagger.json @@ -695,6 +695,9 @@ "definitions": { "actions.WorkspaceActionPause": { "type": "object", + "required": [ + "paused" + ], "properties": { "paused": { "type": "boolean" @@ -714,6 +717,9 @@ }, "api.ErrorEnvelope": { "type": "object", + "required": [ + "error" + ], "properties": { "error": { "$ref": "#/definitions/api.HTTPError" @@ -722,6 +728,10 @@ }, "api.HTTPError": { "type": "object", + "required": [ + "code", + "message" + ], "properties": { "cause": { "$ref": "#/definitions/api.ErrorCause" @@ -736,6 +746,9 @@ }, "api.NamespaceListEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -747,6 +760,11 @@ }, "api.ValidationError": { "type": "object", + "required": [ + "field", + "message", + "type" + ], "properties": { "field": { "type": "string" @@ -761,6 +779,9 @@ }, "api.WorkspaceActionPauseEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "$ref": "#/definitions/actions.WorkspaceActionPause" @@ -769,6 +790,9 @@ }, "api.WorkspaceCreateEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "$ref": "#/definitions/workspaces.WorkspaceCreate" @@ -777,6 +801,9 @@ }, "api.WorkspaceEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "$ref": "#/definitions/workspaces.Workspace" @@ -785,6 +812,9 @@ }, "api.WorkspaceKindEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "$ref": "#/definitions/workspacekinds.WorkspaceKind" @@ -793,6 +823,9 @@ }, "api.WorkspaceKindListEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -804,6 +837,9 @@ }, "api.WorkspaceListEnvelope": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -842,6 +878,10 @@ }, "health_check.HealthCheck": { "type": "object", + "required": [ + "status", + "systemInfo" + ], "properties": { "status": { "$ref": "#/definitions/health_check.ServiceStatus" @@ -864,6 +904,9 @@ }, "health_check.SystemInfo": { "type": "object", + "required": [ + "version" + ], "properties": { "version": { "type": "string" @@ -872,6 +915,9 @@ }, "namespaces.Namespace": { "type": "object", + "required": [ + "name" + ], "properties": { "name": { "type": "string" @@ -880,6 +926,10 @@ }, "workspacekinds.ImageConfig": { "type": "object", + "required": [ + "default", + "values" + ], "properties": { "default": { "type": "string" @@ -894,6 +944,13 @@ }, "workspacekinds.ImageConfigValue": { "type": "object", + "required": [ + "description", + "displayName", + "hidden", + "id", + "labels" + ], "properties": { "clusterMetrics": { "$ref": "#/definitions/workspacekinds.clusterMetrics" @@ -923,6 +980,9 @@ }, "workspacekinds.ImageRef": { "type": "object", + "required": [ + "url" + ], "properties": { "url": { "type": "string" @@ -931,6 +991,10 @@ }, "workspacekinds.OptionLabel": { "type": "object", + "required": [ + "key", + "value" + ], "properties": { "key": { "type": "string" @@ -942,6 +1006,9 @@ }, "workspacekinds.OptionRedirect": { "type": "object", + "required": [ + "to" + ], "properties": { "message": { "$ref": "#/definitions/workspacekinds.RedirectMessage" @@ -953,6 +1020,10 @@ }, "workspacekinds.PodConfig": { "type": "object", + "required": [ + "default", + "values" + ], "properties": { "default": { "type": "string" @@ -967,6 +1038,13 @@ }, "workspacekinds.PodConfigValue": { "type": "object", + "required": [ + "description", + "displayName", + "hidden", + "id", + "labels" + ], "properties": { "clusterMetrics": { "$ref": "#/definitions/workspacekinds.clusterMetrics" @@ -996,6 +1074,10 @@ }, "workspacekinds.PodMetadata": { "type": "object", + "required": [ + "annotations", + "labels" + ], "properties": { "annotations": { "type": "object", @@ -1013,6 +1095,11 @@ }, "workspacekinds.PodTemplate": { "type": "object", + "required": [ + "options", + "podMetadata", + "volumeMounts" + ], "properties": { "options": { "$ref": "#/definitions/workspacekinds.PodTemplateOptions" @@ -1027,6 +1114,10 @@ }, "workspacekinds.PodTemplateOptions": { "type": "object", + "required": [ + "imageConfig", + "podConfig" + ], "properties": { "imageConfig": { "$ref": "#/definitions/workspacekinds.ImageConfig" @@ -1038,6 +1129,9 @@ }, "workspacekinds.PodVolumeMounts": { "type": "object", + "required": [ + "home" + ], "properties": { "home": { "type": "string" @@ -1046,6 +1140,10 @@ }, "workspacekinds.RedirectMessage": { "type": "object", + "required": [ + "level", + "text" + ], "properties": { "level": { "$ref": "#/definitions/workspacekinds.RedirectMessageLevel" @@ -1070,6 +1168,17 @@ }, "workspacekinds.WorkspaceKind": { "type": "object", + "required": [ + "deprecated", + "deprecationMessage", + "description", + "displayName", + "hidden", + "icon", + "logo", + "name", + "podTemplate" + ], "properties": { "clusterMetrics": { "$ref": "#/definitions/workspacekinds.clusterMetrics" @@ -1105,6 +1214,9 @@ }, "workspacekinds.clusterMetrics": { "type": "object", + "required": [ + "workspacesCount" + ], "properties": { "workspacesCount": { "type": "integer" @@ -1113,6 +1225,10 @@ }, "workspaces.Activity": { "type": "object", + "required": [ + "lastActivity", + "lastUpdate" + ], "properties": { "lastActivity": { "description": "Unix Epoch time", @@ -1129,6 +1245,10 @@ }, "workspaces.HttpService": { "type": "object", + "required": [ + "displayName", + "httpPath" + ], "properties": { "displayName": { "type": "string" @@ -1140,6 +1260,9 @@ }, "workspaces.ImageConfig": { "type": "object", + "required": [ + "current" + ], "properties": { "current": { "$ref": "#/definitions/workspaces.OptionInfo" @@ -1157,6 +1280,9 @@ }, "workspaces.ImageRef": { "type": "object", + "required": [ + "url" + ], "properties": { "url": { "type": "string" @@ -1165,6 +1291,12 @@ }, "workspaces.LastProbeInfo": { "type": "object", + "required": [ + "endTimeMs", + "message", + "result", + "startTimeMs" + ], "properties": { "endTimeMs": { "description": "Unix Epoch time in milliseconds", @@ -1184,6 +1316,12 @@ }, "workspaces.OptionInfo": { "type": "object", + "required": [ + "description", + "displayName", + "id", + "labels" + ], "properties": { "description": { "type": "string" @@ -1204,6 +1342,10 @@ }, "workspaces.OptionLabel": { "type": "object", + "required": [ + "key", + "value" + ], "properties": { "key": { "type": "string" @@ -1215,6 +1357,9 @@ }, "workspaces.PodConfig": { "type": "object", + "required": [ + "current" + ], "properties": { "current": { "$ref": "#/definitions/workspaces.OptionInfo" @@ -1232,6 +1377,10 @@ }, "workspaces.PodMetadata": { "type": "object", + "required": [ + "annotations", + "labels" + ], "properties": { "annotations": { "type": "object", @@ -1249,6 +1398,10 @@ }, "workspaces.PodMetadataMutate": { "type": "object", + "required": [ + "annotations", + "labels" + ], "properties": { "annotations": { "type": "object", @@ -1266,6 +1419,10 @@ }, "workspaces.PodSecretInfo": { "type": "object", + "required": [ + "mountPath", + "secretName" + ], "properties": { "defaultMode": { "type": "integer" @@ -1280,6 +1437,10 @@ }, "workspaces.PodSecretMount": { "type": "object", + "required": [ + "mountPath", + "secretName" + ], "properties": { "defaultMode": { "type": "integer" @@ -1294,6 +1455,11 @@ }, "workspaces.PodTemplate": { "type": "object", + "required": [ + "options", + "podMetadata", + "volumes" + ], "properties": { "options": { "$ref": "#/definitions/workspaces.PodTemplateOptions" @@ -1308,6 +1474,11 @@ }, "workspaces.PodTemplateMutate": { "type": "object", + "required": [ + "options", + "podMetadata", + "volumes" + ], "properties": { "options": { "$ref": "#/definitions/workspaces.PodTemplateOptionsMutate" @@ -1322,6 +1493,10 @@ }, "workspaces.PodTemplateOptions": { "type": "object", + "required": [ + "imageConfig", + "podConfig" + ], "properties": { "imageConfig": { "$ref": "#/definitions/workspaces.ImageConfig" @@ -1333,6 +1508,10 @@ }, "workspaces.PodTemplateOptionsMutate": { "type": "object", + "required": [ + "imageConfig", + "podConfig" + ], "properties": { "imageConfig": { "type": "string" @@ -1344,6 +1523,11 @@ }, "workspaces.PodVolumeInfo": { "type": "object", + "required": [ + "mountPath", + "pvcName", + "readOnly" + ], "properties": { "mountPath": { "type": "string" @@ -1358,6 +1542,10 @@ }, "workspaces.PodVolumeMount": { "type": "object", + "required": [ + "mountPath", + "pvcName" + ], "properties": { "mountPath": { "type": "string" @@ -1372,6 +1560,9 @@ }, "workspaces.PodVolumes": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -1392,6 +1583,9 @@ }, "workspaces.PodVolumesMutate": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -1425,6 +1619,10 @@ }, "workspaces.RedirectMessage": { "type": "object", + "required": [ + "level", + "text" + ], "properties": { "level": { "$ref": "#/definitions/workspaces.RedirectMessageLevel" @@ -1449,6 +1647,10 @@ }, "workspaces.RedirectStep": { "type": "object", + "required": [ + "sourceId", + "targetId" + ], "properties": { "message": { "$ref": "#/definitions/workspaces.RedirectMessage" @@ -1471,6 +1673,20 @@ }, "workspaces.Workspace": { "type": "object", + "required": [ + "activity", + "deferUpdates", + "name", + "namespace", + "paused", + "pausedTime", + "pendingRestart", + "podTemplate", + "services", + "state", + "stateMessage", + "workspaceKind" + ], "properties": { "activity": { "$ref": "#/definitions/workspaces.Activity" @@ -1515,6 +1731,13 @@ }, "workspaces.WorkspaceCreate": { "type": "object", + "required": [ + "deferUpdates", + "kind", + "name", + "paused", + "podTemplate" + ], "properties": { "deferUpdates": { "type": "boolean" @@ -1535,6 +1758,12 @@ }, "workspaces.WorkspaceKindInfo": { "type": "object", + "required": [ + "icon", + "logo", + "missing", + "name" + ], "properties": { "icon": { "$ref": "#/definitions/workspaces.ImageRef"