swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.

Overview

Build Status

Build Status

Build Status

  • Master (2.4.25-SNAPSHOT): Java Test Windows Test

  • 3.0.31-SNAPSHOT: Java Test Windows Test

Maven Central

If you would like to contribute, please refer to guidelines and a list of open tasks.

📔 For more information, please refer to the Wiki page and FAQ 📔

⚠️ If the OpenAPI/Swagger spec is obtained from an untrusted source, please make sure you've reviewed the spec before using Swagger Codegen to generate the API client, server stub or documentation as code injection may occur ⚠️

🚀 ProductHunt: https://producthunt.com/posts/swagger-codegen 🚀

📔 The eBook A Beginner's Guide to Code Generation for REST APIs is a good starting point for beginners.

Versioning

NOTE: version 2.X (io.swagger) and 3.X (io.swagger.codegen.v3) have different group ids.

2.X and 3.X version lines of Swagger Codegen are available; 2.X (master branch) supports Swagger/OpenAPI version 2, while 3.X (3.0.0 branch) supports OpenAPI version 3 (and version 2 via spec conversion to version 3). Online generator of version 3.X supports both generation from Swagger/OpenAPI version 2 (by using engine + generators of 2.X) and version 3 specifications.

NOTE: this document refers to version 2.X, check here for 3.X.

Swagger Codegen 2.X (master branch)

Swagger Codegen 2.X supports Swagger/OpenAPI version 2.

group id: io.swagger maven central (maven plugin): https://mvnrepository.com/artifact/io.swagger/swagger-codegen-maven-plugin

dependency example:

<dependency>
    <groupId>io.swagger</groupId>
    <artifactId>swagger-codegen-maven-plugin</artifactId>
    <version>2.4.24</version>
</dependency>

Swagger Codegen 3.X (3.0.0 branch)

Swagger Codegen 3.X supports OpenAPI version 3 (and version 2 via spec conversion to version 3) Online generator of version 3.X supports both generation from Swagger/OpenAPI version 2 (by using engine + generators of 2.X) and version 3 specifications.

group id: io.swagger.codegen.v3 maven central: https://mvnrepository.com/artifact/io.swagger.codegen.v3

dependency example:

<dependency>
    <groupId>io.swagger.codegen.v3</groupId>
    <artifactId>swagger-codegen-maven-plugin</artifactId>
    <version>3.0.30</version>
</dependency>

Overview

This is the Swagger Codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an OpenAPI Spec. Currently, the following languages/frameworks are supported:

  • API clients: ActionScript, Ada, Apex, Bash, C# (.net 2.0, 3.5 or later), C++ (cpprest, Qt5, Tizen), Clojure, Dart, Elixir, Elm, Eiffel, Erlang, Go, Groovy, Haskell (http-client, Servant), Java (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured), Kotlin, Lua, Node.js (ES5, ES6, AngularJS with Google Closure Compiler annotations) Objective-C, Perl, PHP, PowerShell, Python, R, Ruby, Rust (rust, rust-server), Scala (akka, http4s, swagger-async-httpclient), Swift (2.x, 3.x, 4.x, 5.x), Typescript (Angular1.x, Angular2.x, Fetch, jQuery, Node)
  • Server stubs: Ada, C# (ASP.NET Core, NancyFx), C++ (Pistache, Restbed), Erlang, Go, Haskell (Servant), Java (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, PKMST), Kotlin, PHP (Lumen, Slim, Silex, Symfony, Zend Expressive), Python (Flask), NodeJS, Ruby (Sinatra, Rails5), Rust (rust-server), Scala (Finch, Lagom, Scalatra)
  • API documentation generators: HTML, Confluence Wiki
  • Configuration files: Apache2
  • Others: JMeter

Check out OpenAPI-Spec for additional information about the OpenAPI project.

Table of contents

Compatibility

The OpenAPI Specification has undergone 3 revisions since initial creation in 2010. The Swagger Codegen project has the following compatibilities with the OpenAPI Specification:

Swagger Codegen Version Release Date OpenAPI Spec compatibility Notes
3.0.31-SNAPSHOT (current 3.0.0, upcoming minor release) SNAPSHOT TBD 1.0, 1.1, 1.2, 2.0, 3.0 Minor release
3.0.30 (current stable) 2021-11-18 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.30
3.0.29 2021-10-05 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.29
3.0.28 2021-09-30 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.28
3.0.27 2021-06-28 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.27
3.0.26 2021-05-28 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.26
3.0.25 2021-03-04 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.25
3.0.24 2020-12-29 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.24
3.0.23 2020-11-02 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.23
3.0.22 2020-10-05 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.22
3.0.21 2020-07-28 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.21
3.0.20 2020-05-18 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.20
3.0.19 2020-04-02 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.19
3.0.18 2020-02-26 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.18
3.0.17 2020-02-23 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.17
3.0.17 2020-01-15 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.16
3.0.15 2020-01-03 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.15
3.0.14 2019-11-16 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.14
3.0.13 2019-10-16 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.13
3.0.12 2019-10-14 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.12
3.0.11 2019-08-24 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.11
3.0.10 2019-07-11 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.10
3.0.9 2019-06-28 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.9
3.0.8 2019-04-25 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.8
3.0.7 2019-03-26 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.7
3.0.5 2019-02-18 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.5
3.0.4 2019-01-16 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.4
3.0.3 2018-11-30 1.0, 1.1, 1.2, 2.0, 3.0 tag v3.0.3
3.0.2 2018-10-19 1.0, 1.1, 1.2, 2.0, 3.0 Minor release
3.0.1 2018-10-05 1.0, 1.1, 1.2, 2.0, 3.0 Major release with breaking changes
3.0.0 2018-09-06 1.0, 1.1, 1.2, 2.0, 3.0 Major release with breaking changes
2.4.25-SNAPSHOT (current master, upcoming minor release) SNAPSHOT TBD 1.0, 1.1, 1.2, 2.0 Minor release
2.4.24 (current stable) 2021-11-18 1.0, 1.1, 1.2, 2.0 tag v2.4.24
2.4.23 2021-10-08 1.0, 1.1, 1.2, 2.0 tag v2.4.23
2.4.22 2021-09-30 1.0, 1.1, 1.2, 2.0 tag v2.4.22
2.4.21 2021-06-28 1.0, 1.1, 1.2, 2.0 tag v2.4.21
2.4.20 2021-05-28 1.0, 1.1, 1.2, 2.0 tag v2.4.20
2.4.19 2021-03-04 1.0, 1.1, 1.2, 2.0 tag v2.4.19
2.4.18 2020-12-29 1.0, 1.1, 1.2, 2.0 tag v2.4.18
2.4.17 2020-11-02 1.0, 1.1, 1.2, 2.0 tag v2.4.17
2.4.16 2020-10-05 1.0, 1.1, 1.2, 2.0 tag v2.4.16
2.4.15 2020-07-28 1.0, 1.1, 1.2, 2.0 tag v2.4.15
2.4.14 2020-05-18 1.0, 1.1, 1.2, 2.0 tag v2.4.14
2.4.13 2020-04-02 1.0, 1.1, 1.2, 2.0 tag v2.4.13
2.4.12 2020-01-15 1.0, 1.1, 1.2, 2.0 tag v2.4.12
2.4.11 2020-01-03 1.0, 1.1, 1.2, 2.0 tag v2.4.11
2.4.10 2019-11-16 1.0, 1.1, 1.2, 2.0 tag v2.4.10
2.4.9 2019-10-14 1.0, 1.1, 1.2, 2.0 tag v2.4.9
2.4.8 2019-08-24 1.0, 1.1, 1.2, 2.0 tag v2.4.8
2.4.7 2019-07-11 1.0, 1.1, 1.2, 2.0 tag v2.4.7
2.4.6 2019-06-28 1.0, 1.1, 1.2, 2.0 tag v2.4.6
2.4.5 2019-04-25 1.0, 1.1, 1.2, 2.0 tag v2.4.5
2.4.4 2019-03-26 1.0, 1.1, 1.2, 2.0 tag v2.4.4
2.4.2 2019-02-18 1.0, 1.1, 1.2, 2.0 tag v2.4.2
2.4.1 2019-01-16 1.0, 1.1, 1.2, 2.0 tag v2.4.1
2.4.0 2018-11-30 1.0, 1.1, 1.2, 2.0 tag v2.4.0
2.3.1 2018-01-17 1.0, 1.1, 1.2, 2.0 tag v2.3.1
2.3.0 2017-12-21 1.0, 1.1, 1.2, 2.0 tag v2.3.0
2.2.3 2017-07-15 1.0, 1.1, 1.2, 2.0 tag v2.2.3
2.2.2 2017-03-01 1.0, 1.1, 1.2, 2.0 tag v2.2.2
2.2.1 2016-08-07 1.0, 1.1, 1.2, 2.0 tag v2.2.1
2.1.6 2016-04-06 1.0, 1.1, 1.2, 2.0 tag v2.1.6
2.0.17 2014-08-22 1.1, 1.2 tag v2.0.17
1.0.4 2012-04-12 1.0, 1.1 tag v1.0.4

Prerequisites

If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):

# Download current stable 2.x.x branch (Swagger and OpenAPI version 2)
wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.24/swagger-codegen-cli-2.4.24.jar -O swagger-codegen-cli.jar

java -jar swagger-codegen-cli.jar help

# Download current stable 3.x.x branch (OpenAPI version 3)
wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.30/swagger-codegen-cli-3.0.30.jar -O swagger-codegen-cli.jar

java -jar swagger-codegen-cli.jar --help

For Windows users, you will need to install wget or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. Invoke-WebRequest -OutFile swagger-codegen-cli.jar https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.24/swagger-codegen-cli-2.4.24.jar

On a mac, it's even easier with brew:

brew install swagger-codegen

To build from source, you need the following installed and available in your $PATH:

OS X Users

Don't forget to install Java 8+.

Export JAVA_HOME in order to use the supported Java version:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
export PATH=${JAVA_HOME}/bin:$PATH

Building

After cloning the project, you can build it from source with this command:

mvn clean package

If you don't have maven installed, you may directly use the included maven wrapper, and build with the command:

./mvnw clean package

Homebrew

To install, run brew install swagger-codegen

Here is an example usage:

swagger-codegen generate -i https://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/

Docker

Development in docker

You can use run-in-docker.sh to do all development. This script maps your local repository to /gen in the docker container. It also maps ~/.m2/repository to the appropriate container location.

To execute mvn package:

git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
./run-in-docker.sh mvn package

Build artifacts are now accessible in your working directory.

Once built, run-in-docker.sh will act as an executable for swagger-codegen-cli. To generate code, you'll need to output to a directory under /gen (e.g. /gen/out). For example:

./run-in-docker.sh help # Executes 'help' command for swagger-codegen-cli
./run-in-docker.sh langs # Executes 'langs' command for swagger-codegen-cli
./run-in-docker.sh /gen/bin/go-petstore.sh  # Builds the Go client
./run-in-docker.sh generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml \
    -l go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore

Standalone generator Development in docker

See standalone generator development

Run Docker in Vagrant

Prerequisite: install Vagrant and VirtualBox.

git clone http://github.com/swagger-api/swagger-codegen.git
cd swagger-codegen
vagrant up
vagrant ssh
cd /vagrant
./run-in-docker.sh mvn package

Public Pre-built Docker images

Swagger Generator Docker Image

The Swagger Generator image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code.

Example usage (note this assumes jq is installed for command line processing of JSON):

# Start container and save the container id
CID=$(docker run -d swaggerapi/swagger-generator)
# allow for startup
sleep 5
# Get the IP of the running container
GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}'  $CID)
# Execute an HTTP request and store the download link
RESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
  "swaggerUrl": "https://petstore.swagger.io/v2/swagger.json"
}' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '"')
# Download the generated zip and redirect to a file
curl $RESULT > result.zip
# Shutdown the swagger generator image
docker stop $CID && docker rm $CID

In the example above, result.zip will contain the generated client.

Swagger Codegen CLI Docker Image

The Swagger Codegen image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version.

To generate code with this image, you'll need to mount a local location as a volume.

Example:

docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
    -i https://petstore.swagger.io/v2/swagger.json \
    -l go \
    -o /local/out/go

(On Windows replace ${PWD} with %CD%)

The generated code will be located under ./out/go in the current directory.

Getting Started

To generate a PHP client for https://petstore.swagger.io/v2/swagger.json, please run the following

git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
mvn clean package
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
   -i https://petstore.swagger.io/v2/swagger.json \
   -l php \
   -o /var/tmp/php_api_client

(if you're on Windows, replace the last command with java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i https://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client)

You can also download the JAR (latest release) directly from maven.org

To get a list of general options available, please run java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate (for version 3.x check 3.0.0 branch)

To get a list of PHP specified options (which can be passed to the generator with a config file via the -c option), please run java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l php

Generators

To generate a sample client library

You can build a client against the swagger sample petstore API as follows:

./bin/java-petstore.sh

(On Windows, run .\bin\windows\java-petstore.bat instead)

This will run the generator with this command:

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
  -i https://petstore.swagger.io/v2/swagger.json \
  -l java \
  -o samples/client/petstore/java

with a number of options. You can get the options with the help generate command (below only shows partial results):

NAME
        swagger-codegen-cli generate - Generate code with chosen lang

SYNOPSIS
        swagger-codegen-cli generate
                [(-a <authorization> | --auth <authorization>)]
                [--additional-properties <additional properties>...]
                [--api-package <api package>] [--artifact-id <artifact id>]
                [--artifact-version <artifact version>]
                [(-c <configuration file> | --config <configuration file>)]
                [-D <system properties>...] [--git-repo-id <git repo id>]
                [--git-user-id <git user id>] [--group-id <group id>]
                [--http-user-agent <http user agent>]
                (-i <spec file> | --input-spec <spec file>)
                [--ignore-file-override <ignore file override location>]
                [--import-mappings <import mappings>...]
                [--instantiation-types <instantiation types>...]
                [--invoker-package <invoker package>]
                (-l <language> | --lang <language>)
                [--language-specific-primitives <language specific primitives>...]
                [--library <library>] [--model-name-prefix <model name prefix>]
                [--model-name-suffix <model name suffix>]
                [--model-package <model package>]
                [(-o <output directory> | --output <output directory>)]
                [--release-note <release note>] [--remove-operation-id-prefix]
                [--reserved-words-mappings <reserved word mappings>...]
                [(-s | --skip-overwrite)]
                [(-t <template directory> | --template-dir <template directory>)]
                [--type-mappings <type mappings>...] [(-v | --verbose)]

OPTIONS
        -a <authorization>, --auth <authorization>
            adds authorization headers when fetching the swagger definitions
            remotely. Pass in a URL-encoded string of name:header with a comma
            separating multiple values

...... (results omitted)

        -v, --verbose
            verbose mode

You can then compile and run the client, as well as unit tests against it:

cd samples/client/petstore/java
mvn package

Other languages have petstore samples, too:

./bin/android-petstore.sh
./bin/java-petstore.sh
./bin/objc-petstore.sh

Generating libraries from your server

It's just as easy--just use the -i flag to point to either a server or file.

Modifying the client library format

Don't like the default swagger client syntax? Want a different language supported? No problem! Swagger Codegen processes mustache templates with the jmustache engine. You can modify our templates or make your own.

You can look at modules/swagger-codegen/src/main/resources/${your-language} for examples. To make your own templates, create your own files and use the -t flag to specify your template folder. It actually is that easy.

Making your own codegen modules

If you're starting a project with a new language and don't see what you need, Swagger Codegen can help you create a project to generate your own libraries:

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar meta \
  -o output/myLibrary -n myClientCodegen -p com.my.company.codegen

This will write, in the folder output/myLibrary, all the files you need to get started, including a `README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic.

You would then compile your library in the output/myLibrary folder with mvn package and execute the codegen like such:

java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen

For Windows users, you will need to use ; instead of : in the classpath, e.g.

java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar;modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen

Note the myClientCodegen is an option now, and you can use the usual arguments for generating your library:

java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \
  io.swagger.codegen.SwaggerCodegen generate -l myClientCodegen\
  -i https://petstore.swagger.io/v2/swagger.json \
  -o myClient

See also standalone generator development

Where is Javascript???

See our javascript library--it's completely dynamic and doesn't require static code generation. There is a third-party component called swagger-js-codegen that can generate angularjs or nodejs source code from an OpenAPI Specification.

On Dec 7th 2015, a Javascript API client generator has been added by @jfiala.

Generating a client from local files

If you don't want to call your server, you can save the OpenAPI Spec files into a directory and pass an argument to the code generator like this:

-i ./modules/swagger-codegen/src/test/resources/2_0/petstore.json

Great for creating libraries on your ci server, from the Swagger Editor... or while coding on an airplane.

Selective generation

You may not want to generate all models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output:

The default is generate everything supported by the specific library. Once you enable a feature, it will restrict the contents generated:

# generate only models
java -Dmodels {opts}

# generate only apis
java -Dapis {opts}

# generate only supporting files
java -DsupportingFiles

# generate models and supporting files
java -Dmodels -DsupportingFiles

To control the specific files being generated, you can pass a CSV list of what you want:

# generate the User and Pet models only
-Dmodels=User,Pet

# generate the User model and the supportingFile `StringUtil.java`:
-Dmodels=User -DsupportingFiles=StringUtil.java

To control generation of docs and tests for api and models, pass false to the option. For api, these options are -DapiTests=false and -DapiDocs=false. For models, -DmodelTests=false and -DmodelDocs=false. These options default to true and don't limit the generation of the feature options listed above (like -Dapi):

# generate only models (with tests and documentation)
java -Dmodels {opts}

# generate only models (with tests but no documentation)
java -Dmodels -DmodelDocs=false {opts}

# generate only User and Pet models (no tests and no documentation)
java -Dmodels=User,Pet -DmodelTests=false {opts}

# generate only apis (without tests)
java -Dapis -DapiTests=false {opts}

# generate only apis (modelTests option is ignored)
java -Dapis -DmodelTests=false {opts}

When using selective generation, only the templates needed for the specific generation will be used.

Ignore file format

Swagger Codegen supports a .swagger-codegen-ignore file, similar to .gitignore or .dockerignore you're probably already familiar with.

The ignore file allows for better control over overwriting existing files than the --skip-overwrite flag. With the ignore file, you can specify individual files or directories can be ignored. This can be useful, for example if you only want a subset of the generated code.

Examples:

# Swagger Codegen Ignore
# Lines beginning with a # are comments

# This should match build.sh located anywhere.
build.sh

# Matches build.sh in the root
/build.sh

# Exclude all recursively
docs/**

# Explicitly allow files excluded by other rules
!docs/UserApi.md

# Recursively exclude directories named Api
# You can't negate files below this directory.
src/**/Api/

# When this file is nested under /Api (excluded above),
# this rule is ignored because parent directory is excluded by previous rule.
!src/**/PetApiTests.cs

# Exclude a single, nested file explicitly
src/IO.Swagger.Test/Model/AnimalFarmTests.cs

The .swagger-codegen-ignore file must exist in the root of the output directory.

Upon first code generation, you may also pass the CLI option --ignore-file-override=/path/to/ignore_file for greater control over generated outputs. Note that this is a complete override, and will override the .swagger-codegen-ignore file in an output directory when regenerating code.

Editor support for .swagger-codegen-ignore files is available in IntelliJ via the .ignore plugin.

Customizing the generator

There are different aspects of customizing the code generator beyond just creating or modifying templates. Each language has a supporting configuration file to handle different type mappings, etc:

$ ls -1 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/
AbstractJavaJAXRSServerCodegen.java
AbstractTypeScriptClientCodegen.java
... (results omitted)
TypeScriptAngularClientCodegen.java
TypeScriptNodeClientCodegen.java

Each of these files creates reasonable defaults so you can get running quickly. But if you want to configure package names, prefixes, model folders, etc. you can use a json config file to pass the values.

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
  -i https://petstore.swagger.io/v2/swagger.json \
  -l java \
  -o samples/client/petstore/java \
  -c path/to/config.json

and config.json contains the following as an example:

{
  "apiPackage" : "petstore"
}

Supported config options can be different per language. Running config-help -l {lang} will show available options. These options are applied via configuration file (e.g. config.json) or by passing them with java -jar swagger-codegen-cli.jar -D{optionName}={optionValue}. (If -D{optionName} does not work, please open a ticket and we'll look into it)

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l java

Output

CONFIG OPTIONS
	modelPackage
	    package for generated models

	apiPackage
	    package for generated api classes
...... (results omitted)
	library
	    library template (sub-template) to use:
	    jersey1 - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2
	    jersey2 - HTTP client: Jersey client 2.6
	    feign - HTTP client: Netflix Feign 8.1.1.  JSON processing: Jackson 2.6.3
	    okhttp-gson (default) - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1
	    retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0)
        retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2)
        google-api-client - HTTP client: google-api-client 1.23.0. JSON processing: Jackson 2.8.9
        rest-assured - HTTP client: rest-assured : 3.1.0. JSON processing: Gson 2.6.1. Only for Java8

Your config file for Java can look like

{
  "groupId": "com.my.company",
  "artifactId": "MyClient",
  "artifactVersion": "1.2.0",
  "library": "feign"
}

For all the unspecified options default values will be used.

Another way to override default options is to extend the config class for the specific language. To change, for example, the prefix for the Objective-C generated files, simply subclass the ObjcClientCodegen.java:

package com.mycompany.swagger.codegen;

import io.swagger.codegen.languages.*;

public class MyObjcCodegen extends ObjcClientCodegen {
    static {
        PREFIX = "HELO";
    }
}

and specify the classname when running the generator:

-l com.mycompany.swagger.codegen.MyObjcCodegen

Your subclass will now be loaded and overrides the PREFIX value in the superclass.

Bringing your own models

Sometimes you don't want a model generated. In this case, you can simply specify an import mapping to tell the codegen what not to create. When doing this, every location that references a specific model will refer back to your classes. Note, this may not apply to all languages...

To specify an import mapping, use the --import-mappings argument and specify the model-to-import logic as such:

--import-mappings Pet=my.models.MyPet

Or for multiple mappings:

--import-mappings Pet=my.models.MyPet,Order=my.models.MyOrder

or

--import-mappings Pet=my.models.MyPet --import-mappings Order=my.models.MyOrder

Validating your OpenAPI Spec

You have options. The easiest is to use our online validator which not only will let you validate your spec, but with the debug flag, you can see what's wrong with your spec. For example:

http://online.swagger.io/validator/debug?url=https://petstore.swagger.io/v2/swagger.json

Generating dynamic html api documentation

To do so, just use the -l dynamic-html flag when reading a spec file. This creates HTML documentation that is available as a single-page application with AJAX. To view the documentation:

cd samples/dynamic-html/
npm install
node .

Which launches a node.js server so the AJAX calls have a place to go.

Generating static html api documentation

To do so, just use the -l html flag when reading a spec file. This creates a single, simple HTML file with embedded css so you can ship it as an email attachment, or load it from your filesystem:

cd samples/html/
open index.html

To build a server stub

Please refer to https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO for more information.

To build the codegen library

This will create the Swagger Codegen library from source.

mvn package

Note! The templates are included in the library generated. If you want to modify the templates, you'll need to either repackage the library OR specify a path to your scripts

Workflow Integration

Maven Integration

You can use the swagger-codegen-maven-plugin for integrating with your workflow, and generating any codegen target.

Gradle Integration

Gradle Swagger Generator Plugin is available for generating source code and API document.

GitHub Integration

To push the auto-generated SDK to GitHub, we provide git_push.sh to streamline the process. For example:

  1. Create a new repository in GitHub (Ref: https://help.github.com/articles/creating-a-new-repository/)

  2. Generate the SDK

 java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
 -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l perl \
 --git-user-id "swaggerapi" \
 --git-repo-id "petstore-perl" \
 --release-note "Github integration demo" \
 -o /var/tmp/perl/petstore
  1. Push the SDK to GitHub
cd /var/tmp/perl/petstore
/bin/sh ./git_push.sh

Online generators

One can also generate API client or server using the online generators (https://generator.swagger.io)

For example, to generate Ruby API client, simply send the following HTTP request using curl:

curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"https://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby

Then you will receive a JSON response with the URL to download the zipped code.

To customize the SDK, you can POST to https://generator.swagger.io/api/gen/clients/{language} with the following HTTP body:

{
  "options":  {},
  "swaggerUrl": "https://petstore.swagger.io/v2/swagger.json"
}

in which the options for a language can be obtained by submitting a GET request to https://generator.swagger.io/api/gen/clients/{language}:

For example, curl https://generator.swagger.io/api/gen/clients/python returns

{
  "packageName": {
    "opt": "packageName",
    "description": "python package name (convention: snake_case).",
    "type": "string",
    "default": "swagger_client"
  },
  "packageVersion": {
    "opt": "packageVersion",
    "description": "python package version.",
    "type": "string",
    "default": "1.0.0"
  },
  "sortParamsByRequiredFlag": {
    "opt": "sortParamsByRequiredFlag",
    "description": "Sort method arguments to place required parameters before optional parameters.",
    "type": "boolean",
    "default": "true"
  }
}

To set package name to pet_store, the HTTP body of the request is as follows:

{
  "options": {
    "packageName": "pet_store"
  },
  "swaggerUrl": "https://petstore.swagger.io/v2/swagger.json"
}

and here is the curl command:

curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "https://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python

Instead of using swaggerUrl with an URL to the OpenAPI/Swagger spec, one can include the spec in the JSON payload with spec, e.g.

{
  "options": {},
  "spec": {
    "swagger": "2.0",
    "info": {
      "version": "1.0.0",
      "title": "Test API"
    },
    ...
  }
}

Guidelines for Contribution

Please refer to this page

Companies/Projects using Swagger Codegen

Here are some companies/projects using Swagger Codegen in production. To add your company/project to the list, please visit README.md and click on the icon to edit the page.

Presentations/Videos/Tutorials/Books

Swagger Codegen Core Team

Swagger Codegen core team members are contributors who have been making significant contributions (review issues, fix bugs, make enhancements, etc) to the project on a regular basis.

Core Team Members

Template Creator

Here is a list of template creators:

  • API Clients:
    • Ada: @stcarrez
    • Akka-Scala: @cchafer
    • Apex: @asnelling
    • Bash: @bkryza
    • C++ REST: @Danielku15
    • C# (.NET 2.0): @who
    • C# (.NET Standard 1.3 ): @Gronsak
    • C# (.NET 4.5 refactored): @jimschubert
    • Clojure: @xhh
    • Dart: @yissachar
    • Dart (refactored in 2.4.0): @joernahrens
    • Elixir: @niku
    • Elm: @trenneman
    • Eiffel: @jvelilla
    • Erlang: @tsloughter
    • Groovy: @victorgit
    • Go: @wing328
    • Go (rewritten in 2.3.0): @antihax
    • Haskell (http-client): @jonschoning
    • Java (Feign): @davidkiss
    • Java (Retrofit): @0legg
    • Java (Retrofit2): @emilianobonassi
    • Java (Jersey2): @xhh
    • Java (okhttp-gson): @xhh
    • Java (RestTemplate): @nbruno
    • Java (RESTEasy): @gayathrigs
    • Java (Vertx): @lopesmcc
    • Java (Google APIs Client Library): @charlescapps
    • Java (Rest-assured): @viclovsky
    • Javascript/NodeJS: @jfiala
    • Javascript (Closure-annotated Angular) @achew22
    • JMeter: @davidkiss
    • Kotlin: @jimschubert
    • Lua: @daurnimator
    • Perl: @wing328
    • PHP (Guzzle): @baartosz
    • PowerShell: @beatcracker
    • R: @ramnov
    • Rust: @farcaller
    • Rust (rust-server): @metaswitch
    • Scala (scalaz & http4s): @tbrown1979
    • Swift: @tkqubo
    • Swift 3: @hexelon
    • Swift 4: @ehyche
    • TypeScript (Node): @mhardorf
    • TypeScript (Angular1): @mhardorf
    • TypeScript (Fetch): @leonyu
    • TypeScript (Angular2): @roni-frantchi
    • TypeScript (jQuery): @bherila
  • Server Stubs
    • Ada: @stcarrez
    • C# ASP.NET5: @jimschubert
    • C# NancyFX: @mstefaniuk
    • C++ Pistache: @sebymiano
    • C++ Restbed: @stkrwork
    • Erlang Server: @galaxie
    • Go Server: @guohuang
    • Haskell Servant: @algas
    • Java MSF4J: @sanjeewa-malalgoda
    • Java Spring Boot: @diyfr
    • Java Undertow: @stevehu
    • Java Play Framework: @JFCote
    • Java PKMST: @anshu2185 @sanshuman @rkumar-pk @ninodpillai
    • JAX-RS RestEasy: @chameleon82
    • JAX-RS CXF: @hiveship
    • JAX-RS CXF (CDI): @nickcmaynard
    • JAX-RS RestEasy (JBoss EAP): @jfiala
    • Kotlin: @jimschubert
    • PHP Lumen: @abcsun
    • PHP Slim: @jfastnacht
    • PHP Symfony: @ksm2
    • PHP Zend Expressive (with Path Handler): @Articus
    • Ruby on Rails 5: @zlx
    • Rust (rust-server): @metaswitch
    • Scala Finch: @jimschubert
    • Scala Lagom: @gmkumar2005
  • Documentation
    • HTML Doc 2: @jhitchcock
    • Confluence Wiki: @jhitchcock
  • Configuration
    • Apache2: @stkrwork

How to join the core team

Here are the requirements to become a core team member:

To become a Template Creator, simply submit a PR for new API client (e.g. Rust, Elixir) or server stub (e.g. Ruby Grape) generator.

Swagger Codegen Technical Committee

Members of the Swagger Codegen technical committee shoulder the following responsibilities:

  • Provides guidance and direction to other users
  • Reviews pull requests and issues
  • Improves the generator by making enhancements, fixing bugs or updating documentations
  • Sets the technical direction of the generator

Who is eligible? Those who want to join must have at least 3 PRs merged into a generator. (Exceptions can be granted to template creators or contributors who have made a lot of code changes with less than 3 merged PRs)

Members of Technical Committee

Languages Member (join date)
ActionScript
Ada @stcarrez (2018/02)
Android
Apex
Bash @kenjones-cisco (2017/09)
C++
C# @mandrean (2017/08)
Clojure
Dart @ircecho (2017/07)
Eiffel
Elixir
Elm
Erlang
Groovy
Go
Haskell
Java
Kotlin
Lua
NodeJS/Javascript @CodeNinjai (2017/07)
ObjC
Perl
PHP @dkarlovi (2017/07) @mandrean (2017/08)
Python @kenjones-cisco (2017/11)
R
Ruby @zlx (2017/09)
Rust
Scala
Swift @ehyche (2017/08)
TypeScript

Security contact

Please disclose any security-related issues or vulnerabilities by emailing [email protected], instead of using the public issue tracker.

License information on Generated Code

The Swagger Codegen project is intended as a benefit for users of the Swagger / Open API Specification. The project itself has the License as specified. In addition, please understand the following points:

  • The templates included with this project are subject to the License.
  • Generated code is intentionally not subject to the parent project license

When code is generated from this project, it shall be considered AS IS and owned by the user of the software. There are no warranties--expressed or implied--for generated code. You can do what you wish with it, and once generated, the code is your responsibility and subject to the licensing terms that you deem appropriate.

License

Copyright 2019 SmartBear Software

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • How to use swagger-codegen for Typescript-angular2

    How to use swagger-codegen for Typescript-angular2

    Reference https://github.com/swagger-api/swagger-codegen/tree/master/samples/client/petstore/typescript-angular2/npm

    These are ts file , how to compile and create a client ?

    Please help

    Feature: Documentation Client: TypeScript General: Question 
    opened by rajeget 54
  • [CPPREST][CPP] Several Compilation Errors, setTags method missing

    [CPPREST][CPP] Several Compilation Errors, setTags method missing

    Description

    There are several methods which are causing compilation errors.
    fromJson fromMultipart setTags

    While I am able to find fromJson and fromMultipart, I cannot find the method setTags method anywhere. Interestingly, I generated Petstore and Petstore on Heroku samples and this method was not referenced anywhere in that code. Perhaps those specs don't have custom tags and my spec does.

    Swagger-codegen version

    http://editor.swagger.io http://editor2.swagger.io

    Swagger declaration file content or url

    Here is the JSON Swagger spec: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-iothub/2017-01-19/swagger/iothub.json

    Command line used for generation

    http://editor.swagger.io http://editor2.swagger.io

    Both produce this method setTags()

    Steps to reproduce
    1. Generate the code from the provided swagger spec using the web editor.
    2. Open file model\Resource.cpp
    3. Navigate to line 166 and find :

    setTags( newItem );

    This method does not exist anywhere in any version of the the Microsoft CPPREST library: https://github.com/Microsoft/cpprestsdk Nor does it exist in the generated sources.

    Related issues

    I could find no previous github issue referencing the setTags method.

    Suggest a Fix

    I noticed that the QT5 sample for petstore also references the setTags method. In researching, I saw that the CPPREST generator was probably based off the QT5 generator to some extent. It seems possible that the generation of setTags() was copied from the QT5 generator but without the code that generates an implementation of the method. Meanwhile, perhaps none of the sample specs used for testing happen to feature custom tags, so it never got generated during testing and never discovered. All very speculative, I'm really not sure.

    Issue: Bug help wanted Client: C++ 
    opened by solvingj 50
  • C# client does not support text/html output

    C# client does not support text/html output

    I have created a swagger.json file (through Swashbuckle) describing an API that produces text/html (nothing else). The response for "200" defines a schema with a prinitive "type": "string" (no format).

    Now, with swagger-ui, everything works nicely. The response body contains the HTML returned by the Web API. The generated C# client, however, tries to deserialize the string into JSON, which obviously fails. When I (1) remove the generated line of code that attempts to deserialize the response.Content and (2) replace that with a simple return response.Content, everything works as expected.

    Since it works in swagger-ui, which also says the swagger is valid, I'd expect it to work in the generated clients as well. But the code generation seems to ignore the "produces" declaration alltogether. If the API does not prodoce any JSON (text/json, application/json), the client will nevertheless try to deserialize response.Content into JSON (unless the type passed to the ApiClient's Deserialize method is Object).

    Client: C-Sharp 
    opened by ThomasBarnekow 48
  • api paths decorated with :.+ produce invalid angular code

    api paths decorated with :.+ produce invalid angular code

    Description

    If I have the following api path:

    /myservice/{myvar:.+}:

    Then this produces invalid angular code with the typescript-angular plugin.

    Swagger-codegen version

    2.3.0

    Swagger declaration file content or url

    Any API path with: /myservice/{myvar:.+}:

    Command line used for generation

    mvn clean compile

    Steps to reproduce

    Simply put that into your path and use the typescript-angular plugin to generate. The default.service.ts generation is invalid:

    ${this.basePath}/myservice/${encodeURIComponent(String(myvar:.+))}`,

    Produces the following ts compile errors:

    [ERROR] src/app/api/default.service.ts(172,132): error TS1005: ',' expected. [ERROR] src/app/api/default.service.ts(172,133): error TS1135: Argument expression expected. [ERROR] src/app/api/default.service.ts(172,135): error TS1109: Expression expected.

    We will have to regress to 2.2.3 version for the time being. The :.+ construct was working fine in 2.2.3 and enables the system to process variables with "extra" characters such as slashes and the like.

    Issue: Bug Client: TypeScript 
    opened by inthegarage 46
  • [TypeScript][Angular] represent swagger enums as union of literal types

    [TypeScript][Angular] represent swagger enums as union of literal types

    PR checklist

    • [x] Read the contribution guidelines.
    • [x] Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
    • [x] Filed the PR against the correct branch: master for non-breaking changes and 3.0.0 branch for breaking (non-backward compatible) changes.

    Description of the PR

    This PR changes the angular-typescript generator to emit a union of literals for swagger enums, e.g.:

    export type StatusEnum = 'open' | 'inProgress' | 'resolved' | 'closed';
    

    or

    export type ResponseCode = 200 | 404;
    

    enabling their easy use in angular templates, structural subtyping among enums (in particular, different instances of the same enum are now mutually assignable), improving type safety by preventing incorrect widening, and permitting numeric enum values (albeit without descriptive names)

    Fixes #6206, #5146, #3500

    Enhancement: Feature Client: TypeScript Breaking change (without fallback) Feature: Enum 
    opened by bedag-moo 45
  • [Swift] fixes #3788 Support for Swift 3.0

    [Swift] fixes #3788 Support for Swift 3.0

    PR checklist

    • [X] Read the contribution guildelines.
    • [X] Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)
    • [x] Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

    I've upgrade the swift codegen to swift 3.0

    Enhancement: Feature Client: Swift 
    opened by hexelon 43
  • [Rust] add new Rust client generator

    [Rust] add new Rust client generator

    PR checklist

    • [ ] Read the contribution guidelines.
    • [ ] Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
    • [ ] Filed the PR against the correct branch: master for non-breaking changes and 3.0.0 branch for breaking (non-backward compatible) changes.

    Description of the PR

    Add Rust client generator based on the Petstore samples provided by @farcaller (https://github.com/swagger-api/swagger-codegen/pull/6092)

    Enhancement: New generator Client: Rust 
    opened by wing328 40
  • Question: Plan for OpenAPI-Specification 3.0

    Question: Plan for OpenAPI-Specification 3.0

    With the first Implementer Draft of the 3.0 spec due to be released at the end of February is there a plan to begin implementing the features of the 3.0 spec into the generator?

    https://www.openapis.org/blog/2017/01/24/a-new-year-a-new-specification

    Enhancement: Feature General: Discussion 
    opened by JLLeitschuh 40
  • Nancyfx codegen (C#)

    Nancyfx codegen (C#)

    Here you have codegen for .NET NancyFX framework. It generates code for library that should be shared as compiled artifact (NuGet). So there is no tests but Nancy REST module, service interface and simplified abstract implementation. It is heavily tested within private projects.

    Enhancement: Feature Server: C-Sharp 
    opened by mstefaniuk 36
  • Does any codegen work for open api spec 3 yet?

    Does any codegen work for open api spec 3 yet?

    I know it's not released, but I got the impression much of the functionality was there for the version 3 spec. Particularly interested in the server stub generation.

    I tried both the 3.0.0 branch (checkout and mvn clean package) and the snapshot from 24 Sept from https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/3.0.0-SNAPSHOT/

    I tried with a sample.yml which is a direct copy of the basic example from https://swagger.io/docs/specification/basic-structure/

    openapi: 3.0.0
    info:
      title: Sample API
      description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
      version: 0.1.9
    
    servers:
      - url: http://api.example.com/v1
        description: Optional server description, e.g. Main (production) server
      - url: http://staging-api.example.com
        description: Optional server description, e.g. Internal staging server for testing
    
    paths:
      /users:
        get:
          summary: Returns a list of users.
          description: Optional extended description in CommonMark or HTML.
          responses:
            '200':    # status code
              description: A JSON array of user names
              content:
                'application/json':
                  schema: 
                    type: array
                    items: 
                      type: string
    

    It fails on the first line with Unrecognized token 'openapi': was expecting ('true', 'false' or 'null')

    Full output (with -v)

    [adamc@adamc-centos push]$ java -jar ./swagger-codegen-cli-3.0.0-20170924.102354-5.jar generate   -i sample.yml   -l aspnetcore   -o samples3/server/aspnetcore -v
    [main] INFO io.swagger.codegen.config.CodegenConfigurator -
    VERBOSE MODE: ON. Additional debug options are injected
     - [debugSwagger] prints the swagger specification as interpreted by the codegen
     - [debugModels] prints models passed to the template engine
     - [debugOperations] prints operations passed to the template engine
     - [debugSupportingFiles] prints additional data passed to the template engine
    [main] INFO io.swagger.parser.Swagger20Parser - reading from sample.yml
    [main] INFO io.swagger.parser.Swagger20Parser - reading from sample.yml
    [main] ERROR io.swagger.parser.SwaggerCompatConverter - failed to read resource listing
    com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting ('true', 'false' or 'null')
     at [Source: sample.yml; line: 1, column: 9]
            at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1702)
            at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:558)
            at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidToken(UTF8StreamJsonParser.java:3528)
            at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2686)
            at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:878)
            at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:772)
            at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3850)
            at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3799)
            at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2447)
            at io.swagger.parser.SwaggerCompatConverter.readResourceListing(SwaggerCompatConverter.java:189)
            at io.swagger.parser.SwaggerCompatConverter.read(SwaggerCompatConverter.java:116)
            at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:75)
            at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:431)
            at io.swagger.codegen.cmd.Generate.run(Generate.java:283)
            at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
    [main] WARN io.swagger.codegen.ignore.CodegenIgnoreProcessor - Output directory does not exist, or is inaccessible. No file (.swager-codegen-ignore) will be evaluated.
    Exception in thread "main" java.lang.RuntimeException: missing swagger input or config!
            at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:715)
            at io.swagger.codegen.cmd.Generate.run(Generate.java:285)
            at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
    

    Am I doing something wrong? Do I need to call it differently for version 3 (help generate seems the same, although I'm new to swagger and don't know what all the options do). I not ice it's using io.swagger.parser.Swagger20Parser, which I guess is the 2.0 parser. Or is this not implemented yet for 3.0

    Swagger-Parser 
    opened by slarti-b 35
  • [TypeScript][Angular] Add optional support for HttpClient

    [TypeScript][Angular] Add optional support for HttpClient

    Support HttpClient in addition to Http, clean up generated code

    Fixes #6080

    PR checklist

    • [x] Read the contribution guidelines.
    • [x] Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
    • [x] Filed the PR against the correct branch: master for non-breaking changes and 3.0.0 branch for breaking (non-backward compatible) changes.
    Enhancement: Feature Client: TypeScript 
    opened by bedag-moo 35
  • Support for pyproject.toml

    Support for pyproject.toml

    Description

    Since pyproject.toml is going to replace old python packaging system (with setup.py and setuptools), it would be nice to add ability to generate pyproject.toml instad of setup.py and requirements.txt

    We use poetry for dependency management and want to utilize swagger-codegen for code generation. We would like to use the same workflow for generated packages as we use for other packages.

    Swagger-codegen version

    3.0.36

    Suggest a fix/enhancement

    Option to generate pyproject.toml

    opened by s-vitaliy 0
  • Added changes to pick OS root cert

    Added changes to pick OS root cert

    PR checklist

    • [x] Read the contribution guidelines.
    • [x] Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
    • [x] Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
    • [x] Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

    Description of the PR

    • Added change in rest.mustache to read OS Root Cert using truststore
    • Added change in configuration.mustache to ask user if user wants to use OS root CA
    • Added dependency of truststore to requirements.mustache

    Kindly review: @kenjones-cisco

    opened by inviul 0
  • ruby http client integration to use httpx instead of typhoeus

    ruby http client integration to use httpx instead of typhoeus

    PR checklist

    • [x] Read the contribution guidelines.
    • [ ] Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
    • [x] Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
    • [ ] Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

    Description of the PR

    This PR proposes switching the HTTP library used by API clients generated for ruby.

    httpx is a modern ruby HTTP client, which provides most of the features out-of-the-box that an API client requires.

    typhoeus hasn't seen a release in 3 years, and sees little activity lately. It's also known for a huge number of issues reported due to compilation/linking to curl.

    httpx being pure ruby, supporting HTTP/2 and concurrent requests, it supports the same and then some features of typhoeus while being easier to install (no native extensions required).

    This switch is made conservatively, by "switching the engine" while keeping the same public API as before.

    opened by HoneyryderChuck 2
  • CVE-2022-1471 (High) detected in snakeyaml-1.33.jar

    CVE-2022-1471 (High) detected in snakeyaml-1.33.jar

    CVE-2022-1471 - High Severity Vulnerability

    Vulnerable Library - snakeyaml-1.33.jar

    YAML 1.1 parser and emitter for Java

    Library home page: https://bitbucket.org/snakeyaml/snakeyaml

    Path to dependency file: /modules/swagger-codegen-cli/pom.xml

    Path to vulnerable library: /modules/swagger-generator/target/swagger-generator-2.4.30-SNAPSHOT/WEB-INF/lib/snakeyaml-1.33.jar,/home/wss-scanner/.m2/repository/org/yaml/snakeyaml/1.33/snakeyaml-1.33.jar,/home/wss-scanner/.m2/repository/org/yaml/snakeyaml/1.33/snakeyaml-1.33.jar,/home/wss-scanner/.m2/repository/org/yaml/snakeyaml/1.33/snakeyaml-1.33.jar,/home/wss-scanner/.m2/repository/org/yaml/snakeyaml/1.33/snakeyaml-1.33.jar,/modules/swagger-generator/target/lib/snakeyaml-1.33.jar

    Dependency Hierarchy:

    • :x: snakeyaml-1.33.jar (Vulnerable Library)

    Found in HEAD commit: 4b7a8d7d7384aa6a27d6309c35ade0916edae7ed

    Found in base branches: 3.0.0, master

    Vulnerability Details

    SnakeYaml's Constructor() class does not restrict types which can be instantiated during deserialization. Deserializing yaml content provided by an attacker can lead to remote code execution. We recommend using SnakeYaml's SafeConsturctor when parsing untrusted content to restrict deserialization.

    Publish Date: 2022-12-01

    URL: CVE-2022-1471

    CVSS 3 Score Details (9.8)

    Base Score Metrics:

    • Exploitability Metrics:
      • Attack Vector: Network
      • Attack Complexity: Low
      • Privileges Required: None
      • User Interaction: None
      • Scope: Unchanged
    • Impact Metrics:
      • Confidentiality Impact: High
      • Integrity Impact: High
      • Availability Impact: High

    For more information on CVSS3 Scores, click here.

    Suggested Fix

    Type: Upgrade version

    Origin: https://nvd.nist.gov/vuln/detail/CVE-2022-1471

    Release Date: 2022-12-01

    Fix Resolution: org.yaml:snakeyaml - 1.31


    • [ ] Check this box to open an automated fix PR
    security vulnerability 
    opened by mend-for-github-com[bot] 0
  • CVE-2022-45693 (High) detected in jettison-1.1.jar

    CVE-2022-45693 (High) detected in jettison-1.1.jar

    CVE-2022-45693 - High Severity Vulnerability

    Vulnerable Library - jettison-1.1.jar

    A StAX implementation for JSON.

    Path to dependency file: /samples/client/petstore/scala/build.gradle

    Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/org.codehaus.jettison/jettison/1.1/1a01a2a1218fcf9faa2cc2a6ced025bdea687262/jettison-1.1.jar,/home/wss-scanner/.gradle/caches/modules-2/files-2.1/org.codehaus.jettison/jettison/1.1/1a01a2a1218fcf9faa2cc2a6ced025bdea687262/jettison-1.1.jar

    Dependency Hierarchy:

    • jersey-ahc-client-1.0.5.jar (Root Library)
      • jersey-json-1.14.jar
        • :x: jettison-1.1.jar (Vulnerable Library)

    Found in HEAD commit: 4b7a8d7d7384aa6a27d6309c35ade0916edae7ed

    Found in base branch: master

    Vulnerability Details

    Jettison before v1.5.2 was discovered to contain a stack overflow via the map parameter. This vulnerability allows attackers to cause a Denial of Service (DoS) via a crafted string.

    Publish Date: 2022-12-13

    URL: CVE-2022-45693

    CVSS 3 Score Details (7.5)

    Base Score Metrics:

    • Exploitability Metrics:
      • Attack Vector: Network
      • Attack Complexity: Low
      • Privileges Required: None
      • User Interaction: None
      • Scope: Unchanged
    • Impact Metrics:
      • Confidentiality Impact: None
      • Integrity Impact: None
      • Availability Impact: High

    For more information on CVSS3 Scores, click here.

    Suggested Fix

    Type: Upgrade version

    Release Date: 2022-12-13

    Fix Resolution: org.codehaus.jettison:jettison:1.5.2

    security vulnerability 
    opened by mend-for-github-com[bot] 0
  • CVE-2022-45685 (High) detected in jettison-1.1.jar

    CVE-2022-45685 (High) detected in jettison-1.1.jar

    CVE-2022-45685 - High Severity Vulnerability

    Vulnerable Library - jettison-1.1.jar

    A StAX implementation for JSON.

    Path to dependency file: /samples/client/petstore/scala/build.gradle

    Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/org.codehaus.jettison/jettison/1.1/1a01a2a1218fcf9faa2cc2a6ced025bdea687262/jettison-1.1.jar,/home/wss-scanner/.gradle/caches/modules-2/files-2.1/org.codehaus.jettison/jettison/1.1/1a01a2a1218fcf9faa2cc2a6ced025bdea687262/jettison-1.1.jar

    Dependency Hierarchy:

    • jersey-ahc-client-1.0.5.jar (Root Library)
      • jersey-json-1.14.jar
        • :x: jettison-1.1.jar (Vulnerable Library)

    Found in HEAD commit: 4b7a8d7d7384aa6a27d6309c35ade0916edae7ed

    Found in base branch: master

    Vulnerability Details

    A stack overflow in Jettison before v1.5.2 allows attackers to cause a Denial of Service (DoS) via crafted JSON data.

    Publish Date: 2022-12-13

    URL: CVE-2022-45685

    CVSS 3 Score Details (7.5)

    Base Score Metrics:

    • Exploitability Metrics:
      • Attack Vector: Network
      • Attack Complexity: Low
      • Privileges Required: None
      • User Interaction: None
      • Scope: Unchanged
    • Impact Metrics:
      • Confidentiality Impact: None
      • Integrity Impact: None
      • Availability Impact: High

    For more information on CVSS3 Scores, click here.

    Suggested Fix

    Type: Upgrade version

    Release Date: 2022-12-13

    Fix Resolution: org.codehaus.jettison:jettison:1.5.2

    security vulnerability 
    opened by mend-for-github-com[bot] 0
Releases(v3.0.36)
  • v3.0.36(Nov 11, 2022)

    3.0.36 release of swagger-codegen with OpenAPI 3 support.

    See also https://github.com/swagger-api/swagger-codegen-generators/releases/tag/v1.0.36

    What's Changed

    • updated jackson dependency in java samples by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11881
    • updated java samples affected by security issue by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11897
    • updated csharp samples with security dependency issue fixed by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11902
    • bump snakeyaml to 1.33 by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11917
    • CSharp and ASPNetCore samples update by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11918

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v3.0.35...v3.0.36

    Source code(tar.gz)
    Source code(zip)
  • v2.4.29(Nov 10, 2022)

    What's Changed

    • changed pattern to work with acronyms in underscore conversion by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11892
    • bump snakeyaml to 1.33 by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11916
    • Make generic model compatible with PHP 8.1 by @BafS in https://github.com/swagger-api/swagger-codegen/pull/11846

    New Contributors

    • @BafS made their first contribution in https://github.com/swagger-api/swagger-codegen/pull/11846

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v2.4.28...v2.4.29

    Source code(tar.gz)
    Source code(zip)
  • v3.0.35(Aug 15, 2022)

    3.0.35 release of swagger-codegen with OpenAPI 3 support.

    See also https://github.com/swagger-api/swagger-codegen-generators/releases/tag/v1.0.35

    What's Changed

    • swagger-codegen#4883: Expose skipInlineModelMatches flag in Maven plugin by @hlyakhovich in https://github.com/swagger-api/swagger-codegen/pull/9672
    • fix flatten option by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11804
    • polymorphism java tests by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11832
    • added composed schema extension for composed models founds by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11829

    New Contributors

    • @hlyakhovich made their first contribution in https://github.com/swagger-api/swagger-codegen/pull/9672

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v3.0.34...v3.0.35

    Source code(tar.gz)
    Source code(zip)
  • v2.4.28(Aug 15, 2022)

    What's Changed

    • fix flatten option and minimize quotes by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11803
    • fix: use information in generator host for generating spec by @fgreinacher in https://github.com/swagger-api/swagger-codegen/pull/11738
    • Workflows for generators by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11818

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v2.4.27...v2.4.28

    Source code(tar.gz)
    Source code(zip)
  • v3.0.34(Apr 12, 2022)

    3.0.34 release of swagger-codegen with OpenAPI 3 support.

    See also https://github.com/swagger-api/swagger-codegen-generators/releases/tag/v1.0.34

    What's Changed

    • fix handling of empty paths by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11708
    • Handlebars 4.2.1 by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11705
    • add org.owasp dependency in security profile by @gracekarina in https://github.com/swagger-api/swagger-codegen/pull/11722
    • added tests files for springboot generated code by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11728
    • added new petstore sample file by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11729
    • bump jackson to 2.13.2 by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11764

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v3.0.33...v3.0.34

    Source code(tar.gz)
    Source code(zip)
  • v2.4.27(Apr 12, 2022)

    What's Changed

    • refs #11373 - latest log4j version in scala gradle by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11712
    • fix: use GENERATOR_HOST variable in server generation by @fgreinacher in https://github.com/swagger-api/swagger-codegen/pull/11711
    • fix: respect configured generator URL in swagger config by @fgreinacher in https://github.com/swagger-api/swagger-codegen/pull/11714
    • add org.owasp dependency in security profile by @gracekarina in https://github.com/swagger-api/swagger-codegen/pull/11721
    • added gh actions for spring generator by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11730
    • fixed spring v3 workflows by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11731
    • run swagger-ui along with flask output code by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11742

    New Contributors

    • @fgreinacher made their first contribution in https://github.com/swagger-api/swagger-codegen/pull/11711

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v2.4.26...v2.4.27

    Source code(tar.gz)
    Source code(zip)
  • v3.0.33(Feb 7, 2022)

    3.0.33 release of swagger-codegen with OpenAPI 3 support.

    See also https://github.com/swagger-api/swagger-codegen-generators/releases/tag/v1.0.32

    What's Changed

    • update swagger-generator-v3 base docker image and java by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11653
    • Fixed custom templates issue by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11689
    • problem of using custom template Fixed by @parhamahmady in https://github.com/swagger-api/swagger-codegen/pull/11622
    • update dependencies by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11697

    New Contributors

    • @parhamahmady made their first contribution in https://github.com/swagger-api/swagger-codegen/pull/11622

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v3.0.32...v3.0.33

    Supported V3 generators

    • typescript-axios (experimental)

    • go (experimental)

    • typescript-fetch (experimental)

    • r (experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Source code(tar.gz)
    Source code(zip)
  • v2.4.26(Feb 7, 2022)

    What's Changed

    • issue 7355 Bug generating equals method for a child class with no additional fields by @castelblanque in https://github.com/swagger-api/swagger-codegen/pull/11148
    • [security problem] no escape for query parameters for Dart/Flutter language, so any query parameter with char like ?,&,= etc will have problems by @fzyzcjy in https://github.com/swagger-api/swagger-codegen/pull/11639
    • updated dependencies by frantuma in https://github.com/swagger-api/swagger-codegen/pull/11694

    New Contributors

    • @fzyzcjy made their first contribution in https://github.com/swagger-api/swagger-codegen/pull/11639

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v2.4.25...v2.4.26

    Source code(tar.gz)
    Source code(zip)
  • v3.0.32(Jan 11, 2022)

    3.0.32 release of swagger-codegen with OpenAPI 3 support.

    What's Changed

    • build two docker images with root and codegenuser images by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11623

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v3.0.31...v3.0.32

    Supported V3 generators

    • typescript-axios (experimental)

    • go (experimental)

    • typescript-fetch (experimental)

    • r (experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Source code(tar.gz)
    Source code(zip)
  • v3.0.31(Dec 28, 2021)

    3.0.31 release of swagger-codegen with OpenAPI 3 support.

    See also https://github.com/swagger-api/swagger-codegen-generators/releases/tag/v1.0.31

    What's Changed

    • allow full url in php option by @gracekarina in https://github.com/swagger-api/swagger-codegen/pull/11271
    • fix docker user for JETTY_BASE dir by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11284
    • bump slf4j version to fix possible vulnerability by @philipplewe in https://github.com/swagger-api/swagger-codegen/pull/11289
    • don't overwrite already existing property useOas2 by @sleicht in https://github.com/swagger-api/swagger-codegen/pull/10880
    • Codegen generators issue 966 by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11299
    • updated java client samples by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11301
    • updated spring samples by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11308
    • bump logback to 1.2.9 by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11313

    New Contributors

    • @sleicht made their first contribution in https://github.com/swagger-api/swagger-codegen/pull/10880

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v3.0.30...v3.0.31

    Supported V3 generators

    • typescript-axios (experimental)

    • go (experimental)

    • typescript-fetch (experimental)

    • r (experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Source code(tar.gz)
    Source code(zip)
  • v2.4.25(Dec 28, 2021)

    What's Changed

    • allow full url in option by @gracekarina in https://github.com/swagger-api/swagger-codegen/pull/11270
    • bump slf4j version to fix possible vulnerability by @philipplewe in https://github.com/swagger-api/swagger-codegen/pull/11288
    • remove scala-gatling obsolete generator by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11297
    • bump junit and akka-actor versions by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11306
    • bump logback version by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11312

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v2.4.24...v2.4.25

    Source code(tar.gz)
    Source code(zip)
  • v3.0.30(Nov 18, 2021)

    3.0.30 release of swagger-codegen with OpenAPI 3 support.

    See also https://github.com/swagger-api/swagger-codegen-generators/releases/tag/v1.0.30

    What's Changed

    • added custom tests for java v3 by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11236
    • replaced ApiException class on tests files to fix build errors on tests by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11243
    • bump Apache Commons IO version in order to fix vulnerability by @philipplewe in https://github.com/swagger-api/swagger-codegen/pull/11247
    • Fix for ENUM that works only by merging PR https://github.com/swagger-api/swagger-codegen-generators/pull/978 by @frantuma in https://github.com/swagger-api/swagger-codegen/pull/11250
    • set non root user in Dockerfile for swagger-generator module by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11248
    • updated samples for spring generator by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11256

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v3.0.29...v3.0.30

    Supported V3 generators

    • typescript-axios (experimental)

    • go (experimental)

    • typescript-fetch (experimental)

    • r (experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Source code(tar.gz)
    Source code(zip)
  • v2.4.24(Nov 18, 2021)

    What's Changed

    • Java11 sample tests by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11231
    • use the right java version on java11 feing workflow by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11232
    • added java client workflows for java 11 version by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11233
    • added workflows for java11 for codegen v3 by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11237
    • Java11 gradle by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11242
    • Java11 gradle v3 by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11244
    • bump Apache Commons IO version in order to fix vulnerability by @philipplewe in https://github.com/swagger-api/swagger-codegen/pull/11246
    • Java client generators update by @HugoMario in https://github.com/swagger-api/swagger-codegen/pull/11255

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v2.4.23...v2.4.24

    Source code(tar.gz)
    Source code(zip)
  • v2.4.23(Oct 8, 2021)

    What's Changed

    • fix swagger-yaml responseObject mixin in https://github.com/swagger-api/swagger-codegen/pull/11210

    Full Changelog: https://github.com/swagger-api/swagger-codegen/compare/v2.4.22...v2.4.23

    Source code(tar.gz)
    Source code(zip)
  • v3.0.29(Oct 5, 2021)

    3.0.29 release of swagger-codegen with OpenAPI 3 support.

    Supported V3 generators

    • typescript-axios (experimental)

    • go (experimental)

    • typescript-fetch (experimental)

    • r (experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Notable changes:

    Source code(tar.gz)
    Source code(zip)
  • v3.0.28(Sep 30, 2021)

    NOTICE: please use 3.0.29 as 3.0.28 introduces regression for some typescript-angular scenarios

    3.0.28 release of swagger-codegen with OpenAPI 3 support.

    Supported V3 generators

    • typescript-axios (experimental)

    • go (experimental)

    • typescript-fetch (experimental)

    • r (experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Notable changes:

    Source code(tar.gz)
    Source code(zip)
  • v2.4.22(Sep 30, 2021)

    • Java sample v2 update (#11194)
    • bump version of snakeyaml to fix security issue in snakeyaml < 1.26 (#11167)
    • feat. option gitRepoBaseURL for PHP generator (#11170)
    • added formatter for date and date time on spring mvc and fixed templates (#11156)
    • added custom date converter in order to fix issue. (#11153)
    • fixed build error on spring boot and added workflows for spring (#11150)
    • removed travis build status. Travis CI is not longer used in codegen. (#11146)
    • Add config property "enumPropertyNaming" to TypeScript codegens. (#9176)
    • updated maven download link (#11145)
    • Update pom.xml (#9637)
    • [Issue 9685] Make RestTemplate thread safe by using the withHttpInfo pattern used … (#9737)
    • Java 11 support on java generators (#11132)
    • fixed enum named for number types (#11114)
    • fixed python namespace package folders (#11113)
    • Fixed bug 10889 (#10890)
    • Fix #11087 Gruzzle (#11104)
    • changed build commands on typescript angular workflows (#11100)
    • Issue 10040 (#11097)
    • A new property additionalModelTypeAnnotations that allows to add any custom annotations on the top of generated java class model (#10978)
    • Java Spring compilation error in gen interfaces with "defaultInterfaces" to false (#10980)
    • fixed python v2 sample workflow (#11080)
    Source code(tar.gz)
    Source code(zip)
  • v3.0.27(Jun 28, 2021)

    3.0.27 release of swagger-codegen with OpenAPI 3 support.

    Supported V3 generators

    • typescript-axios (experimental)

    • go (experimental)

    • typescript-fetch (experimental)

    • r (experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Notable changes:

    Source code(tar.gz)
    Source code(zip)
  • v2.4.21(Jun 28, 2021)

    • removed all non valid characters on project name (#11072)
    • fixes high memory consumption for big specs (#11071)
    • added missed data annotation on model properties (#11070)
    • fixed typo on README (#11050)
    • added option to allow use kebab file naming for typescript-angular (#11048)
    • Update readme file - add an entry companies list (#11017)
    • added option to change case for python generator. (#11019)
    • Fix code generation for Angular 10 (#10464)
    Source code(tar.gz)
    Source code(zip)
  • v3.0.26(May 29, 2021)

    3.0.26 release of swagger-codegen with OpenAPI 3 support.

    Supported V3 generators

    • typescript-axios (experimental)

    • go (experimental)

    • typescript-fetch (experimental)

    • r (experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Notable changes:

    Source code(tar.gz)
    Source code(zip)
  • v2.4.20(May 29, 2021)

    [JavaSpring] Fixed Issue 9250 - Codegen for file datatype (#9490)

    • ref CVE-2020-25649 - jackson 2.11.4 (#10926)
    • added option to write a throwing exception for unknown enums values. (#10356)
    • Add new additional-property ignoreUnknownJacksonAnnotation to add a class level annotation @JsonIgnoreProperties(ignoreUnknown = true) (#10953)
    • [Python] Fix #10948 wrong mode opened file fixed (#10949)
    • Go deni issue 10948 (#10957)
    • [go] object to interface code generator should never generate an interface pointer (#10932)
    • Fix code generation for Angular 10 (#10464)
    • Write mustache template to generate Protocol Oriented class file from swagger for Swift5 (#10868)
    • Update README.md (#10923)
    Source code(tar.gz)
    Source code(zip)
  • v3.0.25(Mar 4, 2021)

    3.0.25 release of swagger-codegen with OpenAPI 3 support.

    Supported V3 generators

    • typescript-axios (experimental)

    • go (experimental)

    • typescript-fetch (experimental)

    • r (experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Notable changes:

    Source code(tar.gz)
    Source code(zip)
  • v2.4.19(Mar 3, 2021)

    • ref CVE-2020-25649 - jackson 2.11.4 (#10926)
    • [csharp] masked EnumMember value in modelEnum (#8129)
    • Generator updates: sample updates and fixes (#10924)
    • Add option modelPropertyNaming to javascript generator (#8086)
    • #10125 fix DefaultCodegen parsing to handle 'uniqueItems' flag (#10154)
    • Fix code generation for Angular 10 (#10464)
    • added actions for dotnet, java and js generators (#10869)
    • added docker file for go-server generator (#10863)
    • added missed validated annotation. (#10856)
    • added option to skip client validaton (#10847)
    • Deprecate InlineModelResolver (#10841)
    Source code(tar.gz)
    Source code(zip)
  • v3.0.24(Dec 29, 2020)

    3.0.24 release of swagger-codegen with OpenAPI 3 support.

    Supported V3 generators

    • typescript-axios (experimental)

    • go (experimental)

    • typescript-fetch (experimental)

    • r (experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Notable changes:

    Source code(tar.gz)
    Source code(zip)
  • v2.4.18(Dec 29, 2020)

    • #9808 - Dart double cast (#9809)
    • Update dependencies and samples (#10044)
    • Configure WhiteSource for GitHub.com (#10593)
    • Issue 10516 (#10576)
    • fix CVE-2020-27216 - bump jetty version (#10568)
    • updated model inner enum template for java generator (#10567)
    • Enum values issue (#10563)
    • add info object extensions to additional property map (#10557)
    • updated parser version and required porperty from composed model (#10549)
    Source code(tar.gz)
    Source code(zip)
  • v3.0.23(Nov 2, 2020)

    3.0.23 release of swagger-codegen with OpenAPI 3 support.

    Supported V3 generators

    • typescript-axios (new, experimental)

    • go (new, experimental)

    • typescript-fetch (new, experimental)

    • r (new, experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Notable changes:

    Source code(tar.gz)
    Source code(zip)
  • v2.4.17(Nov 1, 2020)

    • added option to check duplicated model names. (#10529)
    • [Issue 9178] Handle multiple formats when decoding dates (#9730)
    • added @Valid annotation on bean validation template for java jaxrs (#10519)
    • Bump master junit deps (#10512)
    • removed commented typescript-fetch module (#10511)
    • Fix code generation for Angular 10 (#10464)
    • fix(go): return decoding errors (#10429)
    • Use same spaces style for json snippets in readme (#10487)
    • Update README.md: typo fixed, version 3.X vs 2.X (#10503)
    • Issue 10125 DefaultCodegen doesn't handle "uniqueItems" flag (#10490)
    Source code(tar.gz)
    Source code(zip)
  • v3.0.22(Oct 5, 2020)

    3.0.22 release of swagger-codegen with OpenAPI 3 support.

    Supported V3 generators

    • typescript-axios (new, experimental)

    • go (new, experimental)

    • typescript-fetch (new, experimental)

    • r (new, experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Notable changes:

    Source code(tar.gz)
    Source code(zip)
  • v2.4.16(Oct 4, 2020)

    • updated typescript-fetch sample in order to fix issue (#10481)
    • fixed solution template on aspnetcore (#10478)
    • Wrong generation of @JacksonXmlElementWrapper annotation (#10333)
    • package-lock fix npm advisories 1071 1500 (#10453)
    • [RUBY] Replace deprecated URI.encode to support ruby 2.7 without warnings (#10445)
    • Update README.md (#10443)
    • [Documentation] Use HTTPS for petstore urls (#10427)
    Source code(tar.gz)
    Source code(zip)
  • v3.0.21(Jul 28, 2020)

    3.0.21 release of swagger-codegen with OpenAPI 3 support.

    Supported V3 generators

    • go (new, experimental)

    • typescript-fetch (new, experimental)

    • r (new, experimental)

    • swift5 (experimental)

    • javascript (experimental)

    • micronaut (experimental)

    • go-server (experimental)

    • akka-scala (experimental)

    • nodejs (updated)

    • dynamic-html

    • html

    • html2

    • java

    • jaxrs-cxf-client

    • jaxrs-cxf

    • inflector

    • jaxrs-cxf-cdi

    • jaxrs-spec

    • jaxrs-jersey

    • jaxrs-di

    • jaxrs-resteasy-eap

    • jaxrs-resteasy

    • spring

    • openapi

    • openapi-yaml

    • kotlin-client

    • kotlin-server

    • php

    • swift3

    • swift4

    • typescript-angular

    • scala

    • aspnetcore

    • csharp

    • csharp-dotnet2 (DEPRECATED)

    • python

    • python-flask (experimental)

    Notable changes:

    Source code(tar.gz)
    Source code(zip)
Automated generation of real Swagger/OpenAPI 2.0 schemas from Django REST Framework code.

drf-yasg - Yet another Swagger generator Generate real Swagger/OpenAPI 2.0 specifications from a Django Rest Framework API. Compatible with Django Res

Cristi Vîjdea 3k Dec 31, 2022
Test utility for validating OpenAPI documentation

DRF OpenAPI Tester This is a test utility to validate DRF Test Responses against OpenAPI 2 and 3 schema. It has built-in support for: OpenAPI 2/3 yaml

snok 106 Jan 5, 2023
Swagger Documentation Generator for Django REST Framework: deprecated

Django REST Swagger: deprecated (2019-06-04) This project is no longer being maintained. Please consider drf-yasg as an alternative/successor. I haven

Marc Gibbons 2.6k Jan 3, 2023
📖 Generate markdown API documentation from Google-style Python docstring. The lazy alternative to Sphinx.

lazydocs Generate markdown API documentation for Google-style Python docstring. Getting Started • Features • Documentation • Support • Contribution •

Machine Learning Tooling 118 Dec 31, 2022
API spec validator and OpenAPI document generator for Python web frameworks.

API spec validator and OpenAPI document generator for Python web frameworks.

1001001 249 Dec 22, 2022
Automated Integration Testing and Live Documentation for your API

Automated Integration Testing and Live Documentation for your API

ScanAPI 1.3k Dec 30, 2022
Watch a Sphinx directory and rebuild the documentation when a change is detected. Also includes a livereload enabled web server.

sphinx-autobuild Rebuild Sphinx documentation on changes, with live-reload in the browser. Installation sphinx-autobuild is available on PyPI. It can

Executable Books 440 Jan 6, 2023
A swagger tool for tornado, using python to write api doc!

SwaggerDoc About A swagger tool for tornado, using python to write api doc! Installation pip install swagger-doc Quick Start code import tornado.ioloo

aaashuai 1 Jan 10, 2022
An introduction to hikari, complete with different examples for different command handlers.

An intro to hikari This repo provides some simple examples to get you started with hikari. Contained in this repo are bots designed with both the hika

Ethan Henderson 18 Nov 29, 2022
Sane and flexible OpenAPI 3 schema generation for Django REST framework.

drf-spectacular Sane and flexible OpenAPI 3.0 schema generation for Django REST framework. This project has 3 goals: Extract as much schema informatio

T. Franzel 1.4k Jan 8, 2023
API Documentation for Python Projects

API Documentation for Python Projects. Example pdoc -o ./html pdoc generates this website: pdoc.dev/docs. Installation pip install pdoc pdoc is compat

mitmproxy 1.4k Jan 7, 2023
Your Project with Great Documentation.

Read Latest Documentation - Browse GitHub Code Repository The only thing worse than documentation never written, is documentation written but never di

Timothy Edmund Crosley 809 Dec 28, 2022
Seamlessly integrate pydantic models in your Sphinx documentation.

Seamlessly integrate pydantic models in your Sphinx documentation.

Franz Wöllert 71 Dec 26, 2022
Flask-Rebar combines flask, marshmallow, and swagger for robust REST services.

Flask-Rebar Flask-Rebar combines flask, marshmallow, and swagger for robust REST services. Features Request and Response Validation - Flask-Rebar reli

PlanGrid 223 Dec 19, 2022
Data-Scrapping SEO - the project uses various data scrapping and Google autocompletes API tools to provide relevant points of different keywords so that search engines can be optimized

Data-Scrapping SEO - the project uses various data scrapping and Google autocompletes API tools to provide relevant points of different keywords so that search engines can be optimized; as this information is gathered, the marketing team can target the top keywords to get your company’s website higher on a results page.

Vibhav Kumar Dixit 2 Jul 18, 2022
Documentation generator for C++ based on Doxygen and mosra/m.css.

mosra/m.css is a Doxygen-based documentation generator that significantly improves on Doxygen's default output by controlling some of Doxygen's more unruly options, supplying it's own slick HTML+CSS generation and adding a fantastic live search feature.

Mark Gillard 109 Dec 7, 2022
An interview engine for businesses, interview those who are actually qualified and are worth your time!

easyInterview V0.8B An interview engine for businesses, interview those who are actually qualified and are worth your time! Quick Overview You/the com

Vatsal Shukla 1 Nov 19, 2021
Main repository for the Sphinx documentation builder

Sphinx Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents consisting of mul

null 5.1k Jan 2, 2023
A curated list of awesome tools for Sphinx Python Documentation Generator

Awesome Sphinx (Python Documentation Generator) A curated list of awesome extra libraries, software and resources for Sphinx (Python Documentation Gen

Hyunjun Kim 831 Dec 27, 2022