I'm working on a proxy service modeled with Smithy. I need to pass response objects from an API/SDK to a client in an HTTP response.
Ideally, I would like the response passed to be in JSON format. The API is prone to updates and given my use case, implementing my own serialization for the response is not an option.
Is there a way to JSONify objects in kotlin without serialization? The response object I am primarily interested has a lot of nested fields if it makes any difference.
Currently my solution is passing in the response object's toString() representation which is acceptable, but not ideal as the client will have to parse the response object which is represented in python's repr() output format.
EDIT: By serialization, I mean the response object's class (from the SDK) does not implement serializable interface. I cannot make changes to this class as it is not maintained by me.