mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-05 18:16:13 +00:00
Strip defaults in new places
This commit is contained in:
@@ -24,12 +24,15 @@ import (
|
||||
"github.com/go-openapi/spec"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/diff"
|
||||
"k8s.io/kube-openapi/pkg/handler"
|
||||
)
|
||||
|
||||
func TestOpenAPIRoundtrip(t *testing.T) {
|
||||
dummyRef := func(name string) spec.Ref { return spec.MustCreateRef("#/definitions/dummy") }
|
||||
for name, value := range GetOpenAPIDefinitions(dummyRef) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
// TODO(kubernetes/gengo#193): We currently round-trip ints to floats.
|
||||
value.Schema = *handler.PruneDefaultsSchema(&value.Schema)
|
||||
data, err := json.Marshal(value.Schema)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
|
Reference in New Issue
Block a user