0.2.2 • Published 6 years ago

swagger-fetch-stub v0.2.2

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

swagger-fetch-stub

How to use

import { swaggerApiMock } from 'swagger-fetch-stub';

const spec = join(__dirname, 'path/to/swagger.yaml');
const swaggerFetchMock = swaggerApiMock(spec);

// the swaggerFetchMock implements a Fetch method, just like window.fetch
// you can pass it to a swagger-codegen SDK as the FetchAPI parameter.
// you'll have to use an empty base-path with your SDK for it to work.

Usage in browser

To use this in the browser you'll need to add the following to your webpack config. A dependency of this project uses the fs module. It's not actually required if you use in-file json-refs (the only type of ref that swagger officially supports).

// webpack.config.js
module.exports = {
  // ... other config
  node: {
    fs: 'empty'
  }
}
0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago