node-swagger-generator
TypeScript icon, indicating that this package has built-in type declarations

0.5.0-alpha.33 • Public • Published

Jane - An OpenAPI Specification (formerly Swagger) Client Generator

Jane is an OpenAPI Specification client generator. It uses templates written in Handlebars to generate a client code base in various languages.

The initial release is focused on providing a strong support of C# .NET Standard 1.3 and TypeScript.

Basic usage

To generate the API client, you need to give it two things:

  • The swagger json file of your API, defining all the available methods.
  • A configuration json file, specifying some options for your client generation.

A configuration file looks like this:

{
  "language": "typescript",
  "framework": "angular",
  "version": "1.5",
  "mode": "singleFile",
  "dependencies": {
  },
  "mediaTypesPriorities": {
    "application/json": 1
  },
  "ambientTypes": [
  ],
  "templateOptions": {
    "clientName": "MyAPIClient"
    "scheme": {
      "override": "https"
    },
    "generateInterface": true
  }
}

To generate your API client, just run swaggen with these options:

swaggen --outputPath ./outputpath --options ./swaggen-config.json --schema ./api-swagger.json

Languages available

You can generate the client in 2 languages for the moment. Here are the docs:

Documentation

Documentation is maintained in this repository wiki

Integration

Jane will have a CLI interface but is meant to be integrated in build pipeline such as gulp. A gulp plugin acting as a wrapper for Jane is already available. Please check the wiki for guidance.

Extensibility

One purpose of this generator is to allow you to write or customize templates if needed. Please check the wiki for more information.

The story behind this project

Read the Jane's story

Package Sidebar

Install

npm i node-swagger-generator

Weekly Downloads

0

Version

0.5.0-alpha.33

License

MIT

Unpacked Size

192 kB

Total Files

132

Last publish

Collaborators

  • arnaudauroux
  • asiffermann
  • geeklearningbot
  • mvidailhet
  • sandorfr