I have a swagger file both in yaml format and json. I can view the yaml file on swaggers online viewer https://editor.swagger.io/ but when I try to serve the file locally I get the error:
webbrowser: tried to open "http://localhost:40335/docs", no screen found
After using the command:
swagger serve -F=swagger swagger.yaml
To recreate this scenario you can clone this repo: https://github.com/go-swagger/go-swagger/tree/master/fixtures/goparsing/petstore
Then run the following commands (MAC-OS) to generate the yaml file:
Note: you may have to run these commands in the root of the project using sudo -s
Instructions for windows installation can be found here https://goswagger.io/install.html
Download go-swagger
docker pull quay.io/goswagger/swaggeralias swagger="docker run --rm -it --user $(id -u):$(id -g) -e GOPATH=$HOME/go:/go -v $HOME:$HOME -w $(pwd) quay.io/goswagger/swagger"swagger versionto verify installation
Generate swagger Yaml
4.swagger generate spec -o ./swagger.yaml --scan-models
The swagger file should now be generated but for some reason using the command swagger serve -F=swagger swagger.yaml gives the error described above.