From e5dd75dccf7f1a91879757d5ebab25fe3ee521c3 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 --- staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go b/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go index 6d43868ba80..1ca31d8caf5 100644 --- a/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go +++ b/staging/src/k8s.io/apimachinery/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: