Skip to content

Disable validation for filtered fields#1472

Open
poutsma wants to merge 1 commit intoembabel:mainfrom
poutsma:gh-1471
Open

Disable validation for filtered fields#1472
poutsma wants to merge 1 commit intoembabel:mainfrom
poutsma:gh-1471

Conversation

@poutsma
Copy link
Contributor

@poutsma poutsma commented Mar 6, 2026

This PR disables Jakarta validation for fields/properties that have been disabled using the field filter.

Closes: gh-1471

This commit disables Jakarta validation for fields/properties that have
been disabled using the field filter.

Closes: embabelgh-1471

Signed-off-by: Arjen Poutsma <poutsma@mac.com>
@poutsma poutsma requested review from igordayen and johnsonr March 6, 2026 12:41
fieldFilter: Predicate<Field>,
): Set<ConstraintViolation<O>> =
constraintViolations.filterTo(mutableSetOf()) { violation ->
runCatching { outputClass.getDeclaredField(violation.propertyPath.toString()) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Copy link
Contributor

@igordayen igordayen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

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.

Jakarta validation not disabled for fields excluded by filter

2 participants