Skip to content

Filter upgrades to support kw params - #540

Merged
mattcoley merged 4 commits into
masterfrom
revert-539-revert-534-revert-533-revert-531-feature/abstractfilter-upgrades-1
Dec 9, 2020
Merged

mattcoley merged 4 commits into
masterfrom
revert-539-revert-534-revert-533-revert-531-feature/abstractfilter-upgrades-1

Conversation

@mattcoley

Copy link
Copy Markdown
Contributor

Reverts #539

Looking into some diffs around datetimeformat filter

@mattcoley

Copy link
Copy Markdown
Contributor Author

The main issue has to do with #271. I fixed this by manually overriding the coerceToString method. This has the added effect of enums not roundtripping however, it adds equality between enums and strings which is more desirable. In Jinjava we lose all type information on conversion so we never coerce back to the enum.

@michaelpro1

Copy link
Copy Markdown
Contributor

out of curiousity whats an example of an enum used?

@mattcoley

Copy link
Copy Markdown
Contributor Author

There isn't a way to declare an enum or create one via Jinjava, however an often use case is to add an enum value to the context. Previously functions would typically accept generic Object values and call toString() to extract the String, however the TruthyTypeConverter extends a type converter from Juel that was calling name() which can be different depending on the enum. I am planning on merging this soon and rechecking our diff reports to make sure everything is OK.

@michaelpro1

Copy link
Copy Markdown
Contributor

Noticed that this PR has been sitting for a little while, did you need any help with it?

@mattcoley

Copy link
Copy Markdown
Contributor Author

Let me merge this in again and check our custom diff reports.

@mattcoley
mattcoley merged commit f106bca into master Dec 9, 2020
@mattcoley
mattcoley deleted the revert-539-revert-534-revert-533-revert-531-feature/abstractfilter-upgrades-1 branch December 9, 2020 16:29
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

Successfully merging this pull request may close these issues.

3 participants