Expression to handle missing input variable in json

Need help in validating and handling missing input variable in json

Have tried many examples using JUEL , FEEL and JAVASCRIPT but didnt work as expected

ex: “test” could be a missing variable in json object

= if(x.y.test=null) then
return null
else
return x.y.test

JUEL
empty x.y.test ? x.y.test : “”