{
"type": "Control",
"scope": "#/properties/personalInformation/properties/firstName",
"label": "First Name",
"options": {
"format": "textField",
"hideFromCustomer": true
}
},
{
"type": "Control",
"scope": "#/properties/personalInformation/properties/middleName",
"label": "Middle Name",
"options": {
"format": "textField",
"hideFromCustomer": true
}
},
{
"type": "Control",
"scope": "#/properties/personalInformation/properties/lastName",
"label": "Last Name",
"options": {
"format": "textField",
"hideFromCustomer": true
},
"rule": {
"effect": "SHOW",
"condition": {
"allOf": [
{
"scope": "#/properties/personalInformation/properties/firstName",
"schema": {
"const": "John"
}
},
{
"scope": "#/properties/personalInformation/properties/middleName",
"schema": {
"const": "Doe"
}
}
]
}
}
}
The provided rule in the JSON Forms UI schema is invalid because it attempts to use allOf inside the condition. The condition object only supports a single scope and schema property.
By raising the scope to #/properties/personalInformation and defining the allOf logic within the schema property, you can achieve the desired behavior.
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/personalInformation",
"schema": {
"allOf": [
{
"required": ["firstName"],
"properties": {
"firstName": {
"const": "John"
}
}
},
{
"required": ["middleName"],
"properties": {
"middleName": {
"const": "Doe"
}
}
}
]
}
}
}