title: How to use JSON Schema to require one of two fields
body: <p>I want to validate JSON to make one of two fields manadatory.</p>
  
  <p>Let's assume we have two fields (Email Address and Phone Number).  I want to make sure that one of the two fields is required for the record to be valid.</p>
  
  <pre><code>{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "ExampleID-0212",
    "title": "objectExamples",
    "description": "Demo",
    "type": "object",
    "properties": {
      "RecordObject": {
        "type": "object",
        "properties": {
          "emailAddress": {
            "type": "string"
          },
          "PhoneNumber": {
            "type": "number"
          }
        }
      }
    },
    "required": [
      "RecordObject"
    ]
  }
  </code></pre>