Previous: Contribution guidelines | Next: Notes for Box employees
This project has a few prerequisites.
Git
to download the source codeNode.js
for compilation and linting of the API specification. Ideally Node 12 or above.Yarn
is the Node package manager for this project. It can be installed withnpm i -g yarn
if Node is installed.YamlLint
is the linter to validateYaml
files. It can be installed withbrew install yamllint
if your machine hasHomebrew
installed.
To setup this project, download the source code and install all the dependencies.
git clone git@github.com:box/box-openapi.git box-openapi
cd box-openapi
To run with Node directly, make sure you have Node 14 or higher installed.
yarn install
yarn start
This final yarn start
command starts up a local server and watches the files
for changes. It will open up a browser window with a preview of the compiled API
specification.
With the dependencies installed, it is possible to lint the API spec. Linting validates the API specification is correct, has no spelling mistakes, and that there are no obvious incorrect links.
yarn lint
Additionally, each of the lint steps can be run individually.
yarn lint:spectral # validates the API spec if valid OpenAPI spec
yarn lint:spelling # checks the spelling in the titles and descriptions
yarn lint:sensitivity # checks the titles and descriptions to ensure we do not use an insensitive language
yarn lint:yaml # validates all *.yml files to ensure they are valid Yaml
Before the API spec can be used in other applications, it needs to be
compiled and written out as one singular openapi.json
file.
yarn build