For viewing a Swagger file, I used to copy the json file to Notepad++ and use the Format Json plugin. There’s a much easier approach however. You can get a formatted json file directly in Chrome by installing the JSONView extension.
After installing the extension, reopen Google Chrome. From now on, when you open a json file in your browser, it will be formatted by default. Handy!