You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem description
It is possible to specify Expression.Values which contains other expressions. Validations that are missing in this scenario:
Expressions which are inside are not validated - missing validation propagation to expressions inside Expression.Values.
Values returned from different expressions are not validated (e.g. values(String.class, value("${fact.longValue}")) - longValue is not String)
Suggested solution
Add missing Expression.Values traversing in ReferenceValidator (with tests)
Add validation for types in ReferenceValidator. Placeholders types should be resolved by the current logic. Remember to use isAssignableFrom. Cover null cases. Cover nested values() - might require collections checks. If logic with isAssignableFrom is too complicated consider using commons-lang utils.
Acceptance criteria
Problems 1 and 2 are successfully reported by ReferenceValidator
Tests are prepared
Documentation is updated
Code review is done
The text was updated successfully, but these errors were encountered:
I have thought about this issue. There is no type validation for value("${...}") in Expression. It would be probably better to implement this in more generic way. Implementing this only for Expession.Values would be not generic enough to extend it further for Expression.Value for other Expression uses. By other Expression uses I mean for example:
In above example it is not possible to know what type "context" should be. In such cases we could assume Object type and fail on runtime. The same will happen on function calls in predicate.
I would suggest to implement this in more generic way by creating new tree structure basing on predicate in Rule model. This tree would contain types. By traversing this tree we could find conflicts in types.
Problem description
It is possible to specify Expression.Values which contains other expressions. Validations that are missing in this scenario:
Suggested solution
Acceptance criteria
The text was updated successfully, but these errors were encountered: