Skip to content

Query exposed through Spring-Data-Rest will throw an exception if configured a filter on a List of enums #3502

Description

@antonioT90

The following line of class ReflectionRepositoryInvoker
result[i] = targetType.isInstance(value) ? value : convert(value, param);
In case of targetType List doesn't verify if the generic element required is an enum or a String, skipping the conversion into List of enum.
Hibernate will throw an exception if we provide at least 2 elements.
The convert method, skipped due to the true condition, would have handled the conversion avoiding the error

result[i] = targetType.isInstance(value) ? value : convert(value, param);

I reproduced the error on the following repository:
https://github.com/antonioT90/spring-data-rest-enums-errors-sample

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions