Skip to content

Coerce @ResponseBody CharSequences to strings [SPR-13423] #18002

@spring-projects-issues

Description

@spring-projects-issues

Christopher Smith opened SPR-13423 and commented

In the vein of #17756, but possibly more controversial, I suggest that any CharSequence returned from an @ReponseBody method be coerced to a text string. I believe that in the cases I can think of (returning a StringBuilder or GString), the intent is probably to return the text contents rather than a JSON/XML representation of the its internal structure.


Affects: 4.2 GA

Issue Links:

Referenced from: commits 1291d6e

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions