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
public class Pojo {
String id;
// ignore getter/setter and other fields
}
@Mapper
public interface MyConverter {
Pojo toPojo(String id, Pojo source);
}
In this toPojo method, field id contains 2 sources, one from id parameter, the other from source object, I expect a "Several possible source properties for target property" error but it uses source.id directly.
Actual behavior
no error
Steps to reproduce the problem
default configuration
MapStruct Version
MapStruct 1.5.5.Final
The text was updated successfully, but these errors were encountered:
This works as designed, the highest priority is properties of the source parameters. Then as as second step it is going to check if the source parameter name matches a target property.
Got it, is it possible to add a config item to enforce the check? in case of adding the new POJO parameter into the existing mapping method, actually the source of mapping might be change and it will be helpful to let the develop know.
Expected behavior
Here is my code
In this
toPojo
method, fieldid
contains 2 sources, one from id parameter, the other from source object, I expect a "Several possible source properties for target property" error but it uses source.id directly.Actual behavior
no error
Steps to reproduce the problem
default configuration
MapStruct Version
MapStruct 1.5.5.Final
The text was updated successfully, but these errors were encountered: