When using multiple arguments in a @Mapper, it seems that the @Context arguments is unreachable
public interface MyMapper {
@Mapping(target="target1", source="arg1.arg") //works
@Mapping(target="target2", source="arg2") //works
@Mapping(target="target3", source="arg2.arg") //works
@Mapping(target="target2", source="context.arg") //NOT WORKING
public MyTarget convert(Object arg1, Object arg2, @Context Object context);
}
I am trying to use and expression=""
to work around it, but I can't get it to work.
Any suggestions?
I can see I am not the only one to ever wish this. https://github.com/mapstruct/mapstruct/issues/1280
Thanks