New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@naterkane/swagger-mock-file-generator

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@naterkane/swagger-mock-file-generator

A generator of mock file base on swagger yaml or JSON

  • 1.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

swagger-mock-file-generator

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

Now supports Swagger 2.0 and OpenAPI 3.0 (aka. Swagger 3.0)!

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 @naterkane/swagger-mock-file-generator;

API

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

Notice: mockFile must be a JSON format.

Example

var parser = require('@naterkane/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

FAQs

Package last updated on 06 Mar 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc