Closed felipe88alves closed 1 year ago
Since there is no value, it's not considered a string. Instead, you can use the null()
validator:
required_key: null()
Mea culpa.
Forgot to mention that ytt
will not always be used. So I need it to be a string or null().
But I guess that answers the question anyway.
I can just use:
required_key: any(str(), null())
Thanks again for the great support!
Can the
none
flag be used when therequired
flag is set to True (by default)? I need to validate manifests where the value of the required field is set dynamically using ytt (https://carvel.dev/ytt/)Sample: required_key: #@ "{}".format(source)
Attempted yamale schema: required_key: str(none=True)
Somehow this does not seem to work. Am I doing this wrong? Is there another way of doing this?