public interface CarMapper {
class Details {
public String brand;
public String model;
}
class DetailsDTO {
public String brand;
}
class Car {
public Details details;
}
class CarDTO {
public DetailsDTO detailsDTO;
}
@Mapping(target = "detailsDTO", source = "details")
CarDTO map(Car in);
@InheritInverseConfiguration
@Mapping(target = "details.model", ignore = true)
Car map(CarDTO in);
}
This example mapper results at 1.3.1.Final to this code to be generatedfor the BrandDTO -> Brand mapping:
protected Details detailsDTOToDetails(DetailsDTO detailsDTO) {
if ( detailsDTO == null ) {
return null;
}
Details details = new Details();
details.brand = detailsDTO.brand;
return details;
}
However after upgrading to 1.4.1.Final this is what gets generated:
protected Details carDTOToDetails(CarDTO carDTO) {
if ( carDTO == null ) {
return null;
}
Details details = new Details();
return details;
}
For some strange reason mapstruct is now trying to map CarDTO to Details. In case I specify the full path to the property to ignore like in.details.model than it seems to work. Is that an intentional change or just a regression issue?
This example mapper results at 1.3.1.Final to this code to be generatedfor the BrandDTO -> Brand mapping:
However after upgrading to 1.4.1.Final this is what gets generated:
For some strange reason mapstruct is now trying to map CarDTO to Details. In case I specify the full path to the property to ignore like
in.details.modelthan it seems to work. Is that an intentional change or just a regression issue?