Hi! I am trying to use environment variables with the templating engine, so that I can modify an output xml based on an environment variable. This is working for me:
in stubs.json
"transformers": ["response-template"],
"bodyFileName": "my.xml",
"transformerParameters": {
"newIp": "192.168.1.1"
}
and in xml file:
uri="https://{{parameters.newIp}}
Now, I would like to use the value of an environment variable instead of hardcoding the IP in the newIp parameter. I have tried setting the variable in docker compose, but then I get java.util.MissingResourceException error. I have been playing with several combinations of {{systemValue type='ENVIRONMENT' key='SERVER_IP' default='127.0.0.1'}} in payload or stub file, but I get the java error or no substitution is performed.
In one case, I got this trace in the output payload:
uri="https//[ERROR Access to SERVER_IP is denied]
How could I do this?
Thanks in advance for your help!