This is a ready-made tool for designing HTTP API with Swagger 2.0 specification. For refrences, check out OpenAPI Specification (fka Swagger RESTful API Documentation Specification).
The basic contribution of this project is only to host the Swagger Editor locally. It can help both frontend and backend developers to design API endpoints, test them, and track changes.
As like all npm packages, just type command:
npm install
And to run the editor is:
npm run editor <path-to-your-api.yaml> [port]
As hinted by the command output, it will host the editor webapp on https://127.0.0.1:8081/ as default.
You can open it with browser and start to edit API, and any changes within the webapp will be dumped to the file on disks.
The editor can be also used to test the API endpoints. Just change the host
and basePath
field to point to the server target.
- Always add your API file to git before any edit.
- Group your API endpoints into multiple files and orgnize them with folders.
- Use json referenece pointer to extract duplicate pieces and use them across files.
I refactoried the official example into server
folder. Have a look at its README.md
.
- Make the same tool for OpenAPI 3.0 !
- Collect reusable pieces for API patterns, such as captcha, JWT, paginated query ant etc..
- Add scripts to help combine, export, and publish the API document.
- Find and add tool to automize the API mocking and testing.
- Go deep into Swagger Editor to add support for editing multiple files within a single webapp.