We upgraded from Spring Boot 1.5.9.RELEASE to 2.1.8.RELEASE.

Previously we had this annotation on the controller:

@Controller
@RequestMapping(value = "/allocation", produces = {APPLICATION_JSON_VALUE})

And we had the same on our "execute" method. (This method downloads a csv file.)

    public List<Map<String, Object>> execute(
            HttpServletRequest request,
            HttpServletResponse response,

This was working fine before the Spring Boot upgrade. However after the upgrade it was returning a 406.

We added produces text/csv to the method level, but still getting the 406. Then we added produces text/csv to the controller, and now it works.

(this never used to be required, there is no Spring Framework Media Type for text/csv.)

According to the documentation, the produces at the method level is supposed to override the one at the controller level. This is not happening. (Also, why are we now enforcing the JSON type, where before we did not?)

Comment From: rstoyanchev

@vgrazi, method level produces should be overriding so I'm not sure yet what's going on.

Can you show the method level mapping? I'm also a little puzzled by the execute method signature which implies that it may write to the response but it also returns a value. If the response was rendered through a message converter before, as I expect, was it StringHttpMessageConverter that does the text/csv format or is there a custom custom converter involved?

I'm trying to understand enough to reproduce the issue. Ideally if it is possible to create a sample that would be best.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.