#2624 Nested target methods should be inherited for forged Map to Bean methods#2626
#2624 Nested target methods should be inherited for forged Map to Bean methods#2626filiphr merged 1 commit intomapstruct:mastermapstruct/mapstruct:masterfrom
Conversation
…ap to Bean methods
|
|
||
| Issue2624Mapper INSTANCE = Mappers.getMapper( Issue2624Mapper.class ); | ||
|
|
||
| @Mapping( target = "department.id", source = "did") |
There was a problem hiding this comment.
nice.. Just a thought.. you can't map nested sources, right? Since we don't know the type of the 'value' in the map if it's a Map<String, Object>..
I'm not sure how explicit the documentation is in this area (I remember that we discussed having a sourceType in @Mapping). And especially with reverting mappings (later on), this might to start to play a role. So also, perhaps we need to extend the documentation in this area.
I don't dare to ask 😄 .. but what happens if you specify a @Mapping(target = ".", source = "did")?
There was a problem hiding this comment.
nice.. Just a thought.. you can't map nested sources, right? Since we don't know the type of the 'value' in the map if it's a
Map<String, Object>..
No we can't, that has already been reported in #2553
I don't dare to ask 😄 .. but what happens if you specify a
@Mapping(target = ".", source = "did")?
You just did 😄 . I haven't tested this, but it will try to map whatever type the map value is to the current target. I don't really see a use case for this, so I'll rather wait for someone to complain about it 😄
Fixes #2624