Common modules for the rest-tool
This module provides functions to load REST API descriptor files and help the implementation of both servers and clients that communicates through the API.
There are two main approach to use this module.
- Use the
loadOas()function from the
- Use the
servicesmodule that is made for the
Read the API documentation for further details on how to use this library.
The OAS way
loadOas() function that needs the path to the root descriptor file of either a swagger v2.0 or OpenApi v3.0 file.
The function loads the whole description, even they are distributed among several partials, then returns an object the porvides further functions that makes available the endpoints of the API.
This function also accepts a swagger object, instread of a path string.
Read the oas module documentation for further details.
The rest-tool way
The 'rest-tool' is a simple Node.js command-line tool which can be used to document, emulate and test RESTful APIs.
This project is a Node.js module, that is used by the 'rest-tool' itself, and the REST API projects, that are generated by the tool.
This module is referred by the package.json files and automatically installed during the normal usage of the 'rest-tool', so you probably will not use it directly unless you are willing to develop your own code generator or templates.
Read the services module documentation for further details.
To learn more on how to setup the project, and how to use the tool visit the rest-tool project repository on GitHub.