title: Conditions in YAML to easily convert it as JSON
body: <p>I am struck somewhere and maybe even someone else looking into this kind of thing in future</p>
  <p>actually, I have a requirement to convert YAML to JSON and its working fine but the problem is with
  **YAML Conditions **
  For example, my YAML code is like this</p>
  <pre><code>variables:
    - name: isSaltWater
      &quot;${{ if eq(parameters.WaterBody, 'Ocean')}}&quot;:
        value: SaltWater
      &quot;${{  else }}&quot;:
        value: NormalWater
  </code></pre>
  <p>Now if I convert it to JSON it's coming like this</p>
  <pre><code>{
    &quot;variables&quot;: [
      {
        &quot;name&quot;: &quot;isSaltWater&quot;,
        &quot;${{ if eq(parameters.WaterBody, 'Ocean')}}&quot;: {
          &quot;value&quot;: &quot;SaltWater&quot;
        },
        &quot;${{  else }}&quot;: {
          &quot;value&quot;: &quot;NormalWater&quot;
        }
      }
    ]
  }
  
  </code></pre>
  <p>so is there any way in YAML to do it in another way
  so that even if someone creating objects out of JSON will be helpful</p>
  <p><strong>Question is how to handle if else conditions in JSON ?</strong></p>
  <p>please let me know if someone can help me</p>