diff --git a/.github/workflows/check-supported-versions.yaml b/.github/workflows/check-supported-versions.yaml index 3702fd30fb4..017b4bdf0ab 100644 --- a/.github/workflows/check-supported-versions.yaml +++ b/.github/workflows/check-supported-versions.yaml @@ -26,17 +26,17 @@ jobs: - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: ${{ matrix.java }} - - uses: actions/cache@v2.1.6 + - uses: actions/cache@v2.1.7 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - - uses: actions/cache@v2.1.6 + - uses: actions/cache@v2.1.7 with: path: | ~/.gradle/caches diff --git a/.github/workflows/gradle-test.yaml b/.github/workflows/gradle-test.yaml index 755ca996a15..c6f6f495ab1 100644 --- a/.github/workflows/gradle-test.yaml +++ b/.github/workflows/gradle-test.yaml @@ -36,18 +36,18 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: 11 # Cache Gradle Dependencies - name: Setup Gradle Dependencies Cache - uses: actions/cache@v2 + uses: actions/cache@v2.1.7 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} # Cache Gradle Wrapper - name: Setup Gradle Wrapper Cache - uses: actions/cache@v2 + uses: actions/cache@v2.1.7 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index aa1a94e21e9..b2e477592d4 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -17,11 +17,12 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 8 + distribution: 'temurin' - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: cache-maven-repository with: @@ -52,11 +53,12 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 8 + distribution: 'temurin' - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: cache-maven-repository with: @@ -86,9 +88,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 8 + distribution: 'temurin' - name: Download openapi-generator-cli.jar artifact uses: actions/download-artifact@v2.0.10 with: @@ -124,9 +127,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 8 + distribution: 'temurin' - name: Download openapi-generator-cli.jar artifact uses: actions/download-artifact@v2.0.10 with: @@ -158,11 +162,12 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 11 + distribution: 'temurin' - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: cache-maven-repository with: @@ -190,11 +195,12 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 11 + distribution: 'temurin' - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: cache-maven-repository with: diff --git a/.github/workflows/samples-dart.yaml b/.github/workflows/samples-dart.yaml index 47ae424394d..5efe3b6b686 100644 --- a/.github/workflows/samples-dart.yaml +++ b/.github/workflows/samples-dart.yaml @@ -20,10 +20,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: maven-repository with: @@ -32,7 +32,7 @@ jobs: ~/.gradle key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Cache test dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: pub-cache with: @@ -53,10 +53,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: maven-repository with: @@ -65,7 +65,7 @@ jobs: ~/.gradle key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Cache test dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: pub-cache with: diff --git a/.github/workflows/samples-kotlin.yaml b/.github/workflows/samples-kotlin.yaml index ddc46f801cb..d1d812cbadb 100644 --- a/.github/workflows/samples-kotlin.yaml +++ b/.github/workflows/samples-kotlin.yaml @@ -30,8 +30,7 @@ jobs: #- samples/client/petstore/kotlin-json-request-string - samples/client/petstore/kotlin-jvm-okhttp4-coroutines - samples/client/petstore/kotlin-moshi-codegen - # need some special setup - #- samples/client/petstore/kotlin-multiplatform + - samples/client/petstore/kotlin-multiplatform - samples/client/petstore/kotlin-nonpublic - samples/client/petstore/kotlin-nullable - samples/client/petstore/kotlin-okhttp3 @@ -45,10 +44,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: maven-repository with: diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index d991e052a7d..63f622d66e1 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -16,7 +16,7 @@ jobs: - name: Set up JDK 11 uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: 11 - name: Compile with Maven run: mvn -B -q clean install jacoco:report diff --git a/README.md b/README.md index 5774c216447..804104dd962 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0, .NET 5.0. Libraries: RestSharp, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient, Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) | -| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | +| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | | **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** | | **Configuration files** | [**Apache2**](https://httpd.apache.org/) | | **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer**, **WSDL** | @@ -223,21 +223,21 @@ Examples: # Execute latest released openapi-generator-cli openapi-generator-cli version -# Execute version 3.1.0 for the current invocation, regardless of the latest released version -OPENAPI_GENERATOR_VERSION=3.1.0 openapi-generator-cli version +# Execute version 4.1.0 for the current invocation, regardless of the latest released version +OPENAPI_GENERATOR_VERSION=4.1.0 openapi-generator-cli version -# Execute version 3.1.0-SNAPSHOT for the current invocation -OPENAPI_GENERATOR_VERSION=3.1.0-SNAPSHOT openapi-generator-cli version +# Execute version 4.1.0-SNAPSHOT for the current invocation +OPENAPI_GENERATOR_VERSION=4.1.0-SNAPSHOT openapi-generator-cli version -# Execute version 3.0.2 for every invocation in the current shell session -export OPENAPI_GENERATOR_VERSION=3.0.2 -openapi-generator-cli version # is 3.0.2 -openapi-generator-cli version # is also 3.0.2 +# Execute version 4.0.2 for every invocation in the current shell session +export OPENAPI_GENERATOR_VERSION=4.0.2 +openapi-generator-cli version # is 4.0.2 +openapi-generator-cli version # is also 4.0.2 # To "install" a specific version, set the variable in .bashrc/.bash_profile -echo "export OPENAPI_GENERATOR_VERSION=3.0.2" >> ~/.bashrc +echo "export OPENAPI_GENERATOR_VERSION=4.0.2" >> ~/.bashrc source ~/.bashrc -openapi-generator-cli version # is always 3.0.2, unless any of the above overrides are done ad hoc +openapi-generator-cli version # is always 4.0.2, unless any of the above overrides are done ad hoc ``` ### [1.4 - Build Projects](#table-of-contents) @@ -577,6 +577,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Adaptant Solutions AG](https://www.adaptant.io/) - [adesso SE](https://www.adesso.de/) - [Agoda](https://www.agoda.com/) +- [Airthings](https://www.airthings.com/) - [Allianz](https://www.allianz.com) - [Angular.Schule](https://angular.schule/) - [Aqovia](https://aqovia.com/) @@ -843,6 +844,8 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2021-10-02 - [How to Write Fewer Lines of Code with the OpenAPI Generator](https://hackernoon.com/how-to-write-fewer-lines-of-code-with-the-openapi-generator) by [Mikhail Alfa](https://hackernoon.com/u/alphamikle) - 2021-10-12 - [OpenAPI Generator : 4000 étoiles sur GitHub et des spaghettis](https://www.youtube.com/watch?v=9hEsNBSqTFk) by [Jérémie Bresson](https://github.com/jmini) at [Devoxx FR 2021](https://cfp.devoxx.fr/2021/speaker/jeremie_bresson) - 2021-10-17 - [Generate a TypeScript HTTP Client From An OpenAPI Spec In DotNET 5](https://richardwillis.info/blog/generate-a-type-script-http-client-from-an-open-api-spec-in-dot-net-5) by [Richard Willis](https://github.com/badsyntax) +- 2021-11-06 - [スタートアップの開発で意識したこと](https://zenn.dev/woo_noo/articles/5cb09f8e2899ae782ad1) by [woo-noo](https://zenn.dev/woo_noo) +- 2021-11-09 - [Effective Software Development using OpenAPI Generator](https://apexlabs.ai/post/effective-software-development-using-openapi-generator) by Ajil Oomme ## [6 - About Us](#table-of-contents) @@ -951,6 +954,7 @@ Here is a list of template creators: * C# ASP.NET 5: @jimschubert [:heart:](https://www.patreon.com/jimschubert) * C# ASP.NET Core 3.0: @A-Joshi * C# APS.NET Core 3.1: @phatcher + * C# Azure functions: @Abrhm7786 * C# NancyFX: @mstefaniuk * C++ (Qt5 QHttpEngine): @etherealjoy * C++ Pistache: @sebymiano @@ -1059,7 +1063,7 @@ If you want to join the committee, please kindly apply by sending an email to te | GraphQL | @renepardon (2018/12) | | Groovy | | | Haskell | | -| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @nmuesch (2021/01) | +| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) | | JMeter | @kannkyo (2021/01) | | Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) | | Lua | @daurnimator (2017/08) | diff --git a/bin/configs/java-okhttp-gson-nextgen.yaml b/bin/configs/java-okhttp-gson-nextgen.yaml new file mode 100644 index 00000000000..b6b12f86bdd --- /dev/null +++ b/bin/configs/java-okhttp-gson-nextgen.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/okhttp-gson-nextgen +library: okhttp-gson-nextgen +#inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-okhttp-gson-nextgen + hideGenerationTimestamp: "true" diff --git a/bin/configs/other/csharp-netcore-functions.yaml b/bin/configs/other/csharp-netcore-functions.yaml new file mode 100644 index 00000000000..6d7e9a691b0 --- /dev/null +++ b/bin/configs/other/csharp-netcore-functions.yaml @@ -0,0 +1,6 @@ +generatorName: csharp-netcore-functions +outputDir: samples/client/petstore/csharp-netcore-functions +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/csharp-netcore-functions +#additionalProperties: +# packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/swift5-frozenEnums.yaml b/bin/configs/swift5-frozenEnums.yaml new file mode 100644 index 00000000000..64dc04a4f81 --- /dev/null +++ b/bin/configs/swift5-frozenEnums.yaml @@ -0,0 +1,12 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/frozenEnums +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + podAuthors: "" + podSummary: PetstoreClient + sortParamsByRequiredFlag: false + generateFrozenEnums: false + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/bin/configs/typescript-angular-v13-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v13-provided-in-root-with-npm.yaml new file mode 100644 index 00000000000..22284f92f6c --- /dev/null +++ b/bin/configs/typescript-angular-v13-provided-in-root-with-npm.yaml @@ -0,0 +1,11 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-angular +additionalProperties: + ngVersion: 13.0.1 + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-angular-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false + supportsES6: true diff --git a/bin/configs/typescript-angular-v13-provided-in-root.yaml b/bin/configs/typescript-angular-v13-provided-in-root.yaml new file mode 100644 index 00000000000..bf16e022ded --- /dev/null +++ b/bin/configs/typescript-angular-v13-provided-in-root.yaml @@ -0,0 +1,7 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-angular +additionalProperties: + ngVersion: 13.0.1 + supportsES6: true diff --git a/docs/generators.md b/docs/generators.md index ed80e860e49..6ce82ffadbb 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -86,6 +86,7 @@ The following generators are available: * [cpp-qt-qhttpengine-server](generators/cpp-qt-qhttpengine-server.md) * [cpp-restbed-server](generators/cpp-restbed-server.md) * [csharp-nancyfx](generators/csharp-nancyfx.md) +* [csharp-netcore-functions (beta)](generators/csharp-netcore-functions.md) * [erlang-server](generators/erlang-server.md) * [fsharp-functions (beta)](generators/fsharp-functions.md) * [fsharp-giraffe-server (beta)](generators/fsharp-giraffe-server.md) diff --git a/docs/generators/crystal.md b/docs/generators/crystal.md index 721384c810c..93a893215ca 100644 --- a/docs/generators/crystal.md +++ b/docs/generators/crystal.md @@ -58,6 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl