Skip to content

Conversation

@eroznik
Copy link
Contributor

@eroznik eroznik commented Feb 17, 2023

This PR offers a potential fix for the problem that I described in #3165 .

Fixes #3165
Fixes #3129

@filiphr
Copy link
Member

filiphr commented Apr 15, 2023

This fix looks OK. However, there are tests missing. If you would like for us to accept this PR please provide tests.

By the way the support is not really linked to protobuf. It is rather linked to not being able to map an array to a collection / iterable using an adder. It would be good to add tests like that (not with protobuf).

@eroznik eroznik force-pushed the 3165/protobuff-array-to-list branch from 667c2ce to fb8de95 Compare April 15, 2023 17:12
@eroznik eroznik changed the title #3165: support for mapping array to protobuff list/repeatable #3165: support for array to collection with adder preferred Apr 15, 2023
@eroznik
Copy link
Contributor Author

eroznik commented Apr 15, 2023

@filiphr i've just added a test case for the issue, lmk if thats what you expected.. (:

Copy link
Member

@filiphr filiphr left a comment

Choose a reason for hiding this comment

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

The test you added is good. Would be nice if you can also add a test where the source is Iterable<String>. I think that it won't work without the changes I am mentioning in the comments

@filiphr
Copy link
Member

filiphr commented Apr 22, 2023

I think that with the addition of the other tests we are going to show that this is also going to fix #3129 and actually make PR #3130 obsolete

@eroznik
Copy link
Contributor Author

eroznik commented Apr 23, 2023

Added test case for iterable mapping + the required code changes so the test passes

@filiphr filiphr merged commit 4843123 into mapstruct:main May 1, 2023
@filiphr
Copy link
Member

filiphr commented May 1, 2023

Thanks @eroznik

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.

Arrays cannot be mapped to collection / iterable using an adder method CollectionMappingStrategy.ADDER_PREFERRED is not supported for Iterables

2 participants