I have a method that returns a fully formatted JSON as a String, ex { type: "", List1: []...} I'm trying to return that in a way that the browser interprets it as a JSON (Firefox). I've tried specifying that it produces="text/plain" but no luck. I can't put it in a wrapper class as it's already formatted.
I tried specifying produces="text/plain" and @ResponseBody. No luck, still interpreted as text, not JSON.
edit: For my purposes, using produces=MediaType.APPLICATION_JSON_VALUE worked.
@GetMapping(value="/v1/Count", produces="text/plain"
@ResponseBody
public String getCount(@RequestParam...) {
return "{type: "", List1: []...}";
}