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

MappingMongoConverter#writePropertyInternal should prefer custom converters before simple type conversion.

Open ianmelendez95 opened this issue 3 years ago • 0 comments

org.springframework.data.mongodb.core.convert.MappingMongoConverter#writePropertyInternal(Object, DocumentAccessor, MongoPersistentProperty) appears to prefer serializing as a collection/map before checking if there are custom converters.

This is different than MappingMongoConverter#writeInternal(Object, Bson, TypeInformation), where the custom target is honored first. Is this by design? What is the reasoning for treating properties any differently than the objects themselves?

ianmelendez95 avatar Jul 19 '22 18:07 ianmelendez95