mapstruct-idea icon indicating copy to clipboard operation
mapstruct-idea copied to clipboard

Incorrect no source property defined inspection for `@Mapping`

Open filiphr opened this issue 1 year ago • 0 comments

In #153 we added some more extensive support for inspections on mappings. Seems like we were a bit too eager in those inspections.

An inspection like @Mapping(target = "starred", conditionQualifiedByName = "shouldIncludeStarred") is now reported as an error with "No source property defined". However, this is a completely valid mapping, there are others where something similar might happen.

Perhaps we should only report "No source property defined" when only target is defined. However, even in this case when using in combination with @BeanMapping(ignoreByDefault = true) then something like @Mapping(target = "starred") is a valid mapping as well.

filiphr avatar May 02 '24 10:05 filiphr