How to define a JSON schema that requires at least one of many properties
I would like to know if I can define a JSON schema (draft 4) that requires at least one of many properties possible for an object. I already know of allOf , anyOf and oneOf but just can't figure out how to use them in the way I want. Here are some example JSON to illustrate : // Test Data 1 - Should pass { "email": "hello@example.com", "name": "John Doe" } // Test Data 2 - Should pass { "id": 1, "name": "Jane Doe" } // Test Data 3 - Should pass { "id": 1, "email": "hello@example.com", "name": "John Smith" } // Test Data 4 - Should fail, invalid email { "id": 1, "email": "thisIsNotAnEmail",