Pattern properties

Hello,

I want to use patternProperties to auto increments arrays name (vm1 , vm2 …).

For this I’m trying to use this schema :

{
“type”: “object”,
“properties”: {
“vms_to_deploy”: {
“type”: “array”,
“items”: {
“type”: “object”,
“patternProperties”: {
“^(vm[0-9]+)$”: {
“type”: “object”,
“properties”: {
“dns”: {
“type”: “string”,
“format”: “ipv4”
},
“gateway”: {
“type”: “string”,
“format”: “ipv4”
},
“ipaddress”: {
“type”: “string”,
“format”: “ipv4”
},
“name”: {
“type”: “string”
},
“netmask”: {
“type”: “string”,
“format”: “ipv4”
},
“networks”: {
“type”: “array”,
“items”: {
“type”: “string”
}
},
“ovf”: {
“type”: “string”
}
},
“required”: [“dns”, “gateway”, “ipaddress”, “name”, “netmask”, “networks”, “ovf”],
“additionalProperties”: false
}
}
}
}
}
}

And this UI schema :

{
“type”: “VerticalLayout”,
“elements”: [
{
“type”: “Control”,
“scope”: “#/properties/vms_to_deploy”,
“options”: {
“detail”: {
“type”: “VerticalLayout”,
“elements”: [
{
“type”: “Control”,
“scope”: “#/properties/dns”
},
{
“type”: “Control”,
“scope”: “#/properties/gateway”
},
{
“type”: “Control”,
“scope”: “#/properties/ipaddress”
},
{
“type”: “Control”,
“scope”: “#/properties/name”
},
{
“type”: “Control”,
“scope”: “#/properties/netmask”
},
{
“type”: “Control”,
“scope”: “#/properties/networks”,
“options”: {
“elementLabelProp”: “network”
}
},
{
“type”: “Control”,
“scope”: “#/properties/ovf”
}
]
}
}
}
]
}

But that not work… Could you help me please ?

PatternProperties are support or not ? I’m using v3.3 on angular.

Best regards,
Valentin

Hi @vvalette,

We only support patternProperties in the vue-vuetify renderer set(s). In the others you can add a custom renderer to support them yourself. If you like you can then also contribute the renderer to our renderer sets.

Hi,

Thanks for your return. Nobody already develop this kind of renderer ?

Best regards,
Valentin VALETTE

I’m not aware of such an implementation for Angular (the vue-vuetify implementation is linked above), but of course someone could very well have implemented it for themselves without sharing it here.