What you want to do can be achieved using the not
keyword. If the not
schema validates, the parent schema will not validate.
{
"type": "object",
"properties": {
"x": { "type": "integer" }
},
"required": [ "x" ],
"not": { "required": [ "z" ] }
}