How to convert ManagedCursorStreamProvider to Json object in mule. I have written a java method which takes the Json Object as input
Request Payload:
{ a: "one",
b : "two"}
Invoke static
arg0 : payload
Java Function called using invoke static
public static func(JsonObject json){
}
I am getting the following error:
Expected arguments are [com.google.gson.JsonObject jsonObject] and invocation was attempted with arguments [org.mule.runtime.core.internal.streaming.bytes.ManagedCursorStreamProvider arg0]. No suitable transformation was found to match the expected type for the parameter [jsonObject].
UPDATE: I have updated my java method to accept String as input.
"Cannot coerce Object { encoding: UTF-8, mediaType: application/json; charset=UTF-8, mimeType: application/json, raw: org.mule.weave.v2.el.SeekableCursorStream@868075a } (org.mule.weave.v2.el.MuleTypedValue@7c0c5e89) to String
1| arg0 : vars.req as String
^^^^^^^^^^^^^^^^^^
Trace:
at main (line: 1, column: 8)" evaluating expression: "arg0 : vars.req as String".