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.

Hello, how implement custom renderers with Angular ? I’m trying to implement it with Angular but not work… And there is no documentation for angular. Could you help me ?

Best regards

Hi @vvalette,

I would like to recommend checking our off-the-shelf Angular Material renderers in the main repository. There is no difference between custom renderers and our provided renderers, so you can check how they are implemented and do the same.

Ok thanks for your reply, moreover I’m testing with VueJS but seems “patternpropperty” don’t work as well… Do you have an exemple please ?

Thanks a lot for your help

The only renderer set of ours which supports pattern properties is the vue-vuetify renderer set as linked above.