There is a way, but it is not very. You need to use the anyOf keyword to determine how you want to check it if secure is true and how you want it to check when secure is false .
{ "type": "object", "properties": { "secure": { "title": "Serve files over HTTPS", "description": "Flag telling whether to serve contents over HTTPS and WSS", "type": "boolean" } }, "anyOf": [ { "type": "object", "properties": { "secure": { "enum": [true] }, "certificate": { "title": "Certificate file", "description": "Location of the certificate file", "type": "string" }, "privateKey": { "title": "Private key file", "description": "Location of the private key file", "type": "string" } }, "required": ["certificate", "privateKey"] }, { "type": "object", "properties": { "secure": { "enum": [false] } } } ] }
Jason source share