|
2 | 2 |
|
3 | 3 | This is the Linode API OpenAPI 3 Schema
|
4 | 4 |
|
5 |
| -## Implementation |
6 |
| - |
7 |
| -We are using [ReDoc](https://github.com/Rebilly/ReDoc) as the front end |
8 |
| -UI for our OpenAPI specification. |
9 |
| - |
10 |
| -Additionally, we are taking advantage of ReDoc's support of |
11 |
| -[Vendor Extensions](https://github.com/Rebilly/ReDoc/blob/master/docs/redoc-vendor-extensions.md) |
12 |
| -such as `x-logo` and `x-code-samples` for extended functionality. |
13 |
| - |
14 |
| -A CSS file has also been added to the html page, to allow customization to the |
15 |
| -output. |
16 |
| - |
17 | 5 | ## Requirements
|
18 | 6 |
|
19 |
| -Per the [Deployment |
20 |
| -Guidelines](https://github.com/Rebilly/ReDoc#deployment) of the ReDoc |
21 |
| -specification, ReDoc must be installed on the server via yarn or npm. |
22 |
| - |
23 |
| -**yarn:** |
24 |
| -``` |
25 |
| -yarn add redoc |
26 |
| -``` |
| 7 | +The linter used for the OpenAPI spec is written in python3. |
| 8 | +A virtualenv is recommended for local work. |
27 | 9 |
|
28 |
| -**NPM:** |
29 | 10 | ```
|
30 |
| -npm install redoc --save |
| 11 | +virtualenv -p python3 venv |
| 12 | +source venv/bin/activate |
| 13 | +pip install -r requirements.txt |
31 | 14 | ```
|
32 | 15 |
|
33 | 16 | ## Development
|
34 | 17 |
|
35 |
| -Any http server serving this directory will work - simply reload the page to |
36 |
| -see changes. We're working on a nicer way to do this, but for now this should |
37 |
| -get you started: |
| 18 | +The spec can be linted using the `./bin/lint` helper. |
38 | 19 |
|
39 |
| -```shell |
40 |
| -python3 -m http.server |
| 20 | +``` |
| 21 | +python3 ./bin/lint openapi.yaml |
41 | 22 | ```
|
42 | 23 |
|
43 | 24 | ### Versioning
|
44 | 25 |
|
45 |
| -This specification is automatically versioned on build by Jenkins. The version |
46 |
| -presented in the spec is taken directly from the most recent annotated `git tag` |
47 |
| -to the build's `HEAD`. The package version appends the number of commits since |
48 |
| -the last tag to this number, separated by a hyphen. When making a new release |
49 |
| -you **must** tag the release with the correct semantic versioning-compliant |
50 |
| -version string so that all versions are populated appropriately. |
51 |
| - |
52 |
| -### Updating Dependencies |
| 26 | +When making a new release you **must** tag the release with the correct semantic versioning-compliant version string so that all versions are populated appropriately. |
| 27 | +There is a `./bin/deploy` helper which will help with this process. |
53 | 28 |
|
54 |
| -The ReDoc version we are using in this repo is from a fork of the mainline ReDoc |
55 |
| -repo, found [here](https://github.com/dnknapp/ReDoc). This fork has custom |
56 |
| -modifications for Linode. In order to update the ReDoc we are using, clone that |
57 |
| -repo, rebase it's HEAD onto the latest upstream ReDoc (if desired), and run the |
58 |
| -following commands to generate a `redoc.standalone.js`: |
59 |
| - |
60 |
| -```bash |
61 |
| -yarn |
62 |
| -yarn bundle |
63 |
| -cp bundles/redoc.standalone.js /path/to/linode-api-docs/ |
64 | 29 | ```
|
65 |
| - |
66 |
| -This file _is_ committed to this repository, _is_ packaged with this repo's deb, |
67 |
| -and _is_ referenced with a relative link on the server. |
| 30 | +./bin/deploy 0.1.0 |
| 31 | +``` |
68 | 32 |
|
69 | 33 | ## Spec Extensions
|
70 | 34 |
|
|
0 commit comments