Use k8s schema to determine formatting if no type on setter

This commit is contained in:
Morten Torkildsen
2020-07-31 13:44:47 -07:00
parent feeaa994b7
commit 5c433ead5e
5 changed files with 26 additions and 15 deletions

View File

@@ -16,7 +16,7 @@ type visitor interface {
// node is the scalar field value
// path is the path to the field; path elements are separated by '.'
// oa is the OpenAPI schema for the field
visitScalar(node *yaml.RNode, path string, oa *openapi.ResourceSchema) error
visitScalar(node *yaml.RNode, path string, oa *openapi.ResourceSchema, fieldOA *openapi.ResourceSchema) error
// visitSequence is called for each sequence field value on a resource
// node is the sequence field value
@@ -69,7 +69,7 @@ func acceptImpl(v visitor, object *yaml.RNode, p string, oa *openapi.ResourceSch
case yaml.ScalarNode:
// Visit the scalar field
fieldSchema := getSchema(object, oa, "")
return v.visitScalar(object, p, fieldSchema)
return v.visitScalar(object, p, oa, fieldSchema)
}
return nil
}