title: JSON Schema conditional: require and not require
body: <p>I'm trying to implement this condition: if a particular property exists, then another property is required; but if it does not exist, another one is not required.</p>
  
  <p>Also, in JSON schemas, can we use not in dependencies?</p>
  
  <p>Here is a sample schema</p>
  
  <pre><code>var schema = {
      "properties": {
          "smaller": {
              "type": "number"
          },
          "larger": { "type": "number" },
          "medium":{'type':'string'},
          "bulky":{'type':'string'}
      },
      require:['smaller','larger'],
      additionalProperties:false
  };
  </code></pre>
  
  <p>If "medium" is present, then "bulky" is required. Otherwise, "bulky" is not required.</p>
  
  <p>Here "not required" means that if "medium" doesn't exist, then bulky must not be present.</p>