encodeToConfig

Encodes the given value into a Config using the given serializer.

Throws

If list or primitive type passed as a value.