Skip to content

Introspect controller methods on startup to determine if they need validation #445

Closed
@rstoyanchev

Description

@rstoyanchev

There is a known issue with standard bean validation and Kotlin coroutine method, which we cannot address here, see #344, but as it stands our built-in support applies bean validation to every controller method as long as it's on the classpath. That means if you do want bean validation in some places, you can't opt out of it for coroutine methods even if they don't need it.

We should improve how the built-in validation support gets applied. For example, on startup, check if a controller method or its parameters has @Valid, or any other annotations marked with @Constraint. We'll also use Validator#getConstraintsForClass to check for constrained properties on complex Objects. Once we know what methods need validation, we'll use that at runtime to apply validation only where it is expected.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions