Skip to content

Conversation

frantuma
Copy link
Contributor

@frantuma frantuma commented Mar 10, 2025

This PR addresses #4804 and replaces #4797, #4246 and #4805 by changing default behavior to only add by default validation when no groups are specified or when they match "context" groups (e.g. specified via Spring Validated annotation or ValidatedParameter new annotation)

It also introduces new configuration fields groupsValidationStrategy and validatorProcessorClass which allow to tweak resolution of validation constraints, see tests in this PR and upcoming wiki update for usage scenarios.

Previous behavior (resolving validation constraints regardless of groups) can be accomplished by passing new configuration property groupsValidationStrategy=always

@frantuma frantuma merged commit 119e5cc into master Mar 10, 2025
5 checks passed
@frantuma frantuma deleted the ticket-4804 branch March 10, 2025 12:09
method.invoke(swaggerLoader, validatorProcessorClass.get());
}

if (defaultResponseCode.isPresent() && StringUtils.isNotBlank(groupsValidationStrategy.get())) {
Copy link

Choose a reason for hiding this comment

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

A bug has been introduced on this line, see #4858.

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.

2 participants