Enabling templating
Enable templating for a stub by ticking the “Enable templating” box in the Response section:


Handlebars overview
A complete description of the Handlebars syntax and core helpers can be found on the Handlebars JS, but we’ll cover the essentials here. Handlebars works like many other template languages - a template is provided a data model and uses a special tag syntax to denote dynamic elements, referred to as a “helper” in this case. Helpers are always delimited by double or triple curly braces ({ and }). In the simplest case a helper can
simply output the value of a variable in the model:
Helper parameters
Helpers can take both positional and named parameters. In both cases they are delimited by spaces. The following helper takes three positional parameters - the string in which the replacement should take place, the substring to find and the replacement value:name=value. The following helper has a single
positional parameter followed by a parameter named format:
Nesting helpers
Sometimes it’s necessary to apply a helper to the result of another one. This can be achieved by nesting helpers using bracket syntax. For example, this template will truncate the input string, then capitalise the first letter:Blocks
Blocks can be used to apply processing to an inner piece of content.HTML escaping
We mentioned earlier that double or triple curly braces are used to delimit helpers. The difference between these two forms is that with double braces, Handlebars will automatically HTML escape the output of the helper, whereas with triple braces no escaping will be applied. For instance, suppose we have a data model where the variabletag has the value <html>.
The template