Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add equality between Enums and Strings. #271

Open
mattcoley opened this issue Jan 9, 2019 · 3 comments
Open

Add equality between Enums and Strings. #271

mattcoley opened this issue Jan 9, 2019 · 3 comments

Comments

@mattcoley
Copy link
Collaborator

There isn't a way to declare an enum value in Jinjava which makes it difficult to check for different enum values.
{% if enum == 'ENUM_VALUE' %} should ideally work since {{ enum }} will display a string value.

@hs-lsong
Copy link
Collaborator

hs-lsong commented Jan 9, 2019

Is enum usually integers?

@mattcoley
Copy link
Collaborator Author

In the HubSpot case, the enum would be something like a language enum that would print out the language tag en, ge, jp, etc.

@mattcoley
Copy link
Collaborator Author

mattcoley commented Jan 30, 2019

The hacky way to get around this is to do |string on an object to convert these enums to strings. We need a better long term solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants