Caused by: io.temporal.common.converter.DataConverterException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "empty" (class org.json.JSONObject), not marked as ignorable (one known property: "map"])
I switched to use JsonNode from fasterxml.jackson
I suggest change have Temporal’s jackson mapper support org.json. It’s probably a one line change. I feel over time org.json will be very popular
But of course once Temporal support Typescript I’m out of Java
I’m confused. Are you trying to return JSONObject instead of its serialized form from an activity? Have you considered returning byte array that contains the serialized JSON?
Yes. I was returning JSONObject directly from Activity. Jackson automatically tries to serialize it but failed. I then switched to return JsonNode instead
I see. I don’t think we can change the default from Jackson, as it can be a breaking change. The good news that DataConverter is fully pluggable and you can choose whatever serializer you prefer.