-
-
Notifications
You must be signed in to change notification settings - Fork 40
support Map as MappingSource #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, sorry it took so long. I had a look and just made a few nitpicks.
testData/inspection/UnmappedTargetPropertiesWithFromMapMapping.java
Outdated
Show resolved
Hide resolved
src/main/resources/org/mapstruct/intellij/messages/MapStructBundle.properties
Outdated
Show resolved
Hide resolved
src/main/resources/org/mapstruct/intellij/messages/MapStructBundle.properties
Show resolved
Hide resolved
Thanks for your work on this @hduelme and thanks for the review @thunderhook. I also had a look. I think that the inspection should be on the warning level by default, in order to be aligned to what we are doing in the processor. Apart from that I think we need to be a but more lax, e.g. in the |
@filiphr, @thunderhook, thanks for the feedback. For the |
Thanks @hduelme. Sorry that it took me a bit to review it and merge it.
I am not sure that I understand what you meant with this. However, feel free to create an issue and a fix if you know what the bug is. |
No problem. Thanks for having a look at this @filiphr |
I added support for
Map
asMappingSource
.If only
Map<String, ?>
as a valid source is present, unmapped target warnings/errors are suppressed. This fixes #167I also added an inspection if the Map is raw or does not have a String as a key, like described in MapToBeanRawMapMapper and in MapToBeanTypeCheckMapper. For this I added two fixes, add
<String, String>
if theMap
is raw and replace the key withString
if the key is not of typeString
.