-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Feature/always indent json in queryresult #838
Feature/always indent json in queryresult #838
Conversation
The mode is returned by getCodeMirrorModeBasedOnContentType(), which always prefixes the returned values with 'application/'. However returning data on those application/html or application/text break Bruno.
Some APIs return the wrong Content-Type 'application/html', but valid JSON as payload. In this cases the data is still typeof object and a indented JSON makes it easier to work with. However JSON folding and highlighting will still be off in this case.
Hey, @Joschasa, I think it would be better if we instead edit the I think you can just pass the body to |
Hi @Its-treason, is this what you had in mind? |
Yes, and you should be able to revert the changes to the Looks good, nice work! |
This reverts commit 76a26b6.
Any update on this? |
Merged. Thank you @Joschasa for getting this done! Thank you for reviewing this @Its-treason ! |
Description
An unused condition was removed and the QueryPreview window should always indent the JSON payload.
Even for APIs with a Content-Type info of "application/html".
Before:
(Headers:)
After:
However the resulting JSON is not highlighted / foldable, as the CodeEditor still treats this as HTML.
We could leave this as is, so that one might recognize the API returns the wrong Content-Type.
Contribution Checklist: