Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changelog/112706.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 112706
summary: Configure keeping source in `FieldMapper`
area: Mapping
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ private Optional<MatchResult> matchWithFieldSpecificMatcher(String fieldName, Li

// Checks for scenarios when source is stored exactly and therefore can be compared without special logic.
private boolean sourceMatchesExactly(MappingTransforms.FieldMapping mapping, List<Object> expectedValues) {
return mapping.parentMappingParameters().stream().anyMatch(m -> m.getOrDefault("enabled", "true").equals("false"));
return mapping.parentMappingParameters().stream().anyMatch(m -> m.getOrDefault("enabled", "true").equals("false"))
|| mapping.mappingParameters().getOrDefault("synthetic_source_keep", "none").equals("all")
|| expectedValues.size() > 1 && mapping.mappingParameters().getOrDefault("synthetic_source_keep", "none").equals("arrays");
}

private MatchResult matchWithGenericMatcher(List<Object> actualValues, List<Object> expectedValues) {
Expand Down
Loading