Generating Code

API Hub for Design lets you generate server and client code based on API definitions to help you get your API servers and clients up and running quickly. You can also configure integrations to automatically push the generated code to a repository on GitHub, GitLab, Bitbucket, or Azure DevOps.

Code generation is supported for both OpenAPI 2.0 and 3.0.

Learn more

Supported languages and frameworks

The following table lists the available code generators for OpenAPI 2.0 and 3.0 definitions. Note that API editors can choose which generators will actually appear in the Export menu.

Notes:

  • OpenAPI 3.0 generators are currently limited, but new generators are added regularly.

  • Each generator has various options, such as the dependencies to use. These options can be configured by the API editors in the codegen options for individual APIs, and will apply to all users who generate code for an API. If you want to change some options but do not have Edit permissions for an API, you can fork this API and configure the codegen options for yourself.

Name

OpenAPI 2.0

OpenAPI 3.0

Comments

Servers

C# / ASP.NET Core (aspnetcore)

C# / NancyFx (nancyfx)

C++ / Pistache (pistache-server)

 

C++ / Restbed (restbed)

 

Erlang (erlang-server)

Go (go-server)

 

Haskell / Servant (haskell)

Java / Apache CXF (jaxrs-cxf)

Java / Apache CXF and CDI (jaxrs-cxf-cdi)

Java / JAX-RS using Jersey

jaxrs

jaxrs-jersey

Java / JAX-RS (jaxrs-spec)

Uses standard JAX-RS APIs, does not depend on specific JAX-RS implementations.

Java / MSF4J (msf4j)

Java / PKMST (java-pkmst)

Uses ProKarma microservices toolkit.

Java / RESTEasy (jaxrs-resteasy)

Java / RESTEasy with JBoss EAP (jaxrs-resteasy-eap)

Java / Spring (spring)

Can be Spring Boot with Springfox, Spring MVC with Springfox, or Spring Cloud Feign, depending on the codegen options.

Java / Swagger Inflector (inflector)

Java / Undertow (undertow)

Node.js (nodejs-server)

PHP / Lumen (lumen)

PHP / Silex (php-silex)

PHP / Slim (slim)

PHP / Symfony (php-symfony)

Python / Flask (python-flask)

Ruby on Rails 5 (rails5)

Ruby / Sinatra (sinatra)

Rust (rust-server)

 

Scala / Akka HTTP (scala-akka-http-server)

Scala / Scalatra (scalatra)

Clients

ActionScript (flash)

Android / Java (android)

Apex (apex)

C++ using C++ REST SDK (cpprest)

C++ / Qt 5 (qt5cpp)

C++ / Tizen (tizen)

C# / .NET 3.5 or later (csharp)

The target .NET framework version can be changed in the codegen options.

C# / .NET 2.0 using Mono compiler (csharp-dotnet2)

Clojure (clojure)

Dart (dart)

Go (go)

Groovy (groovy)

Java (java)

Uses one of the following HTTP client libraries: Jersey (default), Google API Client Library for Java, OkHttp, OpenFeign, RESTEasy, Spring RestTemplate, Vert.x.

Java / JAX-RS Client API with Apache CXF (jaxrs-cxf-client)

JavaScript (javascript)

JavaScript / AngularJS (javascript-closure-angular)

AngularJS (Angular 1.x) with Google Closure Compiler annotations.

JMeter (jmeter)

Kotlin (kotlin)

Objective-C (objc)

Perl (perl)

PHP (php)

Python (python)

Ruby (ruby)

Scala (scala)

Scala / Akka (akka-scala)

Swift 2.x (swift)

Swift 3.x (swift3)

Swift 4.x (swift4)

Swift 5.x (swift5)

 

TypeScript / Angular (typescript-angular)

Angular version is 4.3.0 by default, but can be changed in the codegen options.

TypeScript / AngularJS (typescript-angularjs)

Angular 1.x.

TypeScript / Fetch (typescript-fetch)

TypeScript / Inversify (typescript-inversify)

TypeScript / Node.js (typescript-node)

Documentation

cwiki

Confluence wiki markup.

dynamic-html

Multiple HTML pages with left-side navigation.

html

A single print-friendly HTML page.

html2

A single HTML page with left-side navigation and tabbed code examples.

Swagger Codegen versions

Code generation is powered by the open-source Swagger Codegen project. The following table lists the Codegen versions used. You can also find the currently used Codegen version in the .swagger-codegen\VERSION file in the generated code.

API Hub for Design version

Codegen version for...

OpenAPI 2.0

OpenAPI 3.0

API Hub for Design SaaS

2.4.26

3.0.33

Publication date: