Add support for a CSV encoder in core

Created on 11 June 2018, almost 7 years ago
Updated 28 May 2025, 2 days ago

Problem/Motivation

Currently a contributed project is required for creating a view that exports to a CSV. The csv_serialization module is one such example with about 8,000 reporting installs for D8.

It seems we already depend on 99% of the code required to make this work out of the box. symfony/serializer already contains \Symfony\Component\Serializer\Encoder\CsvEncoder for encoding and decoding CSV data.

A proof of concept demonstrating how little code this requires is here: https://www.drupal.org/sandbox/sam/2978728

Proposed resolution

  1. Add a new tagged service for a "csv" encoder.
  2. Do what jsonapi does and disable this encoder for use in REST (I don't see any reason to support CSV in the rest module).
  3. Enable the use of CSV views in core 🎉.

Remaining tasks

  • Validate we want this.
  • Sanity check the impact of including a new encoder on the rest system and how we exclude that.
  • Figure out how to deal with contrib encoders using the same format string.

User interface changes

An additional format for use in the views REST display.

API changes

An additional format for use in the serializer service.

Data model changes

None.

Feature request
Status

Postponed: needs info

Version

11.0 🔥

Component

serialization.module

Created by

🇦🇺Australia Sam152

Live updates comments and jobs are added and updated live.
  • VDC

    Related to the Views in Drupal Core initiative.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    The Ideas project is being deprecated. This issue is moved to the Drupal project. Check that the selected component is correct. Also, add the relevant tags, especially any 'needs manager review' tags.

    Since it has been quiet on this issue for about 7 years, checking in to see if this is still valid.

    Is there interest in this feature request?

Production build 0.71.5 2024