Skip to content

Commit

Permalink
Fix PassThroughObjectMapper by correctly overriding the merge method
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbarny committed Apr 8, 2024
1 parent 5ec1a75 commit 3e77d23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Expand Up @@ -99,9 +99,14 @@ public PassThroughObjectMapper.Builder newBuilder(IndexVersion indexVersionCreat
return builder;
}

public PassThroughObjectMapper merge(ObjectMapper mergeWith, MapperMergeContext parentBuilderContext) {
final var mergeResult = MergeResult.build(this, mergeWith, parentBuilderContext);
@Override
public PassThroughObjectMapper merge(Mapper mergeWith, MapperMergeContext parentBuilderContext) {
if (mergeWith instanceof PassThroughObjectMapper == false) {
MapperErrors.throwObjectMappingConflictError(mergeWith.name());
}

PassThroughObjectMapper mergeWithObject = (PassThroughObjectMapper) mergeWith;
final var mergeResult = MergeResult.build(this, mergeWithObject, parentBuilderContext);

final Explicit<Boolean> containsDimensions = (mergeWithObject.timeSeriesDimensionSubFields.explicit())
? mergeWithObject.timeSeriesDimensionSubFields
Expand Down
Expand Up @@ -344,6 +344,7 @@ protected MapperMergeContext createChildContext(MapperMergeContext mapperMergeCo
return mapperMergeContext.createChildContext(null, dynamic);
}

@Override
public RootObjectMapper merge(Mapper mergeWith, MapperMergeContext parentMergeContext) {
if (mergeWith instanceof RootObjectMapper == false) {
MapperErrors.throwObjectMappingConflictError(mergeWith.name());
Expand Down

0 comments on commit 3e77d23

Please sign in to comment.