Skip to content

Commit 8ef499b

Browse files
committed
Change
1 parent a18d776 commit 8ef499b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

server/src/main/java/org/elasticsearch/ingest/ESONSource.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,18 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
401401
case ESONArray a -> a.toXContent(builder, params);
402402
case FixedValue v -> v.writeToXContent(builder, objectValues.get());
403403
case VariableValue v -> v.writeToXContent(builder, objectValues.get());
404-
case Mutation m -> builder.value(m.object());
404+
case Mutation m -> {
405+
Object object = m.object();
406+
if (object instanceof Map) {
407+
@SuppressWarnings("unchecked")
408+
final Map<String, ?> valueMap = (Map<String, ?>) object;
409+
builder.map(valueMap, false);
410+
} else {
411+
// TODO: Will check self references on array which is unnecessary
412+
builder.value(object);
413+
}
414+
415+
}
405416
default -> throw new IllegalArgumentException("Unknown type: " + entry.getValue());
406417
}
407418
}

0 commit comments

Comments
 (0)