Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ private MessageInterpolatorContext buildHibernateContext(Map<String, Object> mes
);

Map<String, Object> expressionVariables = StandardELVariables.standardELVars(validationEnvironment);
expressionVariables.putAll(messageParams);

Class<?> rootBeanType = null;
Path propertyPath = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ResourceBundleMessageInterpolatorTest extends Specification {
def interpolatorUnderTest = new ResourceBundleMessageInterpolator()

def validatedValue = [zig: "zag"]
def messageParams = ["validatedValue": validatedValue, "p1": "pv1", "p2": "pv2", "min": "5", "max": "10", path : "a/b/c"]
def messageParams = ["validatedValue": validatedValue, "p1": "pv1", "p2": "pv2", "min": "5", "max": "10", path : "a/b/c", "value" : "100", "inclusive" : true]
ValidationEnvironment validationEnvironment = buildEnv(schema, "arg", validatedValue, interpolatorUnderTest, null)

expect:
Expand All @@ -66,6 +66,8 @@ class ResourceBundleMessageInterpolatorTest extends Specification {
'graphql.test.message' | 'Test message with expressions : zag and replacements : pv1'
// system level message finding from graphql.validation
'graphql.validation.Size.message' | 'a/b/c size must be between 5 and 10'
// message with el expression
'graphql.validation.DecimalMax.message' | 'a/b/c must be less than or equal to 100'
// expressions
'Could not ${validatedValue.zig}' | 'Could not zag'
// message param replacement
Expand Down