swagger-rm-example
v0.1.3
Published
This library removes example from your swagger code.
Downloads
8
Readme
swagger-rm-example
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