JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2008
  • Score
    100M100P100Q109060F
  • License Apache-2.0

Generate HAR objects from Swagger specs

Package Exports

  • swagger2har
  • swagger2har/dist/swagger2har.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (swagger2har) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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

yarn test