diff --git a/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationParams.kt b/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationParams.kt index 0452bc24..0c4f4a53 100644 --- a/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationParams.kt +++ b/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationParams.kt @@ -20,6 +20,7 @@ import org.opensearch.common.xcontent.ObjectParser import org.opensearch.common.xcontent.ToXContent import org.opensearch.common.xcontent.XContentBuilder import org.opensearch.common.xcontent.XContentParser +import org.opensearch.common.xcontent.XContentType import org.opensearch.index.Index import org.opensearch.persistent.PersistentTaskParams import java.io.IOException @@ -80,6 +81,6 @@ class IndexReplicationParams : PersistentTaskParams { } override fun toString(): String { - return Strings.toString(this) + return Strings.toString(XContentType.JSON, this) } } diff --git a/src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationParams.kt b/src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationParams.kt index 12432eae..eb5c23b1 100644 --- a/src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationParams.kt +++ b/src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationParams.kt @@ -20,6 +20,7 @@ import org.opensearch.common.xcontent.ObjectParser import org.opensearch.common.xcontent.ToXContent import org.opensearch.common.xcontent.XContentBuilder import org.opensearch.common.xcontent.XContentParser +import org.opensearch.common.xcontent.XContentType import org.opensearch.index.shard.ShardId import org.opensearch.persistent.PersistentTaskParams import java.io.IOException @@ -84,7 +85,7 @@ class ShardReplicationParams : PersistentTaskParams { } override fun toString(): String { - return Strings.toString(this) + return Strings.toString(XContentType.JSON, this) } class Builder { @@ -122,4 +123,4 @@ class ShardReplicationParams : PersistentTaskParams { followerShardIdObj.id)) } } -} \ No newline at end of file +}