diff --git a/pkg/api/validation/schema.go b/pkg/api/validation/schema.go index a4cbc0ebdd6..4bfaa7536e7 100644 --- a/pkg/api/validation/schema.go +++ b/pkg/api/validation/schema.go @@ -126,7 +126,7 @@ func (s *SwaggerSchema) validateField(value interface{}, apiVersion, fieldName, if !ok { return NewInvalidTypeError(reflect.Array, reflect.TypeOf(value).Kind(), fieldName) } - arrType := *fieldDetails.Items[0].Ref + arrType := *fieldDetails.Items.Ref for ix := range arr { err := s.validateField(arr[ix], apiVersion, fmt.Sprintf("%s[%d]", fieldName, ix), arrType, nil) if err != nil { diff --git a/pkg/api/validation/v1beta1-swagger.json b/pkg/api/validation/v1beta1-swagger.json index dfcc371bf6d..7eb8663eb4e 100644 --- a/pkg/api/validation/v1beta1-swagger.json +++ b/pkg/api/validation/v1beta1-swagger.json @@ -943,11 +943,9 @@ "properties": { "command": { "type": "array", - "items": [ - { + "items": { "$ref": "string" } - ] }, "cpu": { "type": "integer", @@ -955,11 +953,9 @@ }, "env": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.EnvVar" } - ] }, "image": { "type": "string" @@ -982,11 +978,9 @@ }, "ports": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.Port" } - ] }, "privileged": { "type": "boolean" @@ -996,11 +990,9 @@ }, "volumeMounts": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.VolumeMount" } - ] }, "workingDir": { "type": "string" @@ -1018,11 +1010,9 @@ "properties": { "containers": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.Container" } - ] }, "id": { "type": "string" @@ -1038,11 +1028,9 @@ }, "volumes": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.Volume" } - ] } } }, @@ -1075,11 +1063,9 @@ }, "endpoints": { "type": "array", - "items": [ - { + "items": { "$ref": "string" } - ] }, "id": { "type": "string" @@ -1130,11 +1116,9 @@ }, "items": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.Endpoints" } - ] }, "kind": { "type": "string" @@ -1260,11 +1244,9 @@ }, "items": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.Event" } - ] }, "kind": { "type": "string" @@ -1288,11 +1270,9 @@ "properties": { "command": { "type": "array", - "items": [ - { + "items": { "$ref": "string" } - ] } } }, @@ -1482,22 +1462,18 @@ }, "items": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.Minion" } - ] }, "kind": { "type": "string" }, "minions": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.Minion" } - ] }, "namespace": { "type": "string" @@ -1639,11 +1615,9 @@ }, "items": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.Pod" } - ] }, "kind": { "type": "string" @@ -1813,11 +1787,9 @@ }, "items": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.ReplicationController" } - ] }, "kind": { "type": "string" @@ -1942,11 +1914,9 @@ }, "publicIPs": { "type": "array", - "items": [ - { + "items": { "$ref": "string" } - ] }, "resourceVersion": { "type": "uint64" @@ -1999,11 +1969,9 @@ }, "items": { "type": "array", - "items": [ - { + "items": { "$ref": "v1beta1.Service" } - ] }, "kind": { "type": "string"