Unmapped source properties
error when source is mapped to a nested field of the target object
#2781
Labels
Milestone
An example to reproduce this issue can be found in this repository
The issue is easily reproducible with this simple mapping:
Where
MyTarget.nested
is of typeMySource
When
unmappedSourcePolicy
is set toReportingPolicy.ERROR
, the report producesUnmapped source properties
error (or warning in the case ofReportingPolicy.WARN
)The mapping code is generated correctly. For
ReportingPolicy.ERROR
, the following workaround is necessary in order to get a successful build:@BeanMapping(ignoreUnmappedSourceProperties = { "field1", "field2" })
Where
"field1", "field2"
are the fields ofMySource
MapStruct version is
1.4.2.Final
Best regards
JC
The text was updated successfully, but these errors were encountered: