Customizing PropertyNodeNameProvider Not Working in Programmatic Constraint Definition

Description

When using Hibernate Validator's Programmatic Constraint Definition

, the custom PropertyNodeNameProvider does not work as expected. Instead, the default defaultPropertyNodeNameProvider is always used during constraint creation, making it impossible to customize property name resolution for constraint violations.

Upon reviewing the source code, it is observed that the method ConstraintMapping.createConstraintMapping() directly passes the defaultPropertyNodeNameProvider to JavaBeanHelper while creating the DefaultConstraintMapping. This behavior ignores custom PropertyNodeNameProvider

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Labels

Bug Testcase Reminder (view)

Bug reports should generally be accompanied by a test case!

Bug Testcase Reminder (edit)

Bug reports should generally be accompanied by a test case!

Participants

Marko Bekhta
xiaodjan

Components

Fix versions

Affects versions

Priority

Created January 2, 2025 at 10:03 AM
Updated January 17, 2025 at 4:33 PM
Resolved January 17, 2025 at 4:33 PM