Jolt conditional spec
<p>I want a conditional transformation where I need to add a property in output if the value of a specific field in input matches my condition. Below is my input and output required. </p>

<hr>

<p><strong>Input</strong></p>

<pre><code>{
    "attr": [
        {
            "name": "first",
            "validations": [
                {
                    "type": "Required",
                    "value": true
                }
            ]
        },
        {
            "name": "last",
            "validations": [
                {
                    "type": "lenght",
                    "value": "10"
                }
            ]
        },
        {
            "name": "email",
            "validations": [
                {
                    "type": "min",
                    "value": 10
                }
            ]
        }
    ]
}
</code></pre>

<hr>

<p><strong>Output</strong></p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>{
  "out" : [
    {
      "name" : "first",
      "required" : "yes"
    },{
      "name" : "last"
    },{
      "name" : "email"
    }
  ]
}</code></pre>
</div>
</div>
</p>

<p>So I am able to get till the condition, but inside condition, &amp; and @ are being respective to the input rather than to the output. Can anybody help me out with the transformation. Below is the spec i have written so far.</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>[
  {
    "operation": "shift",
    "spec": {
      "attr": {
        "*": {
          "name": "out.&amp;1.name",
          "validations": {
            "*": {
              "type": {
                "Required": {
                  "@(2,value)": "out.&amp;1.req"
                }
              }
            }
          }
        }
      }
    }
  }
]</code></pre>
</div>
</div>
</p>