diff --git a/cli/pkg/kctrl/cmd/package/release/schemagenerator/helm_openapi_schema_gen.go b/cli/pkg/kctrl/cmd/package/release/schemagenerator/helm_openapi_schema_gen.go index 9d2c470a7d..3d0e91856a 100644 --- a/cli/pkg/kctrl/cmd/package/release/schemagenerator/helm_openapi_schema_gen.go +++ b/cli/pkg/kctrl/cmd/package/release/schemagenerator/helm_openapi_schema_gen.go @@ -203,6 +203,8 @@ func (h HelmValuesSchemaGen) calculateProperties(key *yaml3.Node, value *yaml3.N return nil, err } apiKeys = append(apiKeys, &MapItem{Key: itemsKey, Value: calculatedProperties}) + } else { + apiKeys = append(apiKeys, &MapItem{Key: itemsKey, Value: &Map{}}) } case yaml3.ScalarNode: defaultVal, err := h.getDefaultValue(value.Tag, value.Value) diff --git a/cli/pkg/kctrl/cmd/package/release/schemagenerator/helm_openapi_schema_gen_test.go b/cli/pkg/kctrl/cmd/package/release/schemagenerator/helm_openapi_schema_gen_test.go index 2006c3b8ca..c59681118b 100644 --- a/cli/pkg/kctrl/cmd/package/release/schemagenerator/helm_openapi_schema_gen_test.go +++ b/cli/pkg/kctrl/cmd/package/release/schemagenerator/helm_openapi_schema_gen_test.go @@ -39,8 +39,13 @@ arrKeyWithIntValues: arrKeyWithFloatValues: - 1.1 - 1.2 +arrKeyEmpty: [] `, want: `properties: + arrKeyEmpty: + default: [] + items: {} + type: array arrKeyWithFloatValues: default: [] description: default value is 1.1. 1.2 is ignored diff --git a/cli/test/e2e/package_authoring_e2e_test.go b/cli/test/e2e/package_authoring_e2e_test.go index 83f3e4ac6b..c618b8e8a2 100644 --- a/cli/test/e2e/package_authoring_e2e_test.go +++ b/cli/test/e2e/package_authoring_e2e_test.go @@ -252,6 +252,7 @@ spec: properties: clusters: default: [] + items: {} type: array kubeConfigSecretName: default: mongodb-enterprise-operator-multi-cluster-kubeconfig @@ -289,6 +290,7 @@ spec: type: string tolerations: default: [] + items: {} type: array vaultSecretBackend: properties: @@ -812,6 +814,7 @@ spec: type: object imagePullSecrets: default: [] + items: {} type: array nameOverride: default: ""