Closed RobertHana closed 3 years ago
Hi, thanks for using Yamale. I think you're right...I don't see a way to perform exactly this validation. Here's the closest I could get:
req_key: any()
keys: any(include('keys'), required=False)
---
keys:
map(any(), key=regex('^key.*$'))
Of course, that means putting your optional keys under a separate mapping like this:
req_key: value
keys:
key1: value
key2: value
Validating a required key and optional mapping at the same node isn't something we support at this time.
Closing due to lack of activity, and I don't see us supporting this exact use case.
I want to somehow match keys AND retain value requirement like so:
I can't figure out how to do this currently with a map and without a custom validator.