We want to be able to set an unmappedSourcePolicy to ReportingPolicy.ERROR, so that by default missing sources fail loudly. However, there will be times when the source object model contains something not relevant to the target. So we are looking to be able to do something like:
@Mapping(source = "fieldToIgnore", ignore = true)
Like can be done for targets. If I try the above, I get errors because target is required in a mapping.
Source properties can be ignored by using BeanMapping#ignoreUnmappedSourceProperties
. In your case you can do
@BeanMapping(ignoreUnmappedSourceProperties = { "fieldToIgnore" })