You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a binder has @Validated set on its AbstractExtendedBindingProperties implementation, then annotation-driven validation works as expected when bindings have at least one configs set through a binding-specific config option (i.e. spring.cloud.stream.<binder-type>.bindings.<binding-name>.(consumer|producer).<property-name>).
e.g.: Suppose batch-max-size=0 in the following config is invalid (@Min(1)):
This is a bit tricky as it involves hierarchy of standard @ConfiguirationProperties and their extensions. The same problem is in Rabbit and Kafka, but I am close to figuring it out
Describe the issue
If a binder has
@Validated
set on itsAbstractExtendedBindingProperties
implementation, then annotation-driven validation works as expected when bindings have at least one configs set through a binding-specific config option (i.e.spring.cloud.stream.<binder-type>.bindings.<binding-name>.(consumer|producer).<property-name>
).e.g.: Suppose
batch-max-size=0
in the following config is invalid (@Min(1)
):Then validation would successfully fail here, because there's at least one config explicitly referring to the binding,
my-input-binding
:But if the binding is configured only through default configs, then config validation doesn't work:
In this config,
batch-max-size=0
isn't validated because there was no explicit configuration referring tomy-input-binding
.To Reproduce
Steps to reproduce the behavior:
@Validated
to a binder'sAbstractExtendedBindingProperties
, whose consumer or producer bindings has a constraint annotation like@Min()
.application.yml
orapplication.properties
to fail the constraint through a default binding config.Version of the framework
Spring Boot:
3.3.1
Spring Cloud:
2023.0.2
Expected behavior
Expected validation to work when bindings are only configured through default values.
Additional context
Please tag as
[solace]
.The text was updated successfully, but these errors were encountered: