Hi Timo,
Thanks for the nice feedback. Very glad to hear you like MapStruct!
What you are trying to do is not directly possible as you found out already. Could you describe the actual use case for this and maybe give a "real world" example where it would be useful?
If you really only have a list of strings and the target bean has no further properties, I would simply write a method for that from hand. You e.g. can do so by making your mapper an abstract class and just add that method yourself. Or you "import" it from a hand-written mapper type via @Mapper#uses().
If your target bean actually has more properties besides the string list and these properties are to be populated from another source bean, you could leverage a mapping method with several source objects:
CustomerDto customerAndPhoneListToDto(Customer customer, List<String> phoneNumbers);
This would populate all the CustomerDto properties with the corresponding properties from the given Customer object and only the "phoneNumbers" property would be populated with the given list. If the "customer" object itself had a list of phone numbers already but you wanted to propagate the separately given list instead, you could do so like this:
@Mapping(target="phoneNumbers", source="extraPhoneNumbers")
CustomerDto customerAndPhoneListToDto(Customer customer, List<String> extraPhoneNumbers);
Hth,
--Gunnar