title: Karate - Is there a way to add a new json key/value pair to an existing JSON object where the key is the same and values are different?
body: <p>I am a newbie at both JavaScript and Karate. This may not be a Karate centric question per se, however, I am wondering if the solution can be done in Karate natively by any chance.</p>
  <p>I have looked at existing questions on here but they don't seem to work likely due to my unique input. This answer looked promising, but it didn't work out for me: <a href="https://stackoverflow.com/questions/53554411/adding-new-key-value-pair-into-json-using-karate">Adding new key-value pair into json using karate</a></p>
  <p>I have a JAVA method that produces a payload consisting of a JSON object (which has a secondary json object in it) for a POST call. The payload looks something like this:</p>
  <pre><code>[
    {
      &quot;keyId&quot;: &quot;s123&quot;,
      &quot;clientId&quot;: &quot;c0909&quot;,
      &quot;regionInfo&quot;: {
        &quot;geoTag&quot;: &quot;3s98d238&quot;,
        &quot;locationId&quot;: 32
      }
    }
  ]
  </code></pre>
  <p>Now I am doing a test where I have to insert a bogus key/value pair into the payload and make sure it is ignored in the POST call itself and we return a 200. I have tried using karate.merge and karate.append, but they have not worked thus far.</p>
  <p>The key value pair looks like this:</p>
  <p><code>{'bogusfield': 'ABC', 'bogusfield': '123', 'bogusfield': 'abc123', 'bogusfield': 'abc123!$%'}</code></p>
  <p>So in total, there will be four POST calls , each with a different value from above .Is ttherea way to get this done? I apologize if I missed on giving any crucial details/and/or if this too newb of a question. Thank you in advance for all the help!</p>