https://linen.dev logo
#help
Title
# help
p

Papop Lekhapanyaporn

12/12/2023, 2:12 PM
Hi everyone, Im trying to use wiremock standalone with handlebars and i got this error can someone help me look into this? my handlebar file
Copy code
{ {{#if {{jsonPath request.body '$.immediatereject'}}}}
        "immediatereject":{{jsonPath request.body '$.client'}},
    {{else}}
        "secret":"secret",
    {{/if}}
    "client":{{jsonPath request.body '$.client'}},
    "status":200,
}
error:
Copy code
Error 500
      wiremock.com.google.common.util.concurrent.UncheckedExecutionException:
      wiremock.com.github.jknack.handlebars.HandlebarsException:
      inline@107c9fbe:2:11: found: '{'
      {{#if {{jsonPath request.body '$.immediatereject'}}}}
      ^
t

Tom

12/12/2023, 2:15 PM
Hi @Papop Lekhapanyaporn the issue is the syntax for nested helper calls. You need ( rather than { for inner calls:
Copy code
{{#if (jsonPath request.body '$.immediatereject')}}
p

Papop Lekhapanyaporn

12/12/2023, 2:17 PM
Tysm 🙂. the problem is resolved now!
👍 1
3 Views