Have ideas to improve npm?Join in the discussion! »

    swagger-rm-example

    0.1.2 • Public • Published

    swagger-rm-example Build Status

    Language: English | 日本語
    This library removes `example` from your swagger code.

    Purpose

    The purpose of this library is to avoid errors that occure when importing a swagger file into Amazon API Gateway like below.

    errors : [Invalid model schema specified. Unsupported keyword(s): ["example"]]

    Usage

    This library require npm. If npm has already been installed, you can install the library with the following command.

    npm install swagger-rm-example
    

    Please call the library as following.

    // import package
    const fs = require('fs');
    const swaggerRmExample = require('swagger-rm-example');
     
    // read yaml file
    const inputFile = "./swagger.yaml";
    const inputStr = fs.readFileSync(inputFile, 'utf8');
     
    // remove example from string
    const outputStr = swaggerRmExample.removeExample(inputStr);
     
    // display result
    console.log(outputStr);

    Development

    If you edit this project, you can clone it from the repository and build the development environment with the following command.

    # Install required packages 
    npm install
     
    # Run the test 
    npm test

    Keywords

    Install

    npm i swagger-rm-example

    DownloadsWeekly Downloads

    2

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    7.43 kB

    Total Files

    9

    Last publish

    Collaborators

    • avatar