Socket
Book a DemoInstallSign in
Socket

swagger-mock-file-generator

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-mock-file-generator

A generator of mock file base on swagger yaml or JSON

latest
Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
8
-55.56%
Maintainers
1
Weekly downloads
 
Created
Source

swagger-mock-file-generator

A generator of mock file base on swagger yaml or JSON,output swagger with mock data JSON file.

The mock data will pour into responses.[code].schema.example,if your original swagger file has already defined example,it will not change Spec: here

Install

npm i swagger-mock-file-generator;

API

require('swagger-mock-file-generator')(<swaggerFile>, <mockFile>[, callback])

Notice: mockFile must be a JSON format.

Example

var parser = require('swagger-mock-file-generator');
// swagger source file is both .yaml and .json is OK.
parser('./swagger.yaml','./swaggerWithMock.json', function(){
    console.log('mock json file created!')
});

This mocked file supports : https://github.com/whq731/swagger-express-middleware-with-chance and https://github.com/BigstickCarpet/swagger-express-middleware Free to choose!

Keywords

swagger

FAQs

Package last updated on 03 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts