I want to conditionally render an input field depending on a checkbox checked.
This checkbox is nested and I dont know how to access it.
I got this to work:
{
"type": "object",
"properties": {
"firstName": {
"type": "boolean"
}
},
"dependencies": {
"firstName": {
"oneOf": [
{
"properties": {
"firstName": {
"enum": [true]
},
"lastName": {
"type": "string"
}
}
}
]
}
}
}
Now what if the dependency is nested like so?:
{
"type": "object",
"properties": {
"test": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
}
}
},
"dependencies": {
"test": {
"enabled": {
"oneOf": [
{
"properties": {
"enabled": {
"enum": [true]
},
"lastName": {
"type": "string"
}
}
}
]
}
}
}
}
as you can see: I have tried to access it but it is not recognized correctly. How would I approach this problem? Is this even possible?
JSON Scheme Validator says its valid