-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Mapping from map to bean #2471
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
Mapping from map to bean #2471
Conversation
|
One think that I forgot to add is the warning about raw map or a map that does not have Is there something in backwards compatibility way that we need to think about? |
|
Thanks for bringing this feature further! From what i understand about the polishing, it looks great! So i agree 👍 . But if i understand it correct, in this case the message will only be a warning and does not stop the mapper from working, am i correct? |
sjaakd
left a comment
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.
Only a few minor's..
processor/src/main/java/org/mapstruct/ap/internal/util/Message.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/org/mapstruct/ap/internal/util/Message.java
Outdated
Show resolved
Hide resolved
|
@filiphr .. I guess we do need to update the documentation as well.. right? |
You are right @sjaakd. I will add some documentation to this as well.
@ckosmowski yes there will be a warning. However, the mapping will not work in this case because raw maps are skipped. Your implementation was doing that already. Check: I added the assertions, but the was null anyways. Only a |
|
@sjaakd, I've added some docs, added some more tests and also addressed your comments about the warning messages. Please have a look and let me know what you think. |
sjaakd
left a comment
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.
@filiphr . LGTM in general. Though the generated code doesn't look as it should be.
documentation/src/main/asciidoc/chapter-3-defining-a-mapper.asciidoc
Outdated
Show resolved
Hide resolved
|
|
||
| [WARNING] | ||
| ==== | ||
| When a raw map or a map that does not have a String as a key is used, then a warning will be generated. |
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.
How is the key interpreted in such case.. guess we need to add that in the doc.
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.
It isn't, I thought that it is clear at the beginning of the section
There are situations when a mapping from a
Map<String, ???>into a specific bean is needed.
Co-authored-by: Filip Hrisafov <[email protected]>
|
Awesome that this change made it to the project! Thanks guys. I would love to be added to the copyright notice of the project like the other contributors if possible as a reference. Thanks in advance :-) |
|
Thanks for letting us know @ckosmowski. You've been added to the copyright notice 0b2c7e5. I did a pass of all the commits, but it seems like I missed you. Sorry about that |
|
Thanks, nevermind! |
This supersedes #2317. @ckosmowski did an amazing job, I only polished it a bit and fixed the merge conflicts.
@ckosmowski let me know if you don't agree with some of my changes.
Fixes #1075
Open points: