talira

Swagger Codegen

Generates API clients, server stubs and documentation from an OpenAPI or Swagger definition

open sourceApache-2.0self-hostablefree

Swagger Codegen is the original template-driven generator from the Swagger project: it parses a Swagger or OpenAPI definition and produces API client libraries, server stubs and HTML or Confluence documentation in many languages. Two version lines are maintained independently: 2.x (group id io.swagger) for Swagger 1.x and 2.0, and 3.x (io.swagger.codegen.v3), which adds OpenAPI 3.0. It runs as a Java CLI, through Maven and Gradle plugins, as Docker images or as a hosted generator service. OpenAPI Generator is a community hard fork of it from 2018.

Ways to install

Problems it solves

  • generate a client SDK from our swagger.json file
  • we have an old Swagger 2.0 spec and need server stubs for a Java or Scala service
  • produce static HTML API documentation from a Swagger definition
  • our build still uses a Maven plugin that generates the API client from a Swagger file
  • create Spring server interfaces from an API contract before writing the implementation
  • run an API code generator as a web service inside our network
  • generate API clients for several languages from one definition without writing them by hand
  • keep generated client code in a legacy project reproducible with the same tool and version it was made with

Features

  • API clients for many languages
  • server stubs (Spring, JAX-RS, Flask, ASP.NET Core and others)
  • HTML and Confluence documentation
  • 2.x line for Swagger 1.x/2.0 and 3.x line adding OpenAPI 3.0
  • Maven and Gradle plugins
  • Docker CLI images and a generator web service image
  • customisable templates

Capabilities

Has an APIplan not known
Has a command line toolplan not known
Takes pluginsplan not known

Forks

  • OpenAPI Generator Generates API clients, server stubs and documentation from OpenAPI 2.0 and 3.x documents. Its own project since 2018.

Alternatives

The same job

These do what Swagger Codegen does.

  1. OpenAPI Generator Generates API clients, server stubs and documentation from OpenAPI 2.0 and 3.x documents

Compare Swagger Codegen with the top 3