Conventions of parameter order in annotations

66 views
Skip to first unread message

Jeroen van Wilgenburg

unread,
Dec 30, 2020, 6:30:32 AM12/30/20
to mapstruct-users
Are there any conventions on the order of the parameters in the @Mapping annotations?

The mapstruct documentation is not consistent here.
Examples: 
@Mapping(target = "label", source = "designation")
@Mapping(source = "make", target = "manufacturer")

The intellij plugin puts target first.

So I'm a bit confused, I think it would be nice to have a convention (and want to help with updating the docs if people think it is useful).

Filip Hrisafov

unread,
Feb 27, 2021, 11:29:26 AM2/27/21
to mapstruct-users
Hey Jeroen,

Our convention is to put the target first and then the source. If we have an inconsistency in the documentation, then we need to fix that.

Cheers,
Filip

Reply all
Reply to author
Forward
0 new messages