swagger-rm-example

0.1.3 • 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 occur 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

Readme

Keywords

Package Sidebar

Install

npm i swagger-rm-example

Weekly Downloads

2

Version

0.1.3

License

MIT

Unpacked Size

7.52 kB

Total Files

10

Last publish

Collaborators

  • segur