Skip to content

Conversation

@filiphr
Copy link
Member

@filiphr filiphr commented Oct 30, 2021

Fixes #1752

Copy link
Contributor

@sjaakd sjaakd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we need some spent some words in documentation as well.

For the remainder LGTM 👍

@filiphr
Copy link
Member Author

filiphr commented Oct 31, 2021

I guess we need some spent some words in documentation as well.

I checked the docs and we have nothing about this type of update methods. We have something in MappingTarget that only provides an example for "Update exist bean and return it".

I'll add something to the release notes though.

@sjaakd
Copy link
Contributor

sjaakd commented Oct 31, 2021

I checked the docs and we have nothing about this type of update methods. We have something in MappingTarget that only provides an example for "Update exist bean and return it".

I'll add something to the release notes though.

That's fine.. But should we mention these kind of methods in the documentation.? (It's more a completeness question)

@filiphr
Copy link
Member Author

filiphr commented Oct 31, 2021

That's fine.. But should we mention these kind of methods in the documentation.? (It's more a completeness question)

Seems I was wrong. We do have something in the docs:

Instead of void you may also set the method's return type to the type of the target parameter, which will cause the generated implementation to update the passed mapping target and return it as well

I think that this is fine and that we do not need any change, since what we say in the docs is what we are doing now as well.

@filiphr filiphr merged commit 166eb69 into mapstruct:master Oct 31, 2021
@filiphr filiphr deleted the 1752 branch October 31, 2021 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MapStruct should return the target object(which marking with @MappingTarget) when the source object is null

2 participants