Serialize JSON directly to a string if asked.