import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; /** The target record has a component (note) that the source does not have. */ @Mapper(unmappedTargetPolicy = ReportingPolicy.ERROR) public interface BrokenMapper { record Src(String name, int qty) { } record Dst(String name, int qty, String note) { } Dst map(Src src); }