toDynamicDto

fun toDynamicDto(value: Any, json: Json = this.json): DynamicDto

Wraps value so it is written as a dynamic_dto whatever strategy says. Needed under EXPLICIT_ONLY, and for a class also registered as a composite under AUTOMATIC_WHEN_UNAMBIGUOUS.

Throws

INVALID_ARGUMENT where value's class was never registered.