Return a string for json encoding.