Previous: Contribution guidelines | Next: Notes for Box employees
This project has a few prerequisites.
Gitto download the source codeNode.jsfor compilation and linting of the API specification. Ideally Node 12 or above.Yarnis the Node package manager for this project. It can be installed withnpm i -g yarnif Node is installed.YamlLintis the linter to validateYamlfiles. It can be installed withbrew install yamllintif your machine hasHomebrewinstalled.
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-openapiTo run with Node directly, make sure you have Node 14 or higher installed.
yarn install
yarn startThis 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 lintAdditionally, 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 YamlBefore 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