Segment JSON serialization