I am using the karate java-api to work with Json objects. I have the below json to be created:
{
"a": [
{
"b": [
{
"c": "hello"
}
]
}
]
}
When I try to json.set("$.a[0].b[0].c", "hello"), I get the below error :
Exception in thread "main" java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class java.util.List (java.util.LinkedHashMap and java.util.List are in module java.base of loader 'bootstrap')
at com.intuit.karate.Json.createPath(Json.java:232)
at com.intuit.karate.Json.createPath(Json.java:246)
at com.intuit.karate.Json.setInternal(Json.java:199)
at com.intuit.karate.Json.set(Json.java:148)
The json path syntax is correct as cross checked, any other point(s) which I might be missing?
Edit: I'm using v1.1.0 of karate-core