Skip to content

A generator of mock file base on swagger yaml or JSON,auto mock responses by chanceJS

Notifications You must be signed in to change notification settings

whq731/swagger-mock-file-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

A generator of mock file base on swagger yaml or JSON,auto mock responses by chanceJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published