Hi,

can we have an entry added to org.springframework.http.MediaType for comma-separated values, i.e text/csv ?

Best regards, Sven

Comment From: rajagopalmani

Hi, can I do this change as first time contributor if you guys are planning to include ? I would like to get hands on with the process flow here. Thanks.

Comment From: bclozel

Thanks to both of you for your contribution. These days, we're trying to limit the number of static MediaType instances there. I know it's not always been the case, but from now on I think we should only add new ones there if Spring Framework is providing dedicated support for that media type.

Declaring such an instance is quite easy to do in an application, and I don't think all applications should pay the price of new types when it's clearly not useful to most of them.

Thanks!

Comment From: jencodingatwork

A more helpful answer would be to provide a link or guidance on how to implement a csv MediaType with the limited supported options.

For anyone stumbling across this the MediaType class does provide a method to create one by parsing a String into a MediaType via parseMediaType(java.lang.String mediaType). See this link for more information: https://ferncode.com/return-csv-file-for-spring-rest-service/