Mongoose OS RPC MQTT commands

I’m using a ESP32 firmware on Mongoose OS which uses a RPC protocol .
An example format from a publish command is as follows

mosquitto_pub -h mythbox -t esp32_8AD88C/rpc -m ‘{“method”:“relay”,“args”:{“name”:“RELAY3”,“cmd”:“ON”}}’

Question how do I code a “thing” for this …?
something like this???
How do I put a JSON string in the ON/OFF commands?

Type switch : hotwater_booster_switch "Hotwater Booster" [commandTopic="cmd/RELAY3", on="{"method":"relay","args":{"name":"RELAY3","cmd":"ON"}}'", off="{"method":"relay","args":{"name":"RELAY3","cmd":"OFF"}}'" ]

Looks promising.
Your commandTopic doesn’t seem to match your example.

A problem is the on/off parameters require a quoted string
on="bananas"
which gives you problems if you want to send
"bananas":"fred"
including the quote marks.
You have to hide (escape) those internal quote marks
on="\"bananas\":\"fred\""

I’m not sure if using alternate single quote marks may work in this context to make it more legible for humans
on='"bananas":"fred"'
don’t think that works in a xx.things file though.