we have subnet names as keys in subnets map. I want create schema to make subnet name length restricted conditional based on vpc_access key which is nested in the subnet.
I know that it is possible to make condition on nested property via properties.PROPERTY1.properties.PROPERTY2.const.VALUE
, but in my case I do not know the exact property name because I’m using patternProperties
.
So I’m trying to do something like this. It is JSON schema written in yaml form.
subnets:
if:
patternProperties:
^.*$:
properties:
vpc_access:
const: true
required:
- vpc_access
then:
propertyNames:
pattern: ^[a-z][a-z0-9-]{1,22}[a-z0-9]$
patternProperties:
^.*$:
$ref: /schemas/network.subnet
Can you please confirm if this is possible in schema and help how to do it, please?
gorge511 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.