Once you have installed the VM following the instructions in PREREQUISITES.md (option 1) you are ready to begin using the tutorial tools!
You can check the status of the VM by running vagrant status
from within
the repo directory. If it is not already running, start it with
vagrant up --provider virtualbox
.
On the day of the tutorial, make sure to git pull
the latest updates to the
repo and then run vagrant provision
in order to make sure the VM has the
latest updates.
You can log in to the VM using vagrant ssh
on the command line or by
connecting to localhost:2222
via ssh.
You may suspend the VM when you are not working with it by using
vagrant suspend
in the repo directory. You may then check the status and
start it again using the commands above.
Vagrant is configured to map this repo directory to a directory called
tutorial-repo
in the ssh user's home directory. This will allow you to edit
files on your host machine using your preferred editor while also being able
to edit and validate them while logged-in via ssh.
Two versions of the web-based swagger-editor have been installed on the VM and should be accessible from the host machine.
http://localhost:8000/ - Swagger Editor 2.x (includes links to code generation service)
http://localhost:8001/ - Swagger Editor 3.x (improved editor but no coge generation)
An example implementation using Connexion
is included in the tutorial repo. To run it you first need to activate the
Python virtual environment (using the workon
command provided via
virtualenvwrapper.):
workon tutorial
Then to run the connexion app:
python -m betterapis
With the application running, the API and Swagger UI are available from the host machine.
The API should be available here:
The Swagger UI for the API is available here:
A validation tool has been installed. This will help you find errors in working specification files. For example, you can run it on one of the tutorial solution files:
swagger validate tutorial-repo/lessons/lesson-1.02/solution.yaml
Results: 0 errors, 0 warnings
The Dredd testing tool is installed. You may verify it works and see usage information by running:
dredd --help
In addition to being available via links in the Swagger Editor 2.x, swagger-codegen is available on the command line in the VM. For usage information run:
java -jar swagger-codegen.jar help