title: Karate DSL : How to check if the JSON object is optional, but if that object comes the keys inside that object should be of correct schema?
body: <p>I want to validate a JSON schema where an object in a nested JSON response is optional but if the object comes the keys in that object should also come.</p>
  
  <p>Sample Response :-</p>
  
  <pre><code>{
      "id" : "1234",
      "targetPhoneNumber" : "1234",
      "paid" : { //optional
        "units" : "asd", //mandatory if the paid object is coming
        "amount" : 12.00 //mandatory if the paid object is coming
      },
      "date" : "2019",
      "boolean" : false,
      "transactionId" : "1234"
    }
  </code></pre>
  
  <p>I need schema checks for these cases.</p>
  
  <p>1) If the paid object is coming it should be a JSON object and should contains units as string and amount as mandatory.
  2) If the paid object is not coming still the schema validation should pass.</p>