Skip to content

Commit e797cc5

Browse files
Ian ZelikmanIan Zelikman
Ian Zelikman
authored and
Ian Zelikman
committed
Merge branch 'master' of github.com:tylerdave/OpenAPI-Tutorial
2 parents 1c17001 + e2d98fd commit e797cc5

File tree

3 files changed

+107
-11
lines changed

3 files changed

+107
-11
lines changed

PREREQUISITES.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ In order to follow-along with the exercises in this tutorial you will need
55
to install some applications and tooling. Installation can take a while so
66
please try to make sure everything is installed before the session.
77

8-
Option 1: Vagrant + VirtualBox
9-
------------------------------
8+
Option 1: Vagrant + VirtualBox (recommended)
9+
-------------------------------------------
1010

1111
We have created a VM with all of the required applications already installed
1212
and configured. To use it you will need to have Vagrant and Virtualbox
@@ -15,7 +15,9 @@ installed.
1515
- [Download & Install VirtualBox](https://www.virtualbox.org/wiki/Downloads)
1616
- [Download & Install Vagrant](https://www.vagrantup.com/docs/installation/)
1717

18-
Once they're installed, clone this repo:
18+
*Be sure to reboot your host system after installing Vagrant + VirtualBox.*
19+
20+
Once they're installed and you've rebooted, clone this repo:
1921

2022
```
2123
git clone https://github.com/tylerdave/OpenAPI-Tutorial.git
@@ -40,6 +42,9 @@ to localhost:2222 using an SSH clinet program. More details:
4042
- Connect via PuTTY: http://stackoverflow.com/a/9924122/
4143
- SSH with Git Bash: http://stackoverflow.com/a/16247703/
4244

45+
### Using the VM
46+
47+
See [VM.md](VM.md) for more usage information.
4348

4449
Option 2: Manual Installation
4550
-----------------------------
@@ -87,7 +92,7 @@ python -m venv tutorial
8792
Install the implementation package and its dependencies:
8893

8994
```
90-
pip install -e tutorial-repo/implementation/betterapis
95+
pip install -e tutorial-repo/implementation
9196
```
9297

9398
Option 3: Backup Plan

README.md

+10-7
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ Exercises and slides for our OSCON 2017 OpenAPI Tutorial:
55

66
https://conferences.oreilly.com/oscon/oscon-tx/public/schedule/detail/56579
77

8-
Prerequisites
9-
-------------
8+
Getting Started
9+
---------------
10+
11+
To follow this tutorial you will need to have everything installed as
12+
described in [PREREQUISITES.md](PREREQUISITES.md).
1013

11-
To follow this tutorial, please make sure to install everything as described in
12-
[PREREQUISITES.md](PREREQUISITES.md).
14+
If you're using the recommended VM option, see [VM.md](VM.md) for more usage
15+
information.
1316

1417
Repo Contents
1518
-------------
1619

17-
- `lessons`: Tutorial lesson examples and solution files.
18-
- `implementation`: Example implementation using Connexions.
19-
- `presentation`: HTML presentation and source.
20+
- [lessons](lessons/): Tutorial lesson examples and solution files.
21+
- [implementation](implementation/): Example implementation using Connexions.
22+
- [presentation](presentation/): HTML presentation and source.
2023

VM.md

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
Using the VM
2+
============
3+
4+
Once you have installed the VM following the instructions in
5+
[PREREQUISITES.md](PREREQUISITES.md) (option 1) you are ready to begin using
6+
the tutorial tools!
7+
8+
### Running the VM
9+
10+
You can check the status of the VM by running `vagrant status` from within
11+
the repo directory. If it is not already running, start it with
12+
`vagrant up --provider virtualbox`.
13+
14+
### Logging In
15+
16+
You can log in to the VM using `vagrant ssh` on the command line or by
17+
connecting to `localhost:2222` via ssh.
18+
19+
VM Tools
20+
--------
21+
22+
### Swagger Editor
23+
24+
Two versions of the web-based [swagger-editor](https://github.com/swagger-api/swagger-editor)
25+
have been installed on the VM and should be accessible from the host machine.
26+
27+
http://localhost:8000/ - Swagger Editor 2.x (includes links to code generation service)
28+
29+
http://localhost:8001/ - Swagger Editor 3.x (improved editor but no coge generation)
30+
31+
### Python API Implementation
32+
33+
An example implementation using [Connexion](https://connexion.readthedocs.io/en/latest/)
34+
is included in the tutorial repo. To run it you first need to activate the
35+
Python virtual environment (using the `workon` command provided via
36+
virtualenvwrapper.):
37+
38+
```
39+
workon tutorial
40+
```
41+
42+
Then to run the connexion app:
43+
44+
```
45+
python -m betterapis
46+
```
47+
48+
With the application running, the API and Swagger UI are available from the
49+
host machine.
50+
51+
The API should be available here:
52+
53+
http://localhost:8080/talks
54+
55+
The Swagger UI for the API is available here:
56+
57+
http://localhost:8080/ui/
58+
59+
### Swagger Validator
60+
61+
A validation tool has been installed. This will help you find errors in working
62+
specification files. For example, you can run it on one of the tutorial solution
63+
files:
64+
65+
```
66+
swagger validate tutorial-repo/lessons/lesson-1.02/solution.yaml
67+
Results: 0 errors, 0 warnings
68+
```
69+
70+
### Dredd
71+
72+
The [Dredd](http://dredd.readthedocs.io/en/latest/) testing tool is installed.
73+
You may verify it works and see usage information by running:
74+
75+
```
76+
dredd --help
77+
```
78+
79+
### Swagger-codegen
80+
81+
In addition to being available via links in the Swagger Editor 2.x,
82+
swagger-codegen is available on the command line in the VM. For usage
83+
information run:
84+
85+
```
86+
java -jar swagger-codegen.jar help
87+
```
88+

0 commit comments

Comments
 (0)