:wave: hi! I am having a problem when trying to u...
# help
l
đź‘‹ hi! I am having a problem when trying to use a helper inside a template, have been looking for hors in the docs but can't find anything, details in đź§µ
I am enabling templating globally when creating the server, like
Copy code
private val wireMockServer = new WireMockServer(
    wireMockConfig().port(port).globalTemplating(true)
  )
and trying to use inside my template a header value, using val as I want it to be
null
if the header is not present as a default value
so inside my json response I have
Copy code
"emId": "{{val request.headers.emId}}",
this worked fine before adding "val" helper but now it throws an error as the helper can't be found but according to the docs it should be available?
Copy code
<tr><th>URI:</th><td>/v1/mock</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>com.google.common.util.concurrent.UncheckedExecutionException: com.github.jknack.handlebars.HandlebarsException: inline@5bc7c21:1:2: could not find helper: &apos;val&apos;
{{val request.headers.emId}}
  ^
</td></tr>
thanks!
l
Hi. What version of WireMock are you using?
The
val
helper was released as part of WireMock
3.6.0
so you will need to be using that version to use the
val
helper
l
ahhhh damn I am using
3.5.4
🤦‍♀️
will try updating, thanks!
l
No worries
🙌 1