From 7b6c37e0424083789dc6662ab4de2f0493de0a2b Mon Sep 17 00:00:00 2001 From: Jiahui Feng Date: Tue, 22 Mar 2022 14:12:23 -0700 Subject: [PATCH] oneOf types for Quantity Kubernetes-commit: e5dd75dccf7f1a91879757d5ebab25fe3ee521c3 --- pkg/api/resource/quantity.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/api/resource/quantity.go b/pkg/api/resource/quantity.go index 6d43868ba..1ca31d8ca 100644 --- a/pkg/api/resource/quantity.go +++ b/pkg/api/resource/quantity.go @@ -397,6 +397,10 @@ func (_ Quantity) OpenAPISchemaType() []string { return []string{"string"} } // the OpenAPI spec of this type. func (_ Quantity) OpenAPISchemaFormat() string { return "" } +// OpenAPIV3OneOfTypes is used by the kube-openapi generator when constructing +// the OpenAPI v3 spec of this type. +func (Quantity) OpenAPIV3OneOfTypes() []string { return []string{"string", "number"} } + // CanonicalizeBytes returns the canonical form of q and its suffix (see comment on Quantity). // // Note about BinarySI: