JSPM

  • Created
  • Published
  • Downloads 1436
  • Score
    100M100P100Q106022F
  • License Apache-2.0

OpenAPI 3.0 CodeGen

Package Exports

  • openapi-codegen

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 (openapi-codegen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

OpenAPI-CodeGen

Build status

Experimental port of swagger-codegen templates to Node.js. This project was initially a 24-hour hackathon. The model adaptor code is entirely original and has been reverse-engineered from the existing documentation and template usage.

Work in progress

Supports OpenAPI 3.0.x natively, and Swagger/OpenAPI 2.0 by internal conversion

Usage

CLI

cg [options] {configName} {openapi-definition}

Options:
  -d, --debug    Turn on debugging information in the model            [boolean]
  --help         Show help                                             [boolean]
  -l, --lint     Lint input definition                                 [boolean]
  --version      Show version number                                   [boolean]
  -v, --verbose  Increase verbosity                                    [boolean]

API

const renderer = require('openapi-codegen');
// load a config and a definition
renderer.main(definition,config,configName);

Templates

Templates are taken directly from swagger-codegen. This project is also licensed under Apache-2.0 for this reason. Generated code is explicitly covered by the Unlicense.

Contributors

See here for a partial list of template contributors.

Status of the template configurations

The crossed-off templates have a working (if not necessarily tested) configuration in the configs directory.

Click here to expand...
  • _common contains Apache-2.0 and Unlicense licenses
  • Ada
  • akka-scala
  • android
  • apache2 - needs work
  • apex
  • aspnetcore
  • bash
  • clojure
  • codegen
  • confluenceWikiDocs - needs testing
  • cpprest
  • csharp
  • csharp-dotnet2
  • dart
  • debug - used for dumping the model state
  • Eiffel
  • elixir
  • erlang-client
  • erlang-server
  • finch
  • flash
  • flaskConnexion - needs testing
  • go
  • go-server
  • Groovy - untested
  • haskell-http-client
  • haskell-servant
  • htmlDocs - appears to work
  • htmlDocs2 - appears to work, no console errors logged
  • Java
  • JavaInflector
  • JavaJaxRS
  • JavaPlayFramework
  • Javascript
  • Javascript-Closure-Angular
  • JavaSpring
  • JavaVertXServer
  • JMeter
  • kotlin-client
  • lua
  • lumen
  • MSF4J
  • nancyfx
  • nodejs - tested
  • objc
  • openapi - outputs the input definition (in OpenAPI 3.0.x form)
  • perl
  • php
  • php-silex - untested
  • php-symfony
  • pistache-server
  • powershell
  • python - needs testing
  • qt5cpp
  • r
  • rails5
  • restbed
  • ruby
  • rust
  • rust-server
  • scala
  • scalatra
  • scalaz
  • sinatra
  • slim
  • swagger - outputs the input definition (in original form if OpenAPI 2.0)
  • swagger-static - tested template modified to include partials
  • swift
  • swift3
  • swift4
  • tizen
  • typescript-angular
  • typescript-angularjs
  • typescript-aurelia
  • typescript-fetch - compiles with tsc ok
  • typescript-jquery
  • typescript-node - compiles with tsc ok
  • undertow
  • validator - uses swagger2openapi's OpenAPI 3.0 validator internally
  • ze-ph

See also

These projects use their own template model, not that of swagger-codegen