Compare commits

..

3 Commits

Author SHA1 Message Date
WILLIAM CHENG
ff80c4ea83 rebalance circleci tests 2021-10-29 09:40:26 +08:00
WILLIAM CHENG
90176c8a2e update samples 2021-10-27 15:48:45 +08:00
WILLIAM CHENG
a8840e7a26 update okhttp-gson pom dependencies 2021-10-27 15:37:23 +08:00
5430 changed files with 43762 additions and 181186 deletions

View File

@@ -26,17 +26,17 @@ jobs:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: 'temurin'
distribution: 'adopt'
java-version: ${{ matrix.java }}
- uses: actions/cache@v2.1.7
- uses: actions/cache@v2.1.6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/cache@v2.1.7
- uses: actions/cache@v2.1.6
with:
path: |
~/.gradle/caches

View File

@@ -21,7 +21,7 @@ jobs:
build:
name: Gradle tests
runs-on: ubuntu-latest
container: gradle:jdk11
container: gradle:jdk8
strategy:
fail-fast: true
matrix:
@@ -36,18 +36,18 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
distribution: 'adopt'
java-version: 8
# Cache Gradle Dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v2.1.7
uses: actions/cache@v2
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.1.7
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}

View File

@@ -17,12 +17,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v1
with:
java-version: 8
distribution: 'temurin'
- name: Cache maven dependencies
uses: actions/cache@v2.1.7
uses: actions/cache@v2.1.6
env:
cache-name: cache-maven-repository
with:
@@ -53,12 +52,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v1
with:
java-version: 8
distribution: 'temurin'
- name: Cache maven dependencies
uses: actions/cache@v2.1.7
uses: actions/cache@v2.1.6
env:
cache-name: cache-maven-repository
with:
@@ -88,10 +86,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v1
with:
java-version: 8
distribution: 'temurin'
- name: Download openapi-generator-cli.jar artifact
uses: actions/download-artifact@v2.0.10
with:
@@ -127,10 +124,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v1
with:
java-version: 8
distribution: 'temurin'
- name: Download openapi-generator-cli.jar artifact
uses: actions/download-artifact@v2.0.10
with:
@@ -162,12 +158,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v1
with:
java-version: 11
distribution: 'temurin'
- name: Cache maven dependencies
uses: actions/cache@v2.1.7
uses: actions/cache@v2.1.6
env:
cache-name: cache-maven-repository
with:
@@ -195,12 +190,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v1
with:
java-version: 11
distribution: 'temurin'
- name: Cache maven dependencies
uses: actions/cache@v2.1.7
uses: actions/cache@v2.1.6
env:
cache-name: cache-maven-repository
with:

View File

@@ -20,10 +20,10 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
distribution: 'adopt'
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2.1.7
uses: actions/cache@v2.1.6
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.7
uses: actions/cache@v2.1.6
env:
cache-name: pub-cache
with:
@@ -53,10 +53,10 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
distribution: 'adopt'
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2.1.7
uses: actions/cache@v2.1.6
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.7
uses: actions/cache@v2.1.6
env:
cache-name: pub-cache
with:

View File

@@ -30,7 +30,8 @@ jobs:
#- samples/client/petstore/kotlin-json-request-string
- samples/client/petstore/kotlin-jvm-okhttp4-coroutines
- samples/client/petstore/kotlin-moshi-codegen
- samples/client/petstore/kotlin-multiplatform
# need some special setup
#- samples/client/petstore/kotlin-multiplatform
- samples/client/petstore/kotlin-nonpublic
- samples/client/petstore/kotlin-nullable
- samples/client/petstore/kotlin-okhttp3
@@ -44,10 +45,10 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
distribution: 'adopt'
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2.1.7
uses: actions/cache@v2.1.6
env:
cache-name: maven-repository
with:

View File

@@ -16,7 +16,7 @@ jobs:
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
distribution: 'adopt'
java-version: 11
- name: Compile with Maven
run: mvn -B -q clean install jacoco:report

View File

@@ -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, 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) |
| **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) |
| **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 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 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-SNAPSHOT for the current invocation
OPENAPI_GENERATOR_VERSION=4.1.0-SNAPSHOT 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.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
# 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
# To "install" a specific version, set the variable in .bashrc/.bash_profile
echo "export OPENAPI_GENERATOR_VERSION=4.0.2" >> ~/.bashrc
echo "export OPENAPI_GENERATOR_VERSION=3.0.2" >> ~/.bashrc
source ~/.bashrc
openapi-generator-cli version # is always 4.0.2, unless any of the above overrides are done ad hoc
openapi-generator-cli version # is always 3.0.2, unless any of the above overrides are done ad hoc
```
### [1.4 - Build Projects](#table-of-contents)
@@ -577,7 +577,6 @@ 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/)
@@ -590,7 +589,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [Bithost GmbH](https://www.bithost.ch)
- [Bosch Connected Industry](https://www.bosch-connected-industry.com)
- [Boxever](https://www.boxever.com/)
- [Bunker Holding Group](https://www.bunker-holding.com/)
- [California State University, Northridge](https://www.csun.edu)
- [CAM](https://www.cam-inc.co.jp/)
- [Camptocamp](https://www.camptocamp.com/en)
@@ -652,7 +650,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [Ponicode](https://ponicode.dev/)
- [Pricefx](https://www.pricefx.com/)
- [Prometheus/Alertmanager](https://github.com/prometheus/alertmanager)
- [Qavar](https://www.qavar.com)
- [QEDIT](https://qed-it.com)
- [Qulix Systems](https://www.qulix.com)
- [Raksul](https://corp.raksul.com)
@@ -836,7 +833,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- 2021-05-31 - [FlutterでOpen Api Generator(Swagger)を使う](https://aakira.app/blog/2021/05/flutter-open-api/) by [AAkira](https://twitter.com/_a_akira)
- 2021-06-22 - [Rest API Documentation and Client Generation With OpenAPI](https://dzone.com/articles/rest-api-documentation-and-client-generation-with) by [Prasanth Gullapalli](https://dzone.com/users/1011797/prasanthnath.g@gmail.com.html)
- 2021-07-16 - [銀行事業のサーバーサイド開発について / LINE 京都開発室 エンジニア採用説明会](https://www.youtube.com/watch?v=YrrKQHxLPpQ) by 野田誠人, Robert Mitchell
- 2021-07-19 - [OpenAPI code generation with kotlin](https://sylhare.github.io/2021/07/19/Openapi-swagger-codegen-with-kotlin.html) by [sylhare](https://github.com/sylhare)
- 2021-07-29 - [How To Rewrite a Huge Codebase](https://dzone.com/articles/how-to-rewrite-a-huge-code-base) by [Curtis Poe](https://dzone.com/users/4565446/publiusovidius.html)
- 2021-08-21 - [Generating Client APIs using Swagger Part 1](https://medium.com/@flowsquad/generating-client-apis-using-swagger-part-1-2d46f13f5e92) by [FlowSquad.io](https://medium.com/@flowsquad)
- 2021-09-11 - [Invoking AWS ParallelCluster API](https://docs.aws.amazon.com/parallelcluster/latest/ug/api-reference-v3.html) at [AWS ParallelCluster API official documentation](https://docs.aws.amazon.com/parallelcluster/latest/ug/api-reference-v3.html)
@@ -844,8 +840,6 @@ 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)
@@ -954,7 +948,6 @@ 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
@@ -1063,7 +1056,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) |
| 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) |
| 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) |

View File

@@ -7,7 +7,7 @@ install:
Add-Type -AssemblyName System.IO.Compression.FileSystem
if (!(Test-Path -Path "C:\maven" )) {
(new-object System.Net.WebClient).DownloadFile(
'https://archive.apache.org/dist/maven/maven-3/3.8.3/binaries/apache-maven-3.8.3-bin.zip',
'http://www.us.apache.org/dist/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.zip',
'C:\maven-bin.zip'
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven")
@@ -22,15 +22,15 @@ install:
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\gradle-bin.zip", "C:\gradle")
}
- cmd: SET PATH=C:\maven\apache-maven-3.8.3\bin;C:\gradle\gradle-5.6.4\bin;%JAVA_HOME%\bin;%PATH%
- cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;C:\gradle\gradle-5.6.4\bin;%JAVA_HOME%\bin;%PATH%
- cmd: SET MAVEN_OPTS=-Xmx4g
- cmd: SET JAVA_OPTS=-Xmx4g
- cmd: SET M2_HOME=C:\maven\apache-maven-3.8.3
- cmd: SET M2_HOME=C:\maven\apache-maven-3.2.5
- cmd: java -version
- cmd: gradle -v
- cmd: dir/w
- git clone https://github.com/wing328/swagger-samples --depth 1
- ps: Start-Process -FilePath 'C:\maven\apache-maven-3.8.3\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci"
- ps: Start-Process -FilePath 'C:\maven\apache-maven-3.2.5\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci"
- ps: Start-Sleep -s 15
- ps: $PSVersionTable.PSVersion
- ps: Install-Module -Name Pester -Force -Scope CurrentUser

View File

@@ -2,5 +2,3 @@ generatorName: cpp-restsdk
outputDir: samples/client/petstore/cpp-restsdk/client
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/cpp-rest-sdk-client
additionalProperties:
packageName: CppRestPetstoreClient

View File

@@ -1,10 +0,0 @@
generatorName: csharp-netcore
outputDir: samples/client/others/csharp-netcore-complex-files
inputSpec: modules/openapi-generator/src/test/resources/3_0/form-multipart-binary-array.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp-netcore
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
targetFramework: netstandard2.0
useCompareNetObjects: "true"
globalProperties:
skipFormModel: "false"

View File

@@ -1,9 +0,0 @@
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"

View File

@@ -1,6 +0,0 @@
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}'

View File

@@ -1,12 +0,0 @@
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

View File

@@ -1,11 +0,0 @@
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

View File

@@ -1,7 +0,0 @@
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

View File

@@ -79,7 +79,6 @@ declare -a xml_files=(
"${root}/modules/openapi-generator-online/pom.xml"
"${root}/modules/openapi-generator/pom.xml"
"${root}/modules/openapi-generator-gradle-plugin/gradle.properties"
"${root}/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties"
"${root}/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml"
"${root}/modules/openapi-generator-maven-plugin/examples/java-client.xml"
"${root}/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml"

View File

@@ -86,7 +86,6 @@ 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)

View File

@@ -236,10 +236,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
|BearerToken|✓|OAS3
|OAuth2_Implicit||OAS2,OAS3
|OAuth2_Password||OAS2,OAS3
|OAuth2_ClientCredentials||OAS2,OAS3
|OAuth2_AuthorizationCode||OAS2,OAS3
|OAuth2_Implicit||OAS2,OAS3
|OAuth2_Password||OAS2,OAS3
|OAuth2_ClientCredentials||OAS2,OAS3
|OAuth2_AuthorizationCode||OAS2,OAS3
### Wire Format Feature
| Name | Supported | Defined By |

View File

@@ -12,7 +12,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|defaultInclude|The default include statement that should be placed in all headers for including things like the declspec (convention: #include "Commons.h" | ||
|generateGMocksForApis|Generate Google Mock classes for APIs.| |null|
|modelPackage|C++ namespace for models (convention: name.space.model).| |org.openapitools.client.model|
|packageName|C++ package (library) name.| |CppRestOpenAPIClient|
|packageVersion|C++ package version.| |1.0.0|
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -> Value)| |true|

View File

@@ -58,7 +58,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<ul class="column-ul">
<li>abstract</li>
<li>alias</li>
<li>annotation</li>
<li>as</li>
<li>as?</li>
<li>asm</li>

View File

@@ -1,300 +0,0 @@
---
title: Config Options for csharp-netcore-functions
sidebar_label: csharp-netcore-functions
---
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false|
|conditionalSerialization|Serialize only those properties which are initialized by user, accepted values are true or false, default value is false.| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I|
|library|HTTP library template (sub-template) to use|<dl><dt>**httpclient**</dt><dd>HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) (Experimental. May subject to breaking changes without further notice.)</dd><dt>**restsharp**</dt><dd>RestSharp (https://github.com/restsharp/RestSharp)</dd></dl>|restsharp|
|licenseId|The identifier of the license| |null|
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase|
|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false|
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false|
|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.0 or newer.| |false|
|optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true|
|optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false|
|optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true|
|optionalProjectFile|Generate {PackageName}.csproj.| |true|
|packageGuid|The GUID that will be associated with the C# project| |null|
|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools|
|packageTags|Tags to identify the package| |null|
|packageVersion|C# package version.| |1.0.0|
|releaseNote|Release note, default to 'Minor update'.| |Minor update|
|returnICollection|Return ICollection&lt;T&gt; instead of the concrete type.| |false|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src|
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.0`|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3 compatible</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4 compatible</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5 compatible</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6 compatible</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0 compatible</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1 compatible</dd><dt>**netcoreapp2.0**</dt><dd>.NET Core 2.0 compatible</dd><dt>**netcoreapp2.1**</dt><dd>.NET Core 2.1 compatible</dd><dt>**netcoreapp3.0**</dt><dd>.NET Core 3.0 compatible</dd><dt>**netcoreapp3.1**</dt><dd>.NET Core 3.1 compatible</dd><dt>**net47**</dt><dd>.NET Framework 4.7 compatible</dd><dt>**net5.0**</dt><dd>.NET 5.0 compatible</dd></dl>|netstandard2.0|
|useCollection|Deserialize array types to Collection&lt;T&gt; instead of List&lt;T&gt;.| |false|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false|
|validatable|Generates self-validatable models.| |true|
## IMPORT MAPPING
| Type/Alias | Imports |
| ---------- | ------- |
## INSTANTIATION TYPES
| Type/Alias | Instantiated By |
| ---------- | --------------- |
|array|List|
|list|List|
|map|Dictionary|
## LANGUAGE PRIMITIVES
<ul class="column-ul">
<li>Boolean</li>
<li>Collection</li>
<li>DateTime</li>
<li>DateTime?</li>
<li>DateTimeOffset</li>
<li>DateTimeOffset?</li>
<li>Decimal</li>
<li>Dictionary</li>
<li>Double</li>
<li>Float</li>
<li>Guid</li>
<li>Guid?</li>
<li>ICollection</li>
<li>Int32</li>
<li>Int64</li>
<li>List</li>
<li>Object</li>
<li>String</li>
<li>System.IO.Stream</li>
<li>bool</li>
<li>bool?</li>
<li>byte[]</li>
<li>decimal</li>
<li>decimal?</li>
<li>double</li>
<li>double?</li>
<li>float</li>
<li>float?</li>
<li>int</li>
<li>int?</li>
<li>long</li>
<li>long?</li>
<li>string</li>
</ul>
## RESERVED WORDS
<ul class="column-ul">
<li>Client</li>
<li>Configuration</li>
<li>Version</li>
<li>abstract</li>
<li>as</li>
<li>base</li>
<li>bool</li>
<li>break</li>
<li>byte</li>
<li>case</li>
<li>catch</li>
<li>char</li>
<li>checked</li>
<li>class</li>
<li>client</li>
<li>const</li>
<li>continue</li>
<li>decimal</li>
<li>default</li>
<li>delegate</li>
<li>do</li>
<li>double</li>
<li>else</li>
<li>enum</li>
<li>event</li>
<li>explicit</li>
<li>extern</li>
<li>false</li>
<li>finally</li>
<li>fixed</li>
<li>float</li>
<li>for</li>
<li>foreach</li>
<li>goto</li>
<li>if</li>
<li>implicit</li>
<li>in</li>
<li>int</li>
<li>interface</li>
<li>internal</li>
<li>is</li>
<li>localVarFileParams</li>
<li>localVarFormParams</li>
<li>localVarHeaderParams</li>
<li>localVarHttpContentType</li>
<li>localVarHttpContentTypes</li>
<li>localVarHttpHeaderAccept</li>
<li>localVarHttpHeaderAccepts</li>
<li>localVarPath</li>
<li>localVarPathParams</li>
<li>localVarPostBody</li>
<li>localVarQueryParams</li>
<li>localVarResponse</li>
<li>localVarStatusCode</li>
<li>lock</li>
<li>long</li>
<li>namespace</li>
<li>new</li>
<li>null</li>
<li>object</li>
<li>operator</li>
<li>out</li>
<li>override</li>
<li>parameter</li>
<li>params</li>
<li>private</li>
<li>protected</li>
<li>public</li>
<li>readonly</li>
<li>ref</li>
<li>return</li>
<li>sbyte</li>
<li>sealed</li>
<li>short</li>
<li>sizeof</li>
<li>stackalloc</li>
<li>static</li>
<li>string</li>
<li>struct</li>
<li>switch</li>
<li>this</li>
<li>throw</li>
<li>true</li>
<li>try</li>
<li>typeof</li>
<li>uint</li>
<li>ulong</li>
<li>unchecked</li>
<li>unsafe</li>
<li>ushort</li>
<li>using</li>
<li>virtual</li>
<li>void</li>
<li>volatile</li>
<li>while</li>
</ul>
## FEATURE SET
### Client Modification Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasePath|✓|ToolingExtension
|Authorizations|✗|ToolingExtension
|UserAgent|✓|ToolingExtension
|MockServer|✗|ToolingExtension
### Data Type Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Custom|✗|OAS2,OAS3
|Int32|✓|OAS2,OAS3
|Int64|✓|OAS2,OAS3
|Float|✓|OAS2,OAS3
|Double|✓|OAS2,OAS3
|Decimal|✓|ToolingExtension
|String|✓|OAS2,OAS3
|Byte|✓|OAS2,OAS3
|Binary|✓|OAS2,OAS3
|Boolean|✓|OAS2,OAS3
|Date|✓|OAS2,OAS3
|DateTime|✓|OAS2,OAS3
|Password|✓|OAS2,OAS3
|File|✓|OAS2
|Array|✓|OAS2,OAS3
|Maps|✓|ToolingExtension
|CollectionFormat|✓|OAS2
|CollectionFormatMulti|✓|OAS2
|Enum|✓|OAS2,OAS3
|ArrayOfEnum|✓|ToolingExtension
|ArrayOfModel|✓|ToolingExtension
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|ArrayOfCollectionOfModel|✓|ToolingExtension
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|MapOfEnum|✓|ToolingExtension
|MapOfModel|✓|ToolingExtension
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|MapOfCollectionOfModel|✓|ToolingExtension
|MapOfCollectionOfEnum|✓|ToolingExtension
### Documentation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Readme|✓|ToolingExtension
|Model|✓|ToolingExtension
|Api|✓|ToolingExtension
### Global Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Host|✓|OAS2,OAS3
|BasePath|✓|OAS2,OAS3
|Info|✓|OAS2,OAS3
|Schemes|✗|OAS2,OAS3
|PartialSchemes|✓|OAS2,OAS3
|Consumes|✓|OAS2
|Produces|✓|OAS2
|ExternalDocumentation|✓|OAS2,OAS3
|Examples|✓|OAS2,OAS3
|XMLStructureDefinitions|✗|OAS2,OAS3
|MultiServer|✗|OAS3
|ParameterizedServer|✗|OAS3
|ParameterStyling|✗|OAS3
|Callbacks|✗|OAS3
|LinkObjects|✗|OAS3
### Parameter Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Path|✓|OAS2,OAS3
|Query|✓|OAS2,OAS3
|Header|✓|OAS2,OAS3
|Body|✓|OAS2
|FormUnencoded|✓|OAS2
|FormMultipart|✓|OAS2
|Cookie|✓|OAS3
### Schema Support Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Simple|✓|OAS2,OAS3
|Composite|✓|OAS2,OAS3
|Polymorphism|✓|OAS2,OAS3
|Union|✗|OAS3
### Security Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasicAuth|✓|OAS2,OAS3
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
|BearerToken|✗|OAS3
|OAuth2_Implicit|✓|OAS2,OAS3
|OAuth2_Password|✗|OAS2,OAS3
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
### Wire Format Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|JSON|✓|OAS2,OAS3
|XML|✓|OAS2,OAS3
|PROTOBUF|✗|ToolingExtension
|Custom|✗|OAS2,OAS3

View File

@@ -31,7 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|returnICollection|Return ICollection&lt;T&gt; instead of the concrete type.| |false|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src|
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.0`|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3 compatible</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4 compatible</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5 compatible</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6 compatible</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0 compatible</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1 compatible</dd><dt>**netcoreapp2.0**</dt><dd>.NET Core 2.0 compatible</dd><dt>**netcoreapp2.1**</dt><dd>.NET Core 2.1 compatible</dd><dt>**netcoreapp3.0**</dt><dd>.NET Core 3.0 compatible</dd><dt>**netcoreapp3.1**</dt><dd>.NET Core 3.1 compatible</dd><dt>**net47**</dt><dd>.NET Framework 4.7 compatible</dd><dt>**net5.0**</dt><dd>.NET 5.0 compatible</dd><dt>**net6.0**</dt><dd>.NET 6.0 compatible</dd></dl>|netstandard2.0|
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.0`|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3 compatible</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4 compatible</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5 compatible</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6 compatible</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0 compatible</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1 compatible</dd><dt>**netcoreapp2.0**</dt><dd>.NET Core 2.0 compatible</dd><dt>**netcoreapp2.1**</dt><dd>.NET Core 2.1 compatible</dd><dt>**netcoreapp3.0**</dt><dd>.NET Core 3.0 compatible</dd><dt>**netcoreapp3.1**</dt><dd>.NET Core 3.1 compatible</dd><dt>**net47**</dt><dd>.NET Framework 4.7 compatible</dd><dt>**net5.0**</dt><dd>.NET 5.0 compatible</dd></dl>|netstandard2.0|
|useCollection|Deserialize array types to Collection&lt;T&gt; instead of List&lt;T&gt;.| |false|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false|

View File

@@ -30,7 +30,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|dynamicOperations|Generate operations dynamically at runtime from an OAS| |false|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|errorObjectType|Error Object type. (This option is for okhttp-gson-next-gen only)| |null|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|gradleProperties|Append additional Gradle proeprties to the gradle.properties file| |null|
|groupId|groupId in generated pom.xml| |org.openapitools|
@@ -39,7 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|invokerPackage|root package for generated code| |org.openapitools.client|
|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd></dl>|true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**okhttp-gson-nextgen**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+</dd><dt>**microprofile**</dt><dd>HTTP client: Microprofile client 1.x. JSON processing: JSON-B</dd><dt>**apache-httpclient**</dt><dd>HTTP client: Apache httpclient 4.x</dd></dl>|okhttp-gson|
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+</dd><dt>**microprofile**</dt><dd>HTTP client: Microprofile client 1.x. JSON processing: JSON-B</dd><dt>**apache-httpclient**</dt><dd>HTTP client: Apache httpclient 4.x</dd></dl>|okhttp-gson|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|microprofileFramework|Framework for microprofile. Possible values &quot;kumuluzee&quot;| |null|

View File

@@ -74,7 +74,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
## RESERVED WORDS
<ul class="column-ul">
<li>ApiResponse</li>
<li>abstract</li>
<li>actual</li>
<li>annotation</li>

View File

@@ -76,7 +76,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
## RESERVED WORDS
<ul class="column-ul">
<li>ApiResponse</li>
<li>abstract</li>
<li>actual</li>
<li>annotation</li>

View File

@@ -68,7 +68,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
## RESERVED WORDS
<ul class="column-ul">
<li>ApiResponse</li>
<li>abstract</li>
<li>actual</li>
<li>annotation</li>

View File

@@ -17,7 +17,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|library|Library template (sub-template) to use|<dl><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-okhttp3**</dt><dd>Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.0. JSON processing: Kotlinx Serialization: 1.2.1.</dd></dl>|jvm-okhttp4|
|modelMutable|Create mutable models| |false|
|moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false|
|omitGradlePluginVersions|Whether to declare Gradle plugin versions in build files.| |false|
|packageName|Generated artifact package name.| |org.openapitools.client|
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|
|requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|<dl><dt>**toJson**</dt><dd>[DEFAULT] Date formatter option using a json converter.</dd><dt>**toString**</dt><dd>Use the 'toString'-method of the date-time object to retrieve the related string representation.</dd></dl>|toJson|
@@ -79,7 +78,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
## RESERVED WORDS
<ul class="column-ul">
<li>ApiResponse</li>
<li>abstract</li>
<li>actual</li>
<li>annotation</li>

View File

@@ -7,8 +7,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|numberedFieldNumberList|Field numbers in order.| |false|
|startEnumsWithUnknown|Introduces &quot;UNKNOWN&quot; as the first element of enumerations.| |false|
## IMPORT MAPPING

View File

@@ -10,13 +10,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|gemAuthor|gem author (only one is supported).| |OpenAPI-Generator|
|gemAuthor|gem author (only one is supported).| |null|
|gemAuthorEmail|gem author email (only one is supported).| |null|
|gemDescription|gem description. | |This gem maps to a REST API|
|gemHomepage|gem homepage. | |https://openapi-generator.tech|
|gemHomepage|gem homepage. | |http://org.openapitools|
|gemLicense|gem license. | |unlicense|
|gemName|gem name (convention: underscore_case).| |openapi_client|
|gemRequiredRubyVersion|gem required Ruby version. | |&gt;= 2.4|
|gemRequiredRubyVersion|gem required Ruby version. | |&gt;= 1.9|
|gemSummary|gem summary. | |A ruby wrapper for the REST APIs|
|gemVersion|gem version.| |1.0.0|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|

View File

@@ -13,7 +13,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId| |openapi-scala-akka-http-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|asManagedSources|Resulting files cab be used as managed resources. No build files or default controllers will be generated| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (prefered for JDK 1.8+)</dd></dl>|java8|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|

View File

@@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|apiPackage|package for generated api classes| |null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (prefered for JDK 1.8+)</dd></dl>|java8|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|

View File

@@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|apiPackage|package for generated api classes| |null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (prefered for JDK 1.8+)</dd></dl>|java8|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|

View File

@@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|apiPackage|package for generated api classes| |null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (prefered for JDK 1.8+)</dd></dl>|java8|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|

View File

@@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|apiPackage|package for generated api classes| |null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (prefered for JDK 1.8+)</dd></dl>|java8|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|

View File

@@ -10,7 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|apiPackage|package for generated api classes| |null|
|circeVersion|The version of circe library| |0.13.0|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (prefered for JDK 1.8+)</dd></dl>|java8|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|jodaTimeVersion|The version of joda-time library| |2.10.10|

View File

@@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|apiPackage|package for generated api classes| |null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (prefered for JDK 1.8+)</dd></dl>|java8|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|

View File

@@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|apiPackage|package for generated api classes| |null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (prefered for JDK 1.8+)</dd></dl>|java8|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|

View File

@@ -45,7 +45,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|modelPackage|package for generated models| |org.openapitools.model|
|oas3|Use OAS 3 Swagger annotations instead of OAS 2 annotations| |false|
|openApiNullable|Enable OpenAPI Jackson Nullable library| |true|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
@@ -70,7 +69,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
|useBeanValidation|Use BeanValidation API annotations| |true|
|useOptional|Use Optional container for optional parameters| |false|
|useSpringController|Annotate the generated API as a Spring Controller| |false|
|useTags|use tags for creating interface and controller classnames| |false|
|virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|

View File

@@ -11,7 +11,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|apiNamePrefix|Prefix that will be appended to all API names ('tags'). Default: empty string. e.g. Pet =&gt; Pet.| |null|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|generateFrozenEnums|Generate frozen enums (default: true)| |true|
|generateModelAdditionalProperties|Generate model additional properties (default: true)| |true|
|hashableModels|Make hashable models (default: true)| |true|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|

View File

@@ -19,7 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|modelFileSuffix|The suffix of the file of the generated model (model&lt;suffix&gt;.ts).| |null|
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original|
|modelSuffix|The suffix of the generated model.| |null|
|ngVersion|The version of Angular. (At least 6.0.0)| |13.0.1|
|ngVersion|The version of Angular. (At least 6.0.0)| |12.0.0|
|npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null|
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|

View File

@@ -86,7 +86,7 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
"--markdown-header"}, title = "markdown header", description = "When format=markdown, include this option to write out markdown headers (e.g. for docusaurus).")
private Boolean markdownHeader;
@Option(name = {"--full-details"}, title = "full generator details", description = "displays CLI options as well as other configs/mappings (implies --instantiation-types, --reserved-words, --language-specific-primitives, --import-mappings, --feature-set)")
@Option(name = {"--full-details"}, title = "full generator details", description = "displays CLI options as well as other configs/mappings (implies --instantiation-types, --reserved-words, --language-specific-primitives, --import-mappings, --supporting-files)")
private Boolean fullDetails;
private String newline = System.lineSeparator();

View File

@@ -22,9 +22,7 @@ import org.apache.commons.lang3.ArrayUtils;
import org.mockito.MockSettings;
import org.openapitools.codegen.DefaultGenerator;
import org.openapitools.codegen.Generator;
import org.openapitools.codegen.SpecValidationException;
import org.openapitools.codegen.config.CodegenConfigurator;
import org.testng.TestException;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -432,12 +430,4 @@ public class GenerateTest {
verify(configurator).toContext();
verifyNoMoreInteractions(configurator);
}
/**
* This test ensures that when the
*/
@Test(expectedExceptions = SpecValidationException.class)
public void testNPEWithInvalidSpecFile() {
setupAndRunTest("-i", "src/test/resources/npe-test.yaml", "-g", "java", "-o", "src/main/java", false, null);
}
}

View File

@@ -1,14 +0,0 @@
test:
get:
responses:
'200':
description: test
content:
application/json:
schema:
type: object
properties:
prop1:
type: array
prop2:
type: date

View File

@@ -1,8 +0,0 @@
openapi: 3.0.0
info:
description: test
version: test
title: test
paths:
/test:
$ref: 'npe-test-spec-file.yaml#/test'

View File

@@ -1,3 +1,3 @@
# RELEASE_VERSION
openApiGeneratorVersion=5.3.1-SNAPSHOT
openApiGeneratorVersion=5.3.0-SNAPSHOT
# /RELEASE_VERSION

View File

@@ -93,17 +93,13 @@
<!-- dependencies are needed for the client being generated -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-annotations-version}</version>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-annotations-version}</version>
</dependency>
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<!-- You can find the dependencies for the library configuration you chose by looking in JavaClientCodegen.
Then find the corresponding dependency on Maven Central, and set the versions in the property section below -->
<!-- HTTP client: jersey-client -->
<dependency>
@@ -111,11 +107,6 @@
<artifactId>jersey-client</artifactId>
<version>${jersey-version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey-version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
@@ -127,76 +118,77 @@
<version>${jersey-version}</version>
</dependency>
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-base</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson-version}</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind-version}</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>
<!-- Joda time: if you use it -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson-version}</version>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime-version}</version>
</dependency>
<dependency>
<groupId>com.github.scribejava</groupId>
<artifactId>scribejava-apis</artifactId>
<version>${scribejava-apis-version}</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>${jakarta-annotation-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>jersey-apache-connector</artifactId>
<version>${jersey-version}</version>
</dependency>
<!-- Base64 encoding that works in both JVM and Android -->
<dependency>
<groupId>com.brsanthu</groupId>
<artifactId>migbase64</artifactId>
<version>2.2</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>1.6.3</swagger-annotations-version>
<jersey-version>2.35</jersey-version>
<jackson-version>2.13.0</jackson-version>
<jackson-databind-version>2.13.0</jackson-databind-version>
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>4.13.2</junit-version>
<scribejava-apis-version>8.3.1</scribejava-apis-version>
<swagger-annotations-version>1.5.8</swagger-annotations-version>
<jersey-version>2.27</jersey-version>
<jackson-version>2.9.10</jackson-version>
<jackson-databind-nullable-version>0.2.0</jackson-databind-nullable-version>
<jodatime-version>2.7</jodatime-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.8.1</junit-version>
<scribejava-apis-version>6.9.0</scribejava-apis-version>
</properties>
</project>

View File

@@ -14,9 +14,9 @@
<properties>
<swagger-annotations-version>1.5.8</swagger-annotations-version>
<jersey-version>2.35</jersey-version>
<jackson-version>2.13.0</jackson-version>
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
<jersey-version>2.27</jersey-version>
<jackson-version>2.9.10</jackson-version>
<jackson-databind-nullable-version>0.2.0</jackson-databind-nullable-version>
<jodatime-version>2.7</jodatime-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.8.1</junit-version>

View File

@@ -45,7 +45,7 @@ public class CodegenConfigLoader {
try {
return (CodegenConfig) Class.forName(name).getDeclaredConstructor().newInstance();
} catch (Exception e) {
throw new GeneratorNotFoundException("Can't load config class with name '".concat(name) + "'\nAvailable:\n" + availableConfigs, e);
throw new GeneratorNotFoundException("Can't load config class with name '".concat(name) + "'\nAvailable:\n" + availableConfigs.toString(), e);
}
}

View File

@@ -1,67 +0,0 @@
package org.openapitools.codegen;
import java.util.List;
import java.util.Objects;
public class CodegenEncoding {
private String contentType;
private List<CodegenParameter> headers;
private String style;
private boolean explode;
private boolean allowReserved;
public CodegenEncoding(String contentType, List<CodegenParameter> headers, String style, boolean explode, boolean allowReserved) {
this.contentType = contentType;
this.headers = headers;
this.style = style;
this.explode = explode;
this.allowReserved = allowReserved;
}
public String getContentType() {
return contentType;
}
public List<CodegenParameter> getHeaders() {
return headers;
}
public String getStyle() {
return style;
}
public boolean getExplode() {
return explode;
}
public boolean getAllowReserved() {
return allowReserved;
}
public String toString() {
final StringBuilder sb = new StringBuilder("CodegenEncoding{");
sb.append("contentType=").append(contentType);
sb.append(", headers=").append(headers);
sb.append(", style=").append(style);
sb.append(", explode=").append(explode);
sb.append(", allowReserved=").append(allowReserved);
sb.append('}');
return sb.toString();
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenEncoding that = (CodegenEncoding) o;
return contentType == that.getContentType() &&
Objects.equals(headers, that.getHeaders()) &&
style == that.getStyle() &&
explode == that.getExplode() &&
allowReserved == that.getAllowReserved();
}
@Override
public int hashCode() {
return Objects.hash(contentType, headers, style, explode, allowReserved);
}
}

View File

@@ -1,45 +0,0 @@
package org.openapitools.codegen;
import java.util.LinkedHashMap;
import java.util.Objects;
public class CodegenMediaType {
private CodegenProperty schema;
private LinkedHashMap<String, CodegenEncoding> encoding;
public CodegenMediaType(CodegenProperty schema, LinkedHashMap<String, CodegenEncoding> encoding) {
this.schema = schema;
this.encoding = encoding;
}
public CodegenProperty getSchema() {
return schema;
}
public LinkedHashMap<String, CodegenEncoding> getEncoding() {
return encoding;
}
public String toString() {
final StringBuilder sb = new StringBuilder("CodegenMediaType{");
sb.append("schema=").append(schema);
sb.append(", encoding=").append(encoding);
sb.append('}');
return sb.toString();
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenMediaType that = (CodegenMediaType) o;
return Objects.equals(schema,that.getSchema()) &&
Objects.equals(encoding, that.getEncoding());
}
@Override
public int hashCode() {
return Objects.hash(schema, encoding);
}
}

View File

@@ -45,9 +45,9 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
public List<CodegenModel> children;
// anyOf, oneOf, allOf
public Set<String> anyOf = new TreeSet<>();
public Set<String> oneOf = new TreeSet<>();
public Set<String> allOf = new TreeSet<>();
public Set<String> anyOf = new TreeSet<String>();
public Set<String> oneOf = new TreeSet<String>();
public Set<String> allOf = new TreeSet<String>();
// The schema name as written in the OpenAPI document.
public String name;
@@ -66,20 +66,20 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
public boolean isAlias; // Is this effectively an alias of another simple type
public boolean isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, isDate, isDateTime, isShort, isUnboundedInteger, isBoolean;
private boolean additionalPropertiesIsAnyType;
public List<CodegenProperty> vars = new ArrayList<>(); // all properties (without parent's properties)
public List<CodegenProperty> allVars = new ArrayList<>(); // all properties (with parent's properties)
public List<CodegenProperty> requiredVars = new ArrayList<>(); // a list of required properties
public List<CodegenProperty> optionalVars = new ArrayList<>(); // a list of optional properties
public List<CodegenProperty> readOnlyVars = new ArrayList<>(); // a list of read-only properties
public List<CodegenProperty> readWriteVars = new ArrayList<>(); // a list of properties for read, write
public List<CodegenProperty> parentVars = new ArrayList<>();
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>(); // all properties (without parent's properties)
public List<CodegenProperty> allVars = new ArrayList<CodegenProperty>(); // all properties (with parent's properties)
public List<CodegenProperty> requiredVars = new ArrayList<CodegenProperty>(); // a list of required properties
public List<CodegenProperty> optionalVars = new ArrayList<CodegenProperty>(); // a list of optional properties
public List<CodegenProperty> readOnlyVars = new ArrayList<CodegenProperty>(); // a list of read-only properties
public List<CodegenProperty> readWriteVars = new ArrayList<CodegenProperty>(); // a list of properties for read, write
public List<CodegenProperty> parentVars = new ArrayList<CodegenProperty>();
public Map<String, Object> allowableValues;
// Sorted sets of required parameters.
public Set<String> mandatory = new TreeSet<>(); // without parent's required properties
public Set<String> allMandatory = new TreeSet<>(); // with parent's required properties
public Set<String> mandatory = new TreeSet<String>(); // without parent's required properties
public Set<String> allMandatory = new TreeSet<String>(); // with parent's required properties
public Set<String> imports = new TreeSet<>();
public Set<String> imports = new TreeSet<String>();
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasValidation;
/**
* Indicates the OAS schema specifies "nullable: true".
@@ -104,9 +104,8 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
public boolean hasOnlyReadOnly = true; // true if all properties are read-only
public ExternalDocumentation externalDocumentation;
public Map<String, Object> vendorExtensions = new HashMap<>();
public Map<String, Object> vendorExtensions = new HashMap<String, Object>();
private CodegenComposedSchemas composedSchemas;
private boolean hasMultipleTypes = false;
/**
* The type of the value for the additionalProperties keyword in the OAS document.
@@ -320,7 +319,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
public void setDiscriminator(CodegenDiscriminator discriminator) {
this.discriminator = discriminator;
if (discriminator != null && !discriminator.getMappedModels().isEmpty()) {
if (discriminator instanceof CodegenDiscriminator && !discriminator.getMappedModels().isEmpty()) {
this.hasDiscriminatorWithNonEmptyMapping = true;
}
}
@@ -817,12 +816,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
return composedSchemas;
}
@Override
public boolean getHasMultipleTypes() {return hasMultipleTypes; }
@Override
public void setHasMultipleTypes(boolean hasMultipleTypes) { this.hasMultipleTypes = hasMultipleTypes; }
@Override
public boolean equals(Object o) {
if (this == o) return true;
@@ -856,7 +849,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
hasOnlyReadOnly == that.hasOnlyReadOnly &&
isNull == that.isNull &&
hasValidation == that.hasValidation &&
hasMultipleTypes == that.getHasMultipleTypes() &&
hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() &&
getIsAnyType() == that.getIsAnyType() &&
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
@@ -934,7 +926,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(),
getMaximum(), getPattern(), getMultipleOf(), getItems(), getAdditionalProperties(), getIsModel(),
getAdditionalPropertiesIsAnyType(), hasDiscriminatorWithNonEmptyMapping,
isAnyType, getComposedSchemas(), hasMultipleTypes);
isAnyType, getComposedSchemas());
}
@Override
@@ -1027,7 +1019,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping);
sb.append(", getIsAnyType=").append(getIsAnyType());
sb.append(", composedSchemas=").append(composedSchemas);
sb.append(", hasMultipleTypes=").append(hasMultipleTypes);
sb.append('}');
return sb.toString();
}
@@ -1067,13 +1058,13 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
private List<CodegenProperty> removeDuplicatedProperty(List<CodegenProperty> vars) {
// clone the list first
List<CodegenProperty> newList = new ArrayList<>();
List<CodegenProperty> newList = new ArrayList<CodegenProperty>();
for (CodegenProperty cp : vars) {
newList.add(cp.clone());
}
Set<String> propertyNames = new TreeSet<>();
Set<String> duplicatedNames = new TreeSet<>();
Set<String> propertyNames = new TreeSet<String>();
Set<String> duplicatedNames = new TreeSet<String>();
ListIterator<CodegenProperty> iterator = newList.listIterator();
while (iterator.hasNext()) {

View File

@@ -29,8 +29,7 @@ public class CodegenOperation {
isArray, isMultipart,
isResponseBinary = false, isResponseFile = false, hasReference = false,
isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy,
isRestful, isDeprecated, isCallbackRequest, uniqueItems, hasDefaultResponse = false,
hasErrorResponseObject; // if 4xx, 5xx repsonses have at least one error object defined
isRestful, isDeprecated, isCallbackRequest, uniqueItems, hasDefaultResponse = false;
public String path, operationId, returnType, returnFormat, httpMethod, returnBaseType,
returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse;
public CodegenDiscriminator discriminator;
@@ -226,17 +225,9 @@ public class CodegenOperation {
/**
* Check if body param is allowed for the request method
*
* @return true request method is DELETE, PUT, PATCH or POST; false otherwise
*/
public boolean isBodyAllowed() {
return Arrays.asList("DELETE","PUT", "PATCH", "POST").contains(httpMethod.toUpperCase(Locale.ROOT));
}
/**
* Check if the request method is PUT or PATCH or POST
*
* @return true request method is PUT, PATCH or POST; false otherwise
*/
public boolean isMethodPutOrPatchOrPost() {
public boolean isBodyAllowed() {
return Arrays.asList("PUT", "PATCH", "POST").contains(httpMethod.toUpperCase(Locale.ROOT));
}
@@ -298,7 +289,6 @@ public class CodegenOperation {
sb.append(", isResponseFile=").append(isResponseFile);
sb.append(", hasReference=").append(hasReference);
sb.append(", hasDefaultResponse=").append(hasDefaultResponse);
sb.append(", hasErrorResponseObject=").append(hasErrorResponseObject);
sb.append(", isRestfulIndex=").append(isRestfulIndex);
sb.append(", isRestfulShow=").append(isRestfulShow);
sb.append(", isRestfulCreate=").append(isRestfulCreate);
@@ -373,7 +363,6 @@ public class CodegenOperation {
isResponseFile == that.isResponseFile &&
hasReference == that.hasReference &&
hasDefaultResponse == that.hasDefaultResponse &&
hasErrorResponseObject == that.hasErrorResponseObject &&
isRestfulIndex == that.isRestfulIndex &&
isRestfulShow == that.isRestfulShow &&
isRestfulCreate == that.isRestfulCreate &&
@@ -438,7 +427,6 @@ public class CodegenOperation {
produces, prioritizedContentTypes, servers, bodyParam, allParams, bodyParams, pathParams, queryParams,
headerParams, formParams, cookieParams, requiredParams, optionalParams, authMethods, tags,
responses, callbacks, imports, examples, requestBodyExamples, externalDocs, vendorExtensions,
nickname, operationIdOriginal, operationIdLowerCase, operationIdCamelCase, operationIdSnakeCase,
hasErrorResponseObject);
nickname, operationIdOriginal, operationIdLowerCase, operationIdCamelCase, operationIdSnakeCase);
}
}

View File

@@ -52,7 +52,6 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
public boolean hasValidation;
public boolean isNullable;
public boolean isDeprecated;
private CodegenProperty schema;
/**
* Determines whether this parameter is mandatory. If the parameter is in "path",
* this property is required and its value MUST be true. Otherwise, the property
@@ -109,8 +108,6 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
private boolean hasRequired;
private boolean hasDiscriminatorWithNonEmptyMapping;
private CodegenComposedSchemas composedSchemas;
private boolean hasMultipleTypes = false;
private LinkedHashMap<String, CodegenMediaType> content;
public CodegenParameter copy() {
CodegenParameter output = new CodegenParameter();
@@ -162,14 +159,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
output.setHasVars(this.hasVars);
output.setHasRequired(this.hasRequired);
output.setHasDiscriminatorWithNonEmptyMapping(this.hasDiscriminatorWithNonEmptyMapping);
output.setHasMultipleTypes(this.hasMultipleTypes);
if (this.content != null) {
output.setContent(this.content);
}
if (this.schema != null) {
output.setSchema(this.schema);
}
if (this.composedSchemas != null) {
output.setComposedSchemas(this.getComposedSchemas());
}
@@ -230,7 +220,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
@Override
public int hashCode() {
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content);
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas);
}
@Override
@@ -278,16 +268,13 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
isDeprecated == that.isDeprecated &&
required == that.required &&
isNull == that.isNull &&
hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() &&
hasDiscriminatorWithNonEmptyMapping && that.getHasDiscriminatorWithNonEmptyMapping() &&
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
hasMultipleTypes == that.getHasMultipleTypes() &&
getHasVars() == that.getHasVars() &&
getHasRequired() == that.getHasRequired() &&
getExclusiveMaximum() == that.getExclusiveMaximum() &&
getExclusiveMinimum() == that.getExclusiveMinimum() &&
getUniqueItems() == that.getUniqueItems() &&
Objects.equals(content, that.getContent()) &&
Objects.equals(schema, that.getSchema()) &&
Objects.equals(composedSchemas, that.getComposedSchemas()) &&
Objects.equals(baseName, that.baseName) &&
Objects.equals(paramName, that.paramName) &&
@@ -412,9 +399,6 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
sb.append(", getHasRequired=").append(hasRequired);
sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping);
sb.append(", composedSchemas=").append(composedSchemas);
sb.append(", hasMultipleTypes=").append(hasMultipleTypes);
sb.append(", schema=").append(schema);
sb.append(", content=").append(content);
sb.append('}');
return sb.toString();
}
@@ -738,23 +722,5 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
public CodegenComposedSchemas getComposedSchemas() {
return composedSchemas;
}
@Override
public boolean getHasMultipleTypes() {return hasMultipleTypes; }
@Override
public void setHasMultipleTypes(boolean hasMultipleTypes) { this.hasMultipleTypes = hasMultipleTypes; }
public CodegenProperty getSchema() {return schema; }
public void setSchema(CodegenProperty schema) { this.schema = schema; }
public LinkedHashMap<String, CodegenMediaType> getContent() {
return content;
}
public void setContent(LinkedHashMap<String, CodegenMediaType> content) {
this.content = content;
}
}

View File

@@ -192,7 +192,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
private boolean hasRequired;
private boolean hasDiscriminatorWithNonEmptyMapping;
private CodegenComposedSchemas composedSchemas = null;
private boolean hasMultipleTypes = false;
public String getBaseName() {
return baseName;
@@ -802,12 +801,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
this.isAnyType = isAnyType;
}
@Override
public boolean getHasMultipleTypes() {return hasMultipleTypes; }
@Override
public void setHasMultipleTypes(boolean hasMultipleTypes) { this.hasMultipleTypes = hasMultipleTypes; }
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("CodegenProperty{");
@@ -904,7 +897,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
sb.append(", getHasRequired=").append(getHasRequired());
sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping);
sb.append(", composedSchemas=").append(composedSchemas);
sb.append(", hasMultipleTypes=").append(hasMultipleTypes);
sb.append('}');
return sb.toString();
}
@@ -956,7 +948,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
isXmlAttribute == that.isXmlAttribute &&
isXmlWrapped == that.isXmlWrapped &&
isNull == that.isNull &&
hasMultipleTypes == that.getHasMultipleTypes() &&
hasDiscriminatorWithNonEmptyMapping == that.hasDiscriminatorWithNonEmptyMapping &&
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
getHasVars() == that.getHasVars() &&
@@ -1024,6 +1015,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase,
nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName,
xmlNamespace, isXmlWrapped, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired,
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes);
hasDiscriminatorWithNonEmptyMapping, composedSchemas);
}
}

View File

@@ -21,7 +21,6 @@ import java.util.*;
public class CodegenResponse implements IJsonSchemaValidationProperties {
public final List<CodegenProperty> headers = new ArrayList<CodegenProperty>();
private List<CodegenParameter> responseHeaders = new ArrayList<CodegenParameter>();
public String code;
public boolean is1xx;
public boolean is2xx;
@@ -87,8 +86,6 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
private boolean hasRequired;
private boolean hasDiscriminatorWithNonEmptyMapping;
private CodegenComposedSchemas composedSchemas;
private boolean hasMultipleTypes = false;
private LinkedHashMap<String, CodegenMediaType> content;
@Override
public int hashCode() {
@@ -100,7 +97,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(),
getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(),
is1xx, is2xx, is3xx, is4xx, is5xx, additionalPropertiesIsAnyType, hasVars, hasRequired,
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, responseHeaders, content);
hasDiscriminatorWithNonEmptyMapping, composedSchemas);
}
@Override
@@ -145,12 +142,9 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
is4xx == that.is4xx &&
is5xx == that.is5xx &&
hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() &&
hasMultipleTypes == that.getHasMultipleTypes() &&
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
getHasVars() == that.getHasVars() &&
getHasRequired() == that.getHasRequired() &&
Objects.equals(content, that.getContent()) &&
Objects.equals(responseHeaders, that.getResponseHeaders()) &&
Objects.equals(composedSchemas, that.getComposedSchemas()) &&
Objects.equals(vars, that.vars) &&
Objects.equals(requiredVars, that.requiredVars) &&
@@ -180,22 +174,6 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
}
public LinkedHashMap<String, CodegenMediaType> getContent() {
return content;
}
public void setContent(LinkedHashMap<String, CodegenMediaType> content) {
this.content = content;
}
public List<CodegenParameter> getResponseHeaders() {
return responseHeaders;
}
public void setResponseHeaders(List<CodegenParameter> responseHeaders) {
this.responseHeaders = responseHeaders;
}
@Override
public String getPattern() {
return pattern;
@@ -507,9 +485,6 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
sb.append(", getHasRequired=").append(hasRequired);
sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping);
sb.append(", composedSchemas=").append(composedSchemas);
sb.append(", hasMultipleTypes=").append(hasMultipleTypes);
sb.append(", responseHeaders=").append(responseHeaders);
sb.append(", content=").append(content);
sb.append('}');
return sb.toString();
}
@@ -608,10 +583,4 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
public CodegenComposedSchemas getComposedSchemas() {
return composedSchemas;
}
@Override
public boolean getHasMultipleTypes() {return hasMultipleTypes; }
@Override
public void setHasMultipleTypes(boolean hasMultipleTypes) { this.hasMultipleTypes = hasMultipleTypes; }
}

View File

@@ -147,8 +147,8 @@ public class DefaultCodegen implements CodegenConfig {
protected Map<String, String> typeMapping;
protected Map<String, String> instantiationTypes;
protected Set<String> reservedWords;
protected Set<String> languageSpecificPrimitives = new HashSet<>();
protected Map<String, String> importMapping = new HashMap<>();
protected Set<String> languageSpecificPrimitives = new HashSet<String>();
protected Map<String, String> importMapping = new HashMap<String, String>();
protected String modelPackage = "", apiPackage = "", fileSuffix;
protected String modelNamePrefix = "", modelNameSuffix = "";
protected String apiNamePrefix = "", apiNameSuffix = "Api";
@@ -159,25 +159,25 @@ public class DefaultCodegen implements CodegenConfig {
apiTemplateFiles are for API outputs only (controllers/handlers).
API templates may be written multiple times; APIs are grouped by tag and the file is written once per tag group.
*/
protected Map<String, String> apiTemplateFiles = new HashMap<>();
protected Map<String, String> modelTemplateFiles = new HashMap<>();
protected Map<String, String> apiTestTemplateFiles = new HashMap<>();
protected Map<String, String> modelTestTemplateFiles = new HashMap<>();
protected Map<String, String> apiDocTemplateFiles = new HashMap<>();
protected Map<String, String> modelDocTemplateFiles = new HashMap<>();
protected Map<String, String> reservedWordsMappings = new HashMap<>();
protected Map<String, String> apiTemplateFiles = new HashMap<String, String>();
protected Map<String, String> modelTemplateFiles = new HashMap<String, String>();
protected Map<String, String> apiTestTemplateFiles = new HashMap<String, String>();
protected Map<String, String> modelTestTemplateFiles = new HashMap<String, String>();
protected Map<String, String> apiDocTemplateFiles = new HashMap<String, String>();
protected Map<String, String> modelDocTemplateFiles = new HashMap<String, String>();
protected Map<String, String> reservedWordsMappings = new HashMap<String, String>();
protected String templateDir;
protected String embeddedTemplateDir;
protected Map<String, Object> additionalProperties = new HashMap<>();
protected Map<String, String> serverVariables = new HashMap<>();
protected Map<String, Object> vendorExtensions = new HashMap<>();
protected Map<String, String> serverVariables = new HashMap<String, String>();
protected Map<String, Object> vendorExtensions = new HashMap<String, Object>();
/*
Supporting files are those which aren't models, APIs, or docs.
These get a different map of data bound to the templates. Supporting files are written once.
See also 'apiTemplateFiles'.
*/
protected List<SupportingFile> supportingFiles = new ArrayList<>();
protected List<CliOption> cliOptions = new ArrayList<>();
protected List<SupportingFile> supportingFiles = new ArrayList<SupportingFile>();
protected List<CliOption> cliOptions = new ArrayList<CliOption>();
protected boolean skipOverwrite;
protected boolean removeOperationIdPrefix;
protected String removeOperationIdPrefixDelimiter = "_";
@@ -210,7 +210,7 @@ public class DefaultCodegen implements CodegenConfig {
*/
protected boolean supportsAdditionalPropertiesWithComposedSchema;
protected boolean supportsMixins;
protected Map<String, String> supportedLibraries = new LinkedHashMap<>();
protected Map<String, String> supportedLibraries = new LinkedHashMap<String, String>();
protected String library;
protected Boolean sortParamsByRequiredFlag = true;
protected Boolean sortModelPropertiesByRequiredFlag = false;
@@ -222,7 +222,7 @@ public class DefaultCodegen implements CodegenConfig {
// How to encode special characters like $
// They are translated to words like "Dollar" and prefixed with '
// Then translated back during JSON encoding and decoding
protected Map<String, String> specialCharReplacements = new HashMap<>();
protected Map<String, String> specialCharReplacements = new HashMap<String, String>();
// When a model is an alias for a simple type
protected Map<String, String> typeAliases = null;
protected Boolean prependFormOrBodyParameters = false;
@@ -236,7 +236,7 @@ public class DefaultCodegen implements CodegenConfig {
protected boolean useOneOfInterfaces = false;
// whether or not the oneOf imports machinery should add oneOf interfaces as imports in implementing classes
protected boolean addOneOfInterfaceImports = false;
protected List<CodegenModel> addOneOfInterfaces = new ArrayList<>();
protected List<CodegenModel> addOneOfInterfaces = new ArrayList<CodegenModel>();
// flag to indicate whether to only update files whose contents have changed
protected boolean enableMinimalUpdate = false;
@@ -260,7 +260,7 @@ public class DefaultCodegen implements CodegenConfig {
private Map<String, Schema> modelNameToSchemaCache;
// A cache to efficiently lookup schema `toModelName()` based on the schema Key
private final Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
private Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
@Override
public List<CliOption> cliOptions() {
@@ -440,7 +440,7 @@ public class DefaultCodegen implements CodegenConfig {
// Gather data from all the models that contain oneOf into OneOfImplementorAdditionalData classes
// (see docstring of that class to find out what information is gathered and why)
Map<String, OneOfImplementorAdditionalData> additionalDataMap = new HashMap<>();
Map<String, OneOfImplementorAdditionalData> additionalDataMap = new HashMap<String, OneOfImplementorAdditionalData>();
for (Map.Entry<String, Object> modelsEntry : objs.entrySet()) {
Map<String, Object> modelsAttrs = (Map<String, Object>) modelsEntry.getValue();
List<Object> models = (List<Object>) modelsAttrs.get("models");
@@ -503,7 +503,7 @@ public class DefaultCodegen implements CodegenConfig {
* @return map of all models indexed by names
*/
public Map<String, CodegenModel> getAllModels(Map<String, Object> objs) {
Map<String, CodegenModel> allModels = new HashMap<>();
Map<String, CodegenModel> allModels = new HashMap<String, CodegenModel>();
for (Entry<String, Object> entry : objs.entrySet()) {
String modelName = toModelName(entry.getKey());
Map<String, Object> inner = (Map<String, Object>) entry.getValue();
@@ -570,7 +570,14 @@ public class DefaultCodegen implements CodegenConfig {
List<Map<String, Object>> models = (List<Map<String, Object>>) inner.get("models");
for (Map<String, Object> mo : models) {
CodegenModel cm = (CodegenModel) mo.get("model");
removeSelfReferenceImports(cm);
for (CodegenProperty cp : cm.allVars) {
// detect self import
if (cp.dataType.equalsIgnoreCase(cm.classname) ||
(cp.isContainer && cp.items != null && cp.items.dataType.equalsIgnoreCase(cm.classname))) {
cm.imports.remove(cm.classname); // remove self import
cp.isSelfReference = true;
}
}
}
}
setCircularReferences(allModels);
@@ -578,23 +585,6 @@ public class DefaultCodegen implements CodegenConfig {
return objs;
}
/**
* Removes imports from the model that points to itself
* Marks a self referencing property, if detected
*
* @param model Self imports will be removed from this model.imports collection
*/
protected void removeSelfReferenceImports(CodegenModel model) {
for (CodegenProperty cp : model.allVars) {
// detect self import
if (cp.dataType.equalsIgnoreCase(model.classname) ||
(cp.isContainer && cp.items != null && cp.items.dataType.equalsIgnoreCase(model.classname))) {
model.imports.remove(model.classname); // remove self import
cp.isSelfReference = true;
}
}
}
public void setCircularReferences(Map<String, CodegenModel> models) {
final Map<String, List<CodegenProperty>> dependencyMap = models.entrySet().stream()
.collect(Collectors.toMap(Entry::getKey, entry -> getModelDependencies(entry.getValue())));
@@ -833,9 +823,9 @@ public class DefaultCodegen implements CodegenConfig {
public void preprocessOpenAPI(OpenAPI openAPI) {
if (useOneOfInterfaces) {
// we process the openapi schema here to find oneOf schemas and create interface models for them
Map<String, Schema> schemas = new HashMap<>(openAPI.getComponents().getSchemas());
Map<String, Schema> schemas = new HashMap<String, Schema>(openAPI.getComponents().getSchemas());
if (schemas == null) {
schemas = new HashMap<>();
schemas = new HashMap<String, Schema>();
}
Map<String, PathItem> pathItems = openAPI.getPaths();
@@ -868,12 +858,12 @@ public class DefaultCodegen implements CodegenConfig {
}
// also add all properties of all schemas to be checked for oneOf
Map<String, Schema> propertySchemas = new HashMap<>();
Map<String, Schema> propertySchemas = new HashMap<String, Schema>();
for (Map.Entry<String, Schema> e : schemas.entrySet()) {
Schema s = e.getValue();
Map<String, Schema> props = s.getProperties();
if (props == null) {
props = new HashMap<>();
props = new HashMap<String, Schema>();
}
for (Map.Entry<String, Schema> p : props.entrySet()) {
propertySchemas.put(e.getKey() + "/" + p.getKey(), p.getValue());
@@ -1441,7 +1431,7 @@ public class DefaultCodegen implements CodegenConfig {
public String toVarName(final String name) {
if (reservedWords.contains(name)) {
return escapeReservedWord(name);
} else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) {
} else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey("" + ((char) character)))) {
return escape(name, specialCharReplacements, null, null);
}
return name;
@@ -1459,7 +1449,7 @@ public class DefaultCodegen implements CodegenConfig {
name = removeNonNameElementToCamelCase(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
if (reservedWords.contains(name)) {
return escapeReservedWord(name);
} else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) {
} else if (name.chars().anyMatch(character -> specialCharReplacements.containsKey("" + ((char) character)))) {
return escape(name, specialCharReplacements, null, null);
}
return name;
@@ -1557,7 +1547,7 @@ public class DefaultCodegen implements CodegenConfig {
.generationMessage(String.format(Locale.ROOT, "OpenAPI Generator: %s (%s)", getName(), codegenType.toValue()))
.build();
defaultIncludes = new HashSet<>(
defaultIncludes = new HashSet<String>(
Arrays.asList("double",
"int",
"long",
@@ -1574,7 +1564,7 @@ public class DefaultCodegen implements CodegenConfig {
"Float")
);
typeMapping = new HashMap<>();
typeMapping = new HashMap<String, String>();
typeMapping.put("array", "List");
typeMapping.put("set", "Set");
typeMapping.put("map", "Map");
@@ -1601,9 +1591,9 @@ public class DefaultCodegen implements CodegenConfig {
typeMapping.put("URI", "URI");
typeMapping.put("AnyType", "oas_any_type_not_mapped");
instantiationTypes = new HashMap<>();
instantiationTypes = new HashMap<String, String>();
reservedWords = new HashSet<>();
reservedWords = new HashSet<String>();
cliOptions.add(CliOption.newBoolean(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG,
CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC).defaultValue(Boolean.TRUE.toString()));
@@ -1758,7 +1748,7 @@ public class DefaultCodegen implements CodegenConfig {
if (!param.getRequired()) {
paramPart.append("]");
}
sb.append(paramPart);
sb.append(paramPart.toString());
}
}
}
@@ -2392,14 +2382,14 @@ public class DefaultCodegen implements CodegenConfig {
}
}
Map<NamedSchema, CodegenProperty> schemaCodegenPropertyCache = new HashMap<>();
Map<NamedSchema, CodegenProperty> schemaCodegenPropertyCache = new HashMap<NamedSchema, CodegenProperty>();
protected void updateModelForComposedSchema(CodegenModel m, Schema schema, Map<String, Schema> allDefinitions) {
final ComposedSchema composed = (ComposedSchema) schema;
Map<String, Schema> properties = new LinkedHashMap<>();
List<String> required = new ArrayList<>();
Map<String, Schema> allProperties = new LinkedHashMap<>();
List<String> allRequired = new ArrayList<>();
Map<String, Schema> properties = new LinkedHashMap<String, Schema>();
List<String> required = new ArrayList<String>();
Map<String, Schema> allProperties = new LinkedHashMap<String, Schema>();
List<String> allRequired = new ArrayList<String>();
// if schema has properties outside of allOf/oneOf/anyOf also add them to m
if (composed.getProperties() != null && !composed.getProperties().isEmpty()) {
@@ -2417,7 +2407,7 @@ public class DefaultCodegen implements CodegenConfig {
// TODO revise the logic below to set discriminator, xml attributes
if (supportsInheritance || supportsMixins) {
m.allVars = new ArrayList<>();
m.allVars = new ArrayList<CodegenProperty>();
if (composed.getAllOf() != null) {
int modelImplCnt = 0; // only one inline object allowed in a ComposedModel
int modelDiscriminators = 0; // only one discriminator allowed in a ComposedModel
@@ -2453,7 +2443,7 @@ public class DefaultCodegen implements CodegenConfig {
if (!interfaces.isEmpty()) {
// m.interfaces is for backward compatibility
if (m.interfaces == null)
m.interfaces = new ArrayList<>();
m.interfaces = new ArrayList<String>();
for (Schema interfaceSchema : interfaces) {
interfaceSchema = unaliasSchema(interfaceSchema, importMapping);
@@ -2531,7 +2521,7 @@ public class DefaultCodegen implements CodegenConfig {
m.parent = toModelName(parentName);
if (supportsMultipleInheritance) {
m.allParents = new ArrayList<>();
m.allParents = new ArrayList<String>();
for (String pname : allParents) {
String pModelName = toModelName(pname);
m.allParents.add(pModelName);
@@ -2683,7 +2673,7 @@ public class DefaultCodegen implements CodegenConfig {
// TODO remove the anyType check here in the future ANyType models can have enums defined
m.isEnum = true;
// comment out below as allowableValues is not set in post processing model enum
m.allowableValues = new HashMap<>();
m.allowableValues = new HashMap<String, Object>();
m.allowableValues.put("values", schema.getEnum());
}
if (!ModelUtils.isArraySchema(schema)) {
@@ -2752,7 +2742,7 @@ public class DefaultCodegen implements CodegenConfig {
// set isDiscriminator on the discriminator property
if (m.discriminator != null) {
String discPropName = m.discriminator.getPropertyBaseName();
List<List<CodegenProperty>> listOLists = new ArrayList<>();
List<List<CodegenProperty>> listOLists = new ArrayList<List<CodegenProperty>>();
listOLists.add(m.requiredVars);
listOLists.add(m.vars);
listOLists.add(m.allVars);
@@ -3170,16 +3160,10 @@ public class DefaultCodegen implements CodegenConfig {
List<MappedModel> uniqueDescendants = new ArrayList();
if (sourceDiscriminator.getMapping() != null && !sourceDiscriminator.getMapping().isEmpty()) {
for (Entry<String, String> e : sourceDiscriminator.getMapping().entrySet()) {
String name;
if (e.getValue().indexOf('/') >= 0) {
name = ModelUtils.getSimpleRef(e.getValue());
if (ModelUtils.getSchema(openAPI, name) == null) {
LOGGER.error("Failed to lookup the schema '{}' when processing the discriminator mapping of oneOf/anyOf. Please check to ensure it's defined properly.", name);
}
} else {
name = e.getValue();
}
uniqueDescendants.add(new MappedModel(e.getKey(), toModelName(name)));
String nameOrRef = e.getValue();
String name = nameOrRef.indexOf('/') >= 0 ? ModelUtils.getSimpleRef(nameOrRef) : nameOrRef;
String modelName = toModelName(name);
uniqueDescendants.add(new MappedModel(e.getKey(), modelName));
}
}
@@ -3352,7 +3336,6 @@ public class DefaultCodegen implements CodegenConfig {
protected void updatePropertyForString(CodegenProperty property, Schema p) {
if (ModelUtils.isByteArraySchema(p)) {
property.setIsString(false);
property.isByteArray = true;
} else if (ModelUtils.isBinarySchema(p)) {
property.isBinary = true;
@@ -3477,13 +3460,13 @@ public class DefaultCodegen implements CodegenConfig {
//Inline enum case:
if (p.getEnum() != null && !p.getEnum().isEmpty()) {
List<Object> _enum = p.getEnum();
property._enum = new ArrayList<>();
property._enum = new ArrayList<String>();
for (Object i : _enum) {
property._enum.add(String.valueOf(i));
}
property.isEnum = true;
Map<String, Object> allowableValues = new HashMap<>();
Map<String, Object> allowableValues = new HashMap<String, Object>();
allowableValues.put("values", _enum);
if (allowableValues.size() > 0) {
property.allowableValues = allowableValues;
@@ -3496,7 +3479,7 @@ public class DefaultCodegen implements CodegenConfig {
if (referencedSchema.getEnum() != null && !referencedSchema.getEnum().isEmpty()) {
List<Object> _enum = referencedSchema.getEnum();
Map<String, Object> allowableValues = new HashMap<>();
Map<String, Object> allowableValues = new HashMap<String, Object>();
allowableValues.put("values", _enum);
if (allowableValues.size() > 0) {
property.allowableValues = allowableValues;
@@ -3799,7 +3782,7 @@ public class DefaultCodegen implements CodegenConfig {
Map<String, Schema> schemas,
CodegenOperation op,
ApiResponse methodResponse) {
handleMethodResponse(operation, schemas, op, methodResponse, Collections.emptyMap());
handleMethodResponse(operation, schemas, op, methodResponse, Collections.<String, String>emptyMap());
}
/**
@@ -3904,7 +3887,7 @@ public class DefaultCodegen implements CodegenConfig {
Map<String, Schema> schemas = ModelUtils.getSchemas(this.openAPI);
CodegenOperation op = CodegenModelFactory.newInstance(CodegenModelType.OPERATION);
Set<String> imports = new HashSet<>();
Set<String> imports = new HashSet<String>();
if (operation.getExtensions() != null && !operation.getExtensions().isEmpty()) {
op.vendorExtensions.putAll(operation.getExtensions());
@@ -3965,20 +3948,6 @@ public class DefaultCodegen implements CodegenConfig {
ApiResponse response = operationGetResponsesEntry.getValue();
addProducesInfo(response, op);
CodegenResponse r = fromResponse(key, response);
Map<String, Header> headers = response.getHeaders();
if (headers != null) {
List<CodegenParameter> responseHeaders = new ArrayList<>();
for (Entry<String, Header> entry: headers.entrySet()) {
String headerName = entry.getKey();
Header header = entry.getValue();
CodegenParameter responseHeader = heeaderToCodegenParameter(header, headerName, imports, String.format(Locale.ROOT, "%sResponseParameter", r.code));
responseHeaders.add(responseHeader);
}
r.setResponseHeaders(responseHeaders);
}
String mediaTypeSchemaSuffix = String.format(Locale.ROOT, "%sResponseBody", r.code);
r.setContent(getContent(response.getContent(), imports, mediaTypeSchemaSuffix));
if (r.baseType != null &&
!defaultIncludes.contains(r.baseType) &&
!languageSpecificPrimitives.contains(r.baseType)) {
@@ -3996,12 +3965,6 @@ public class DefaultCodegen implements CodegenConfig {
if (Boolean.TRUE.equals(r.isFile) && Boolean.TRUE.equals(r.is2xx) && Boolean.FALSE.equals(op.isResponseFile)) {
op.isResponseFile = Boolean.TRUE;
}
// check if any 4xx or 5xx reponse has an error response object defined
if ((Boolean.TRUE.equals(r.is4xx) || Boolean.TRUE.equals(r.is5xx)) &&
Boolean.FALSE.equals(r.primitiveType) && Boolean.FALSE.equals(r.simpleType)) {
op.hasErrorResponseObject = Boolean.TRUE;
}
}
op.responses.sort((a, b) -> {
int aScore = a.isWildcard() ? 2 : a.isRange() ? 1 : 0;
@@ -4022,15 +3985,15 @@ public class DefaultCodegen implements CodegenConfig {
}
List<Parameter> parameters = operation.getParameters();
List<CodegenParameter> allParams = new ArrayList<>();
List<CodegenParameter> bodyParams = new ArrayList<>();
List<CodegenParameter> pathParams = new ArrayList<>();
List<CodegenParameter> queryParams = new ArrayList<>();
List<CodegenParameter> headerParams = new ArrayList<>();
List<CodegenParameter> cookieParams = new ArrayList<>();
List<CodegenParameter> formParams = new ArrayList<>();
List<CodegenParameter> requiredParams = new ArrayList<>();
List<CodegenParameter> optionalParams = new ArrayList<>();
List<CodegenParameter> allParams = new ArrayList<CodegenParameter>();
List<CodegenParameter> bodyParams = new ArrayList<CodegenParameter>();
List<CodegenParameter> pathParams = new ArrayList<CodegenParameter>();
List<CodegenParameter> queryParams = new ArrayList<CodegenParameter>();
List<CodegenParameter> headerParams = new ArrayList<CodegenParameter>();
List<CodegenParameter> cookieParams = new ArrayList<CodegenParameter>();
List<CodegenParameter> formParams = new ArrayList<CodegenParameter>();
List<CodegenParameter> requiredParams = new ArrayList<CodegenParameter>();
List<CodegenParameter> optionalParams = new ArrayList<CodegenParameter>();
CodegenParameter bodyParam = null;
RequestBody requestBody = operation.getRequestBody();
@@ -4075,7 +4038,7 @@ public class DefaultCodegen implements CodegenConfig {
// add example
if (schemas != null) {
op.requestBodyExamples = new ExampleGenerator(schemas, this.openAPI).generate(null, new ArrayList<>(getConsumesInfo(this.openAPI, operation)), bodyParam.baseType);
op.requestBodyExamples = new ExampleGenerator(schemas, this.openAPI).generate(null, new ArrayList<String>(getConsumesInfo(this.openAPI, operation)), bodyParam.baseType);
}
}
}
@@ -4085,7 +4048,6 @@ public class DefaultCodegen implements CodegenConfig {
param = ModelUtils.getReferencedParameter(this.openAPI, param);
CodegenParameter p = fromParameter(param, imports);
p.setContent(getContent(param.getContent(), imports, "RequestParameter" + toModelName(param.getName())));
// ensure unique params
if (ensureUniqueParams) {
@@ -4296,7 +4258,6 @@ public class DefaultCodegen implements CodegenConfig {
r.setComposedSchemas(getComposedSchemas(responseSchema));
if (ModelUtils.isArraySchema(responseSchema)) {
r.simpleType = false;
r.isArray = true;
r.containerType = cp.containerType;
ArraySchema as = (ArraySchema) responseSchema;
CodegenProperty items = fromProperty("response", getSchemaItems(as));
@@ -4316,7 +4277,6 @@ public class DefaultCodegen implements CodegenConfig {
} else if (ModelUtils.isUUIDSchema(responseSchema)) {
r.isUuid = true;
} else if (ModelUtils.isByteArraySchema(responseSchema)) {
r.setIsString(false);
r.isByteArray = true;
} else if (ModelUtils.isBinarySchema(responseSchema)) {
r.isFile = true; // file = binary in OAS3
@@ -4352,8 +4312,6 @@ public class DefaultCodegen implements CodegenConfig {
} else if (ModelUtils.isTypeObjectSchema(responseSchema)) {
if (ModelUtils.isFreeFormObject(openAPI, responseSchema)) {
r.isFreeFormObject = true;
} else {
r.isModel = true;
}
r.simpleType = false;
r.containerType = cp.containerType;
@@ -4365,6 +4323,9 @@ public class DefaultCodegen implements CodegenConfig {
LOGGER.debug("Property type is not primitive: {}", cp.dataType);
}
if (!r.isMap && !r.isArray) {
r.simpleType = true;
}
r.primitiveType = (r.baseType == null || languageSpecificPrimitives().contains(r.baseType));
if (r.baseType == null) {
@@ -4536,8 +4497,6 @@ public class DefaultCodegen implements CodegenConfig {
Schema parameterSchema;
if (parameter.getSchema() != null) {
parameterSchema = parameter.getSchema();
CodegenProperty prop = fromProperty(parameter.getName(), parameterSchema);
codegenParameter.setSchema(prop);
} else if (parameter.getContent() != null) {
Content content = parameter.getContent();
if (content.size() > 1) {
@@ -4570,7 +4529,7 @@ public class DefaultCodegen implements CodegenConfig {
return codegenParameter;
}
parameterSchema = unaliasSchema(parameterSchema, Collections.emptyMap());
parameterSchema = unaliasSchema(parameterSchema, Collections.<String, String>emptyMap());
if (parameterSchema == null) {
LOGGER.warn("warning! Schema not found for parameter \" {} \", using String", parameter.getName());
parameterSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to missing type definition.");
@@ -4794,7 +4753,7 @@ public class DefaultCodegen implements CodegenConfig {
return Collections.emptyList();
}
List<CodegenSecurity> codegenSecurities = new ArrayList<>(securitySchemeMap.size());
List<CodegenSecurity> codegenSecurities = new ArrayList<CodegenSecurity>(securitySchemeMap.size());
for (String key : securitySchemeMap.keySet()) {
final SecurityScheme securityScheme = securitySchemeMap.get(key);
if (SecurityScheme.Type.APIKEY.equals(securityScheme.getType())) {
@@ -4810,12 +4769,12 @@ public class DefaultCodegen implements CodegenConfig {
final CodegenSecurity cs = defaultCodegenSecurity(key, securityScheme);
cs.isKeyInHeader = cs.isKeyInQuery = cs.isKeyInCookie = cs.isApiKey = cs.isOAuth = false;
cs.isBasic = true;
if ("basic".equalsIgnoreCase(securityScheme.getScheme())) {
if ("basic".equals(securityScheme.getScheme())) {
cs.isBasicBasic = true;
} else if ("bearer".equalsIgnoreCase(securityScheme.getScheme())) {
} else if ("bearer".equals(securityScheme.getScheme())) {
cs.isBasicBearer = true;
cs.bearerFormat = securityScheme.getBearerFormat();
} else if ("signature".equalsIgnoreCase(securityScheme.getScheme())) {
} else if ("signature".equals(securityScheme.getScheme())) {
// HTTP signature as defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/
// The registry of security schemes is maintained by IANA.
// https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml
@@ -4894,7 +4853,7 @@ public class DefaultCodegen implements CodegenConfig {
}
protected void setReservedWordsLowerCase(List<String> words) {
reservedWords = new HashSet<>();
reservedWords = new HashSet<String>();
for (String word : words) {
reservedWords.add(word.toLowerCase(Locale.ROOT));
}
@@ -4957,9 +4916,9 @@ public class DefaultCodegen implements CodegenConfig {
return null;
}
final List<Map<String, Object>> output = new ArrayList<>(examples.size());
final List<Map<String, Object>> output = new ArrayList<Map<String, Object>>(examples.size());
for (Map.Entry<String, Object> entry : examples.entrySet()) {
final Map<String, Object> kv = new HashMap<>();
final Map<String, Object> kv = new HashMap<String, Object>();
kv.put("contentType", entry.getKey());
kv.put("example", entry.getValue());
output.add(kv);
@@ -5015,7 +4974,7 @@ public class DefaultCodegen implements CodegenConfig {
co, Map<String, List<CodegenOperation>> operations) {
List<CodegenOperation> opList = operations.get(tag);
if (opList == null) {
opList = new ArrayList<>();
opList = new ArrayList<CodegenOperation>();
operations.put(tag, opList);
}
// check for operationId uniqueness
@@ -5123,8 +5082,8 @@ public class DefaultCodegen implements CodegenConfig {
m.hasVars = true;
m.hasEnums = false; // TODO need to fix as its false in both cases
Set<String> mandatory = required == null ? Collections.emptySet()
: new TreeSet<>(required);
Set<String> mandatory = required == null ? Collections.<String>emptySet()
: new TreeSet<String>(required);
// update "vars" without parent's properties (all, required)
addVars(m, m.vars, properties, mandatory);
@@ -5136,8 +5095,8 @@ public class DefaultCodegen implements CodegenConfig {
}
if (allProperties != null) {
Set<String> allMandatory = allRequired == null ? Collections.emptySet()
: new TreeSet<>(allRequired);
Set<String> allMandatory = allRequired == null ? Collections.<String>emptySet()
: new TreeSet<String>(allRequired);
// update "vars" with parent's properties (all, required)
addVars(m, m.allVars, allProperties, allMandatory);
m.allMandatory = allMandatory;
@@ -5147,14 +5106,14 @@ public class DefaultCodegen implements CodegenConfig {
}
// loop through list to update property name with toVarName
Set<String> renamedMandatory = new ConcurrentSkipListSet<>();
Set<String> renamedMandatory = new ConcurrentSkipListSet<String>();
Iterator<String> mandatoryIterator = m.mandatory.iterator();
while (mandatoryIterator.hasNext()) {
renamedMandatory.add(toVarName(mandatoryIterator.next()));
}
m.mandatory = renamedMandatory;
Set<String> renamedAllMandatory = new ConcurrentSkipListSet<>();
Set<String> renamedAllMandatory = new ConcurrentSkipListSet<String>();
Iterator<String> allMandatoryIterator = m.allMandatory.iterator();
while (allMandatoryIterator.hasNext()) {
renamedAllMandatory.add(toVarName(allMandatoryIterator.next()));
@@ -5204,7 +5163,17 @@ public class DefaultCodegen implements CodegenConfig {
cm.hasOnlyReadOnly = false;
}
addImportsForPropertyType(cm, cp);
// TODO revise the logic to include map
if (cp.isContainer) {
addImport(cm, typeMapping.get("array"));
}
addImport(cm, cp.baseType);
CodegenProperty innerCp = cp;
while (innerCp != null) {
addImport(cm, innerCp.complexType);
innerCp = innerCp.items;
}
// if required, add to the list "requiredVars"
if (Boolean.TRUE.equals(cp.required)) {
@@ -5225,28 +5194,6 @@ public class DefaultCodegen implements CodegenConfig {
return;
}
/**
* For a given property, adds all needed imports to the model
* This includes a flat property type (e.g. property type: ReferencedModel)
* as well as container type (property type: array of ReferencedModel's)
*
* @param model The codegen representation of the OAS schema.
* @param property The codegen representation of the OAS schema's property.
*/
protected void addImportsForPropertyType(CodegenModel model, CodegenProperty property) {
// TODO revise the logic to include map
if (property.isContainer) {
addImport(model, typeMapping.get("array"));
}
addImport(model, property.baseType);
CodegenProperty innerCp = property;
while (innerCp != null) {
addImport(model, innerCp.complexType);
innerCp = innerCp.items;
}
}
/**
* Determine all of the types in the model definitions (schemas) that are aliases of
* simple types.
@@ -5619,7 +5566,7 @@ public class DefaultCodegen implements CodegenConfig {
* @return sanitized string
*/
public String sanitizeName(String name, String removeCharRegEx) {
return sanitizeName(name, removeCharRegEx, new ArrayList<>());
return sanitizeName(name, removeCharRegEx, new ArrayList<String>());
}
/**
@@ -5878,7 +5825,7 @@ public class DefaultCodegen implements CodegenConfig {
enumName = String.valueOf(value);
} else {
enumName = value.toString().substring(truncateIdx);
if (enumName.isEmpty()) {
if ("".equals(enumName)) {
enumName = value.toString();
}
}
@@ -6108,7 +6055,7 @@ public class DefaultCodegen implements CodegenConfig {
return null;
}
Set<String> produces = new ConcurrentSkipListSet<>();
Set<String> produces = new ConcurrentSkipListSet<String>();
for (ApiResponse r : operation.getResponses().values()) {
ApiResponse response = ModelUtils.getReferencedApiResponse(openAPI, r);
@@ -6159,7 +6106,7 @@ public class DefaultCodegen implements CodegenConfig {
LOGGER.debug("debugging fromRequestBodyToFormParameters= {}", body);
Schema schema = ModelUtils.getSchemaFromRequestBody(body);
schema = ModelUtils.getReferencedSchema(this.openAPI, schema);
List<String> allRequired = new ArrayList<>();
List<String> allRequired = new ArrayList<String>();
Map<String, Schema> properties = new LinkedHashMap<>();
// this traverses a composed schema and extracts all properties in each schema into properties
// TODO in the future have this return one codegenParameter of type object or composed which includes all definition
@@ -6340,7 +6287,7 @@ public class DefaultCodegen implements CodegenConfig {
codegenParameter.datatypeWithEnum = codegenProperty.datatypeWithEnum;
codegenParameter.enumName = codegenProperty.enumName;
}
// import
if (codegenProperty.complexType != null) {
imports.add(codegenProperty.complexType);
@@ -6582,7 +6529,6 @@ public class DefaultCodegen implements CodegenConfig {
protected void updateRequestBodyForString(CodegenParameter codegenParameter, Schema schema, Set<String> imports, String bodyParameterName) {
updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports);
if (ModelUtils.isByteArraySchema(schema)) {
codegenParameter.setIsString(false);
codegenParameter.isByteArray = true;
} else if (ModelUtils.isBinarySchema(schema)) {
codegenParameter.isBinary = true;
@@ -6606,77 +6552,6 @@ public class DefaultCodegen implements CodegenConfig {
codegenParameter.pattern = toRegularExpression(schema.getPattern());
}
protected String toMediaTypeSchemaName(String contentType, String mediaTypeSchemaSuffix) {
return "SchemaFor" + mediaTypeSchemaSuffix + toModelName(contentType);
}
private CodegenParameter heeaderToCodegenParameter(Header header, String headerName, Set<String> imports, String mediaTypeSchemaSuffix) {
if (header == null) {
return null;
}
Parameter headerParam = new Parameter();
headerParam.setName(headerName);
headerParam.setIn("header");
headerParam.setDescription(header.getDescription());
headerParam.setRequired(header.getRequired());
headerParam.setDeprecated(header.getDeprecated());
Header.StyleEnum style = header.getStyle();
if (style != null) {
headerParam.setStyle(Parameter.StyleEnum.valueOf(style.name()));
}
headerParam.setExplode(header.getExplode());
headerParam.setSchema(header.getSchema());
headerParam.setExamples(header.getExamples());
headerParam.setExample(header.getExample());
headerParam.setContent(header.getContent());
headerParam.setExtensions(header.getExtensions());
CodegenParameter param = fromParameter(headerParam, imports);
param.setContent(getContent(headerParam.getContent(), imports, mediaTypeSchemaSuffix));
return param;
}
protected LinkedHashMap<String, CodegenMediaType> getContent(Content content, Set<String> imports, String mediaTypeSchemaSuffix) {
if (content == null) {
return null;
}
LinkedHashMap<String, CodegenMediaType> cmtContent = new LinkedHashMap<>();
for (Entry<String, MediaType> contentEntry: content.entrySet()) {
MediaType mt = contentEntry.getValue();
LinkedHashMap<String, CodegenEncoding> ceMap = null;
if (mt.getEncoding() != null ) {
ceMap = new LinkedHashMap<>();
Map<String, Encoding> encMap = mt.getEncoding();
for (Entry<String, Encoding> encodingEntry: encMap.entrySet()) {
Encoding enc = encodingEntry.getValue();
List<CodegenParameter> headers = new ArrayList<>();
if (enc.getHeaders() != null) {
Map<String, Header> encHeaders = enc.getHeaders();
for (Entry<String, Header> headerEntry: encHeaders.entrySet()) {
String headerName = headerEntry.getKey();
Header header = ModelUtils.getReferencedHeader(this.openAPI, headerEntry.getValue());
CodegenParameter param = heeaderToCodegenParameter(header, headerName, imports, mediaTypeSchemaSuffix);
headers.add(param);
}
}
CodegenEncoding ce = new CodegenEncoding(
enc.getContentType(),
headers,
enc.getStyle().toString(),
enc.getExplode().booleanValue(),
enc.getAllowReserved().booleanValue()
);
String propName = encodingEntry.getKey();
ceMap.put(propName, ce);
}
}
String contentType = contentEntry.getKey();
CodegenProperty schemaProp = fromProperty(toMediaTypeSchemaName(contentType, mediaTypeSchemaSuffix), mt.getSchema());
CodegenMediaType codegenMt = new CodegenMediaType(schemaProp, ceMap);
cmtContent.put(contentType, codegenMt);
}
return cmtContent;
}
public CodegenParameter fromRequestBody(RequestBody body, Set<String> imports, String bodyParameterName) {
if (body == null) {
LOGGER.error("body in fromRequestBody cannot be null!");
@@ -6698,7 +6573,6 @@ public class DefaultCodegen implements CodegenConfig {
if (schema == null) {
throw new RuntimeException("Request body cannot be null. Possible cause: missing schema in body parameter (OAS v2): " + body);
}
codegenParameter.setContent(getContent(body.getContent(), imports, "RequestBody"));
if (StringUtils.isNotBlank(schema.get$ref())) {
name = ModelUtils.getSimpleRef(schema.get$ref());
@@ -6753,8 +6627,6 @@ public class DefaultCodegen implements CodegenConfig {
} else if (ModelUtils.isObjectSchema(schema)) {
// object type schema OR (AnyType schema with properties defined)
this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, false);
} else {
updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports);
}
addVarsRequiredVarsAdditionalProps(schema, codegenParameter);
} else {
@@ -7078,7 +6950,7 @@ public class DefaultCodegen implements CodegenConfig {
cm.name = type;
cm.classname = type;
cm.vendorExtensions.put("x-is-one-of-interface", true);
cm.interfaceModels = new ArrayList<>();
cm.interfaceModels = new ArrayList<CodegenModel>();
addOneOfInterfaces.add(cm);
}
@@ -7296,7 +7168,7 @@ public class DefaultCodegen implements CodegenConfig {
List<CodegenProperty> xOf = new ArrayList<>();
int i = 0;
for (Schema xOfSchema: xOfCollection) {
CodegenProperty cp = fromProperty(collectionName + "_" + i, xOfSchema);
CodegenProperty cp = fromProperty(collectionName + "_" + String.valueOf(i), xOfSchema);
xOf.add(cp);
i += 1;
}

View File

@@ -268,11 +268,7 @@ public class DefaultGenerator implements Generator {
URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides());
contextPath = removeTrailingSlash(config.escapeText(url.getPath())); // for backward compatibility
basePathWithoutHost = contextPath;
if (URLPathUtils.isRelativeUrl(openAPI.getServers())) {
basePath = removeTrailingSlash(basePathWithoutHost);
} else {
basePath = removeTrailingSlash(config.escapeText(URLPathUtils.getHost(openAPI, config.serverVariableOverrides())));
}
basePath = removeTrailingSlash(config.escapeText(URLPathUtils.getHost(openAPI, config.serverVariableOverrides())));
}
private void configureOpenAPIInfo() {

View File

@@ -149,9 +149,6 @@ public interface IJsonSchemaValidationProperties {
void setComposedSchemas(CodegenComposedSchemas composedSchemas);
boolean getHasMultipleTypes();
void setHasMultipleTypes(boolean hasMultipleTypes);
/**
* Syncs all the schema's type properties into the IJsonSchemaValidationProperties instance

View File

@@ -129,6 +129,6 @@ public class SpecValidationException extends RuntimeException {
});
return super.getMessage() + " | " +
"Error count: " + errorCount + ", Warning count: " + warningCount + sb;
"Error count: " + errorCount + ", Warning count: " + warningCount + sb.toString();
}
}

View File

@@ -103,7 +103,7 @@ public class TemplateManager implements TemplatingExecutor, TemplateProcessor {
* @param name The location of the template
* @return The raw template contents
*/
@SuppressWarnings("java:S112")
@SuppressWarnings({"java:S112"})
// ignored rule java:S112 as RuntimeException is used to match previous exception type
public String readTemplate(String name) {
if (name == null || name.contains("..")) {

View File

@@ -26,7 +26,7 @@ public class TemplatingEngineLoader {
throw new IllegalStateException("Utility class");
}
@SuppressWarnings("java:S112") // ignore java:S112 as generic RuntimeException is acceptable here
@SuppressWarnings({"java:S112"}) // ignore java:S112 as generic RuntimeException is acceptable here
public static TemplatingEngineAdapter byIdentifier(String id) {
ServiceLoader<TemplatingEngineAdapter> loader = ServiceLoader.load(TemplatingEngineAdapter.class, TemplatingEngineLoader.class.getClassLoader());
@@ -42,7 +42,7 @@ public class TemplatingEngineLoader {
// Attempt to load skipping SPI
return (TemplatingEngineAdapter) Class.forName(id).getDeclaredConstructor().newInstance();
} catch (Exception e) {
throw new RuntimeException(String.format(Locale.ROOT, "Couldn't load template engine adapter %s. Available options: %n%s", id, sb), e);
throw new RuntimeException(String.format(Locale.ROOT, "Couldn't load template engine adapter %s. Available options: %n%s", id, sb.toString()), e);
}
}
}

View File

@@ -534,17 +534,9 @@ public class CodegenConfigurator {
if (validationMessages.size() > 0) {
Set<String> warnings = new HashSet<>();
if (specification != null) {
// Wrap the getUnusedSchemas() in try catch block so it catches the NPE
// when the input spec file is not correct
try{
List<String> unusedModels = ModelUtils.getUnusedSchemas(specification);
if (unusedModels != null) {
unusedModels.forEach(name -> warnings.add("Unused model: " + name));
}
} catch (Exception e){
System.err.println("[error] There is an error with OpenAPI specification parsed from the input spec file: " + inputSpec);
System.err.println("[error] Please make sure the spec file has correct format and all required fields are populated with valid value.");
List<String> unusedModels = ModelUtils.getUnusedSchemas(specification);
if (unusedModels != null) {
unusedModels.forEach(name -> warnings.add("Unused model: " + name));
}
}

View File

@@ -165,7 +165,7 @@ public class ExampleGenerator {
}
} else if (modelName != null && mediaType.startsWith(MIME_TYPE_XML)) {
final Schema schema = this.examples.get(modelName);
String example = new XmlExampleGenerator(this.examples).toXml(schema, 0, Collections.emptySet());
String example = new XmlExampleGenerator(this.examples).toXml(schema, 0, Collections.<String>emptySet());
if (example != null) {
kv.put(EXAMPLE, example);
output.add(kv);

View File

@@ -44,7 +44,7 @@ public class XmlExampleGenerator {
}
public String toXml(Schema schema) {
return toXml(null, schema, 0, Collections.emptySet());
return toXml(null, schema, 0, Collections.<String>emptySet());
}
protected String toXml(Schema schema, int indent, Collection<String> path) {

View File

@@ -41,7 +41,7 @@ public class RootedFileRule extends Rule {
}
private String getExtensionPart(final String input, int stopIndex) {
return input.substring(stopIndex > 0 ? stopIndex+1: input.length());
return input.substring(stopIndex > 0 ? stopIndex+1: input.length(), input.length());
}
@Override

View File

@@ -50,7 +50,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
protected List<Map<String, Object>> orderedModels;
protected final Map<String, List<String>> modelDepends;
protected final Map<String, String> nullableTypeMapping;
protected final Map<String, String> operationsScopes;
protected final HashMap<String, String> operationsScopes;
protected int scopeIndex = 0;
public AbstractAdaCodegen() {
@@ -155,7 +155,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
"xor")
);
typeMapping = new HashMap<>();
typeMapping = new HashMap<String, String>();
typeMapping.put("date", "Swagger.Date");
typeMapping.put("DateTime", "Swagger.Datetime");
typeMapping.put("string", "Swagger.UString");
@@ -172,7 +172,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
typeMapping.put("binary", "Swagger.Binary");
// Mapping to convert an Ada required type to an optional type (nullable).
nullableTypeMapping = new HashMap<>();
nullableTypeMapping = new HashMap<String, String>();
nullableTypeMapping.put("Swagger.Date", "Swagger.Nullable_Date");
nullableTypeMapping.put("Swagger.Datetime", "Swagger.Nullable_Date");
nullableTypeMapping.put("Swagger.UString", "Swagger.Nullable_UString");
@@ -181,10 +181,10 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
nullableTypeMapping.put("Boolean", "Swagger.Nullable_Boolean");
nullableTypeMapping.put("Swagger.Object", "Swagger.Object");
modelDepends = new HashMap<>();
orderedModels = new ArrayList<>();
operationsScopes = new HashMap<>();
super.importMapping = new HashMap<>();
modelDepends = new HashMap<String, List<String>>();
orderedModels = new ArrayList<Map<String, Object>>();
operationsScopes = new HashMap<String, String>();
super.importMapping = new HashMap<String, String>();
// CLI options
addOption(CodegenConstants.PROJECT_NAME, "GNAT project name",
@@ -193,7 +193,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
modelNameSuffix = "Type";
embeddedTemplateDir = templateDir = "Ada";
languageSpecificPrimitives = new HashSet<>(
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList("integer", "boolean", "number", "long", "float",
"double", "object", "string", "date", "DateTime", "binary"));
}
@@ -651,7 +651,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
Object v = model.get("model");
if (v instanceof CodegenModel) {
CodegenModel m = (CodegenModel) v;
List<String> d = new ArrayList<>();
List<String> d = new ArrayList<String>();
for (CodegenProperty p : m.vars) {
boolean isModel = false;
CodegenProperty item = p;
@@ -687,8 +687,8 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
// if I find a model that has no dependencies, or all of its dependencies are in revisedOrderedModels, consider it the independentModel
// put the independentModel at the end of revisedOrderedModels, and remove it from orderedModels
//
List<Map<String, Object>> revisedOrderedModels = new ArrayList<>();
List<String> collectedModelNames = new ArrayList<>();
List<Map<String, Object>> revisedOrderedModels = new ArrayList<Map<String, Object>>();
List<String> collectedModelNames = new ArrayList<String>();
int sizeOrderedModels = orderedModels.size();
for (int i = 0; i < sizeOrderedModels; i++) {
Map<String, Object> independentModel = null;
@@ -760,7 +760,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
* @return the authMethods to be used by the operation with its required scopes.
*/
private List<CodegenSecurity> postProcessAuthMethod(List<CodegenSecurity> authMethods, Map<String, List<String>> scopes) {
List<CodegenSecurity> result = (scopes == null) ? null : new ArrayList<>();
List<CodegenSecurity> result = (scopes == null) ? null : new ArrayList<CodegenSecurity>();
if (authMethods != null) {
for (CodegenSecurity authMethod : authMethods) {
if (authMethod.scopes != null) {
@@ -803,7 +803,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
opSecurity.isKeyInQuery = authMethod.isKeyInQuery;
opSecurity.flow = authMethod.flow;
opSecurity.tokenUrl = authMethod.tokenUrl;
List<Map<String, Object>> opAuthScopes = new ArrayList<>();
List<Map<String, Object>> opAuthScopes = new ArrayList<Map<String, Object>>();
for (String opScopeName : opScopes) {
for (Map<String, Object> scope : authMethod.scopes) {
String name = (String) scope.get("scope");

View File

@@ -81,9 +81,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
protected boolean supportNullable = Boolean.FALSE;
// nullable type
protected Set<String> nullableType = new HashSet<>();
protected Set<String> nullableType = new HashSet<String>();
protected Set<String> valueTypes = new HashSet<>();
protected Set<String> valueTypes = new HashSet<String>();
private final Logger LOGGER = LoggerFactory.getLogger(AbstractCSharpCodegen.class);
@@ -104,14 +104,14 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
outputFolder = "generated-code" + File.separator + this.getName();
embeddedTemplateDir = templateDir = this.getName();
collectionTypes = new HashSet<>(
collectionTypes = new HashSet<String>(
Arrays.asList(
"IList", "List",
"ICollection", "Collection",
"IEnumerable")
);
mapTypes = new HashSet<>(
mapTypes = new HashSet<String>(
Arrays.asList("IDictionary")
);
@@ -141,7 +141,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
);
// TODO: Either include fully qualified names here or handle in DefaultCodegen via lastIndexOf(".") search
languageSpecificPrimitives = new HashSet<>(
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList(
"String",
"string",
@@ -184,7 +184,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
// Nullable types here assume C# 2 support is not part of base
typeMapping = new HashMap<>();
typeMapping = new HashMap<String, String>();
typeMapping.put("string", "string");
typeMapping.put("binary", "byte[]");
typeMapping.put("ByteArray", "byte[]");
@@ -207,11 +207,11 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
typeMapping.put("AnyType", "Object");
// nullable type
nullableType = new HashSet<>(
nullableType = new HashSet<String>(
Arrays.asList("decimal", "bool", "int", "float", "long", "double", "DateTime", "DateTimeOffset", "Guid")
);
// value Types
valueTypes = new HashSet<>(
valueTypes = new HashSet<String>(
Arrays.asList("decimal", "bool", "int", "float", "long", "double")
);
}
@@ -463,9 +463,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
*
* @param models processed models to be further processed for enum references
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked"})
private void postProcessEnumRefs(final Map<String, Object> models) {
Map<String, CodegenModel> enumRefs = new HashMap<>();
Map<String, CodegenModel> enumRefs = new HashMap<String, CodegenModel>();
for (Map.Entry<String, Object> entry : models.entrySet()) {
CodegenModel model = ModelUtils.getModelByName(entry.getKey(), models);
if (model.isEnum) {
@@ -1325,7 +1325,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
// only process files with .cs extension
if ("cs".equals(FilenameUtils.getExtension(file.toString()))) {
String command = csharpPostProcessFile + " " + file;
String command = csharpPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
int exitValue = p.waitFor();

View File

@@ -323,7 +323,7 @@ abstract public class AbstractCppCodegen extends DefaultCodegen implements Codeg
}
// only process files with cpp extension
if ("cpp".equals(FilenameUtils.getExtension(file.toString())) || "h".equals(FilenameUtils.getExtension(file.toString()))) {
String command = cppPostProcessFile + " " + file;
String command = cppPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
p.waitFor();

View File

@@ -340,7 +340,7 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
// replace all characters that have a mapping but ignore underscores
// append an underscore to each replacement so that it can be camelized
if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) {
if (name.chars().anyMatch(character -> specialCharReplacements.containsKey("" + ((char) character)))) {
name = escape(name, specialCharReplacements, Collections.singletonList("_"), "_");
}
// remove the rest
@@ -505,7 +505,7 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
super.postProcessModelProperty(model, property);
if (!model.isEnum && property.isEnum) {
// These are inner enums, enums which do not exist as models, just as properties.
// They are handled via the enum_inline template and are generated in the
// They are handled via the enum_inline template and and are generated in the
// same file as the containing class. To prevent name clashes the inline enum classes
// are prefix with the classname of the containing class in the template.
// Here the datatypeWithEnum template variable gets updated to match that scheme.
@@ -529,9 +529,9 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List<Server> servers) {
final CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers);
for (CodegenResponse r : op.responses) {
// By default, only set types are automatically added to operation imports, not sure why.
// By default only set types are automatically added to operation imports, not sure why.
// Add all container type imports here, by default 'dart:core' imports are skipped
// but other sub-classes may require specific container type imports.
// but other sub classes may required specific container type imports.
if (r.containerType != null && typeMapping().containsKey(r.containerType)) {
final String value = typeMapping().get(r.containerType);
if (needToImport(value)) {
@@ -752,7 +752,7 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
// process all files with dart extension
if ("dart".equals(FilenameUtils.getExtension(file.toString()))) {
// currently supported is "dartfmt -w" and "dart format"
String command = dartPostProcessFile + " " + file;
String command = dartPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
int exitValue = p.waitFor();

View File

@@ -53,9 +53,9 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co
"redefine", "rename", "require", "rescue", "Result", "retry", "select", "separate", "then", "True",
"TUPLE", "undefine", "until", "variant", "Void", "when", "xor"));
defaultIncludes = new HashSet<>(Arrays.asList("map", "array"));
defaultIncludes = new HashSet<String>(Arrays.asList("map", "array"));
languageSpecificPrimitives = new HashSet<>(
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList("BOOLEAN", "INTEGER_8", "INTEGER_16", "INTEGER_32", "INTEGER_64", "NATURAL_8",
"NATURAL_16", "NATURAL_32", "NATURAL_64", "REAL_32", "REAL_64"));
@@ -559,7 +559,7 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co
}
public Map<String, String> createMapping(String key, String value) {
Map<String, String> customImport = new HashMap<>();
Map<String, String> customImport = new HashMap<String, String>();
customImport.put(key, value);
return customImport;
@@ -592,7 +592,7 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co
public String toEiffelFeatureStyle(String operationId) {
if (operationId.startsWith("get_")) {
return operationId.substring(4);
return operationId.substring(4, operationId.length());
} else {
return operationId;
}

View File

@@ -73,7 +73,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
// true if nullable types will be supported (as option)
protected boolean supportNullable = Boolean.TRUE;
protected Set<String> nullableType = new HashSet<>();
protected Set<String> nullableType = new HashSet<String>();
private final Logger LOGGER = LoggerFactory.getLogger(AbstractFSharpCodegen.class);
@@ -89,9 +89,9 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
outputFolder = this.getName();
embeddedTemplateDir = templateDir = this.getName();
collectionTypes = new HashSet<>(Arrays.asList("list", "seq"));
collectionTypes = new HashSet<String>(Arrays.asList("list", "seq"));
mapTypes = new HashSet<>(
mapTypes = new HashSet<String>(
Arrays.asList("IDictionary")
);
@@ -114,7 +114,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
);
// TODO - these are based on C# generator, do we need to add any more?
languageSpecificPrimitives = new HashSet<>(
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList(
"String",
"string",
@@ -156,7 +156,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
instantiationTypes.put("map", "IDictionary");
typeMapping = new HashMap<>();
typeMapping = new HashMap<String, String>();
typeMapping.put("string", "string");
typeMapping.put("binary", "byte[]");
typeMapping.put("ByteArray", "byte[]");
@@ -177,7 +177,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
typeMapping.put("URI", "string");
// nullable type
nullableType = new HashSet<>(
nullableType = new HashSet<String>(
Arrays.asList("decimal", "bool", "int", "float", "long", "double", "string", "Guid", "apiKey")
);
}
@@ -349,12 +349,12 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
* Output of CodeGen models must therefore be in dependency order (rather than alphabetical order, which seems to be the default).
* This could probably be made more efficient if absolutely needed.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked"})
public Map<String, Object> postProcessDependencyOrders(final Map<String, Object> objs) {
Map<String, Set<String>> dependencies = new HashMap<>();
Map<String, Set<String>> dependencies = new HashMap<String, Set<String>>();
List<String> classNames = new ArrayList<>();
List<String> classNames = new ArrayList<String>();
for (String k : objs.keySet()) {
CodegenModel model = ModelUtils.getModelByName(k, objs);
@@ -381,7 +381,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
}
}
Map<String, Object> sorted = new LinkedHashMap<>();
Map<String, Object> sorted = new LinkedHashMap<String, Object>();
for (int i = sortedKeys.length - 1; i >= 0; i--) {
Object k = sortedKeys[i];
sorted.put(k.toString(), objs.get(k));
@@ -400,9 +400,9 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
*
* @param models processed models to be further processed for enum references
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked"})
private void postProcessEnumRefs(final Map<String, Object> models) {
Map<String, CodegenModel> enumRefs = new HashMap<>();
Map<String, CodegenModel> enumRefs = new HashMap<String, CodegenModel>();
for (Map.Entry<String, Object> entry : models.entrySet()) {
CodegenModel model = ModelUtils.getModelByName(entry.getKey(), models);
if (model.isEnum) {
@@ -455,9 +455,10 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
// Since we iterate enumVars for modelInnerEnum and enumClass templates, and CodegenModel is missing some of CodegenProperty's properties,
// we can take advantage of Mustache's contextual lookup to add the same "properties" to the model's enumVars scope rather than CodegenProperty's scope.
List<Map<String, String>> enumVars = (ArrayList<Map<String, String>>) model.allowableValues.get("enumVars");
List<Map<String, Object>> newEnumVars = new ArrayList<>();
List<Map<String, Object>> newEnumVars = new ArrayList<Map<String, Object>>();
for (Map<String, String> enumVar : enumVars) {
Map<String, Object> mixedVars = new HashMap<>(enumVar);
Map<String, Object> mixedVars = new HashMap<String, Object>();
mixedVars.putAll(enumVar);
mixedVars.put("isString", isString);
mixedVars.put("isLong", isLong);
@@ -472,7 +473,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
}
}
} else {
LOGGER.warn("Expected to retrieve model {} by name, but no model was found. Check your -Dmodels inclusions.", openAPIName);
LOGGER.warn("Expected to retrieve model %s by name, but no model was found. Check your -Dmodels inclusions.", openAPIName);
}
}
}
@@ -1114,7 +1115,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
// only process files with .fs extension
if ("fs".equals(FilenameUtils.getExtension(file.toString()))) {
String command = fsharpPostProcessFile + " " + file;
String command = fsharpPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
int exitValue = p.waitFor();

View File

@@ -56,7 +56,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
supportsInheritance = true;
hideGenerationTimestamp = Boolean.FALSE;
defaultIncludes = new HashSet<>(
defaultIncludes = new HashSet<String>(
Arrays.asList(
"map",
"array")
@@ -77,7 +77,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
// Added "error" as it's used so frequently that it may as well be a keyword
);
languageSpecificPrimitives = new HashSet<>(
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList(
"string",
"bool",
@@ -133,14 +133,14 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
typeMapping.put("object", "map[string]interface{}");
typeMapping.put("AnyType", "interface{}");
numberTypes = new HashSet<>(
numberTypes = new HashSet<String>(
Arrays.asList(
"uint", "uint8", "uint16", "uint32", "uint64",
"int", "int8", "int16", "int32", "int64",
"float32", "float64")
);
importMapping = new HashMap<>();
importMapping = new HashMap<String, String>();
cliOptions.clear();
cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Go package name (convention: lowercase).")
@@ -252,7 +252,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
String[] parts = name.split("_");
String suffix = parts[parts.length - 1];
Set<String> reservedSuffixes = new HashSet<>(Arrays.asList(
Set<String> reservedSuffixes = new HashSet<String>(Arrays.asList(
// Test
"test",
// $GOOS
@@ -699,7 +699,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
}
public Map<String, String> createMapping(String key, String value) {
Map<String, String> customImport = new HashMap<>();
Map<String, String> customImport = new HashMap<String, String>();
customImport.put(key, value);
return customImport;
@@ -813,7 +813,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
}
// only process the following type (or we can simply rely on the file extension to check if it's a Go file)
Set<String> supportedFileType = new HashSet<>(
Set<String> supportedFileType = new HashSet<String>(
Arrays.asList(
"supporting-mustache",
"model-test",
@@ -828,7 +828,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
if ("go".equals(FilenameUtils.getExtension(file.toString()))) {
// e.g. "gofmt -w yourcode.go"
// e.g. "go fmt path/to/your/package"
String command = goPostProcessFile + " " + file;
String command = goPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
int exitValue = p.waitFor();

View File

@@ -55,13 +55,13 @@ public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements C
)
);
defaultIncludes = new HashSet<>(
defaultIncludes = new HashSet<String>(
Arrays.asList(
"map",
"array")
);
languageSpecificPrimitives = new HashSet<>(
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList(
"null",
"ID",
@@ -344,7 +344,7 @@ public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements C
}
public Map<String, String> createMapping(String key, String value) {
Map<String, String> customImport = new HashMap<>();
Map<String, String> customImport = new HashMap<String, String>();
customImport.put(key, value);
return customImport;

View File

@@ -18,7 +18,6 @@
package org.openapitools.codegen.languages;
import com.google.common.base.Strings;
import com.google.common.collect.Sets;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.PathItem;
@@ -165,7 +164,9 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
"native", "super", "while", "null")
);
languageSpecificPrimitives = Sets.newHashSet("String",
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList(
"String",
"boolean",
"Boolean",
"Double",
@@ -173,7 +174,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
"Long",
"Float",
"Object",
"byte[]"
"byte[]")
);
instantiationTypes.put("array", "ArrayList");
instantiationTypes.put("set", "LinkedHashSet");
@@ -507,7 +508,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
// optional jackson mappings for BigDecimal support
importMapping.put("ToStringSerializer", "com.fasterxml.jackson.databind.ser.std.ToStringSerializer");
importMapping.put("JsonSerialize", "com.fasterxml.jackson.databind.annotation.JsonSerialize");
importMapping.put("JsonDeserialize", "com.fasterxml.jackson.databind.annotation.JsonDeserialize");
// imports for pojos
importMapping.put("ApiModelProperty", "io.swagger.annotations.ApiModelProperty");
@@ -713,7 +713,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
}
// If name contains special chars -> replace them.
if ((((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character))))) {
if ((((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.keySet().contains("" + ((char) character))))) {
List<String> allowedCharacters = new ArrayList<>();
allowedCharacters.add("_");
allowedCharacters.add("$");
@@ -996,7 +996,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
*/
@Override
public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) {
boolean isModel = (codegenParameter.isModel || (codegenParameter.isContainer && codegenParameter.getItems().isModel));
Boolean isModel = (codegenParameter.isModel || (codegenParameter.isContainer && codegenParameter.getItems().isModel));
Content content = requestBody.getContent();
@@ -1228,8 +1228,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
model.imports.add("ArrayList");
} else if ("set".equals(property.containerType)) {
model.imports.add("LinkedHashSet");
model.imports.add("JsonDeserialize");
property.vendorExtensions.put("x-setter-extra-annotation", "@JsonDeserialize(as = LinkedHashSet.class)");
} else if ("map".equals(property.containerType)) {
model.imports.add("HashMap");
}
@@ -1247,10 +1245,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
model.getVendorExtensions().put("x-jackson-optional-nullable-helpers", true);
}
}
if (property.isReadOnly) {
model.getVendorExtensions().put("x-has-readonly-properties", true);
}
}
@Override
@@ -1266,7 +1260,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
// if the import package happens to be found in the importMapping (key)
// add the corresponding import package to the list
if (importMapping.containsKey(_import)) {
Map<String, String> newImportMap = new HashMap<>();
Map<String, String> newImportMap = new HashMap<String, String>();
newImportMap.put("import", importMapping.get(_import));
listIterator.add(newImportMap);
}
@@ -1291,7 +1285,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
for (CodegenOperation op : operationList) {
Collection<String> operationImports = new ConcurrentSkipListSet<>();
Collection<String> operationImports = new ConcurrentSkipListSet<String>();
for (CodegenParameter p : op.allParams) {
if (importMapping.containsKey(p.dataType)) {
operationImports.add(importMapping.get(p.dataType));
@@ -1320,7 +1314,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
if (hasBodyParameter(openAPI, operation) || hasFormParameter(openAPI, operation)) {
String defaultContentType = hasFormParameter(openAPI, operation) ? "application/x-www-form-urlencoded" : "application/json";
List<String> consumes = new ArrayList<>(getConsumesInfo(openAPI, operation));
String contentType = consumes.isEmpty() ? defaultContentType : consumes.get(0);
String contentType = consumes == null || consumes.isEmpty() ? defaultContentType : consumes.get(0);
operation.addExtension("x-contentType", contentType);
}
String accepts = getAccept(openAPI, operation);
@@ -1871,7 +1865,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
// only process files with java extension
if ("java".equals(FilenameUtils.getExtension(file.toString()))) {
String command = javaPostProcessFile + " " + file;
String command = javaPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
p.waitFor();

View File

@@ -66,7 +66,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
updateOption(DATE_LIBRARY, this.getDateLibrary());
updateOption(this.DATE_LIBRARY, this.getDateLibrary());
additionalProperties.put("title", title);
// java inflector uses the jackson lib

View File

@@ -78,7 +78,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
supportsInheritance = true;
setSortModelPropertiesByRequiredFlag(true);
languageSpecificPrimitives = new HashSet<>(Arrays.asList(
languageSpecificPrimitives = new HashSet<String>(Arrays.asList(
"kotlin.Byte",
"kotlin.ByteArray",
"kotlin.Short",
@@ -97,8 +97,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
// this includes hard reserved words defined by https://github.com/JetBrains/kotlin/blob/master/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java
// as well as keywords from https://kotlinlang.org/docs/reference/keyword-reference.html
reservedWords = new HashSet<>(Arrays.asList(
"ApiResponse", // Used in the auto-generated api client
reservedWords = new HashSet<String>(Arrays.asList(
"abstract",
"actual",
"annotation",
@@ -172,7 +171,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
"while"
));
defaultIncludes = new HashSet<>(Arrays.asList(
defaultIncludes = new HashSet<String>(Arrays.asList(
"kotlin.Byte",
"kotlin.ByteArray",
"kotlin.Short",
@@ -188,7 +187,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
"kotlin.collections.Map"
));
typeMapping = new HashMap<>();
typeMapping = new HashMap<String, String>();
typeMapping.put("string", "kotlin.String");
typeMapping.put("boolean", "kotlin.Boolean");
typeMapping.put("integer", "kotlin.Int");
@@ -215,7 +214,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
instantiationTypes.put("list", "kotlin.collections.ArrayList");
instantiationTypes.put("map", "kotlin.collections.HashMap");
importMapping = new HashMap<>();
importMapping = new HashMap<String, String>();
importMapping.put("BigDecimal", "java.math.BigDecimal");
importMapping.put("UUID", "java.util.UUID");
importMapping.put("URI", "java.net.URI");
@@ -897,7 +896,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
}
// If name contains special chars -> replace them.
if ((name.chars().anyMatch(character -> specialCharReplacements.keySet().contains(String.valueOf((char) character))))) {
if ((name.chars().anyMatch(character -> specialCharReplacements.keySet().contains("" + ((char) character))))) {
List<String> allowedCharacters = new ArrayList<>();
allowedCharacters.add("_");
allowedCharacters.add("$");
@@ -942,7 +941,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
// only process files with kt extension
if ("kt".equals(FilenameUtils.getExtension(file.toString()))) {
String command = kotlinPostProcessFile + " " + file;
String command = kotlinPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
p.waitFor();

View File

@@ -79,7 +79,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
);
// ref: http://php.net/manual/en/language.types.intro.php
languageSpecificPrimitives = new HashSet<>(
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList(
"bool",
"boolean",
@@ -107,7 +107,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
additionalProperties.put("primitives", primitives);
// ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types
typeMapping = new HashMap<>();
typeMapping = new HashMap<String, String>();
typeMapping.put("integer", "int");
typeMapping.put("long", "int");
typeMapping.put("number", "float");
@@ -769,7 +769,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
}
// only process files with php extension
if ("php".equals(FilenameUtils.getExtension(file.toString()))) {
String command = phpPostProcessFile + " " + file;
String command = phpPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
p.waitFor();

View File

@@ -270,7 +270,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
// only process files with py extension
if ("py".equals(FilenameUtils.getExtension(file.toString()))) {
String command = pythonPostProcessFile + " " + file;
String command = pythonPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
int exitValue = p.waitFor();

View File

@@ -666,11 +666,11 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho
operation.isMultipart = Boolean.TRUE;
}
}
operation.vendorExtensions.put("x-preferred-consume", consume);
operation.vendorExtensions.put("x-prefered-consume", consume);
} else if (operation.consumes.size() > 1) {
Map<String, String> consume = operation.consumes.get(0);
skipTests.put("reason", "Connexion does not support multiple consumes. See https://github.com/zalando/connexion/pull/760");
operation.vendorExtensions.put("x-preferred-consume", consume);
operation.vendorExtensions.put("x-prefered-consume", consume);
if ("multipart/form-data".equals(consume.get(MEDIA_TYPE))) {
operation.isMultipart = Boolean.TRUE;
}
@@ -680,14 +680,14 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho
if (operation.bodyParam != null) {
Map<String, String> consume = new HashMap<>();
consume.put(MEDIA_TYPE, "application/json");
operation.vendorExtensions.put("x-preferred-consume", consume);
operation.vendorExtensions.put("x-prefered-consume", consume);
skipTests.put("reason", "*/* not supported by Connexion. Use application/json instead. See https://github.com/zalando/connexion/pull/760");
}
}
// Choose to consume 'application/json' if available, else choose the last one.
if (operation.produces != null) {
for (Map<String, String> produce : operation.produces) {
operation.vendorExtensions.put("x-preferred-produce", produce);
operation.vendorExtensions.put("x-prefered-produce", produce);
if (produce.get(MEDIA_TYPE).equals("application/json")) {
break;
}

View File

@@ -238,7 +238,7 @@ abstract public class AbstractRubyCodegen extends DefaultCodegen implements Code
}
// only process files with rb extension
if ("rb".equals(FilenameUtils.getExtension(file.toString()))) {
String command = rubyPostProcessFile + " " + file;
String command = rubyPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
int exitValue = p.waitFor();
@@ -250,7 +250,7 @@ abstract public class AbstractRubyCodegen extends DefaultCodegen implements Code
while ((line = br.readLine()) != null) {
sb.append(line);
}
LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb);
LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb.toString());
}
} else {
LOGGER.info("Successfully executed: `{}`", command);

View File

@@ -46,7 +46,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
protected String dateLibrary = DateLibraries.java8.name();
protected enum DateLibraries {
java8("Java 8 native JSR310 (preferred for JDK 1.8+)"),
java8("Java 8 native JSR310 (prefered for JDK 1.8+)"),
joda( "Joda (for legacy app)"),
legacy( "Backport to http-client (deprecated)");
@@ -529,7 +529,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
// only process files with scala extension
if ("scala".equals(FilenameUtils.getExtension(file.toString()))) {
String command = scalaPostProcessFile + " " + file;
String command = scalaPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
int exitValue = p.waitFor();

View File

@@ -181,7 +181,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
" Required to generate a full package"));
this.cliOptions.add(new CliOption(NPM_VERSION, "The version of your npm package. If not provided, using the version from the OpenAPI specification file.").defaultValue(this.getNpmVersion()));
this.cliOptions.add(CliOption.newBoolean(SNAPSHOT,
"When setting this property to true, the version will be suffixed with -SNAPSHOT." + SNAPSHOT_SUFFIX_FORMAT.get().toPattern(),
"When setting this property to true, the version will be suffixed with -SNAPSHOT." + this.SNAPSHOT_SUFFIX_FORMAT.get().toPattern(),
false));
this.cliOptions.add(new CliOption(NULL_SAFE_ADDITIONAL_PROPS, NULL_SAFE_ADDITIONAL_PROPS_DESC).defaultValue(String.valueOf(this.getNullSafeAdditionalProps())));
}
@@ -896,7 +896,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
}
// only process files with ts extension
if ("ts".equals(FilenameUtils.getExtension(file.toString()))) {
String command = tsPostProcessFile + " " + file;
String command = tsPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
int exitValue = p.waitFor();

View File

@@ -117,7 +117,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
"native", "super", "while", "null")
);
languageSpecificPrimitives = new HashSet<>(
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList(
"String",
"boolean",

View File

@@ -49,7 +49,7 @@ public class ApexClientCodegen extends AbstractApexCodegen {
private String namedCredential;
private String srcPath = "force-app/main/default/";
private String sfdxConfigPath = "config/";
private HashMap<String, Object> primitiveDefaults = new HashMap<>();
private HashMap<String, Object> primitiveDefaults = new HashMap<String, Object>();
public ApexClientCodegen() {
super();
@@ -113,7 +113,7 @@ public class ApexClientCodegen extends AbstractApexCodegen {
"virtual", "void", "webservice", "when", "where", "while"
));
languageSpecificPrimitives = new HashSet<>(
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList("Blob", "Boolean", "Date", "Datetime", "Decimal", "Double", "ID",
"Integer", "Long", "Object", "String", "Time"
));
@@ -233,7 +233,7 @@ public class ApexClientCodegen extends AbstractApexCodegen {
out = String.valueOf(p.getDefault());
} else if (ModelUtils.isLongSchema(p)) {
Long def = (Long) p.getDefault();
out = def == null ? out : def + "L";
out = def == null ? out : def.toString() + "L";
} else if (ModelUtils.isMapSchema(p)) {
Schema inner = getAdditionalProperties(p);
String s = inner == null ? "Object" : getTypeDeclaration(inner);

View File

@@ -89,10 +89,10 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
String includeStatement = "include::{" + attributePathReference + "}" + escapeCurlyBrackets(relativeFileName) + "[opts=optional]";
if (Files.isRegularFile(filePathToInclude)) {
LOGGER.debug("including {}. file into markup from: {}", ++includeCount, filePathToInclude);
LOGGER.debug("including {}. file into markup from: {}", ++includeCount, filePathToInclude.toString());
out.write("\n" + includeStatement + "\n");
} else {
LOGGER.debug("{}. file not found, skip include for: {}", ++notFoundCount, filePathToInclude);
LOGGER.debug("{}. file not found, skip include for: {}", ++notFoundCount, filePathToInclude.toString());
out.write("\n// markup not found, no " + includeStatement + "\n");
}
}
@@ -140,10 +140,10 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
final Path filePathToLinkTo = Paths.get(basePath, relativeFileName).toAbsolutePath();
if (Files.isRegularFile(filePathToLinkTo)) {
LOGGER.debug("linking {}. file into markup from: {}", ++linkedCount, filePathToLinkTo);
LOGGER.debug("linking {}. file into markup from: {}", ++linkedCount, filePathToLinkTo.toString());
out.write("\n" + linkName + " link:" + relativeFileName + "[]\n");
} else {
LOGGER.debug("{}. file not found, skip link for: {}", ++notFoundLinkCount, filePathToLinkTo);
LOGGER.debug("{}. file not found, skip link for: {}", ++notFoundLinkCount, filePathToLinkTo.toString());
out.write("\n// file not found, no " + linkName + " link :" + relativeFileName + "[]\n");
}
}
@@ -217,7 +217,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
outputFolder = "generated-code" + File.separator + "asciidoc";
embeddedTemplateDir = templateDir = "asciidoc-documentation";
defaultIncludes = new HashSet<>();
defaultIncludes = new HashSet<String>();
cliOptions.add(new CliOption("appName", "short name of the application"));
cliOptions.add(new CliOption("appDescription", "description of the application"));
@@ -264,10 +264,10 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
supportingFiles.add(new SupportingFile("index.mustache", "", "index.adoc"));
reservedWords = new HashSet<>();
reservedWords = new HashSet<String>();
languageSpecificPrimitives = new HashSet<>();
importMapping = new HashMap<>();
languageSpecificPrimitives = new HashSet<String>();
importMapping = new HashMap<String, String>();
}
@@ -325,7 +325,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
public void processOpts() {
super.processOpts();
String specDir = String.valueOf(this.additionalProperties.get(SPEC_DIR));
String specDir = this.additionalProperties.get(SPEC_DIR) + "";
if (!Files.isDirectory(Paths.get(specDir))) {
LOGGER.warn("base part for include markup lambda not found: {} as {}", specDir, Paths.get(specDir).toAbsolutePath());
}
@@ -333,7 +333,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
this.includeSpecMarkupLambda = new IncludeMarkupLambda(SPEC_DIR,specDir);
additionalProperties.put("specinclude", this.includeSpecMarkupLambda);
String snippetDir = String.valueOf(this.additionalProperties.get(SNIPPET_DIR));
String snippetDir = this.additionalProperties.get(SNIPPET_DIR) + "";
if (!Files.isDirectory(Paths.get(snippetDir))) {
LOGGER.warn("base part for include markup lambda not found: {} as {}", snippetDir, Paths.get(snippetDir).toAbsolutePath());
}

View File

@@ -444,7 +444,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
}
// Converts, for example, PUT to HttpPut for controller attributes
operation.httpMethod = "Http" + operation.httpMethod.charAt(0) + operation.httpMethod.substring(1).toLowerCase(Locale.ROOT);
operation.httpMethod = "Http" + operation.httpMethod.substring(0, 1) + operation.httpMethod.substring(1).toLowerCase(Locale.ROOT);
}
@Override
@@ -472,7 +472,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
continue;
}
if(consumesString.toString().isEmpty()) {
if(consumesString.toString().equals("")) {
consumesString = new StringBuilder("\"" + consume.get("mediaType") + "\"");
}
else {
@@ -500,7 +500,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
}
}
if(!consumesString.toString().isEmpty()) {
if(!consumesString.toString().equals("")) {
operation.vendorExtensions.put("x-aspnetcore-consumes", consumesString.toString());
}
}

View File

@@ -209,7 +209,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
/**
* Bash reserved words.
*/
reservedWords = new HashSet<>(
reservedWords = new HashSet<String>(
Arrays.asList(
"case",
"do",

View File

@@ -323,7 +323,6 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
// root folder
supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", "", "CMakeLists.txt"));
supportingFiles.add(new SupportingFile("Packing.cmake.mustache", "", "Packing.cmake"));
supportingFiles.add(new SupportingFile("libcurl.licence.mustache", "", "libcurl.licence"));
supportingFiles.add(new SupportingFile("uncrustify-rules.cfg.mustache", "", "uncrustify-rules.cfg"));
supportingFiles.add(new SupportingFile("README.md.mustache", "", "README.md"));
@@ -875,7 +874,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
}
// only process the following type (or we can simply rely on the file extension to check if it's a .c or .h file)
Set<String> supportedFileType = new HashSet<>(
Set<String> supportedFileType = new HashSet<String>(
Arrays.asList(
"supporting-mustache",
"model-test",
@@ -889,7 +888,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
// only process files with .c or .h extension
if ("c".equals(FilenameUtils.getExtension(file.toString())) ||
"h".equals(FilenameUtils.getExtension(file.toString()))) {
String command = cPostProcessFile + " " + file;
String command = cPostProcessFile + " " + file.toString();
try {
Process p = Runtime.getRuntime().exec(command);
int exitValue = p.waitFor();

View File

@@ -35,7 +35,7 @@ import static org.openapitools.codegen.utils.StringUtils.camelize;
import static org.openapitools.codegen.utils.StringUtils.underscore;
public class CSharpClientCodegen extends AbstractCSharpCodegen {
@SuppressWarnings("hiding")
@SuppressWarnings({"hiding"})
private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class);
private static final String NUNIT = "nunit";
private static final String RESTSHARP = "restsharp";

View File

@@ -56,7 +56,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
// Project Variable, determined from target framework. Not intended to be user-settable.
protected static final String TARGET_FRAMEWORK_VERSION = "targetFrameworkVersion";
@SuppressWarnings("hiding")
@SuppressWarnings({"hiding"})
private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class);
private static final List<FrameworkStrategy> frameworkStrategies = Arrays.asList(
FrameworkStrategy.NETSTANDARD_1_3,
@@ -70,8 +70,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
FrameworkStrategy.NETCOREAPP_3_0,
FrameworkStrategy.NETCOREAPP_3_1,
FrameworkStrategy.NETFRAMEWORK_4_7,
FrameworkStrategy.NET_5_0,
FrameworkStrategy.NET_6_0
FrameworkStrategy.NET_5_0
);
private static FrameworkStrategy defaultFramework = FrameworkStrategy.NETSTANDARD_2_0;
protected final Map<String, String> frameworks;
@@ -1002,8 +1001,6 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
};
static FrameworkStrategy NET_5_0 = new FrameworkStrategy("net5.0", ".NET 5.0 compatible", "net5.0", Boolean.FALSE) {
};
static FrameworkStrategy NET_6_0 = new FrameworkStrategy("net6.0", ".NET 6.0 compatible", "net6.0", Boolean.FALSE) {
};
protected String name;
protected String description;
protected String testTargetFramework;

Some files were not shown because too many files have changed in this diff Show More