title: if-then-else in JSON schema for multiple fields
body: <p>How can I make few fields as "required" based on condition?</p>
  
  <p>For example; in below case if <strong>status</strong>==Failed then i want only four fields as required ("orgId",
              "subunitId",
              "fundOutType",
              "status") 
  but any other value of <strong>status</strong> will change the required field list: ("transactionId",
              "orgId",
              "subunitId",
              "fundOutType",
              "fundOutAmount",
              "status")</p>
  
  <p>My below solution is not working. Please help.</p>
  
  <pre><code>{
      "$schema": "http://json-schema.org/draft-07/schema#",
      "versionId": "1.0",
      "javaInterfaces": [
          "java.io.Serializable"
      ],
      "type": "object",
      "properties": {
          "transactionId": {
              "type": "string"
          },
          "orgId": {
              "type": "string"
          },
          "subunitId": {
              "type": "string"
          },
          "fundOutType": {
              "type": "string"
          },
          "fundOutAmount": {
              "type": "string"
          },
          "status": {
              "type": "string"
          },
          "lang": {
              "type": "string"
          },
          "transactionCreatedDateTime": {
              "type": "integer",
              "format": "date-time"
          },
          "userId": {
              "type": "string"
          }
      },
      "if": {
          "properties": {
              "status": {
                  "const": "Failed"
              }
          },
          "required": [ "status" ]
      },
      "then": {
          "required": [
              "orgId",
              "subunitId",
              "fundOutType",
              "status"
          ]
      },
      "else": {
          "required": [
              "transactionId",
              "orgId",
              "subunitId",
              "fundOutType",
              "fundOutAmount",
              "status"
          ]
      }
  }
  </code></pre>