diff --git a/karate-core/src/main/java/com/intuit/karate/ScriptValue.java b/karate-core/src/main/java/com/intuit/karate/ScriptValue.java index 8c6d49cb1..c34c1183e 100755 --- a/karate-core/src/main/java/com/intuit/karate/ScriptValue.java +++ b/karate-core/src/main/java/com/intuit/karate/ScriptValue.java @@ -350,7 +350,7 @@ public String getAsStringRemovingCyclicReferences() { case JSON: case MAP: Map map = JsonUtils.removeCyclicReferences(getAsMap()); - return JsonUtils.toJsonDoc(map).jsonString(); + return JsonUtils.toPrettyJsonString(JsonPath.parse(map)); default: return getAsString(); }