rest-tool-common

    2.7.5 • Public • Published

    Common modules for the rest-tool

    unstable npm version Build Status Coveralls

    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 oas module (preferred).
    • Use the services module that is made for the rest-tool (deprecated).

    Read the API documentation for further details on how to use this library.

    The OAS way

    Use the 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.

    Find examples for both static and non-static endpoints under the fixtures.

    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.

    Install

    npm i rest-tool-common

    DownloadsWeekly Downloads

    6

    Version

    2.7.5

    License

    none

    Unpacked Size

    68.6 kB

    Total Files

    11

    Last publish

    Collaborators

    • tombenke