Skip to content

Syntax error when using is defined with a filter #1226

Open
@ccutrer

Description

@ccutrer

Template:

  {% if value_json.name | first is defined %}a{% else %}b{% endif %}

With binding:

{
  "name": [ "c" ]
}

raises com.hubspot.jinjava.interpret.FatalTemplateErrorsException: Error parsing 'value_json.name | first is defined': syntax error at position 27, encountered 'is', expected '}'

This works in Python Jinja. I can work around with parentheses:

{% if (value_json.name | first) is defined %}a{% else %}b{% endif %}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions