Encode value into a JSON string.
The JSON string representation.
The value to serialize.
Optional Type token for generic types. When null, the serializer should use the runtime class of value.