Need to display the response as application/json instead of text/html

I am using the swagger library ( Currently the response is displaying as text/html, I need to change this to application/json. Anyone help me to do this please?
Below is the current and expected response for reference.

“type1”: “test1”,
“type2”: “test2”

If this is an issue with the library behaviour you should report it on their issue page: