-
-
Notifications
You must be signed in to change notification settings - Fork 523
Malformed api-docs JSON when StringHttpMessageConverter is not active #2051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The problem with the fix, is the potential regressions. Please do not hesitate to propose a PR for your proposals |
@bnasslahsen Thank you for making me happy :-) Edit: what do you mean with regressions? The fix changes from "works sometimes under certain conditions" to "works always" - regressions are very unlikely. |
It means that you might find developers that were using a use-case that you haven't thought about it. |
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:
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)
The text was updated successfully, but these errors were encountered: