Skip to content

hurlgen: literal {{ in request body data collides with Hurl templating #33

Description

@emmanuelperu

A request body string that legitimately contains {{ (e.g. {"tpl": "use {{count}} items"}) is written verbatim into the generated .hurl file, where Hurl interprets it as a template variable: the run fails with an undefined-variable error (or substitutes the wrong value if a variable with that name exists).

Pre-existing on main (not introduced by #30): the body has always been emitted verbatim, and the generator's own {{baseUrl}}/{{productId}} templates rely on exactly this interpolation, so the collision is structural.

Possible directions:

  • emit a comment in the generated file when a literal {{ is detected, so the failure is at least diagnosed
  • check whether recent Hurl versions offer an escape for literal braces and use it
  • document the limitation

Low priority: payloads containing literal moustaches are rare.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions