Morning, I’m using the standalone version of Wirem...
# help
e
Morning, I’m using the standalone version of Wiremock and I’m trying to use the response-template for
JWT
. My json looks like this 👇
Copy code
{
  "request": {
    "method": "POST",
    "urlPattern": "/oauth/token"
  },
  "response": {
    "status": 200,
    "transformers": [
      "response-template"
    ],
    "body": "{{{jwt sub='jonsmith'}}}"
  }
}
But I’m receiving a 500 👇
Copy code
Error 500 wiremock.com.google.common.util.concurrent.UncheckedExecutionException:
		wiremock.com.github.jknack.handlebars.HandlebarsException: inline@10512a5a:1:3: could not find helper:
		'jwt'
		{{{jwt sub='jonsmith'}}}
		^
Is the jwt function only available on cloud? Thanks, Emil
o
Yes, it looks like so after looking into the code. For WireMock open source, there is an extension https://github.com/MasonM/wiremock-jwt-extension you may try, but its response templating syntax is different
e
I might be wrong here but this only extracts the contents of the jwt and doesn’t create one like what I’d assume this does? https://docs.wiremock.io/response-templating/jwt/