spring-data-redis icon indicating copy to clipboard operation
spring-data-redis copied to clipboard

MappingRedisConverter deserializes collections as nulls if it is empty

Open Numbedme opened this issue 3 years ago • 1 comments

Method readCollectionOrArray creates a collection, although if there are no keys it returns null, which seems kinda strange. Wouldn't it be more client-friendly to return an empty list? For example:


@RedisHash("Entity")
public class Entity {
    @Id
    private long id;

    @Indexed
    private List<String> props;
}

props will be null on query if it was saved as an empty list

Numbedme avatar Apr 10 '22 07:04 Numbedme