online-swagger-codegen

An online swagger client generator

Usage no npm install needed!

<script type="module">
  import onlineSwaggerCodegen from 'https://cdn.skypack.dev/online-swagger-codegen';
</script>

README

Online swagger codegen

An online swagger client generator

This package generate a zip folder (sdk.zip) from your swagger JSON file and the desired client using https://generator.swagger.io/api/gen/clients endpoint.

Installation

yarn add --dev online-swagger-codegen

Usage

Example:

GenerateSDK({
        specURL: 'http://localhost:3000/swaggher.json',
        outPath: path.resolve(__dirname, '../generated'),
    });

Input parameters:

  • outPath - required - place to save zip file
  • client - optional, default: typescript-node
  • specURL - optional - the url to swagger json file
  • spec - optional - the swagger json object
  • specURL or spec should be provided

Supported clients

  • Typescript node
  • Typescript angular
  • ...