FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Syntax error when using `is defined` with a `filter` · Issue #1226 · HubSpot/jinjava · GitHub

Syntax error when using is defined with a filter #1226

Description

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


    Back | FazBrowse Home | New Git URL