encode

fun encode(value: Any, json: Json): String

The payload as the text a jsonb attribute is encoded from.

jsonb's codec encodes a String, so this is already what the wire wants and there is no tree to build on the way there - which is why DynamicDto carries the text too, rather than making the wrapped path pay for a structure the unwrapped one never builds.