swagger-to-har2

1.0.5 • Public • Published

This is fork of swagger2har with very minimal modifications for a certian usecase(import swagger to dothttp). visit https://github.com/Kong/swagger2har/

swagger2har

Transform you Swagger OAI spec files to a series of HAR request objects.

Setup

npm install

Usage

Using as a ES module:

import { swagger2har }  from 'swagger2har';
import swaggerJSON from 'your-swagger-api.json'; // e.g. http://petstore.swagger.io/v2/swagger.json

swagger2har(swaggerJSON);

To create HAR Request object for one path and method pair described in a given swagger use createHar directly

import { createHar }  from 'swagger2har';
import swaggerJSON from 'your-swagger-api.json'; // e.g. http://petstore.swagger.io/v2/swagger.json

createHar(swaggerJSON, '/pet/findByTags', 'get', 'http://petstore.swagger.io');

Testing

npm run test

Readme

Keywords

Package Sidebar

Install

npm i swagger-to-har2

Weekly Downloads

76

Version

1.0.5

License

Apache-2.0

Unpacked Size

19 kB

Total Files

4

Last publish

Collaborators

  • cedric05