swagger-mock-file-generator-by-cases

2.0.0 • Public • Published

Badges

version NPM downloads Build Status

Install

npm i swagger-mock-file-generator-by-cases -s

API

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

Output

The mock file name is converted api path through the '/' symbol.

If api path is 'api/v1/accompany/list', mock file name will be 'api-v1-accompany-list.json'.

Data in cases array will give priority to use example in difinitions, you can customize more data in json file.

{
    "cases": [
        {
            "data": {},
            "message": "success",
            "status": 0
        }
    ]
}

Notice: mockFilePath must be an absolute path string(eg './mock/').

This generator is based on swagger-mock-file-generator,thanks for supporting!

Readme

Keywords

Package Sidebar

Install

npm i swagger-mock-file-generator-by-cases

Weekly Downloads

12

Version

2.0.0

License

ISC

Last publish

Collaborators

  • mec
  • mechanicianw