- git, any version
- Node.js >=20.3.0
- NPM >=9.6.7
If you use nvm, running following command inside this repository will automatically pick the right Node.js version for you:
$ nvm use
git clone https://github.com/swagger-api/swagger-js.git
cd swagger-js
npm install
npm run build
npm run test
It is often the case that after fixing a bug or implementing a new feature, developer wants to test his changes in Swagger-UI. This section will guide you through how to do that.
1. Clone and install swagger-ui repository
You'll find complete information about how to do that in swagger-ui Setting up documentation.
2. Clone and install swagger-js repository
You'll find complete information about how to do that in Steps section of this document.
3. Link repositories using npm link
$ cd /path/to/swagger-js
$ npm run build
$ npm link
$ cd /path/to/swagger-ui
$ npm link swagger-client
4. Make sure npm install is not running
Open /path/to/swagger-ui/package.json
in your favorite editor and look for "predev": "npm install"
script. Temporarily delete this line.
$ cd /path/to/swagger-ui
$ npm run dev
You're now running your version of swagger-client
inside swagger-ui
. Test
what you need and continue with following step.
5. Unlink repositories
We have to clean up after we're done. Open /path/to/swagger-ui/package.json
in your favorite editor and return back the "predev": "npm install"
script.
$ cd /path/to/swagger-ui
$ npm unlink --no-save swagger-client
$ npm install
$ cd /path/to/swagger-js
$ npm unlink