You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicclassUser {
privateStringid;
privateStringemail;
privatePermission[] permissions;
// more code omitted for brevity
}
I'd be able to get a mapper to map the Java POJO to
message UserDTO {
string id = 1;
string email = 2;
repeated PermissionDTO permissions = 3;
// more code omitted for brevity
}
Which would map the permission array to the proto permissionsList through the adder pattern.
Actual behavior
The auto-code generation fails because the generated code tries to directly add the whole array instead of iterating over it, map each value on its own and add it to the list.
The pushed code is using the latest snapshot, mostly because I was using the latest snapshot version while testing it out locally. Keep in mind that the linked commit won't build.
Expected behavior
I would expect that given
I'd be able to get a mapper to map the Java POJO to
Which would map the
permissionarray to the protopermissionsListthrough the adder pattern.Actual behavior
The auto-code generation fails because the generated code tries to directly add the whole array instead of iterating over it, map each value on its own and add it to the list.
Steps to reproduce the problem
I modified the public Protobuff example so it fails
eroznik/mapstruct-examples@f4c3a4e
The pushed code is using the latest snapshot, mostly because I was using the latest snapshot version while testing it out locally. Keep in mind that the linked commit won't build.
MapStruct Version
All versions that I tested.