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
We should be able to use it to add validation annotations to the Property type parameter like that:
@NotNullprivateProperty<@Min(10) Integer> number;
But when we do that, it fails with the following error:
jakarta.validation.ConstraintDeclarationException: HV000197: No value extractor found for type parameter 'T' of type com.example.Property.
at org.hibernate.validator.internal.metadata.core.MetaConstraints.addValueExtractorDescriptorForTypeArgumentLocation(MetaConstraints.java:147)
at org.hibernate.validator.internal.metadata.core.MetaConstraints.create(MetaConstraints.java:63)
at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.findTypeUseConstraints(AnnotationMetaDataProvider.java:806)
at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.findTypeArgumentsConstraints(AnnotationMetaDataProvider.java:776)
at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.findTypeAnnotationConstraints(AnnotationMetaDataProvider.java:609)
at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.findPropertyMetaData(AnnotationMetaDataProvider.java:241)
at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getFieldMetaData(AnnotationMetaDataProvider.java:229)
at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.retrieveBeanConfiguration(AnnotationMetaDataProvider.java:130)
at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getBeanConfiguration(AnnotationMetaDataProvider.java:121)
at org.hibernate.validator.internal.metadata.BeanMetaDataManagerImpl.getBeanConfigurationForHierarchy(BeanMetaDataManagerImpl.java:234)
at org.hibernate.validator.internal.metadata.BeanMetaDataManagerImpl.createBeanMetaData(BeanMetaDataManagerImpl.java:201)
at org.hibernate.validator.internal.metadata.BeanMetaDataManagerImpl.getBeanMetaData(BeanMetaDataManagerImpl.java:165)
at org.hibernate.validator.internal.engine.ValidatorImpl.buildNewLocalExecutionContext(ValidatorImpl.java:772)
at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedAnnotatedObjectForCurrentGroup(ValidatorImpl.java:627)
at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:590)
at org.hibernate.validator.internal.engine.ValidatorImpl.validateParametersInContext(ValidatorImpl.java:880)
at org.hibernate.validator.internal.engine.ValidatorImpl.validateParameters(ValidatorImpl.java:283)
at org.hibernate.validator.internal.engine.ValidatorImpl.validateParameters(ValidatorImpl.java:235)
at io.micronaut.validation.ValidatingInterceptor.intercept(ValidatingInterceptor.java:99)
at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:143)
at com.example.$Example$Definition$Intercepted.post(Unknown Source)
at com.example.$Example$Definition$Exec.dispatch(Unknown Source)
See the following reproducer, you can reproduce the error with the following curl command:
if you would like to contribute a PR to resolve this would be appreciated. In general Hibernate Validator support is in maintenance mode and we recommend users switch to Micronaut's implementation
I have no idea where to start, and if it would take long or not.
We may try to update to Micronaut's implementation but as I understand it, it's based on an annotation processor and as our plugins can contribute validators and we don't want too much dependencies between our plugins and Micronaut I'm not sure it will work.
Expected Behavior
We should be able to create a custom value extractor and use it.
Actual Behaviour
Give the following value extractor
We should be able to use it to add validation annotations to the
Property
type parameter like that:But when we do that, it fails with the following error:
See the following reproducer, you can reproduce the error with the following curl command:
value-extractor.zip
You must use Micronaut validation 4.8.0 due to micronaut-projects/micronaut-validation#432
Steps To Reproduce
No response
Environment Information
Ubuntu 24.10
Java 21
Example Application
No response
Version
4.6.3
The text was updated successfully, but these errors were encountered: