[hibernate-issues] [JIRA] (HV-1794) Optional containing a list of items is not being validated

Ihor Mochurad (JIRA) jira at hibernate.atlassian.net
Thu Jul 23 09:12:59 EDT 2020


Ihor Mochurad ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ccb2fc050ff750e51016e32 ) *commented* on HV-1794 ( https://hibernate.atlassian.net/browse/HV-1794?atlOrigin=eyJpIjoiOTRiNDQxOTc4NGQwNGE1NmE2OWEwMTc5NjI5MmE2ZmIiLCJwIjoiaiJ9 )

Re: Optional containing a list of items is not being validated ( https://hibernate.atlassian.net/browse/HV-1794?atlOrigin=eyJpIjoiOTRiNDQxOTc4NGQwNGE1NmE2OWEwMTc5NjI5MmE2ZmIiLCJwIjoiaiJ9 )

Ok, but even if I add @Valid in front of the dto, I am getting:

org.springframework.beans.InvalidPropertyException: Invalid property 'consumerGroups [0] ' of bean class [...ApplicationDTO] : Illegal attempt to get property 'consumerGroups' threw exception; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'consumerGroups [0] ' of bean class [...ApplicationDTO] : Property referenced in indexed property path 'consumerGroups [0] ' is neither an array nor a List nor a Set nor a Map; returned value was [Optional[ [ConsumerGroupDTO(consumerGroupId=, simpleConsumerGroup=false)] ]]

This seems like a bug, it doesn’t generate a proper constraint violation.

( https://hibernate.atlassian.net/browse/HV-1794#add-comment?atlOrigin=eyJpIjoiOTRiNDQxOTc4NGQwNGE1NmE2OWEwMTc5NjI5MmE2ZmIiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HV-1794#add-comment?atlOrigin=eyJpIjoiOTRiNDQxOTc4NGQwNGE1NmE2OWEwMTc5NjI5MmE2ZmIiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100134- sha1:0043a36 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200723/45c6ff95/attachment.html 


More information about the hibernate-issues mailing list