diff --git a/spi/src/main/java/org/opensearch/jobscheduler/spi/LockModel.java b/spi/src/main/java/org/opensearch/jobscheduler/spi/LockModel.java index 2da7d561..95e04b01 100644 --- a/spi/src/main/java/org/opensearch/jobscheduler/spi/LockModel.java +++ b/spi/src/main/java/org/opensearch/jobscheduler/spi/LockModel.java @@ -13,6 +13,7 @@ import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParserUtils; +import org.opensearch.common.xcontent.XContentType; import org.opensearch.index.seqno.SequenceNumbers; import java.io.IOException; @@ -173,7 +174,7 @@ public XContentBuilder toXContent(final XContentBuilder builder, final Params pa @Override public String toString() { - return Strings.toString(this, false, true); + return Strings.toString(XContentType.JSON, this, false, true); } public String getLockId() { diff --git a/spi/src/main/java/org/opensearch/jobscheduler/spi/schedule/CronSchedule.java b/spi/src/main/java/org/opensearch/jobscheduler/spi/schedule/CronSchedule.java index afa7923d..cbd00849 100644 --- a/spi/src/main/java/org/opensearch/jobscheduler/spi/schedule/CronSchedule.java +++ b/spi/src/main/java/org/opensearch/jobscheduler/spi/schedule/CronSchedule.java @@ -18,6 +18,7 @@ import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentType; import java.io.IOException; import java.time.Clock; @@ -180,7 +181,7 @@ private XContentBuilder toXContentWithDelay(XContentBuilder builder) throws IOEx @Override public String toString() { - return Strings.toString(this, false, true); + return Strings.toString(XContentType.JSON, this, false, true); } @Override diff --git a/spi/src/main/java/org/opensearch/jobscheduler/spi/schedule/IntervalSchedule.java b/spi/src/main/java/org/opensearch/jobscheduler/spi/schedule/IntervalSchedule.java index 19e927cb..6d142d8e 100644 --- a/spi/src/main/java/org/opensearch/jobscheduler/spi/schedule/IntervalSchedule.java +++ b/spi/src/main/java/org/opensearch/jobscheduler/spi/schedule/IntervalSchedule.java @@ -15,6 +15,7 @@ import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentType; import java.io.IOException; import java.time.Clock; @@ -188,7 +189,7 @@ void setClock(Clock clock) { @Override public String toString() { - return Strings.toString(this, false, true); + return Strings.toString(XContentType.JSON, this, false, true); } @Override