title: JsonSchema: Validate type based on value of another property
body: <p>I am using the following schema to validate my json:</p>
  
  <pre><code>{
      "$schema": "http://json-schema.org/schema#",
      "title": " Rules",
      "description": "Describes a set of rules",
      "type": "object",
      "properties": {
          "rules": {
              "type": "array",
              "items": {
                  "type": "object",
                  "properties": {
                      "precedence": {
                          "type": "number",
                          "minimum": 0
                      },
                      "conditions": {
                          "type": "array",
                          "items": {
                              "type": "object",
                              "properties": {
                                  "field": {
                                      "type": "string",
                                      "enum": [ "Name", "Size" ]
                                  },
                                  "relation": {
                                      "type": "string",
                                      "enum": [ "is", "is not", "is not one of", "is one of" ]
                                  },
                                  "value": {
                                      "type": ["array", "string", "number"]
                                  }
                              },
                              "required": ["field", "relation", "value"],
                              "additionalProperties": false
                          }
                      }                       
                  },
                  "required": ["precedence", "conditions"],
                  "additionalProperties": false
              }
          }
      },
      "required": ["rules"],
      "additionalProperties": false
  }
  </code></pre>
  
  <p>I want to set up a dependency to validate that when the value of the <code>relation</code> property has the value <code>is one of</code> or the value <code>is not one of</code>, then the type of the <code>value</code> property can only be <code>array</code></p>
  
  <p>For example, the following json should not validate because it uses the relation value <code>is not one of</code> and the <code>value</code> property is not an array:</p>
  
  <pre><code>{
      "rules": [{
              "precedence": 0,
              "conditions": [{
                      "field": "Name",
                      "relation": "is not one of",
                      "value": "Mary"
                  }
              ]
          }
      ]
  }
  </code></pre>
  
  <p>Is it possible to set up dependencies to validate this way?</p>