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

Check unknown target properties in new `@Ignored` annotation

Open thunderhook opened this issue 6 months ago • 0 comments

Referencing a target that does not exist results in a compilation error. Therefore we should support the check of target properties (MapstructTargetReference) for that annotation.

interface FooMapper {

    @Ignored(targets = "nonExistent") // mark this as unknown
    CarDto map(Car car);
}

This should also work for nested properties like @Ignored(targets = "driver.name").

Beware that writing it as an array must also work:

@Ignored(targets = { "a", "b" })

thunderhook avatar Jul 20 '25 19:07 thunderhook