Skip to content

BeanMapping / ignoreByDefault interaction with unmappedSourcePolicy #2560

@incaseoftrouble

Description

@incaseoftrouble

A rather simple issue:

If I specify @BeanMapping(ignoreByDefault = true) and unmappedSourcePolicy != ReportingPolicy.IGNORE, non-mapped source parameters still cause an error. Arguably, this might be the correct behaviour, but I think it is not:

ignoreByDefault basically means "I will do everything manually". In my understanding, reporting policies are there to warn you about things the automatic matching is doing. In particular, if you have an unmappedTargetPolicy + an unmapped target property with ignoreByDefault = true, there are no errors (as, essentially, this throws an ignore = true on every target property). In the current state, this is asymmetric for the unmapped sources case, as @BeanMapping.ignoreUnmappedSourceProperties practically is the equivalent of @Mapping(ignore = true).

Proposal: ignoreByDefault also disables complaints about unmapped source properties :-)

This should be quite easy to implement, if you agree I can submit a PR.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions