Considering you have jq installed, you can just call it within vim itself, passing current text as an argument:
Or to make it permanent, add
,jf (json-format) shortcut to your
:nnoremap ,jf :%!jq .<CR>
You can also force the format of the file to be JSON after reformatting, for instance if you have just opened vim and pasted a JSON text, then reformatted. So instead of above use:
:nnoremap ,jf :%!jq .<CR> <bar> :set syntax=json<CR>
Have a question⁉ Contact me.