Closed
Description
Describe the bug
StringHttpMessageConverter unwraps a JSON string and delivers it's content a string. This may have some uses but it breaks JSON compatibility. If StringHttpMessageConverter is disabled, a JSON string is quoted properly.
In #624 the issue was already partially discussed. The only working solution is to use StringHttpMessageConverter. A real solution that works without StringHttpMessageConverter is needed, so that it works along with fully JSON compatible applications.
To Reproduce
Create an app with a WebMvcConfigurer with the following code:
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
converters.removeIf(c -> c instanceof StringHttpMessageConverter);
}
Query for spec/v1.
Expected behavior
A Json should be returned. Instead a JSON quoted as JSON string is returned.
Edit:
The fix is trivial, see my comment in #624 (comment)