diff --git a/.circleci/config.yml b/.circleci/config.yml
index 1358ee78653..bf994be945e 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -141,7 +141,7 @@ commands: # a reusable command with parameters
jobs:
node0:
machine:
- image: ubuntu-2004:202201-02
+ image: ubuntu-2004:2024.01.1
working_directory: ~/OpenAPITools/openapi-generator
shell: /bin/bash --login
environment:
@@ -154,7 +154,7 @@ jobs:
nodeNo: "0"
node1:
machine:
- image: ubuntu-2004:202201-02
+ image: ubuntu-2004:2024.01.1
working_directory: ~/OpenAPITools/openapi-generator
shell: /bin/bash --login
environment:
@@ -167,7 +167,7 @@ jobs:
nodeNo: "1"
node2:
machine:
- image: ubuntu-2004:202201-02
+ image: ubuntu-2004:2024.01.1
working_directory: ~/OpenAPITools/openapi-generator
shell: /bin/bash --login
environment:
@@ -180,7 +180,7 @@ jobs:
nodeNo: "2"
node3:
machine:
- image: ubuntu-2004:202201-02
+ image: ubuntu-2004:2024.01.1
working_directory: ~/OpenAPITools/openapi-generator
shell: /bin/bash --login
environment:
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 3c64d59bd9b..92423daeffb 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -26,8 +26,8 @@
"java.configuration.runtimes": [
{
"name": "JavaSE-11",
- "path": "/usr/local/sdkman/candidates/java/11.0.16.1-ms",
- "sources": "/usr/local/sdkman/candidates/java/11.0.16.1-ms/lib/src.zip",
+ "path": "/usr/local/sdkman/candidates/java/current",
+ "sources": "/usr/local/sdkman/candidates/java/current/lib/src.zip",
"javadoc": "https://docs.oracle.com/en/java/javase/11/docs/api",
"default": true
}
@@ -50,4 +50,4 @@
// "postCreateCommand": "mvn clean package -DskipTests",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
-}
\ No newline at end of file
+}
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 0e596306d9d..fce2cdd52a6 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -17,5 +17,5 @@
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`.
IMPORTANT: Do **NOT** purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
-- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (upcoming 7.1.0 minor release - breaking changes with fallbacks), `8.0.x` (breaking changes without fallbacks)
+- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (upcoming 7.6.0 minor release - breaking changes with fallbacks), `8.0.x` (breaking changes without fallbacks)
- [ ] If your PR is targeting a particular programming language, @mention the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request.
diff --git a/.github/workflows/gradle-test.yaml b/.github/workflows/gradle-test.yaml
index 8923e20077b..84903ee1128 100644
--- a/.github/workflows/gradle-test.yaml
+++ b/.github/workflows/gradle-test.yaml
@@ -10,7 +10,7 @@ on:
- 'samples/client/petstore/java/**'
- 'samples/openapi3/client/petstore/java/**'
env:
- GRADLE_VERSION: 7.2
+ GRADLE_VERSION: 8.7
jobs:
build:
diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml
index 3eaee80ef24..f61055efd42 100644
--- a/.github/workflows/linux.yaml
+++ b/.github/workflows/linux.yaml
@@ -45,7 +45,7 @@ jobs:
${{ runner.os }}-gradle-
- name: Setup Maven
- uses: s4u/setup-maven-action@v1.12.0
+ uses: s4u/setup-maven-action@v1.13.0
with:
java-version: ${{ matrix.java }}
maven-version: 3.8.8
@@ -87,7 +87,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Maven
- uses: s4u/setup-maven-action@v1.12.0
+ uses: s4u/setup-maven-action@v1.13.0
with:
java-version: 11
maven-version: 3.8.8
diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml
index 1e9fb800ba5..6070ca97d95 100644
--- a/.github/workflows/openapi-generator.yaml
+++ b/.github/workflows/openapi-generator.yaml
@@ -140,8 +140,23 @@ jobs:
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target
+ - name: Delete samples that are entirely generated
+ run: |
+ rm -rf samples/client/petstore/csharp/generichost/net8/AllOf
+ rm -rf samples/client/petstore/csharp/generichost/net8/AnyOf
+ rm -rf samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare
+ rm -rf samples/client/petstore/csharp/generichost/net8/FormModels
+ rm -rf samples/client/petstore/csharp/generichost/net8/NullReferenceTypes
+ rm -rf samples/client/petstore/csharp/generichost/net8/OneOf
+ rm -rf samples/client/petstore/csharp/generichost/net8/Petstore
+ rm -rf samples/client/petstore/csharp/generichost/net8/SourceGeneration
+ rm -rf samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate
+ rm -rf samples/client/petstore/csharp/generichost/standard2.0/Petstore
- name: Generate samples
- run: bash bin/generate-samples.sh
+ run: |
+ bash bin/generate-samples.sh
+ # when a sample is deleted, you have to generate it twice for all files to get created
+ bash bin/generate-samples.sh
- name: Verify git status
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
diff --git a/.github/workflows/samples-cpp-qt-client.yaml b/.github/workflows/samples-cpp-qt-client.yaml
index b65195b8bf9..567ab1e1c87 100644
--- a/.github/workflows/samples-cpp-qt-client.yaml
+++ b/.github/workflows/samples-cpp-qt-client.yaml
@@ -27,7 +27,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Qt
- uses: jurplel/install-qt-action@v3
+ uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt-version }}
tools: ${{ matrix.tools }}
diff --git a/.github/workflows/samples-go.yaml b/.github/workflows/samples-go.yaml
index 62218739f56..c1b8973ba06 100644
--- a/.github/workflows/samples-go.yaml
+++ b/.github/workflows/samples-go.yaml
@@ -1,4 +1,4 @@
-name: Samples Go
+name: Samples Go
on:
push:
@@ -6,15 +6,17 @@ on:
- 'samples/server/petstore/go-echo-server/**'
- 'samples/server/petstore/go-api-server/**'
- 'samples/server/petstore/go-chi-server/**'
+ - 'samples/server/others/go-server/no-body-path-params/**'
pull_request:
paths:
- 'samples/server/petstore/go-echo-server/**'
- 'samples/server/petstore/go-api-server/**'
- 'samples/server/petstore/go-chi-server/**'
+ - 'samples/server/others/go-server/no-body-path-params/**'
jobs:
build:
- name: Build Go
+ name: Build Go
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -23,6 +25,7 @@ jobs:
- samples/server/petstore/go-echo-server/
- samples/server/petstore/go-api-server/
- samples/server/petstore/go-chi-server/
+ - samples/server/others/go-server/no-body-path-params/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
diff --git a/.github/workflows/samples-java-client-echo-api-jdk17.yaml b/.github/workflows/samples-java-client-echo-api-jdk17.yaml
new file mode 100644
index 00000000000..3c193ea204f
--- /dev/null
+++ b/.github/workflows/samples-java-client-echo-api-jdk17.yaml
@@ -0,0 +1,42 @@
+name: Java Client (Echo API) JDK17
+
+on:
+ push:
+ paths:
+ - samples/client/echo_api/java/restclient
+ pull_request:
+ paths:
+ - samples/client/echo_api/java/restclient
+jobs:
+ build:
+ name: Build Java Client JDK17
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ sample:
+ # clients
+ - samples/client/echo_api/java/restclient
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: 17
+ - name: Cache maven dependencies
+ uses: actions/cache@v4
+ env:
+ cache-name: maven-repository
+ with:
+ path: |
+ ~/.m2
+ key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
+ - name: Setup node.js
+ uses: actions/setup-node@v4
+ - name: Run echo server
+ run: |
+ git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server
+ (cd http-echo-server && npm install && npm start &)
+ - name: Build
+ working-directory: ${{ matrix.sample }}
+ run: mvn clean package
diff --git a/.github/workflows/samples-java-client-jdk11.yaml b/.github/workflows/samples-java-client-jdk11.yaml
index 11eb1fb933c..15994e5b749 100644
--- a/.github/workflows/samples-java-client-jdk11.yaml
+++ b/.github/workflows/samples-java-client-jdk11.yaml
@@ -15,6 +15,7 @@ on:
- samples/client/others/java/webclient-useAbstractionForFiles/**
- samples/client/others/java/jersey2-oneOf-duplicates/**
- samples/client/others/java/jersey2-oneOf-Mixed/**
+ - samples/client/others/java/resttemplate-list-schema-validation/**
pull_request:
paths:
- 'samples/client/petstore/java/**'
@@ -29,6 +30,7 @@ on:
- samples/client/others/java/webclient-useAbstractionForFiles/**
- samples/client/others/java/jersey2-oneOf-duplicates/**
- samples/client/others/java/jersey2-oneOf-Mixed/**
+ - samples/client/others/java/resttemplate-list-schema-validation/**
jobs:
build:
name: Build Java Client JDK11
@@ -73,10 +75,12 @@ jobs:
- samples/client/petstore/java/resttemplate-swagger2/
- samples/openapi3/client/petstore/java/jersey2-java8-swagger2/
- samples/client/others/java/okhttp-gson-oneOf/
+ - samples/client/echo_api/java/okhttp-gson-user-defined-templates/
- samples/client/others/java/resttemplate-useAbstractionForFiles/
- samples/client/others/java/webclient-useAbstractionForFiles/
- samples/client/others/java/jersey2-oneOf-duplicates/
- samples/client/others/java/jersey2-oneOf-Mixed/
+ - samples/client/others/java/resttemplate-list-schema-validation/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
diff --git a/.github/workflows/samples-java-client-jdk17.yaml b/.github/workflows/samples-java-client-jdk17.yaml
index 65bdb2a3413..b43fee7981c 100644
--- a/.github/workflows/samples-java-client-jdk17.yaml
+++ b/.github/workflows/samples-java-client-jdk17.yaml
@@ -5,10 +5,12 @@ on:
paths:
- samples/client/petstore/java/resttemplate-jakarta/**
- samples/client/petstore/java/webclient-jakarta/**
+ - samples/client/petstore/java/restclient-*/**
pull_request:
paths:
- samples/client/petstore/java/resttemplate-jakarta/**
- samples/client/petstore/java/webclient-jakarta/**
+ - samples/client/petstore/java/restclient-*/**
jobs:
build:
name: Build Java Client JDK17
@@ -20,6 +22,9 @@ jobs:
# clients
- samples/client/petstore/java/resttemplate-jakarta
- samples/client/petstore/java/webclient-jakarta
+ - samples/client/petstore/java/restclient
+ - samples/client/petstore/java/restclient-nullable-arrays
+ - samples/client/petstore/java/restclient-swagger2
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
@@ -34,9 +39,27 @@ jobs:
path: |
~/.m2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
+
- name: Build with Maven
working-directory: ${{ matrix.sample }}
run: mvn clean package
- - name: Build with Gradle
+
+ - name: Cache gradle dependencies
+ uses: actions/cache@v4
+ env:
+ cache-name: gradle-caches
+ with:
+ path: ~/.gradle/caches
+ key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
+
+ - name: Cache gradle wrapper
+ uses: actions/cache@v4
+ env:
+ cache-name: gradle-wrapper
+ with:
+ path: ~/.gradle/wrapper
+ key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
+
+ - name: Build
working-directory: ${{ matrix.sample }}
- run: gradle clean build
+ run: ./gradlew build -x test
diff --git a/.github/workflows/samples-java-helidon.yaml b/.github/workflows/samples-java-helidon-v3.yaml
similarity index 59%
rename from .github/workflows/samples-java-helidon.yaml
rename to .github/workflows/samples-java-helidon-v3.yaml
index 0ea61f91ff5..7f2bce545c7 100644
--- a/.github/workflows/samples-java-helidon.yaml
+++ b/.github/workflows/samples-java-helidon-v3.yaml
@@ -1,14 +1,14 @@
-name: Samples Java Helidon
+name: Samples Java Helidon v3
on:
push:
paths:
- - samples/client/petstore/java-helidon-client/**
- - samples/server/petstore/java-helidon-server/**
+ - samples/client/petstore/java-helidon-client/v3/**
+ - samples/server/petstore/java-helidon-server/v3/**
pull_request:
paths:
- - samples/client/petstore/java-helidon-client/**
- - samples/server/petstore/java-helidon-server/**
+ - samples/client/petstore/java-helidon-client/v3/**
+ - samples/server/petstore/java-helidon-server/v3/**
jobs:
build:
name: Build Java Helidon
@@ -17,10 +17,10 @@ jobs:
fail-fast: false
matrix:
sample:
- - samples/client/petstore/java-helidon-client/mp
- - samples/client/petstore/java-helidon-client/se
- - samples/server/petstore/java-helidon-server/mp
- - samples/server/petstore/java-helidon-server/se
+ - samples/client/petstore/java-helidon-client/v3/mp
+ - samples/client/petstore/java-helidon-client/v3/se
+ - samples/server/petstore/java-helidon-server/v3/mp
+ - samples/server/petstore/java-helidon-server/v3/se
version: [17]
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/samples-java-helidon-v4.yaml b/.github/workflows/samples-java-helidon-v4.yaml
new file mode 100644
index 00000000000..3b2bc66ec90
--- /dev/null
+++ b/.github/workflows/samples-java-helidon-v4.yaml
@@ -0,0 +1,39 @@
+name: Samples Java Helidon v4
+
+on:
+ push:
+ paths:
+ - samples/client/petstore/java-helidon-client/v4/**
+ - samples/server/petstore/java-helidon-server/v4/**
+ pull_request:
+ paths:
+ - samples/client/petstore/java-helidon-client/v4/**
+ - samples/server/petstore/java-helidon-server/v4/**
+jobs:
+ build:
+ name: Build Java Helidon
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ sample:
+ - samples/client/petstore/java-helidon-client/v4/mp
+ - samples/server/petstore/java-helidon-server/v4/mp
+ version: [21]
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: ${{ matrix.version }}
+ - name: Cache maven dependencies
+ uses: actions/cache@v4
+ env:
+ cache-name: maven-repository
+ with:
+ path: |
+ ~/.m2
+ key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
+ - name: Build
+ working-directory: ${{ matrix.sample }}
+ run: mvn clean package
diff --git a/.github/workflows/samples-java-server-jdk8.yaml b/.github/workflows/samples-java-server-jdk8.yaml
index 51de7249423..56694212c96 100644
--- a/.github/workflows/samples-java-server-jdk8.yaml
+++ b/.github/workflows/samples-java-server-jdk8.yaml
@@ -10,6 +10,7 @@ on:
- 'samples/server/petstore/java-pkmst/**'
# test in circleci instead
- 'samples/server/petstore/java-undertow/**'
+ - 'samples/server/petstore/java-microprofile/**'
pull_request:
paths:
#- 'samples/server/petstore/java-camel/**'
@@ -17,6 +18,7 @@ on:
- 'samples/server/petstore/java-inflector/**'
- 'samples/server/petstore/java-pkmst/**'
#- 'samples/server/petstore/java-undertow/**'
+ - 'samples/server/petstore/java-microprofile/**'
jobs:
build:
name: Build Java Server
@@ -31,6 +33,7 @@ jobs:
- samples/server/petstore/java-inflector/
- samples/server/petstore/java-pkmst/
#- samples/server/petstore/java-undertow/
+ - samples/server/petstore/java-microprofile/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
diff --git a/.github/workflows/samples-jdk17.yaml b/.github/workflows/samples-jdk17.yaml
index 41ebe0190d9..f013cd851c0 100644
--- a/.github/workflows/samples-jdk17.yaml
+++ b/.github/workflows/samples-jdk17.yaml
@@ -4,28 +4,28 @@ on:
paths:
# clients
- samples/openapi3/client/petstore/spring-cloud-3/**
- - samples/client/petstore/java-helidon-client/mp/**
- - samples/client/petstore/java-helidon-client/se/**
+ - samples/client/petstore/java-helidon-client/v3/mp/**
+ - samples/client/petstore/java-helidon-client/v3/se/**
- samples/client/petstore/spring-http-interface-reactive/**
- samples/client/petstore/spring-http-interface/**
- samples/client/petstore/java/webclient-jakarta/**
# servers
- samples/openapi3/server/petstore/springboot-3/**
- - samples/server/petstore/java-helidon-server/mp/**
- - samples/server/petstore/java-helidon-server/se/**
+ - samples/server/petstore/java-helidon-server/v3/mp/**
+ - samples/server/petstore/java-helidon-server/v3/se/**
pull_request:
paths:
# clients
- samples/openapi3/client/petstore/spring-cloud-3/**
- - samples/client/petstore/java-helidon-client/mp/**
- - samples/client/petstore/java-helidon-client/se/**
+ - samples/client/petstore/java-helidon-client/v3/mp/**
+ - samples/client/petstore/java-helidon-client/v3/se/**
- samples/client/petstore/spring-http-interface-reactive/**
- samples/client/petstore/spring-http-interface/**
- samples/client/petstore/java/webclient-jakarta/**
# servers
- samples/openapi3/server/petstore/springboot-3/**
- - samples/server/petstore/java-helidon-server/mp/**
- - samples/server/petstore/java-helidon-server/se/**
+ - samples/server/petstore/java-helidon-server/v3/mp/**
+ - samples/server/petstore/java-helidon-server/v3/se/**
jobs:
build:
name: Build with JDK17
@@ -36,15 +36,15 @@ jobs:
sample:
# clients
- samples/openapi3/client/petstore/spring-cloud-3
- - samples/client/petstore/java-helidon-client/mp
- - samples/client/petstore/java-helidon-client/se
+ - samples/client/petstore/java-helidon-client/v3/mp/
+ - samples/client/petstore/java-helidon-client/v3/se
- samples/client/petstore/spring-http-interface-reactive
- samples/client/petstore/spring-http-interface
- samples/client/petstore/java/webclient-jakarta
# servers
- samples/openapi3/server/petstore/springboot-3
- - samples/server/petstore/java-helidon-server/mp
- - samples/server/petstore/java-helidon-server/se
+ - samples/server/petstore/java-helidon-server/v3/mp/
+ - samples/server/petstore/java-helidon-server/v3/se
- samples/client/petstore/spring-http-interface-reactive
- samples/client/petstore/spring-http-interface
steps:
diff --git a/.github/workflows/samples-jdk21.yaml b/.github/workflows/samples-jdk21.yaml
new file mode 100644
index 00000000000..e09a4485348
--- /dev/null
+++ b/.github/workflows/samples-jdk21.yaml
@@ -0,0 +1,43 @@
+name: Samples JDK21
+on:
+ push:
+ paths:
+ # clients
+ - samples/client/petstore/java-helidon-client/v4/mp/**
+ # servers
+ - samples/server/petstore/java-helidon-server/v4/mp/**
+ pull_request:
+ paths:
+ # clients
+ - samples/client/petstore/java-helidon-client/v4/mp/**
+ # servers
+ - samples/server/petstore/java-helidon-server/v4/mp/**
+jobs:
+ build:
+ name: Build with JDK21
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ sample:
+ # clients
+ - samples/client/petstore/java-helidon-client/v4/mp/
+ # servers
+ - samples/server/petstore/java-helidon-server/v4/mp/
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: 21
+ - name: Cache maven dependencies
+ uses: actions/cache@v4
+ env:
+ cache-name: maven-repository
+ with:
+ path: |
+ ~/.m2
+ key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
+ - name: Build
+ working-directory: ${{ matrix.sample }}
+ run: mvn clean package
diff --git a/.github/workflows/samples-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml
index ab5b2c91b59..9689c0d02b6 100644
--- a/.github/workflows/samples-kotlin-client.yaml
+++ b/.github/workflows/samples-kotlin-client.yaml
@@ -10,9 +10,6 @@ on:
- 'samples/client/petstore/kotlin*/**'
- 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**'
-env:
- GRADLE_VERSION: 6.9
-
jobs:
build:
name: Build Kotlin client
@@ -65,7 +62,6 @@ jobs:
- samples/client/echo_api/kotlin-jvm-spring-3-webclient
- samples/client/petstore/kotlin-jvm-spring-3-restclient
- samples/client/echo_api/kotlin-jvm-spring-3-restclient
- - samples/client/petstore/kotlin-spring-cloud
- samples/client/petstore/kotlin-name-parameter-mappings
- samples/client/others/kotlin-jvm-okhttp-parameter-tests
steps:
@@ -73,7 +69,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
- java-version: 8
+ java-version: 11
- name: Cache maven dependencies
uses: actions/cache@v4
env:
@@ -85,7 +81,6 @@ jobs:
- name: Install Gradle wrapper
uses: eskatos/gradle-command-action@v3
with:
- gradle-version: ${{ env.GRADLE_VERSION }}
build-root-directory: ${{ matrix.sample }}
arguments: wrapper
- name: Build
diff --git a/.github/workflows/samples-kotlin-echo-api.yaml b/.github/workflows/samples-kotlin-echo-api.yaml
index f4fc53d0c5a..0d92c30383b 100644
--- a/.github/workflows/samples-kotlin-echo-api.yaml
+++ b/.github/workflows/samples-kotlin-echo-api.yaml
@@ -7,8 +7,7 @@ on:
pull_request:
paths:
- samples/client/echo_api/kotlin**
-env:
- GRADLE_VERSION: 7.4
+
jobs:
build:
name: Build Kotlin Client JDK17
@@ -37,7 +36,6 @@ jobs:
- name: Install Gradle wrapper
uses: eskatos/gradle-command-action@v3
with:
- gradle-version: ${{ env.GRADLE_VERSION }}
build-root-directory: ${{ matrix.sample }}
arguments: wrapper
- name: Setup node.js
diff --git a/.github/workflows/samples-kotlin-server.yaml b/.github/workflows/samples-kotlin-server.yaml
index 5f76d2fb9bc..b98d4c69532 100644
--- a/.github/workflows/samples-kotlin-server.yaml
+++ b/.github/workflows/samples-kotlin-server.yaml
@@ -43,6 +43,7 @@ jobs:
- samples/server/petstore/kotlin-server/javalin
- samples/server/others/kotlin-server/jaxrs-spec
- samples/server/others/kotlin-server/jaxrs-spec-array-response
+ - samples/server/petstore/kotlin-spring-cloud
# comment out due to gradle build failure
#- samples/server/petstore/kotlin-spring-default
# no build.gradle file
diff --git a/.github/workflows/samples-kotlin-wiremock.yaml b/.github/workflows/samples-kotlin-wiremock.yaml
new file mode 100644
index 00000000000..6b40912dd26
--- /dev/null
+++ b/.github/workflows/samples-kotlin-wiremock.yaml
@@ -0,0 +1,44 @@
+name: Samples Kotlin WireMock
+
+on:
+ push:
+ branches:
+ - samples/server/petstore/kotlin-wiremock/**
+ - samples/server/echo_api/kotlin-wiremock/**
+ pull_request:
+ paths:
+ - samples/server/petstore/kotlin-wiremock/**
+ - samples/server/echo_api/kotlin-wiremock/**
+
+jobs:
+ build:
+ name: Build Kotlin WireMock
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ sample:
+ - samples/server/petstore/kotlin-wiremock
+ - samples/server/echo_api/kotlin-wiremock
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: 11
+ - name: Cache maven dependencies
+ uses: actions/cache@v4
+ env:
+ cache-name: maven-repository
+ with:
+ path: |
+ ~/.gradle
+ key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
+ - name: Install Gradle wrapper
+ uses: eskatos/gradle-command-action@v3
+ with:
+ build-root-directory: ${{ matrix.sample }}
+ arguments: wrapper
+ - name: Build
+ working-directory: ${{ matrix.sample }}
+ run: ./gradlew build -x test
diff --git a/.github/workflows/samples-php8.yaml b/.github/workflows/samples-php8.yaml
index 82ead5c953a..0d2941f6e3c 100644
--- a/.github/workflows/samples-php8.yaml
+++ b/.github/workflows/samples-php8.yaml
@@ -4,9 +4,11 @@ on:
push:
paths:
- samples/server/petstore/php-symfony/SymfonyBundle-php/**
+ - samples/server/petstore/php-flight/**
pull_request:
paths:
- samples/server/petstore/php-symfony/SymfonyBundle-php/**
+ - samples/server/petstore/php-flight/**
jobs:
build:
name: Build PHP projects
@@ -17,6 +19,7 @@ jobs:
sample:
# servers
- samples/server/petstore/php-symfony/SymfonyBundle-php/
+ - samples/server/petstore/php-flight/
steps:
- uses: actions/checkout@v4
- name: Setup PHP with tools
diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml
index 20176edc84f..7387aba6203 100644
--- a/.github/workflows/windows.yaml
+++ b/.github/workflows/windows.yaml
@@ -39,7 +39,7 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Setup Maven
- uses: s4u/setup-maven-action@v1.12.0
+ uses: s4u/setup-maven-action@v1.13.0
with:
java-version: ${{ matrix.java }}
maven-version: 3.8.8
diff --git a/.gitignore b/.gitignore
index bdc4f34b4d8..0bebe6bad6e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -85,6 +85,11 @@ samples/client/petstore/cpp-restsdk/CMakeCache.txt
samples/client/petstore/cpp-restsdk/CMakeFiles/
samples/client/petstore/cpp-restsdk/Makefile
samples/client/petstore/cpp-restsdk/cmake_install.cmake
+samples/client/petstore/cpp-restsdk/client/CMakeFiles
+samples/client/petstore/cpp-restsdk/client/Makefile
+samples/client/petstore/cpp-restsdk/client/cmake_install.cmake
+samples/client/petstore/cpp-restsdk/client/CppRestPetstoreClientConfig.cmake
+samples/client/petstore/cpp-restsdk/client/CMakeCache.txt
#Java/Android
**/.gradle
diff --git a/.sdkmanrc b/.sdkmanrc
new file mode 100644
index 00000000000..f9967f3a5db
--- /dev/null
+++ b/.sdkmanrc
@@ -0,0 +1,2 @@
+java=11.0.23-tem
+maven=3.8.8
diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh
index 837eaa0b522..06e2f163e4e 100755
--- a/CI/circle_parallel.sh
+++ b/CI/circle_parallel.sh
@@ -43,6 +43,7 @@ elif [ "$NODE_INDEX" = "2" ]; then
(cd samples/client/petstore/go && mvn integration-test)
(cd samples/openapi3/client/petstore/go && mvn integration-test)
(cd samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false && mvn integration-test)
+ (cd samples/client/others/go/allof_multiple_ref_and_discriminator && mvn integration-test)
elif [ "$NODE_INDEX" = "3" ]; then
@@ -110,5 +111,6 @@ else
(cd samples/client/petstore/java/resteasy && mvn integration-test)
(cd samples/client/petstore/java-micronaut-client && mvn integration-test)
(cd samples/client/petstore/java/apache-httpclient && mvn integration-test)
+ (cd samples/client/petstore/java/resttemplate-jakarta && mvn integration-test)
fi
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 25b8c613622..695a8d95a02 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -31,7 +31,7 @@ Please file the pull request against the correct branch, e.g. `master` for non-b
All the code generators can be found in [modules/openapi-generator/src/main/java/org/openapitools/codegen/languages](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages)
-If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide.
+If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide.
### Templates
@@ -84,6 +84,26 @@ For [Vendor Extensions](https://github.com/OAI/OpenAPI-Specification/blob/master
- For language-specified vendor extension, put it in the form of `x-{lang}-{extension-name}`. e.g. `x-objc-operation-id`, `x-java-feign-retry-limit`
- For a list of existing vendor extensions in use, please refer to https://github.com/openapitools/openapi-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page.
+### Building
+
+The `openapi-generator-cli` can be built using the following command. This will generate the `openapi-generator-cli.jar` in the `modules/openapi-generator-cli/target` directory without running the tests and generating the Javadocs.
+
+```shell
+./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
+```
+
+Or on Windows:
+
+```shell
+mvnw.cmd clean install -DskipTests -Dmaven.javadoc.skip=true
+```
+
+The binary can run via `java -jar`. For example:
+
+```shell
+java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help
+```
+
### Testing
To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapitools/codegen](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/test/java/org/openapitools/codegen)
@@ -112,5 +132,5 @@ See [OpenAPI Tools wiki](https://github.com/OpenAPITools/openapi-generator/wiki/
- File a PR with meaningful title, description and commit messages
- Make sure the option "Allow edits from maintainers" in the PR is selected so that the maintainers can update your PRs with minor fixes, if needed.
- Recommended git settings
- - `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around
+ - `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around
- To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. `fix #1542`. (Ref: [closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
diff --git a/README.md b/README.md
index 89b69acd365..6f963522835 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.5.0`):
+[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.7.0`):
[](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds)
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
@@ -69,6 +69,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
[](https://www.svix.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
[](https://litslink.com/services/artificial-intelligence?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
[](https://designli.co?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
+[](https://opensource.muenchen.de?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
#### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS, Checkly for sponsoring the API monitoring and Gradle for sponsoring Develocity
@@ -85,7 +86,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.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, 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 4.x, Apache HttpClient 5.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, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **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, pekko), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (9.x - 17.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** |
-| **Server stubs** | **Ada**, **C#** (ASP.NET Core, 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/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **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](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) |
+| **Server stubs** | **Ada**, **C#** (ASP.NET Core, 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/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **PHP** ([Flight](https://docs.flightphp.com/), 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](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) |
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Postman Collection**, **Protocol Buffer**, **WSDL** |
@@ -126,8 +127,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
| OpenAPI Generator Version | Release Date | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
-| 7.5.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.5.0-SNAPSHOT/) | 12.04.2024 | Minor release with breaking changes (with fallback) |
-| [7.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.4.0) (latest stable release) | 11.03.2024 | Minor release with breaking changes (with fallback) |
+| 7.7.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.7.0-SNAPSHOT/) | 20.06.2024 | Minor release with breaking changes (with fallback) |
+| [7.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.6.0) (latest stable release) | 20.05.2024 | Minor release with breaking changes (with fallback) |
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) | 11.05.2023 | Minor release with breaking changes (with fallback) |
| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) |
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
@@ -190,16 +191,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
-JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar`
+JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.6.0/openapi-generator-cli-7.6.0.jar`
For **Mac/Linux** users:
```sh
-wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar -O openapi-generator-cli.jar
+wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.6.0/openapi-generator-cli-7.6.0.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```
-Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar
+Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.6.0/openapi-generator-cli-7.6.0.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -260,7 +261,7 @@ To build from source, you need the following installed and available in your `$P
* [Java 11](https://adoptium.net/)
-* [Apache Maven 3.3.4 or greater](https://maven.apache.org/) (optional)
+* [Apache Maven 3.8.8 or greater](https://maven.apache.org/) (optional)
After cloning the project, you can build it from source using [maven wrapper](https://maven.apache.org/wrapper/):
@@ -705,6 +706,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [REST United](https://restunited.com)
- [Robocorp](https://www.robocorp.com)
- [Robotinfra](https://www.robotinfra.com)
+- [SearchApi](https://www.searchapi.io/)
- [SmartHR](https://smarthr.co.jp/)
- [Sony Interactive Entertainment](https://www.sie.com/en/index.html)
- [Splitit](https://www.splitit.com/)
@@ -931,6 +933,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- 2023-12-10 - [UnityでOpenAPI Generatorを使う](https://www.youtube.com/watch?v=CbNwKVV5LRM) by [Soup Tori](https://www.youtube.com/@souptori8417)
- 2024-03-04 - [Generating TypeScript Types with OpenAPI for REST API Consumption](https://www.pullrequest.com/blog/generating-typescript-types-with-openapi-for-rest-api-consumption/) by [PullRequest](https://www.pullrequest.com/)
- 2024-03-07 - [Fully typed Web Apps with OpenAPI (Part 1)](https://medium.com/@gfox1984/fully-typed-web-apps-with-openapi-part-1-595d55766670) by [Guillaume Renard](https://medium.com/@gfox1984)
+- 2024-03-08 - [Laravel OpenAPIによる "辛くない" スキーマ駆動開発](https://fortee.jp/phperkaigi-2024/proposal/9e2e6c38-d078-4efa-99b4-83ebf9033b34) by [KentarouTakeda](https://twitter.com/KentarouTakeda)
## [6 - About Us](#table-of-contents)
@@ -1089,7 +1092,9 @@ Here is a list of template creators:
* Kotlin (Spring Boot): @dr4ke616
* Kotlin (Vertx): @Wooyme
* Kotlin (JAX-RS): @anttileppa
+ * Kotlin WireMock: @stefankoppier
* NodeJS Express: @YishTish
+ * PHP Flight: @daniel-sc
* PHP Laravel: @renepardon
* PHP Lumen: @abcsun
* PHP Mezzio (with Path Handler): @Articus
diff --git a/bin/configs/cpp-pistache-server-cpp-pistache-everything.yaml b/bin/configs/cpp-pistache-server-cpp-pistache-everything.yaml
new file mode 100644
index 00000000000..b18ff7270d9
--- /dev/null
+++ b/bin/configs/cpp-pistache-server-cpp-pistache-everything.yaml
@@ -0,0 +1,7 @@
+generatorName: cpp-pistache-server
+outputDir: samples/server/petstore/cpp-pistache-everything
+inputSpec: modules/openapi-generator/src/test/resources/3_0/issues-anytype-object-set-petstore-everything.yaml
+templateDir: modules/openapi-generator/src/main/resources/cpp-pistache-server
+additionalProperties:
+ useStructModel: "false"
+ addExternalLibs: "true"
diff --git a/bin/configs/cpp-pistache-server-cpp-pistache-nested-schema-refs.yaml b/bin/configs/cpp-pistache-server-cpp-pistache-nested-schema-refs.yaml
new file mode 100644
index 00000000000..32657b4cf37
--- /dev/null
+++ b/bin/configs/cpp-pistache-server-cpp-pistache-nested-schema-refs.yaml
@@ -0,0 +1,7 @@
+generatorName: cpp-pistache-server
+outputDir: samples/server/petstore/cpp-pistache-nested-schema-refs
+inputSpec: modules/openapi-generator/src/test/resources/3_0/nested-schema-refs.yaml
+templateDir: modules/openapi-generator/src/main/resources/cpp-pistache-server
+additionalProperties:
+ useStructModel: "false"
+ addExternalLibs: "true"
diff --git a/bin/configs/cpp-restsdk-client.yaml b/bin/configs/cpp-restsdk-client.yaml
index fedc628a69e..ccd23932b49 100644
--- a/bin/configs/cpp-restsdk-client.yaml
+++ b/bin/configs/cpp-restsdk-client.yaml
@@ -1,6 +1,6 @@
generatorName: cpp-restsdk
outputDir: samples/client/petstore/cpp-restsdk/client
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
+inputSpec: modules/openapi-generator/src/test/resources/3_0/cpp-restsdk/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/cpp-rest-sdk-client
additionalProperties:
packageName: CppRestPetstoreClient
diff --git a/bin/configs/go-multiple-allof-ref-with-discriminator.yaml b/bin/configs/go-multiple-allof-ref-with-discriminator.yaml
new file mode 100644
index 00000000000..c2c8a195dc5
--- /dev/null
+++ b/bin/configs/go-multiple-allof-ref-with-discriminator.yaml
@@ -0,0 +1,5 @@
+generatorName: go
+outputDir: samples/client/others/go/allof_multiple_ref_and_discriminator
+inputSpec: modules/openapi-generator/src/test/resources/3_0/go/allof_multiple_ref_and_discriminator.yaml
+additionalProperties:
+ hideGenerationTimestamp: "true"
diff --git a/bin/configs/go-server-no-body-path-params.yaml b/bin/configs/go-server-no-body-path-params.yaml
new file mode 100644
index 00000000000..06b9d63908b
--- /dev/null
+++ b/bin/configs/go-server-no-body-path-params.yaml
@@ -0,0 +1,8 @@
+generatorName: go-server
+outputDir: samples/server/others/go-server/no-body-path-params
+inputSpec: modules/openapi-generator/src/test/resources/3_0/go-server/no-body-path-params.yaml
+templateDir: modules/openapi-generator/src/main/resources/go-server
+additionalProperties:
+ hideGenerationTimestamp: "true"
+ packageName: petstoreserver
+ addResponseHeaders: true
diff --git a/bin/configs/unmaintained/html2.yaml b/bin/configs/html2.yaml
similarity index 100%
rename from bin/configs/unmaintained/html2.yaml
rename to bin/configs/html2.yaml
diff --git a/bin/configs/java-helidon-client-mp.yaml b/bin/configs/java-helidon-client-mp_3.yaml
similarity index 82%
rename from bin/configs/java-helidon-client-mp.yaml
rename to bin/configs/java-helidon-client-mp_3.yaml
index 5dc5c6883c6..6b5babac3c1 100644
--- a/bin/configs/java-helidon-client-mp.yaml
+++ b/bin/configs/java-helidon-client-mp_3.yaml
@@ -1,8 +1,9 @@
generatorName: java-helidon-client
library: mp
-outputDir: samples/client/petstore/java-helidon-client/mp
+outputDir: samples/client/petstore/java-helidon-client/v3/mp
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
additionalProperties:
+ helidonVersion: 3.2.7
artifactId: petstore-helidon-client-mp
hideGenerationTimestamp: "true"
configureAuth: "false"
diff --git a/bin/configs/java-helidon-client-mp_4.yaml b/bin/configs/java-helidon-client-mp_4.yaml
new file mode 100644
index 00000000000..188afa0e86b
--- /dev/null
+++ b/bin/configs/java-helidon-client-mp_4.yaml
@@ -0,0 +1,14 @@
+generatorName: java-helidon-client
+library: mp
+outputDir: samples/client/petstore/java-helidon-client/v4/mp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
+additionalProperties:
+ helidonVersion: 4.0.8
+ artifactId: petstore-helidon-client-mp
+ hideGenerationTimestamp: "true"
+ configureAuth: "false"
+ build: "all"
+ test: "spock"
+ requiredPropertiesInConstructor: "false"
+ visitable: "true"
+ fullProject: "true"
diff --git a/bin/configs/java-helidon-client-se.yaml b/bin/configs/java-helidon-client-se_3.yaml
similarity index 82%
rename from bin/configs/java-helidon-client-se.yaml
rename to bin/configs/java-helidon-client-se_3.yaml
index bd4d7a363fd..41e816215af 100644
--- a/bin/configs/java-helidon-client-se.yaml
+++ b/bin/configs/java-helidon-client-se_3.yaml
@@ -1,8 +1,9 @@
generatorName: java-helidon-client
library: se
-outputDir: samples/client/petstore/java-helidon-client/se
+outputDir: samples/client/petstore/java-helidon-client/v3/se
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
additionalProperties:
+ helidonVersion: 3.2.7
artifactId: petstore-helidon-client-se
hideGenerationTimestamp: "true"
configureAuth: "false"
diff --git a/bin/configs/java-helidon-server-mp.yaml b/bin/configs/java-helidon-server-mp_3.yaml
similarity index 82%
rename from bin/configs/java-helidon-server-mp.yaml
rename to bin/configs/java-helidon-server-mp_3.yaml
index 80a72e4f3bd..3be0b87e189 100644
--- a/bin/configs/java-helidon-server-mp.yaml
+++ b/bin/configs/java-helidon-server-mp_3.yaml
@@ -1,9 +1,10 @@
generatorName: java-helidon-server
library: mp
-outputDir: samples/server/petstore/java-helidon-server/mp
+outputDir: samples/server/petstore/java-helidon-server/v3/mp
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/java-helidon/server
additionalProperties:
+ helidonVersion: 3.2.7
artifactId: petstore-helidon-server-mp
hideGenerationTimestamp: "true"
build: "all"
diff --git a/bin/configs/java-helidon-server-mp_4.yaml b/bin/configs/java-helidon-server-mp_4.yaml
new file mode 100644
index 00000000000..40de63bc808
--- /dev/null
+++ b/bin/configs/java-helidon-server-mp_4.yaml
@@ -0,0 +1,13 @@
+generatorName: java-helidon-server
+library: mp
+outputDir: samples/server/petstore/java-helidon-server/v4/mp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/java-helidon/server
+additionalProperties:
+ helidonVersion: 4.0.8
+ artifactId: petstore-helidon-server-mp
+ hideGenerationTimestamp: "true"
+ build: "all"
+ test: "spock"
+ useAuth: "false"
+ fullProject: "true"
\ No newline at end of file
diff --git a/bin/configs/java-helidon-server-se.yaml b/bin/configs/java-helidon-server-se_3.yaml
similarity index 80%
rename from bin/configs/java-helidon-server-se.yaml
rename to bin/configs/java-helidon-server-se_3.yaml
index 641f131f5ed..154e428f725 100644
--- a/bin/configs/java-helidon-server-se.yaml
+++ b/bin/configs/java-helidon-server-se_3.yaml
@@ -1,9 +1,10 @@
generatorName: java-helidon-server
library: se
-outputDir: samples/server/petstore/java-helidon-server/se
+outputDir: samples/server/petstore/java-helidon-server/v3/se
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/java-helidon/server
additionalProperties:
+ helidonVersion: 3.2.7
artifactId: petstore-helidon-server-se
hideGenerationTimestamp: "true"
fullProject: "true"
\ No newline at end of file
diff --git a/bin/configs/java-jersey2-special-characters.yaml b/bin/configs/java-jersey2-special-characters.yaml
index c73b70cc36c..d2fb98091a2 100644
--- a/bin/configs/java-jersey2-special-characters.yaml
+++ b/bin/configs/java-jersey2-special-characters.yaml
@@ -10,6 +10,4 @@ additionalProperties:
dateLibrary: java8
useOneOfDiscriminatorLookup: true
disallowAdditionalPropertiesIfNotPresent: false
-systemProperties:
- skipValidateSpec: "false"
-
+validateSpec: false
diff --git a/bin/configs/java-microprofile-rest-client-3.0-jackson-with-xml.yaml b/bin/configs/java-microprofile-rest-client-3.0-jackson-with-xml.yaml
index 8dc08e4a4bb..40500d64508 100644
--- a/bin/configs/java-microprofile-rest-client-3.0-jackson-with-xml.yaml
+++ b/bin/configs/java-microprofile-rest-client-3.0-jackson-with-xml.yaml
@@ -3,10 +3,10 @@ outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson-wit
library: microprofile
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
-withXml: true
additionalProperties:
serializationLibrary: jackson
artifactId: microprofile-rest-client-3-jackson-with-xml
configKey: petstore
microprofileRestClientVersion: "3.0"
hideGenerationTimestamp: true
+ withXml: true
diff --git a/bin/configs/java-microprofile-rest-client.yaml b/bin/configs/java-microprofile-rest-client.yaml
index 384a6aa7f30..325cebe61ca 100644
--- a/bin/configs/java-microprofile-rest-client.yaml
+++ b/bin/configs/java-microprofile-rest-client.yaml
@@ -1,8 +1,8 @@
generatorName: java
outputDir: samples/client/petstore/java/microprofile-rest-client
library: microprofile
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: microprofile-rest-client
- configKey: petstore
+ configKeyFromClassName: true
diff --git a/bin/configs/java-microprofile-server-multiple-2xx-responses.yaml b/bin/configs/java-microprofile-server-multiple-2xx-responses.yaml
new file mode 100644
index 00000000000..44bf605f09e
--- /dev/null
+++ b/bin/configs/java-microprofile-server-multiple-2xx-responses.yaml
@@ -0,0 +1,8 @@
+generatorName: java-microprofile
+outputDir: samples/server/petstore/java-microprofile
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-multiple-2xx-responses.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ hideGenerationTimestamp: "true"
+ microprofileMutiny: "true"
+ serializationLibrary: "jackson"
diff --git a/bin/configs/java-native.yaml b/bin/configs/java-native.yaml
index cac729a68aa..ba1795d9de3 100644
--- a/bin/configs/java-native.yaml
+++ b/bin/configs/java-native.yaml
@@ -6,3 +6,4 @@ templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: petstore-native
hideGenerationTimestamp: "true"
+ generateBuilders: true
diff --git a/bin/configs/java-okhttp-user-defined-templates.yaml b/bin/configs/java-okhttp-user-defined-templates.yaml
new file mode 100644
index 00000000000..650c2dc1b19
--- /dev/null
+++ b/bin/configs/java-okhttp-user-defined-templates.yaml
@@ -0,0 +1,17 @@
+generatorName: java
+outputDir: samples/client/echo_api/java/okhttp-gson-user-defined-templates
+library: okhttp-gson
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ hideGenerationTimestamp: "true"
+files:
+ README.mustache:
+ destinationFilename: info.md
+ api_doc.mustache:
+ templateType: APIDocs
+ destinationFilename: Documentation.md
+ pojo.mustache:
+ templateType: Model
+ folder: modelCopy
+ destinationFilename: .java
diff --git a/bin/configs/java-restclient-echo-api.yaml b/bin/configs/java-restclient-echo-api.yaml
new file mode 100644
index 00000000000..9612901f8f7
--- /dev/null
+++ b/bin/configs/java-restclient-echo-api.yaml
@@ -0,0 +1,13 @@
+generatorName: java
+outputDir: samples/client/echo_api/java/restclient
+library: restclient
+inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ artifactId: echo-api-native
+ hideGenerationTimestamp: "true"
+
+typeMappings:
+ OffsetDateTime: "Instant"
+importMappings:
+ OffsetDateTime: "java.time.Instant"
diff --git a/bin/configs/java-restclient-nullable-array.yaml b/bin/configs/java-restclient-nullable-array.yaml
new file mode 100644
index 00000000000..99e45bfd551
--- /dev/null
+++ b/bin/configs/java-restclient-nullable-array.yaml
@@ -0,0 +1,8 @@
+generatorName: java
+outputDir: samples/client/petstore/java/restclient-nullable-arrays
+library: restclient
+inputSpec: modules/openapi-generator/src/test/resources/3_0/schema-with-nullable-arrays.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ artifactId: petstore-restclient-nullable-arrays
+ hideGenerationTimestamp: "true"
diff --git a/bin/configs/java-restclient-swagger2.yaml b/bin/configs/java-restclient-swagger2.yaml
new file mode 100644
index 00000000000..a4fc8ba02cd
--- /dev/null
+++ b/bin/configs/java-restclient-swagger2.yaml
@@ -0,0 +1,10 @@
+generatorName: java
+outputDir: samples/client/petstore/java/restclient-swagger2
+library: restclient
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ artifactId: petstore-restclient
+ hideGenerationTimestamp: "true"
+ containerDefaultToNull: "true"
+ annotationLibrary: "swagger2"
diff --git a/bin/configs/java-restclient-useAbstractionForFiles.yaml b/bin/configs/java-restclient-useAbstractionForFiles.yaml
new file mode 100644
index 00000000000..ea2e03468ec
--- /dev/null
+++ b/bin/configs/java-restclient-useAbstractionForFiles.yaml
@@ -0,0 +1,9 @@
+generatorName: java
+outputDir: samples/client/others/java/restclient-useAbstractionForFiles
+library: restclient
+inputSpec: modules/openapi-generator/src/test/resources/3_0/issue13146_file_abstraction_response.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ artifactId: file-restclient
+ hideGenerationTimestamp: "true"
+ useAbstractionForFiles: true
diff --git a/bin/configs/java-restclient.yaml b/bin/configs/java-restclient.yaml
new file mode 100644
index 00000000000..e5c5ac1e73f
--- /dev/null
+++ b/bin/configs/java-restclient.yaml
@@ -0,0 +1,9 @@
+generatorName: java
+outputDir: samples/client/petstore/java/restclient
+library: restclient
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ artifactId: petstore-restclient
+ hideGenerationTimestamp: "true"
+ containerDefaultToNull: "true"
diff --git a/bin/configs/java-resttemplate-jakarta.yaml b/bin/configs/java-resttemplate-jakarta.yaml
index 098e0d96e76..88b094e18ec 100644
--- a/bin/configs/java-resttemplate-jakarta.yaml
+++ b/bin/configs/java-resttemplate-jakarta.yaml
@@ -8,3 +8,4 @@ additionalProperties:
hideGenerationTimestamp: "true"
java8: true
useJakartaEe: true
+ generateConstructorWithAllArgs: true
diff --git a/bin/configs/java-resttemplate-list-schema-validation.yaml b/bin/configs/java-resttemplate-list-schema-validation.yaml
new file mode 100644
index 00000000000..7121a1163db
--- /dev/null
+++ b/bin/configs/java-resttemplate-list-schema-validation.yaml
@@ -0,0 +1,11 @@
+generatorName: java
+outputDir: samples/client/others/java/resttemplate-list-schema-validation
+library: resttemplate
+inputSpec: modules/openapi-generator/src/test/resources/3_1/issue-17485.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ artifactId: java-resttemplate-list-schema-validation
+ hideGenerationTimestamp: "true"
+ useBeanValidation: true
+ generateConstructorWithAllArgs: true
+
diff --git a/bin/configs/java-resttemplate.yaml b/bin/configs/java-resttemplate.yaml
index e71609cbcf3..9d8bec57461 100644
--- a/bin/configs/java-resttemplate.yaml
+++ b/bin/configs/java-resttemplate.yaml
@@ -8,3 +8,5 @@ additionalProperties:
hideGenerationTimestamp: "true"
java8: true
containerDefaultToNull: true
+ generateConstructorWithAllArgs: true
+ generateBuilders: true
diff --git a/bin/configs/jaxrs-spec-quarkus-mutiny.yaml b/bin/configs/jaxrs-spec-quarkus-mutiny.yaml
new file mode 100644
index 00000000000..5620523e027
--- /dev/null
+++ b/bin/configs/jaxrs-spec-quarkus-mutiny.yaml
@@ -0,0 +1,15 @@
+generatorName: jaxrs-spec
+outputDir: samples/server/petstore/jaxrs-spec-quarkus-mutiny
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec
+additionalProperties:
+ artifactId: jaxrs-spec-petstore-server
+ serializableModel: "true"
+ hideGenerationTimestamp: "true"
+ implicitHeadersRegex: (api_key|enum_header_string)
+ generateBuilders: "true"
+ useMicroProfileOpenAPIAnnotations: "true"
+ useAsync: "true"
+ useMutiny: "true"
+ library: "quarkus"
+ dateLibrary: "java8-localdatetime"
diff --git a/bin/configs/jaxrs-spec.yaml b/bin/configs/jaxrs-spec.yaml
index dbbb86bb420..0eca24e4259 100644
--- a/bin/configs/jaxrs-spec.yaml
+++ b/bin/configs/jaxrs-spec.yaml
@@ -1,6 +1,6 @@
generatorName: jaxrs-spec
outputDir: samples/server/petstore/jaxrs-spec
-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/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec
additionalProperties:
artifactId: jaxrs-spec-petstore-server
diff --git a/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml b/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml
index ddafa03ed68..ac7972643cd 100644
--- a/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml
+++ b/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml
@@ -1,6 +1,6 @@
generatorName: kotlin
outputDir: samples/client/echo_api/kotlin-jvm-spring-3-webclient
-library: jvm-spring-restclient
+library: jvm-spring-webclient
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
diff --git a/bin/configs/kotlin-spring-cloud.yaml b/bin/configs/kotlin-spring-cloud.yaml
index 10e6f95a805..676e15788e1 100644
--- a/bin/configs/kotlin-spring-cloud.yaml
+++ b/bin/configs/kotlin-spring-cloud.yaml
@@ -1,5 +1,5 @@
generatorName: kotlin-spring
-outputDir: samples/client/petstore/kotlin-spring-cloud
+outputDir: samples/server/petstore/kotlin-spring-cloud
library: spring-cloud
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
diff --git a/bin/configs/kotlin-wiremock-echo-api.yaml b/bin/configs/kotlin-wiremock-echo-api.yaml
new file mode 100644
index 00000000000..5230b295075
--- /dev/null
+++ b/bin/configs/kotlin-wiremock-echo-api.yaml
@@ -0,0 +1,4 @@
+generatorName: kotlin-wiremock
+outputDir: samples/server/echo_api/kotlin-wiremock
+inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml
+templateDir: modules/openapi-generator/src/main/resources/kotlin-wiremock
diff --git a/bin/configs/kotlin-wiremock.yaml b/bin/configs/kotlin-wiremock.yaml
new file mode 100644
index 00000000000..0e63dfe3cc4
--- /dev/null
+++ b/bin/configs/kotlin-wiremock.yaml
@@ -0,0 +1,4 @@
+generatorName: kotlin-wiremock
+outputDir: samples/server/petstore/kotlin-wiremock
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/kotlin-wiremock
diff --git a/bin/configs/manual/rust-axum-header-uuid.yaml b/bin/configs/manual/rust-axum-header-uuid.yaml
new file mode 100644
index 00000000000..7e04339b464
--- /dev/null
+++ b/bin/configs/manual/rust-axum-header-uuid.yaml
@@ -0,0 +1,9 @@
+generatorName: rust-axum
+outputDir: samples/server/petstore/rust-axum/output/rust-axum-header-uuid
+inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-axum/rust-axum-header-uuid.yaml
+templateDir: modules/openapi-generator/src/main/resources/rust-axum
+generateAliasAsModel: true
+additionalProperties:
+ hideGenerationTimestamp: "true"
+ packageName: rust-axum-header-uui
+enablePostProcessFile: true
diff --git a/bin/configs/manual/rust-axum-petstore-with-fake-endpoints-models-for-testing.yaml b/bin/configs/manual/rust-axum-petstore-with-fake-endpoints-models-for-testing.yaml
index 69ca39092e4..5a537e65b85 100644
--- a/bin/configs/manual/rust-axum-petstore-with-fake-endpoints-models-for-testing.yaml
+++ b/bin/configs/manual/rust-axum-petstore-with-fake-endpoints-models-for-testing.yaml
@@ -7,4 +7,6 @@ additionalProperties:
hideGenerationTimestamp: "true"
packageName: petstore-with-fake-endpoints-models-for-testing
publishRustRegistry: crates-io
-enablePostProcessFile: true
\ No newline at end of file
+globalProperties:
+ skipFormModel: false
+enablePostProcessFile: true
diff --git a/bin/configs/manual/rust-axum-petstore.yaml b/bin/configs/manual/rust-axum-petstore.yaml
index 3149c741858..179e370639a 100644
--- a/bin/configs/manual/rust-axum-petstore.yaml
+++ b/bin/configs/manual/rust-axum-petstore.yaml
@@ -6,4 +6,6 @@ generateAliasAsModel: true
additionalProperties:
hideGenerationTimestamp: "true"
packageName: petstore
+globalProperties:
+ skipFormModel: false
enablePostProcessFile: true
diff --git a/bin/configs/manual/rust-axum-validation.yaml b/bin/configs/manual/rust-axum-validation.yaml
new file mode 100644
index 00000000000..3fd5ba01b5e
--- /dev/null
+++ b/bin/configs/manual/rust-axum-validation.yaml
@@ -0,0 +1,10 @@
+generatorName: rust-axum
+outputDir: samples/server/petstore/rust-axum/output/rust-axum-validation-test
+inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/rust-axum-validation-test.yaml
+templateDir: modules/openapi-generator/src/main/resources/rust-axum
+generateAliasAsModel: true
+additionalProperties:
+ hideGenerationTimestamp: "true"
+ packageName: rust-axum-validation-test
+ disableValidator: "true"
+enablePostProcessFile: true
diff --git a/bin/configs/php-flight.yaml b/bin/configs/php-flight.yaml
new file mode 100644
index 00000000000..2c3dedc1911
--- /dev/null
+++ b/bin/configs/php-flight.yaml
@@ -0,0 +1,6 @@
+generatorName: php-flight
+outputDir: samples/server/petstore/php-flight
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/php-flight
+additionalProperties:
+ hideGenerationTimestamp: "true"
diff --git a/bin/configs/spring-boot-3.yaml b/bin/configs/spring-boot-3.yaml
index 5dea2cbda5e..472f660ac7a 100644
--- a/bin/configs/spring-boot-3.yaml
+++ b/bin/configs/spring-boot-3.yaml
@@ -11,3 +11,5 @@ additionalProperties:
useBeanValidation: true
withXml: true
hideGenerationTimestamp: "true"
+ generateConstructorWithAllArgs: true
+ generateBuilders: true
diff --git a/bin/configs/spring-boot-delegate.yaml b/bin/configs/spring-boot-delegate.yaml
index 56199a182d1..cf5e016cdbf 100644
--- a/bin/configs/spring-boot-delegate.yaml
+++ b/bin/configs/spring-boot-delegate.yaml
@@ -8,3 +8,4 @@ additionalProperties:
hideGenerationTimestamp: "true"
java8: true
delegatePattern: "true"
+ generateConstructorWithAllArgs: true
diff --git a/bin/configs/spring-boot-lombok-data.yaml b/bin/configs/spring-boot-lombok-data.yaml
index ac48f433214..57f54d71d3d 100644
--- a/bin/configs/spring-boot-lombok-data.yaml
+++ b/bin/configs/spring-boot-lombok-data.yaml
@@ -7,3 +7,5 @@ additionalProperties:
artifactId: springboot-lombok-data
hideGenerationTimestamp: "true"
additionalModelTypeAnnotations: "@lombok.Data;@lombok.Builder;@lombok.NoArgsConstructor;@lombok.AllArgsConstructor"
+ generateConstructorWithAllArgs: true
+ generateBuilders: true
diff --git a/bin/configs/spring-boot-oneof.yaml b/bin/configs/spring-boot-oneof.yaml
index a986fc8fabe..f4a7ca7a99c 100644
--- a/bin/configs/spring-boot-oneof.yaml
+++ b/bin/configs/spring-boot-oneof.yaml
@@ -8,3 +8,4 @@ additionalProperties:
artifactId: springboot-oneof
snapshotVersion: "true"
hideGenerationTimestamp: "true"
+ generateBuilders: true
diff --git a/bin/configs/spring-boot-useoptional.yaml b/bin/configs/spring-boot-useoptional.yaml
index 2b3dbdc1a86..82530260d67 100644
--- a/bin/configs/spring-boot-useoptional.yaml
+++ b/bin/configs/spring-boot-useoptional.yaml
@@ -8,3 +8,4 @@ additionalProperties:
useOptional: true
artifactId: spring-boot-useoptional
hideGenerationTimestamp: "true"
+ generateBuilders: true
diff --git a/bin/utils/dart-keywords/README.md b/bin/utils/dart-keywords/README.md
index 2873e00dbe1..2d14a81b61d 100644
--- a/bin/utils/dart-keywords/README.md
+++ b/bin/utils/dart-keywords/README.md
@@ -11,10 +11,7 @@ The last Dart version that was used to generate the keywords can be found in `da
## What does the shellscript do?
-1. compile a dart app
- - `dart2native save-dart-keywords.dart`
-
1. run the dart app
- - `./save-dart-keywords.exe`
+ - `dart run save-dart-keywords.dart`
1. the output is `dart-keywords.txt` and `dart-version.txt`
diff --git a/bin/utils/dart-keywords/dart-version.txt b/bin/utils/dart-keywords/dart-version.txt
index 81b2d0d2cd6..d580ed2666a 100644
--- a/bin/utils/dart-keywords/dart-version.txt
+++ b/bin/utils/dart-keywords/dart-version.txt
@@ -1 +1 @@
-Dart VM version: 2.7.0-dev.0.0 (Tue Nov 5 12:57:33 2019 +0100) on "macos_x64"
+Dart SDK version: 3.3.0 (stable) (Tue Feb 13 10:25:19 2024 +0000) on "macos_arm64"
diff --git a/bin/utils/dart-keywords/pubspec.lock b/bin/utils/dart-keywords/pubspec.lock
index f01fb3f2efb..62299e22a52 100644
--- a/bin/utils/dart-keywords/pubspec.lock
+++ b/bin/utils/dart-keywords/pubspec.lock
@@ -5,190 +5,145 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
- url: "https://pub.dartlang.org"
+ sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
+ url: "https://pub.dev"
source: hosted
- version: "1.0.0"
+ version: "67.0.0"
analyzer:
dependency: "direct main"
description:
name: analyzer
- url: "https://pub.dartlang.org"
+ sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
+ url: "https://pub.dev"
source: hosted
- version: "0.39.1"
- args:
- dependency: transitive
- description:
- name: args
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.5.2"
+ version: "6.4.1"
async:
dependency: transitive
description:
name: async
- url: "https://pub.dartlang.org"
+ sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
+ url: "https://pub.dev"
source: hosted
- version: "2.4.0"
- charcode:
- dependency: transitive
- description:
- name: charcode
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.2"
+ version: "2.11.0"
collection:
dependency: transitive
description:
name: collection
- url: "https://pub.dartlang.org"
+ sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
+ url: "https://pub.dev"
source: hosted
- version: "1.14.12"
+ version: "1.18.0"
convert:
dependency: transitive
description:
name: convert
- url: "https://pub.dartlang.org"
+ sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592"
+ url: "https://pub.dev"
source: hosted
- version: "2.1.1"
+ version: "3.1.1"
crypto:
dependency: transitive
description:
name: crypto
- url: "https://pub.dartlang.org"
+ sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
+ url: "https://pub.dev"
source: hosted
- version: "2.1.3"
- csslib:
+ version: "3.0.3"
+ file:
dependency: transitive
description:
- name: csslib
- url: "https://pub.dartlang.org"
+ name: file
+ sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
+ url: "https://pub.dev"
source: hosted
- version: "0.16.1"
- front_end:
- dependency: transitive
- description:
- name: front_end
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.1.29"
+ version: "7.0.0"
glob:
dependency: transitive
description:
name: glob
- url: "https://pub.dartlang.org"
+ sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
+ url: "https://pub.dev"
source: hosted
- version: "1.2.0"
- html:
- dependency: transitive
- description:
- name: html
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.14.0+3"
- js:
- dependency: transitive
- description:
- name: js
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.6.1+1"
- kernel:
- dependency: transitive
- description:
- name: kernel
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.3.29"
+ version: "2.1.2"
meta:
dependency: transitive
description:
name: meta
- url: "https://pub.dartlang.org"
+ sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
+ url: "https://pub.dev"
source: hosted
- version: "1.1.8"
- node_interop:
- dependency: transitive
- description:
- name: node_interop
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.3"
- node_io:
- dependency: transitive
- description:
- name: node_io
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.1+2"
+ version: "1.12.0"
package_config:
dependency: transitive
description:
name: package_config
- url: "https://pub.dartlang.org"
+ sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
+ url: "https://pub.dev"
source: hosted
- version: "1.1.0"
+ version: "2.1.0"
path:
dependency: transitive
description:
name: path
- url: "https://pub.dartlang.org"
+ sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
+ url: "https://pub.dev"
source: hosted
- version: "1.6.4"
- pedantic:
- dependency: transitive
- description:
- name: pedantic
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.8.0+1"
+ version: "1.9.0"
pub_semver:
dependency: transitive
description:
name: pub_semver
- url: "https://pub.dartlang.org"
+ sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
+ url: "https://pub.dev"
source: hosted
- version: "1.4.2"
+ version: "2.1.4"
source_span:
dependency: transitive
description:
name: source_span
- url: "https://pub.dartlang.org"
+ sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
+ url: "https://pub.dev"
source: hosted
- version: "1.5.5"
+ version: "1.10.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
- url: "https://pub.dartlang.org"
+ sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
+ url: "https://pub.dev"
source: hosted
- version: "1.0.5"
+ version: "1.2.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
- url: "https://pub.dartlang.org"
+ sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
+ url: "https://pub.dev"
source: hosted
- version: "1.1.0"
+ version: "1.2.1"
typed_data:
dependency: transitive
description:
name: typed_data
- url: "https://pub.dartlang.org"
+ sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
+ url: "https://pub.dev"
source: hosted
- version: "1.1.6"
+ version: "1.3.2"
watcher:
dependency: transitive
description:
name: watcher
- url: "https://pub.dartlang.org"
+ sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
+ url: "https://pub.dev"
source: hosted
- version: "0.9.7+12"
+ version: "1.1.0"
yaml:
dependency: transitive
description:
name: yaml
- url: "https://pub.dartlang.org"
+ sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
+ url: "https://pub.dev"
source: hosted
- version: "2.2.0"
+ version: "3.1.2"
sdks:
- dart: ">=2.6.0 <3.0.0"
+ dart: ">=3.0.0 <4.0.0"
diff --git a/bin/utils/dart-keywords/pubspec.yaml b/bin/utils/dart-keywords/pubspec.yaml
index addb9924168..51e99b0ee94 100644
--- a/bin/utils/dart-keywords/pubspec.yaml
+++ b/bin/utils/dart-keywords/pubspec.yaml
@@ -4,7 +4,7 @@ description: Use the Dart SDK to generate Dart keywords.
version: 1.0.0+1
environment:
- sdk: ">=2.6.0 <3.0.0"
+ sdk: ">=3.0.0 <4.0.0"
dependencies:
analyzer:
diff --git a/bin/utils/dart-keywords/save-dart-keywords.dart b/bin/utils/dart-keywords/save-dart-keywords.dart
index 4ad6908a3d5..c48de13d376 100644
--- a/bin/utils/dart-keywords/save-dart-keywords.dart
+++ b/bin/utils/dart-keywords/save-dart-keywords.dart
@@ -4,13 +4,8 @@ import 'package:analyzer/dart/ast/token.dart';
main() {
// save keywords to a text file
- final txtFile = File(
+ final output = File(
'../../../modules/openapi-generator/src/main/resources/dart/dart-keywords.txt');
- String txtString = '';
- for (String keyword in Keyword.keywords.keys.toList()) {
- txtString += keyword + '\n';
- }
- txtString =
- txtString.substring(0, txtString.length - 1); // remove last newline
- txtFile.writeAsStringSync(txtString);
+ final keywords = Keyword.keywords.keys.join('\n');
+ output.writeAsStringSync(keywords);
}
diff --git a/bin/utils/dart-keywords/save_dart_keywords.sh b/bin/utils/dart-keywords/save_dart_keywords.sh
index 4211200c8e5..5cb1e40173f 100755
--- a/bin/utils/dart-keywords/save_dart_keywords.sh
+++ b/bin/utils/dart-keywords/save_dart_keywords.sh
@@ -1,3 +1,2 @@
-dart2native save-dart-keywords.dart
-./save-dart-keywords.exe
-dart --version &> dart-version.txt
\ No newline at end of file
+dart run save-dart-keywords.dart
+dart --version &> dart-version.txt
diff --git a/bin/utils/test_file_list.yaml b/bin/utils/test_file_list.yaml
index c86ca6ea74f..31e862ffb19 100644
--- a/bin/utils/test_file_list.yaml
+++ b/bin/utils/test_file_list.yaml
@@ -8,9 +8,9 @@
sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230
# java okhttp gson test files
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ClientTest.java"
- sha256: db505f7801fef62c13a08a8e9ca1fc4c5c947ab46b46f12943139d353feacf17
+ sha256: 325fdd5d7e2c97790c0fb44f712ab7b2ba022d7e1a5b0056f47b07f342682b6d
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java"
- sha256: 8210bdaf06aae8dc46521515a8a0ef10e48c980fadd3efd95313e6c806f409c2
+ sha256: e673d9928c8eb848262d0116fe0d28db832e128671a810a7c966d06d90cb9b63
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java"
sha256: 0d64cdc11809a7b5b952ccdad2bd91bd0045b3894d6fabf3e368fa0be12b8217
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java"
diff --git a/docs/contributing.md b/docs/contributing.md
index 9502582ac4e..2b7f268aefb 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -35,7 +35,7 @@ Please file the pull request against the correct branch, e.g. `master` for non-b
All the code generators can be found in [modules/openapi-generator/src/main/java/org/openapitools/codegen/languages](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages)
-If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide.
+If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide.
### Templates
@@ -88,6 +88,26 @@ For [Vendor Extensions](https://github.com/OAI/OpenAPI-Specification/blob/master
- For language-specified vendor extension, put it in the form of `x-{lang}-{extension-name}`. e.g. `x-objc-operation-id`, `x-java-feign-retry-limit`
- For a list of existing vendor extensions in use, please refer to https://github.com/openapitools/openapi-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page.
+### Building
+
+The `openapi-generator-cli` can be built using the following command. This will generate the `openapi-generator-cli.jar` in the `modules/openapi-generator-cli/target` directory without running the tests and generating the Javadocs.
+
+```shell
+./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
+```
+
+Or on Windows:
+
+```shell
+mvnw.cmd clean install -DskipTests -Dmaven.javadoc.skip=true
+```
+
+The binary can run via `java -jar`. For example:
+
+```shell
+java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help
+```
+
### Testing
To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapitools/codegen](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/test/java/org/openapitools/codegen)
@@ -116,5 +136,5 @@ See [OpenAPI Tools wiki](https://github.com/OpenAPITools/openapi-generator/wiki/
- File a PR with meaningful title, description and commit messages
- Make sure the option "Allow edits from maintainers" in the PR is selected so that the maintainers can update your PRs with minor fixes, if needed.
- Recommended git settings
- - `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around
+ - `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around
- To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. `fix #1542`. (Ref: [closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
diff --git a/docs/generators.md b/docs/generators.md
index 749f43f15db..bb058761aea 100644
--- a/docs/generators.md
+++ b/docs/generators.md
@@ -101,6 +101,7 @@ The following generators are available:
* [java-helidon-server (beta)](generators/java-helidon-server.md)
* [java-inflector](generators/java-inflector.md)
* [java-micronaut-server (beta)](generators/java-micronaut-server.md)
+* [java-microprofile](generators/java-microprofile.md)
* [java-msf4j](generators/java-msf4j.md)
* [java-pkmst](generators/java-pkmst.md)
* [java-play-framework](generators/java-play-framework.md)
@@ -119,7 +120,9 @@ The following generators are available:
* [kotlin-server](generators/kotlin-server.md)
* [kotlin-spring](generators/kotlin-spring.md)
* [kotlin-vertx (beta)](generators/kotlin-vertx.md)
+* [kotlin-wiremock (beta)](generators/kotlin-wiremock.md)
* [nodejs-express-server (beta)](generators/nodejs-express-server.md)
+* [php-flight (experimental)](generators/php-flight.md)
* [php-laravel](generators/php-laravel.md)
* [php-lumen](generators/php-lumen.md)
* [php-mezzio-ph](generators/php-mezzio-ph.md)
diff --git a/docs/generators/cpp-pistache-server.md b/docs/generators/cpp-pistache-server.md
index 178a0f2bbe8..35886a25a0a 100644
--- a/docs/generators/cpp-pistache-server.md
+++ b/docs/generators/cpp-pistache-server.md
@@ -28,9 +28,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Type/Alias | Imports |
| ---------- | ------- |
-|Object|#include "Object.h"|
|nlohmann::json|#include <nlohmann/json.hpp>|
|std::map|#include <map>|
+|std::set|#include <set>|
|std::string|#include <string>|
|std::vector|#include <vector>|
diff --git a/docs/generators/cpp-restsdk.md b/docs/generators/cpp-restsdk.md
index c60305614de..aef6bfe1c39 100644
--- a/docs/generators/cpp-restsdk.md
+++ b/docs/generators/cpp-restsdk.md
@@ -32,9 +32,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Type/Alias | Imports |
| ---------- | ------- |
+|AnyType|#include "AnyType.h"|
|HttpContent|#include "HttpContent.h"|
|Object|#include "Object.h"|
|std::map|#include <map>|
+|std::set|#include <set>|
|std::string|#include <string>|
|std::vector|#include <vector>|
|utility::datetime|#include <cpprest/details/basic_types.h>|
@@ -184,7 +186,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|Uuid|✗|
|Array|✓|OAS2,OAS3
|Null|✗|OAS3
-|AnyType|✗|OAS2,OAS3
+|AnyType|✓|OAS2,OAS3
|Object|✓|OAS2,OAS3
|Maps|✓|ToolingExtension
|CollectionFormat|✓|OAS2
diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md
index 644631f6272..f93b09ffbf8 100644
--- a/docs/generators/dart-dio.md
+++ b/docs/generators/dart-dio.md
@@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|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.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|equalityCheckMethod|Specify equality check method. Takes effect only in case if serializationLibrary is json_serializable.|
**default**
[DEFAULT] Built in hash code generation method
**equatable**
Uses equatable library for equality checking
|default|
|finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
@@ -70,7 +71,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
as
assert
async
+
augment
await
+
base
break
case
catch
@@ -118,6 +121,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
required
rethrow
return
+
sealed
set
show
source
@@ -132,6 +136,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
typedef
var
void
+
when
while
with
yield
diff --git a/docs/generators/dart.md b/docs/generators/dart.md
index 45972f5e65b..79148a7e479 100644
--- a/docs/generators/dart.md
+++ b/docs/generators/dart.md
@@ -11,7 +11,7 @@ title: Documentation for the dart Generator
| generator type | CLIENT | |
| generator language | Dart | |
| generator default templating engine | mustache | |
-| helpTxt | Generates a Dart 2.x client library. | |
+| helpTxt | Generates a Dart client library. | |
## CONFIG OPTIONS
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.
@@ -68,7 +68,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
as
assert
async
+
augment
await
+
base
break
case
catch
@@ -116,6 +118,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
required
rethrow
return
+
sealed
set
show
source
@@ -130,6 +133,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
typedef
var
void
+
when
while
with
yield
diff --git a/docs/generators/go.md b/docs/generators/go.md
index 31dae23e98b..e81de548e95 100644
--- a/docs/generators/go.md
+++ b/docs/generators/go.md
@@ -22,6 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|enumClassPrefix|Prefix enum with class name| |false|
|generateInterfaces|Generate interfaces for api classes| |false|
|generateMarshalJSON|Generate MarshalJSON method| |true|
+|generateUnmarshalJSON|Generate UnmarshalJSON method| |true|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|isGoSubmodule|whether the generated Go module is a submodule| |false|
|packageName|Go package name (convention: lowercase).| |openapi|
diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md
index 1c83fce3874..12bc9a24ae9 100644
--- a/docs/generators/groovy.md
+++ b/docs/generators/groovy.md
@@ -39,6 +39,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md
index a46b87970da..1c7efa14ec8 100644
--- a/docs/generators/java-camel.md
+++ b/docs/generators/java-camel.md
@@ -55,6 +55,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|documentationProvider|Select the OpenAPI documentation provider.|
**none**
Do not publish an OpenAPI specification.
**source**
Publish the original input OpenAPI specification.
**springfox**
Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.
**springdoc**
Generate an OpenAPI 3 specification using SpringDoc.
|springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false|
diff --git a/docs/generators/java-helidon-client.md b/docs/generators/java-helidon-client.md
index 484df2e5115..7f60cf91dbd 100644
--- a/docs/generators/java-helidon-client.md
+++ b/docs/generators/java-helidon-client.md
@@ -38,8 +38,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
|fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| ||
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
-|helidonVersion|Helidon version for generated code| |3.0.1|
+|helidonVersion|Helidon complete version identifier or major version number. The specified exact Helidon release or, if specified as a major version the latest release of that major version, is used in the generated code.| |Highest released version.|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false|
diff --git a/docs/generators/java-helidon-server.md b/docs/generators/java-helidon-server.md
index 3c2e448a913..2035bb8c6fb 100644
--- a/docs/generators/java-helidon-server.md
+++ b/docs/generators/java-helidon-server.md
@@ -37,16 +37,18 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
|fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| ||
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|gradleProject|Whether to generate gradle project instead of maven.| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
-|helidonVersion|Helidon version for generated code| |3.0.1|
+|helidonVersion|Helidon complete version identifier or major version number. The specified exact Helidon release or, if specified as a major version the latest release of that major version, is used in the generated code.| |Highest released version.|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false|
|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
|invokerPackage|root package for generated code| |org.openapitools.server|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true|
-|library|library template (sub-template) to use|
**mp**
Helidon MP Server
**se**
Helidon SE Server
**nima**
Helidon NIMA Server
**nima-annotations**
Helidon NIMA Annotations Server
|se|
+|library|library template (sub-template) to use|
**mp**
Helidon MP Server
**se**
Helidon SE Server
|se|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|modelPackage|package for generated models| |org.openapitools.server.model|
diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md
index 93bcc5e03d4..c97cc488b15 100644
--- a/docs/generators/java-inflector.md
+++ b/docs/generators/java-inflector.md
@@ -41,6 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md
index c83bce61bad..f8c968280ec 100644
--- a/docs/generators/java-micronaut-client.md
+++ b/docs/generators/java-micronaut-client.md
@@ -50,6 +50,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateOperationOnlyForFirstTag|When false, the operation method will be duplicated in each of the tags if multiple tags are assigned to this operation. If true, each operation will be generated only once in the first assigned tag.| |false|
|generateSwaggerAnnotations|Specify if you want to generate swagger annotations and which version|
**swagger2**
Use io.swagger.core.v3:swagger-annotations for annotating operations and schemas
**true**
Equivalent to "swagger2"
**false**
Do not generate swagger annotations
**swagger1**
Use io.swagger:swagger-annotations for annotating operations and schemas
|false|
|groupId|groupId in generated pom.xml| |org.openapitools|
diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md
index fce177a4697..9cb2ad4dbbc 100644
--- a/docs/generators/java-micronaut-server.md
+++ b/docs/generators/java-micronaut-server.md
@@ -45,6 +45,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateControllerAsAbstract|Generate an abstract class for controller to be extended. (apiPackage is then used for the abstract class, and controllerPackage is used for implementation that extends it.)| |false|
|generateControllerFromExamples|Generate the implementation of controller and tests from parameter and return examples that will verify that the api works as desired (for testing)| |false|
|generateOperationOnlyForFirstTag|When false, the operation method will be duplicated in each of the tags if multiple tags are assigned to this operation. If true, each operation will be generated only once in the first assigned tag.| |true|
diff --git a/docs/generators/java-microprofile.md b/docs/generators/java-microprofile.md
new file mode 100644
index 00000000000..dada45f96d5
--- /dev/null
+++ b/docs/generators/java-microprofile.md
@@ -0,0 +1,365 @@
+---
+title: Documentation for the java-microprofile Generator
+---
+
+## METADATA
+
+| Property | Value | Notes |
+| -------- | ----- | ----- |
+| generator name | java-microprofile | pass this to the generate command after -g |
+| generator stability | STABLE | |
+| generator type | SERVER | |
+| generator language | Java | |
+| generator default templating engine | mustache | |
+| helpTxt | Generates a microprofile server. | |
+
+## CONFIG OPTIONS
+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 |
+| ------ | ----------- | ------ | ------- |
+|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null|
+|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
+|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
+|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
+|annotationLibrary|Select the complementary documentation annotation library.|
**none**
Do not annotate Model and Api with complementary annotations.
**swagger1**
Annotate Model and Api using the Swagger Annotations 1.x library.
**swagger2**
Annotate Model and Api using the Swagger Annotations 2.x library.
|none|
+|apiPackage|package for generated api classes| |org.openapitools.client.api|
+|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
+|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-client|
+|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
+|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option.| |1.0.0|
+|asyncNative|If true, async handlers will be used, instead of the sync version| |false|
+|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
+|booleanGetterPrefix|Set booleanGetterPrefix| |get|
+|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
+|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false|
+|configKey|Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option.| |null|
+|configKeyFromClassName|If true, set tag as key in @RegisterRestClient. Default to false. Only `microprofile` supports this option.| |null|
+|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
+|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8|
+|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
+|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
+|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
+|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
+|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |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.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true|
+|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
+|documentationProvider|Select the OpenAPI documentation provider.|
**none**
Do not publish an OpenAPI specification.
**source**
Publish the original input OpenAPI specification.
|source|
+|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|
+|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|errorObjectType|Error Object type. (This option is for okhttp-gson only)| |null|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateClientAsBean|For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
+|gradleProperties|Append additional Gradle properties to the gradle.properties file| |null|
+|groupId|groupId in generated pom.xml| |org.openapitools|
+|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
+|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
+|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false|
+|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
+|invokerPackage|root package for generated code| |org.openapitools.client|
+|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true|
+|library|library template (sub-template) to use|
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**jersey3**
HTTP client: Jersey client 3.x. JSON processing: Jackson 2.x
**feign**
HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x. or Gson 2.x
**okhttp-gson**
[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'.
**retrofit2**
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)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**restclient**
HTTP client: Spring RestClient 6.1. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
**microprofile**
HTTP client: Microprofile client 1.x. JSON processing: JSON-B or Jackson 2.9.x
**apache-httpclient**
HTTP client: Apache httpclient 5.x
|okhttp-gson|
+|licenseName|The name of the license| |Unlicense|
+|licenseUrl|The URL of the license| |http://unlicense.org|
+|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
+|microprofileMutiny|Whether to use async types for microprofile (currently only Smallrye Mutiny is supported).| |null|
+|microprofileRestClientVersion|Version of MicroProfile Rest Client API.| |null|
+|modelPackage|package for generated models| |org.openapitools.client.model|
+|openApiNullable|Enable OpenAPI Jackson Nullable library| |true|
+|parcelableModel|Whether to generate models for Android that implement Parcelable with the okhttp-gson library.| |false|
+|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|
+|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
+|performBeanValidation|Perform BeanValidation| |false|
+|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
+|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
+|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
+|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
+|serializableModel|boolean - toggle "implements Serializable" for generated models| |false|
+|serializationLibrary|Serialization library, default depends on value of the option library|
**jsonb**
Use JSON-B as serialization library
**jackson**
Use Jackson as serialization library
**gson**
Use Gson as serialization library
|null|
+|snapshotVersion|Uses a SNAPSHOT version.|
**true**
Use a SnapShot Version
**false**
Use a Release Version
|null|
+|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
+|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
+|sourceFolder|source folder for generated code| |src/main/java|
+|supportStreaming|Support streaming endpoint (beta)| |false|
+|supportUrlQuery|Generate toUrlQueryString in POJO (default to true). Available on `native`, `apache-httpclient` libraries.| |false|
+|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
+|useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, restclient, libraries| |false|
+|useBeanValidation|Use BeanValidation API annotations| |false|
+|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false|
+|useGzipFeature|Send gzip-encoded requests| |false|
+|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |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. Only jersey2, jersey3, native, okhttp-gson support this option.| |false|
+|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
+|usePlayWS|Use Play! Async HTTP client (Play WS API)| |false|
+|useReflectionEqualsHashCode|Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.| |false|
+|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
+|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
+|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
+|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile support this option.| |false|
+|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
+|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |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|
+
+## SUPPORTED VENDOR EXTENSIONS
+
+| Extension name | Description | Applicable for | Default value |
+| -------------- | ----------- | -------------- | ------------- |
+|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
+|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
+|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
+|x-tags|Specify multiple swagger tags for operation|OPERATION|null
+|x-accepts|Specify custom value for 'Accept' header for operation|OPERATION|null
+|x-content-type|Specify custom value for 'Content-Type' header for operation|OPERATION|null
+|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null
+|x-field-extra-annotation|List of custom annotations to be added to property|FIELD|null
+|x-webclient-blocking|Specifies if method for specific operation should be blocking or non-blocking(ex: return `Mono/Flux` or `return T/List/Set` & execute `.block()` inside generated method)|OPERATION|false
+
+
+## IMPORT MAPPING
+
+| Type/Alias | Imports |
+| ---------- | ------- |
+|Array|java.util.List|
+|ArrayList|java.util.ArrayList|
+|BigDecimal|java.math.BigDecimal|
+|Date|java.util.Date|
+|DateTime|org.joda.time.*|
+|File|java.io.File|
+|HashMap|java.util.HashMap|
+|LinkedHashSet|java.util.LinkedHashSet|
+|List|java.util.*|
+|LocalDate|org.joda.time.*|
+|LocalDateTime|org.joda.time.*|
+|LocalTime|org.joda.time.*|
+|Map|java.util.Map|
+|Set|java.util.*|
+|Timestamp|java.sql.Timestamp|
+|URI|java.net.URI|
+|UUID|java.util.UUID|
+
+
+## INSTANTIATION TYPES
+
+| Type/Alias | Instantiated By |
+| ---------- | --------------- |
+|array|ArrayList|
+|map|HashMap|
+|set|LinkedHashSet|
+
+
+## LANGUAGE PRIMITIVES
+
+
+
Boolean
+
Double
+
Float
+
Integer
+
Long
+
Object
+
String
+
boolean
+
byte[]
+
+
+## RESERVED WORDS
+
+
+
_
+
abstract
+
apiclient
+
apiexception
+
apiresponse
+
assert
+
boolean
+
break
+
byte
+
case
+
catch
+
char
+
class
+
configuration
+
const
+
continue
+
default
+
do
+
double
+
else
+
enum
+
extends
+
file
+
final
+
finally
+
float
+
for
+
goto
+
if
+
implements
+
import
+
instanceof
+
int
+
interface
+
list
+
localdate
+
localreturntype
+
localtime
+
localvaraccept
+
localvaraccepts
+
localvarauthnames
+
localvarcollectionqueryparams
+
localvarcontenttype
+
localvarcontenttypes
+
localvarcookieparams
+
localvarformparams
+
localvarheaderparams
+
localvarpath
+
localvarpostbody
+
localvarqueryparams
+
long
+
native
+
new
+
null
+
object
+
offsetdatetime
+
package
+
private
+
protected
+
public
+
return
+
short
+
static
+
strictfp
+
stringutil
+
super
+
switch
+
synchronized
+
this
+
throw
+
throws
+
transient
+
try
+
void
+
volatile
+
while
+
+
+## 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
+|Uuid|✗|
+|Array|✓|OAS2,OAS3
+|Null|✗|OAS3
+|AnyType|✗|OAS2,OAS3
+|Object|✓|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
+|allOf|✗|OAS2,OAS3
+|anyOf|✗|OAS3
+|oneOf|✗|OAS3
+|not|✗|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
+|SignatureAuth|✓|OAS3
+|AWSV4Signature|✓|ToolingExtension
+
+### Wire Format Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|JSON|✓|OAS2,OAS3
+|XML|✓|OAS2,OAS3
+|PROTOBUF|✗|ToolingExtension
+|Custom|✗|OAS2,OAS3
diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md
index 624040df9be..52455c5fea1 100644
--- a/docs/generators/java-msf4j.md
+++ b/docs/generators/java-msf4j.md
@@ -41,6 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md
index 20345fb4a23..6ecb576ac90 100644
--- a/docs/generators/java-pkmst.md
+++ b/docs/generators/java-pkmst.md
@@ -43,6 +43,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
|eurekaUri|Eureka URI| |null|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |com.prokarma|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md
index c83e4827e31..bfdef88970f 100644
--- a/docs/generators/java-play-framework.md
+++ b/docs/generators/java-play-framework.md
@@ -44,6 +44,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|handleExceptions|Add a 'throw exception' to each controller function. Add also a custom error handler where you can put your custom logic| |true|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md
index 8556f93afc7..202f013209d 100644
--- a/docs/generators/java-undertow-server.md
+++ b/docs/generators/java-undertow-server.md
@@ -41,6 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md
index aa29fbbc514..3144df23e1a 100644
--- a/docs/generators/java-vertx-web.md
+++ b/docs/generators/java-vertx-web.md
@@ -41,6 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md
index 08672146b4c..4592996516e 100644
--- a/docs/generators/java-vertx.md
+++ b/docs/generators/java-vertx.md
@@ -41,6 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
diff --git a/docs/generators/java-wiremock.md b/docs/generators/java-wiremock.md
index 26cf0167653..081a1296745 100644
--- a/docs/generators/java-wiremock.md
+++ b/docs/generators/java-wiremock.md
@@ -11,7 +11,7 @@ title: Documentation for the java-wiremock Generator
| generator type | SERVER | |
| generator language | Java | |
| generator default templating engine | mustache | |
-| helpTxt | Generates Java Wiremock stubs, requests and responses samples. | |
+| helpTxt | Generates Java WireMock stubs, requests and responses samples. | |
## CONFIG OPTIONS
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.
@@ -41,6 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
diff --git a/docs/generators/java.md b/docs/generators/java.md
index e08e5d2a6f6..028280b4562 100644
--- a/docs/generators/java.md
+++ b/docs/generators/java.md
@@ -34,6 +34,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false|
|configKey|Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option.| |null|
+|configKeyFromClassName|If true, set tag as key in @RegisterRestClient. Default to false. Only `microprofile` supports this option.| |null|
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
@@ -47,8 +48,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|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|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
-|errorObjectType|Error Object type. (This option is for okhttp-gson-next-gen only)| |null|
+|errorObjectType|Error Object type. (This option is for okhttp-gson only)| |null|
+|generateBuilders|Whether to generate builders for models| |false|
|generateClientAsBean|For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|gradleProperties|Append additional Gradle properties to the gradle.properties file| |null|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
@@ -57,7 +60,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
|invokerPackage|root package for generated code| |org.openapitools.client|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true|
-|library|library template (sub-template) to use|
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**jersey3**
HTTP client: Jersey client 3.x. JSON processing: Jackson 2.x
**feign**
HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x. or Gson 2.x
**okhttp-gson**
[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'.
**retrofit2**
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)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
**microprofile**
HTTP client: Microprofile client 1.x. JSON processing: JSON-B or Jackson 2.9.x
**apache-httpclient**
HTTP client: Apache httpclient 5.x
|okhttp-gson|
+|library|library template (sub-template) to use|
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**jersey3**
HTTP client: Jersey client 3.x. JSON processing: Jackson 2.x
**feign**
HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x. or Gson 2.x
**okhttp-gson**
[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'.
**retrofit2**
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)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**restclient**
HTTP client: Spring RestClient 6.1. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
**microprofile**
HTTP client: Microprofile client 1.x. JSON processing: JSON-B or Jackson 2.9.x
**apache-httpclient**
HTTP client: Apache httpclient 5.x
|okhttp-gson|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
@@ -83,7 +86,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|supportStreaming|Support streaming endpoint (beta)| |false|
|supportUrlQuery|Generate toUrlQueryString in POJO (default to true). Available on `native`, `apache-httpclient` libraries.| |false|
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
-|useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, libraries| |false|
+|useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, restclient, libraries| |false|
|useBeanValidation|Use BeanValidation API annotations| |false|
|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false|
|useGzipFeature|Send gzip-encoded requests| |false|
diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md
index 82b1b863e73..f990de40ddb 100644
--- a/docs/generators/jaxrs-cxf-cdi.md
+++ b/docs/generators/jaxrs-cxf-cdi.md
@@ -41,7 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
-|generateBuilders|Whether to generate builders for models.| |false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatePom|Whether to generate pom.xml if the file does not already exist.| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
@@ -78,6 +79,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useBeanValidation|Use BeanValidation API annotations| |true|
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|
|useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.| |false|
+|useMutiny|Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.| |false|
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
|useSwaggerAnnotations|Whether to generate Swagger annotations.| |true|
|useTags|use tags for creating interface and controller classnames| |false|
diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md
index 203688c5302..68d153daf20 100644
--- a/docs/generators/jaxrs-cxf-client.md
+++ b/docs/generators/jaxrs-cxf-client.md
@@ -41,6 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md
index 08a0fe67750..f72c477c3b7 100644
--- a/docs/generators/jaxrs-cxf-extended.md
+++ b/docs/generators/jaxrs-cxf-extended.md
@@ -42,6 +42,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false|
|generateNonSpringApplication|Generate non-Spring application| |false|
|generateOperationBody|Generate fully functional operation bodies| |false|
diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md
index 975ba1a0579..89caf27c7ad 100644
--- a/docs/generators/jaxrs-cxf.md
+++ b/docs/generators/jaxrs-cxf.md
@@ -42,6 +42,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false|
|generateNonSpringApplication|Generate non-Spring application| |false|
|generateSpringApplication|Generate Spring application| |false|
diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md
index 1565d04f0d4..d3b30f001e4 100644
--- a/docs/generators/jaxrs-jersey.md
+++ b/docs/generators/jaxrs-jersey.md
@@ -41,6 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md
index ce8e83b6518..8645361f843 100644
--- a/docs/generators/jaxrs-resteasy-eap.md
+++ b/docs/generators/jaxrs-resteasy-eap.md
@@ -41,6 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md
index b7613483d24..af6e8c0aa2d 100644
--- a/docs/generators/jaxrs-resteasy.md
+++ b/docs/generators/jaxrs-resteasy.md
@@ -41,6 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md
index 6572bfa7247..f1ff6d31bb6 100644
--- a/docs/generators/jaxrs-spec.md
+++ b/docs/generators/jaxrs-spec.md
@@ -41,7 +41,8 @@ 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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
-|generateBuilders|Whether to generate builders for models.| |false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatePom|Whether to generate pom.xml if the file does not already exist.| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
@@ -78,6 +79,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useBeanValidation|Use BeanValidation API annotations| |true|
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|
|useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.| |false|
+|useMutiny|Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.| |false|
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
|useSwaggerAnnotations|Whether to generate Swagger annotations.| |true|
|useTags|use tags for creating interface and controller classnames| |false|
diff --git a/docs/generators/kotlin-wiremock.md b/docs/generators/kotlin-wiremock.md
new file mode 100644
index 00000000000..c836ebc7f23
--- /dev/null
+++ b/docs/generators/kotlin-wiremock.md
@@ -0,0 +1,277 @@
+---
+title: Documentation for the kotlin-wiremock Generator
+---
+
+## METADATA
+
+| Property | Value | Notes |
+| -------- | ----- | ----- |
+| generator name | kotlin-wiremock | pass this to the generate command after -g |
+| generator stability | BETA | |
+| generator type | SERVER | |
+| generator language | Kotlin | |
+| generator default templating engine | mustache | |
+| helpTxt | Generates Kotlin WireMock stub request and response samples. | |
+
+## CONFIG OPTIONS
+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 |
+| ------ | ----------- | ------ | ------- |
+|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
+|apiSuffix|suffix for api classes| |Api|
+|artifactId|Generated artifact id (name of jar).| |null|
+|artifactVersion|Generated artifact's package version.| |1.0.0|
+|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original|
+|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
+|modelMutable|Create mutable models| |false|
+|packageName|Generated artifact package name.| |org.openapitools|
+|parcelizeModels|toggle "@Parcelize" for generated models| |null|
+|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
+|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
+|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
+|sourceFolder|source folder for generated code| |src/main/kotlin|
+
+## IMPORT MAPPING
+
+| Type/Alias | Imports |
+| ---------- | ------- |
+|BigDecimal|java.math.BigDecimal|
+|Date|java.time.LocalDate|
+|DateTime|java.time.OffsetDateTime|
+|File|java.io.File|
+|LocalDate|java.time.LocalDate|
+|LocalDateTime|java.time.LocalDateTime|
+|LocalTime|java.time.LocalTime|
+|Timestamp|java.sql.Timestamp|
+|URI|java.net.URI|
+|UUID|java.util.UUID|
+
+
+## INSTANTIATION TYPES
+
+| Type/Alias | Instantiated By |
+| ---------- | --------------- |
+|array|kotlin.collections.ArrayList|
+|list|kotlin.collections.ArrayList|
+|map|kotlin.collections.HashMap|
+
+
+## LANGUAGE PRIMITIVES
+
+
+
kotlin.Array
+
kotlin.Boolean
+
kotlin.Byte
+
kotlin.ByteArray
+
kotlin.Char
+
kotlin.Double
+
kotlin.Float
+
kotlin.Int
+
kotlin.Long
+
kotlin.Short
+
kotlin.String
+
kotlin.collections.List
+
kotlin.collections.Map
+
kotlin.collections.MutableList
+
kotlin.collections.MutableMap
+
kotlin.collections.MutableSet
+
kotlin.collections.Set
+
+
+## RESERVED WORDS
+
+
+
ApiResponse
+
abstract
+
actual
+
annotation
+
as
+
break
+
class
+
companion
+
const
+
constructor
+
continue
+
contract
+
crossinline
+
data
+
delegate
+
do
+
dynamic
+
else
+
enum
+
expect
+
external
+
false
+
field
+
final
+
finally
+
for
+
fun
+
if
+
import
+
in
+
infix
+
init
+
inline
+
inner
+
interface
+
internal
+
is
+
it
+
lateinit
+
noinline
+
null
+
object
+
open
+
operator
+
out
+
override
+
package
+
param
+
private
+
property
+
protected
+
public
+
receiver
+
reified
+
return
+
sealed
+
setparam
+
super
+
suspend
+
tailrec
+
this
+
throw
+
true
+
try
+
typealias
+
typeof
+
val
+
value
+
var
+
vararg
+
when
+
where
+
while
+
+
+## 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
+|Uuid|✗|
+|Array|✓|OAS2,OAS3
+|Null|✗|OAS3
+|AnyType|✗|OAS2,OAS3
+|Object|✓|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
+|allOf|✗|OAS2,OAS3
+|anyOf|✗|OAS3
+|oneOf|✗|OAS3
+|not|✗|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
+|SignatureAuth|✗|OAS3
+|AWSV4Signature|✗|ToolingExtension
+
+### Wire Format Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|JSON|✓|OAS2,OAS3
+|XML|✓|OAS2,OAS3
+|PROTOBUF|✗|ToolingExtension
+|Custom|✗|OAS2,OAS3
diff --git a/docs/generators/php-flight.md b/docs/generators/php-flight.md
new file mode 100644
index 00000000000..8b7c90a069b
--- /dev/null
+++ b/docs/generators/php-flight.md
@@ -0,0 +1,270 @@
+---
+title: Documentation for the php-flight Generator
+---
+
+## METADATA
+
+| Property | Value | Notes |
+| -------- | ----- | ----- |
+| generator name | php-flight | pass this to the generate command after -g |
+| generator stability | EXPERIMENTAL | |
+| generator type | SERVER | |
+| generator language | PHP | |
+| generator default templating engine | mustache | |
+| helpTxt | Generates a PHP Flight Framework server library. | |
+
+## CONFIG OPTIONS
+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|
+|apiPackage|package for generated api classes| |null|
+|artifactUrl|artifact URL in generated pom.xml| |null|
+|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
+|composerPackageName|The name to use in the composer package name field. e.g. `vendor/project` (must be lowercase and consist of words separated by `-`, `.` or `_`).| |null|
+|developerOrganization|developer organization in generated pom.xml| |null|
+|developerOrganizationUrl|developer organization URL in generated pom.xml| |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.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true|
+|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
+|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
+|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null|
+|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true|
+|licenseName|The name of the license| |null|
+|modelPackage|package for generated models| |null|
+|packageName|The main package name for classes. e.g. GeneratedPetstore| |null|
+|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
+|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
+|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
+|srcBasePath|The directory to serve as source root.| |null|
+|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |camelCase|
+
+## IMPORT MAPPING
+
+| Type/Alias | Imports |
+| ---------- | ------- |
+
+
+## INSTANTIATION TYPES
+
+| Type/Alias | Instantiated By |
+| ---------- | --------------- |
+|array|array|
+|map|array|
+
+
+## LANGUAGE PRIMITIVES
+
+
+
\DateTime
+
\SplFileObject
+
array
+
bool
+
boolean
+
byte
+
float
+
int
+
integer
+
mixed
+
number
+
object
+
string
+
void
+
+
+## RESERVED WORDS
+
+
+
__halt_compiler
+
_header_accept
+
_tempbody
+
abstract
+
and
+
array
+
as
+
break
+
callable
+
case
+
catch
+
class
+
clone
+
const
+
continue
+
declare
+
default
+
die
+
do
+
echo
+
else
+
elseif
+
empty
+
enddeclare
+
endfor
+
endforeach
+
endif
+
endswitch
+
endwhile
+
eval
+
exit
+
extends
+
final
+
for
+
foreach
+
formparams
+
function
+
global
+
goto
+
headerparams
+
httpbody
+
if
+
implements
+
include
+
include_once
+
instanceof
+
insteadof
+
interface
+
isset
+
list
+
namespace
+
new
+
or
+
print
+
private
+
protected
+
public
+
queryparams
+
require
+
require_once
+
resourcepath
+
return
+
static
+
switch
+
throw
+
trait
+
try
+
unset
+
use
+
var
+
while
+
xor
+
+
+## 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
+|Uuid|✗|
+|Array|✓|OAS2,OAS3
+|Null|✗|OAS3
+|AnyType|✗|OAS2,OAS3
+|Object|✓|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
+|allOf|✗|OAS2,OAS3
+|anyOf|✗|OAS3
+|oneOf|✗|OAS3
+|not|✗|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
+|SignatureAuth|✗|OAS3
+|AWSV4Signature|✗|ToolingExtension
+
+### Wire Format Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|JSON|✓|OAS2,OAS3
+|XML|✗|OAS2,OAS3
+|PROTOBUF|✗|ToolingExtension
+|Custom|✗|OAS2,OAS3
diff --git a/docs/generators/php.md b/docs/generators/php.md
index 05b9bd48887..b3997fb00d7 100644
--- a/docs/generators/php.md
+++ b/docs/generators/php.md
@@ -219,7 +219,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ExternalDocumentation|✓|OAS2,OAS3
|Examples|✓|OAS2,OAS3
|XMLStructureDefinitions|✗|OAS2,OAS3
-|MultiServer|✗|OAS3
+|MultiServer|✓|OAS3
|ParameterizedServer|✗|OAS3
|ParameterStyling|✗|OAS3
|Callbacks|✗|OAS3
diff --git a/docs/generators/scala-cask.md b/docs/generators/scala-cask.md
index d187ba56939..802870eef7b 100644
--- a/docs/generators/scala-cask.md
+++ b/docs/generators/scala-cask.md
@@ -21,6 +21,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|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null|
+|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option.| |null|
|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (preferred for JDK 1.8+)
|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.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
diff --git a/docs/generators/spring.md b/docs/generators/spring.md
index 9e426fb0f04..6ae3b647ac6 100644
--- a/docs/generators/spring.md
+++ b/docs/generators/spring.md
@@ -48,6 +48,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|documentationProvider|Select the OpenAPI documentation provider.|
**none**
Do not publish an OpenAPI specification.
**source**
Publish the original input OpenAPI specification.
**springfox**
Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.
**springdoc**
Generate an OpenAPI 3 specification using SpringDoc.
|springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|generateBuilders|Whether to generate builders for models| |false|
+|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false|
diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md
index 20a758ccf3f..63a97cf5360 100644
--- a/docs/generators/typescript-fetch.md
+++ b/docs/generators/typescript-fetch.md
@@ -25,6 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase|
|enumPropertyNamingReplaceSpecialChar|Set to true to replace '-' and '+' symbols with 'minus_' and 'plus_' in enum of type string| |false|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|fileNaming|Naming convention for the output files: 'PascalCase', 'camelCase', 'kebab-case'.| |PascalCase|
|importFileExtension|File extension to use with relative imports. Set it to '.js' or '.mjs' when using [ESM](https://nodejs.org/api/esm.html).| ||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
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.
|true|
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
diff --git a/docs/generators/typescript-nestjs.md b/docs/generators/typescript-nestjs.md
index 9788a613971..11748efb4ec 100644
--- a/docs/generators/typescript-nestjs.md
+++ b/docs/generators/typescript-nestjs.md
@@ -45,6 +45,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|stringEnums|Generate string enums instead of objects for enum values.| |false|
|supportsES6|Generate code that conforms to ES6.| |false|
|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false|
+|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false|
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
## IMPORT MAPPING
diff --git a/docs/global-properties.md b/docs/global-properties.md
index 1fe76f58013..445b7f21ce5 100644
--- a/docs/global-properties.md
+++ b/docs/global-properties.md
@@ -5,23 +5,22 @@ title: Global Properties
## Available Global Properties
-| Property | Description | Acceptable value |
-| -------- | ------------| ---------------- |
-| debugOpenAPI | Dumps JSON formatted and fully parsed OpenAPI document during generation | none |
-| debugModels | Dumps JSON formatted template-bound model information during generation | none |
-| debugOperations | Dumps JSON formatted template-bound operation information during generation | none |
-| debugSupportingFiles | Dumps JSON formatted Supporting File information during generation | none |
-| verbose | Defines the verbosity | `true` or `false` |
-| generateAliasAsModel | Defines whether primitive types defined at the model/schema level will be wrapped in a model | `true` or `false` |
-| org.openapitools.codegen.utils.oncelogger.enabled | Enable/disable the "OnceLogger" which reduces noise for select repeated logs | `true` or `false` |
-| supportingFiles | Allows the user to define which supporting files will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of file names |
-| models | Allows the user to define which models will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of model names |
-| apis | Allows the user to define which apis will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of api names |
-| apiDocs | Allows the user to define if api docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
-| modelDocs | Allows the user to define if model docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
-| apiTests | Allows the user to define if api tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
-| modelTests | Allows the user to define if model tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
-| withXml | Allows the user to control support of XML generated constructs, where supported | none |
+| Property | Description | Acceptable value |
+|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
+| debugOpenAPI | Dumps JSON formatted and fully parsed OpenAPI document during generation | none |
+| debugModels | Dumps JSON formatted template-bound model information during generation | none |
+| debugOperations | Dumps JSON formatted template-bound operation information during generation | none |
+| debugSupportingFiles | Dumps JSON formatted Supporting File information during generation | none |
+| verbose | Defines the verbosity | `true` or `false` |
+| generateAliasAsModel | Defines whether primitive types defined at the model/schema level will be wrapped in a model | `true` or `false` |
+| org.openapitools.codegen.utils.oncelogger.enabled | Enable/disable the "OnceLogger" which reduces noise for select repeated logs | `true` or `false` |
+| supportingFiles | Allows the user to define which supporting files will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of file names |
+| models | Allows the user to define which models will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of model names |
+| apis | Allows the user to define which apis will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of api names |
+| apiDocs | Allows the user to define if api docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
+| modelDocs | Allows the user to define if model docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
+| apiTests | Allows the user to define if api tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
+| modelTests | Allows the user to define if model tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
## Note on Global Property declaration
diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc
index 00144d2dacc..804d41c4a69 100644
--- a/modules/openapi-generator-gradle-plugin/README.adoc
+++ b/modules/openapi-generator-gradle-plugin/README.adoc
@@ -97,7 +97,7 @@ task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valid
[source,group]
----
plugins {
- id "org.openapi.generator" version "7.2.0"
+ id "org.openapi.generator" version "7.5.0"
}
----
@@ -389,11 +389,6 @@ apply plugin: 'org.openapi.generator'
|true
|Defines whether or not api-related _documentation_ files should be generated.
-|withXml
-|Boolean
-|false
-|A special-case setting which configures some generators with XML support. In some cases, this forces json OR xml, so the default here is false.
-
|configOptions
|Map(String,String)
|None
@@ -545,9 +540,7 @@ openApiGenerate {
apiPackage.set("org.openapi.example.api")
invokerPackage.set("org.openapi.example.invoker")
modelPackage.set("org.openapi.example.model")
- configOptions.set([
- dateLibrary: "java8"
- ])
+ configOptions.put("dateLibrary", "java8")
}
----
diff --git a/modules/openapi-generator-gradle-plugin/build.gradle b/modules/openapi-generator-gradle-plugin/build.gradle
index f660266e856..90bf9dcc8d1 100644
--- a/modules/openapi-generator-gradle-plugin/build.gradle
+++ b/modules/openapi-generator-gradle-plugin/build.gradle
@@ -8,7 +8,7 @@ plugins {
id("java-gradle-plugin")
id("maven-publish")
id("org.gradle.kotlin.kotlin-dsl") version "2.4.1"
- id("org.jetbrains.kotlin.jvm") version "1.7.10"
+ id("org.jetbrains.kotlin.jvm") version "1.9.0"
id("signing")
}
@@ -26,8 +26,8 @@ specifications as part of your build. Other tasks are available as command line
java {
withSourcesJar()
withJavadocJar()
- sourceCompatibility = 1.11
- targetCompatibility = 1.11
+ sourceCompatibility = JavaVersion.VERSION_11
+ targetCompatibility = JavaVersion.VERSION_11
}
repositories {
@@ -41,7 +41,7 @@ repositories {
dependencies {
implementation("org.openapitools:openapi-generator:$openApiGeneratorVersion")
- testImplementation("org.jetbrains.kotlin:kotlin-test-testng:1.7.10")
+ testImplementation("org.jetbrains.kotlin:kotlin-test-testng:1.9.0")
}
tasks.named("test", Test).configure {
@@ -63,7 +63,7 @@ tasks.named("test", Test).configure {
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
- jvmTarget = "1.8"
+ jvmTarget = "11"
}
}
diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties
index c86ac39b259..5d82081e5ea 100644
--- a/modules/openapi-generator-gradle-plugin/gradle.properties
+++ b/modules/openapi-generator-gradle-plugin/gradle.properties
@@ -1,5 +1,9 @@
# RELEASE_VERSION
+<<<<<<< HEAD
openApiGeneratorVersion=8.0.0-SNAPSHOT
+=======
+openApiGeneratorVersion=7.7.0-SNAPSHOT
+>>>>>>> master
# /RELEASE_VERSION
# BEGIN placeholders
diff --git a/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties b/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties
index f398c33c4b0..c7d437bbb47 100644
--- a/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties
+++ b/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml
index 9b6da7792d6..0ea4bf9bbfc 100644
--- a/modules/openapi-generator-gradle-plugin/pom.xml
+++ b/modules/openapi-generator-gradle-plugin/pom.xml
@@ -17,8 +17,8 @@
true
- 7.6
- 7.3-20210825160000+0000
+ 7.6.4
+ 7.4.2
diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
index 6a4917a957a..40cc6251ebe 100644
--- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
+++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
@@ -1,7 +1,11 @@
# RELEASE_VERSION
<<<<<<< HEAD
+<<<<<<< HEAD
openApiGeneratorVersion=8.0.0-SNAPSHOT
=======
openApiGeneratorVersion=7.5.0-SNAPSHOT
>>>>>>> origin/master
+=======
+openApiGeneratorVersion=7.7.0-SNAPSHOT
+>>>>>>> master
# /RELEASE_VERSION
diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle/wrapper/gradle-wrapper.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle/wrapper/gradle-wrapper.properties
index 068cdb2dc26..3994438e229 100644
--- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle/wrapper/gradle-wrapper.properties
+++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt
index cf3552d38fb..46d6cfcc690 100644
--- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt
+++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt
@@ -144,7 +144,6 @@ class OpenApiGeneratorPlugin : Plugin {
generateModelDocumentation.set(generate.generateModelDocumentation)
generateApiTests.set(generate.generateApiTests)
generateApiDocumentation.set(generate.generateApiDocumentation)
- withXml.set(generate.withXml)
configOptions.set(generate.configOptions)
logToStderr.set(generate.logToStderr)
enablePostProcessFile.set(generate.enablePostProcessFile)
diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt
index 236453a8709..b80ffbcdd69 100644
--- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt
+++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt
@@ -342,12 +342,6 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
*/
val generateApiDocumentation = project.objects.property()
- /**
- * A special-case setting which configures some generators with XML support. In some cases,
- * this forces json OR xml, so the default here is false.
- */
- val withXml = project.objects.property()
-
/**
* To write all log messages (not just errors) to STDOUT
*/
@@ -408,7 +402,6 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
generateModelDocumentation.set(true)
generateApiTests.set(true)
generateApiDocumentation.set(true)
- withXml.set(false)
configOptions.set(mapOf())
validateSpec.set(true)
logToStderr.set(false)
diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
index d9473159a87..193cdbed15d 100644
--- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
+++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
@@ -506,14 +506,6 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
@Input
val generateApiDocumentation = project.objects.property()
- /**
- * A special-case setting which configures some generators with XML support. In some cases,
- * this forces json OR xml, so the default here is false.
- */
- @Optional
- @Input
- val withXml = project.objects.property()
-
/**
* To write all log messages (not just errors) to STDOUT
*/
@@ -680,10 +672,6 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
GlobalSettings.setProperty(CodegenConstants.API_TESTS, generateApiTests.get().toString())
}
- if (withXml.isPresent) {
- GlobalSettings.setProperty(CodegenConstants.WITH_XML, withXml.get().toString())
- }
-
if (inputSpec.isPresent && remoteInputSpec.isPresent) {
logger.warn("Both inputSpec and remoteInputSpec is specified. The remoteInputSpec will take priority over inputSpec.")
}
diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskConfigurationCacheTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskConfigurationCacheTest.kt
index b1636e2b0ae..b9ec75eb429 100644
--- a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskConfigurationCacheTest.kt
+++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskConfigurationCacheTest.kt
@@ -20,7 +20,7 @@ class GenerateTaskConfigurationCacheTest : TestBase() {
}
@DataProvider(name = "gradle_version_provider")
- private fun gradleVersionProviderWithConfigurationCache(): Array> = arrayOf(arrayOf("8.1.1"), arrayOf("7.6"))
+ private fun gradleVersionProviderWithConfigurationCache(): Array> = arrayOf(arrayOf("8.7"), arrayOf("7.6.4"))
@DataProvider(name = "gradle_version_provider_without_cc")
private fun gradleVersionProviderWithoutConfigurationCache(): Array> = arrayOf(arrayOf("5.6.1"))
diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskFromCacheTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskFromCacheTest.kt
index 9f73e0e388a..e66f6264578 100644
--- a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskFromCacheTest.kt
+++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskFromCacheTest.kt
@@ -22,7 +22,7 @@ class GenerateTaskFromCacheTest : TestBase() {
}
@DataProvider(name = "gradle_version_provider")
- private fun gradleVersionProvider(): Array> = arrayOf(arrayOf("8.1.1"), arrayOf("7.6"))
+ private fun gradleVersionProvider(): Array> = arrayOf(arrayOf("8.7"), arrayOf("7.6.4"))
// inputSpec tests
diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskUpToDateTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskUpToDateTest.kt
index 7cfe81fd276..f8932c6bcc4 100644
--- a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskUpToDateTest.kt
+++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskUpToDateTest.kt
@@ -9,7 +9,7 @@ import kotlin.test.assertEquals
class GenerateTaskUpToDateTest : TestBase() {
@DataProvider(name = "gradle_version_provider")
- private fun gradleVersionProvider(): Array> = arrayOf(arrayOf("8.1.1"), arrayOf("7.6"))
+ private fun gradleVersionProvider(): Array> = arrayOf(arrayOf("8.7"), arrayOf("7.6.4"))
// inputSpec tests
diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt
index aa80ed587f8..c6687bd69a0 100644
--- a/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt
+++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt
@@ -17,8 +17,8 @@ class ValidateTaskDslTest : TestBase() {
@DataProvider(name = "gradle_version_provider")
fun gradleVersionProvider(): Array> = arrayOf(
arrayOf(null), // uses the version of Gradle used to build the plugin itself
- arrayOf("8.1.1"),
- arrayOf("7.6")
+ arrayOf("8.7"),
+ arrayOf("7.6.4")
)
private fun getGradleRunner(gradleVersion: String?): GradleRunner {
diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md
index 1700662a76e..a3d45bd2c38 100644
--- a/modules/openapi-generator-maven-plugin/README.md
+++ b/modules/openapi-generator-maven-plugin/README.md
@@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
org.openapitoolsopenapi-generator-maven-plugin
- 7.2.0
+ 7.5.0
@@ -107,7 +107,6 @@ mvn clean compile
| `generateModelDocumentation` | `openapi.generator.maven.plugin.generateModelDocumentation` | generate the model documentation (`true` by default. Only available if `generateModels` is `true`)
| `generateApiTests` | `openapi.generator.maven.plugin.generateApiTests` | generate the api tests (`true` by default. Only available if `generateApis` is `true`)
| `generateApiDocumentation` | `openapi.generator.maven.plugin.generateApiDocumentation` | generate the api documentation (`true` by default. Only available if `generateApis` is `true`)
-| `withXml` | `openapi.generator.maven.plugin.withXml` | enable XML annotations inside the generated models and API (only works with Java `language` and libraries that provide support for JSON and XML)
| `skip` | `codegen.skip` | skip code generation (`false` by default. Can also be set globally through the `codegen.skip` property)
| `skipIfSpecIsUnchanged` | `codegen.skipIfSpecIsUnchanged` | Skip the execution if the source file is older than the output folder (`false` by default. Can also be set globally through the `codegen.skipIfSpecIsUnchanged` property)
| `addCompileSourceRoot` | `openapi.generator.maven.plugin.addCompileSourceRoot` | Add the output directory to the project as a source root, so that the generated java types are compiled and included in the project artifact (`true` by default). Mutually exclusive with `addTestCompileSourceRoot`.
diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml
index e30070b073d..8f4ef4b1dd5 100644
--- a/modules/openapi-generator-maven-plugin/examples/java-client.xml
+++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml
@@ -70,6 +70,30 @@
true
+
+ jar
+
+ generate
+
+
+
+ jar:file:${project.basedir}/../src/test/resources/default/local-repo/petstore/schema/1/schema-1.jar!/petstore.yaml
+
+
+ java
+
+
+
+
+
+ joda
+
+
+
+ jersey2
+
+
diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml
index fdc0d5272e0..ab59209425d 100644
--- a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml
+++ b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml
@@ -19,7 +19,7 @@
0.2.12.71.0.0
- 4.13.2
+ 5.10.21.4
diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml
index f1f1f46f161..c965b34320b 100644
--- a/modules/openapi-generator-maven-plugin/examples/non-java.xml
+++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml
@@ -13,11 +13,7 @@
org.openapitoolsopenapi-generator-maven-plugin
-<<<<<<< HEAD
8.0.0-SNAPSHOT
-=======
- 7.5.0-SNAPSHOT
->>>>>>> origin/master
diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml
index 09b4d0f4236..83773ed26bf 100644
--- a/modules/openapi-generator-maven-plugin/pom.xml
+++ b/modules/openapi-generator-maven-plugin/pom.xml
@@ -16,7 +16,7 @@
UTF-8**/src/main/java/org/openapitools/codegen/plugin/**/*
-
+ 3.9.6
@@ -27,25 +27,25 @@
org.apache.mavenmaven-core
- 3.9.4
+ ${maven.version}providedorg.apache.mavenmaven-artifact
- 3.9.4
+ ${maven.version}providedorg.apache.mavenmaven-compat
- 3.9.4
+ ${maven.version}testorg.apache.mavenmaven-plugin-api
- 3.9.4
+ ${maven.version}provided
@@ -59,11 +59,17 @@
${project.version}
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter-api${junit.version}test
+
+ org.apache.maven
+ maven-resolver-provider
+ ${maven.version}
+ test
+ org.apache.maven.sharedmaven-verifier
diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java
index 6c3b717189b..372b9aeb47e 100644
--- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java
+++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java
@@ -32,6 +32,7 @@ import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
+import java.net.URLClassLoader;
import java.net.URLConnection;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
@@ -39,6 +40,7 @@ import java.nio.channels.ReadableByteChannel;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.text.MessageFormat;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@@ -50,14 +52,17 @@ import com.google.common.io.CharSource;
import io.swagger.v3.parser.core.models.ParseOptions;
import io.swagger.v3.parser.util.ClasspathHelper;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
@@ -82,7 +87,7 @@ import com.google.common.io.Files;
* Goal which generates client/server code from a OpenAPI json/yaml definition.
*/
@SuppressWarnings({"unused", "MismatchedQueryAndUpdateOfCollection"})
-@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
+@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = true)
public class CodeGenMojo extends AbstractMojo {
private final Logger LOGGER = LoggerFactory.getLogger(CodeGenMojo.class);
@@ -443,6 +448,12 @@ public class CodeGenMojo extends AbstractMojo {
@Parameter(name = "generateModels", property = "openapi.generator.maven.plugin.generateModels")
private Boolean generateModels = true;
+ /**
+ * Generate the models recursively if models should generate selectively (see modelsToGenerate) and all dependent models are to generate
+ */
+ @Parameter(name = "generateRecursiveDependentModels", property = "openapi.generator.maven.plugin.generateRecursiveDependentModels")
+ private Boolean generateRecursiveDependentModels = false;
+
/**
* A comma separated list of models to generate. All models is the default.
*/
@@ -485,12 +496,6 @@ public class CodeGenMojo extends AbstractMojo {
@Parameter(name = "generateApiDocumentation", property = "openapi.generator.maven.plugin.generateApiDocumentation")
private Boolean generateApiDocumentation = true;
- /**
- * Generate the api documentation
- */
- @Parameter(name = "withXml", property = "openapi.generator.maven.plugin.withXml")
- private Boolean withXml = false;
-
/**
* Skip the execution.
*/
@@ -656,7 +661,13 @@ public class CodeGenMojo extends AbstractMojo {
}
if (isNotEmpty(inputSpec)) {
- configurator.setInputSpec(inputSpec);
+ URL url = inputSpecRemoteUrl();
+
+ if ((! inputSpecFile.exists()) && url != null) {
+ configurator.setInputSpec(url.toString());
+ } else {
+ configurator.setInputSpec(inputSpec);
+ }
}
if (isNotEmpty(gitHost)) {
@@ -794,7 +805,7 @@ public class CodeGenMojo extends AbstractMojo {
GlobalSettings.setProperty(CodegenConstants.MODEL_DOCS, generateModelDocumentation.toString());
GlobalSettings.setProperty(CodegenConstants.API_TESTS, generateApiTests.toString());
GlobalSettings.setProperty(CodegenConstants.API_DOCS, generateApiDocumentation.toString());
- GlobalSettings.setProperty(CodegenConstants.WITH_XML, withXml.toString());
+ GlobalSettings.setProperty(CodegenConstants.GENERATE_RECURSIVE_DEPENDENT_MODELS, generateRecursiveDependentModels.toString());
if (configOptions != null) {
// Retained for backwards-compatibility with configOptions -> instantiation-types
@@ -1068,15 +1079,35 @@ public class CodeGenMojo extends AbstractMojo {
}
/**
- * Try to parse inputSpec setting string into URL
+ * Try to parse inputSpec setting string into URL (truly remote or resource)
* @return A valid URL or null if inputSpec is not a valid URL
*/
- private URL inputSpecRemoteUrl(){
- try {
- return new URI(inputSpec).toURL();
- } catch (URISyntaxException | MalformedURLException | IllegalArgumentException e) {
- return null;
+ private URL inputSpecRemoteUrl() {
+ URL url = dependencyClassLoader().getResource(inputSpec);
+
+ if (url == null) {
+ try {
+ url = new URI(FilenameUtils.separatorsToUnix(inputSpec)).toURL();
+ } catch (URISyntaxException | MalformedURLException | IllegalArgumentException e) {
+ }
}
+
+ return url;
+ }
+
+ private ClassLoader dependencyClassLoader() {
+ List list = new ArrayList<>();
+
+ for (Artifact artifact : project.getArtifacts()) {
+ try {
+ if (artifact.isResolved() && artifact.getType().equals("jar")) {
+ list.add(new URL("jar:" + artifact.getFile().toURI() + "!/"));
+ }
+ } catch (Exception e) {
+ }
+ }
+
+ return new URLClassLoader(list.toArray(new URL[] { }), getClass().getClassLoader());
}
/**
@@ -1089,7 +1120,7 @@ public class CodeGenMojo extends AbstractMojo {
String name = inputSpecFile.getName();
URL url = inputSpecRemoteUrl();
- if (url != null) {
+ if (inputSpecFile.exists() && url != null) {
String[] segments = url.getPath().split("/");
name = Files.getNameWithoutExtension(segments[segments.length - 1]);
}
diff --git a/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java b/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java
index 4881db21921..d39da0d8a62 100644
--- a/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java
+++ b/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java
@@ -16,7 +16,7 @@
package org.openapitools.codegen.plugin;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.File;
import java.nio.file.Files;
@@ -37,7 +37,12 @@ import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.impl.DefaultServiceLocator;
+import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.RepositorySystem;
public class CodeGenMojoTest extends BaseTestCase {
@Override
@@ -45,10 +50,22 @@ public class CodeGenMojoTest extends BaseTestCase {
super.setUp();
}
+ public void testCommonConfigurationWithFileInputSpec() throws Exception {
+ testCommonConfiguration("file");
+ }
+
+ public void testCommonConfigurationWithResourceInputSpec() throws Exception {
+ testCommonConfiguration("resource");
+ }
+
+ public void testCommonConfigurationWithURLInputSpec() throws Exception {
+ testCommonConfiguration("url");
+ }
+
@SuppressWarnings("unchecked")
- public void testCommonConfiguration() throws Exception {
+ private void testCommonConfiguration(String profile) throws Exception {
File folder = Files.createTempDirectory("test").toFile();
- CodeGenMojo mojo = loadMojo(folder, "src/test/resources/default");
+ CodeGenMojo mojo = loadMojo(folder, "src/test/resources/default", profile);
mojo.execute();
assertEquals("java", getVariableValueFromObject(mojo, "generatorName"));
assertEquals("jersey2", getVariableValueFromObject(mojo, "library"));
@@ -65,7 +82,7 @@ public class CodeGenMojoTest extends BaseTestCase {
public void testHashGenerationFileContainsExecutionId() throws Exception {
// GIVEN
Path folder = Files.createTempDirectory("test");
- CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "executionId");
+ CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId");
// WHEN
mojo.execute();
@@ -86,7 +103,7 @@ public class CodeGenMojoTest extends BaseTestCase {
//GIVEN
/* Setup the mojo */
final Path folder = Files.createTempDirectory("test-classpath");
- final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", "executionId");
+ final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", null, "executionId");
/* Perform an initial generation */
mojo.execute();
@@ -124,7 +141,7 @@ public class CodeGenMojoTest extends BaseTestCase {
//GIVEN
/* Setup the mojo */
final Path folder = Files.createTempDirectory("test-classpath");
- final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", "executionId");
+ final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", null, "executionId");
/* Perform an initial generation */
mojo.execute();
@@ -159,7 +176,7 @@ public class CodeGenMojoTest extends BaseTestCase {
public void testCollapsedSpecProduced() throws Exception {
// GIVEN
Path folder = Files.createTempDirectory("test");
- CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "executionId");
+ CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId");
// WHEN
mojo.execute();
@@ -172,7 +189,7 @@ public class CodeGenMojoTest extends BaseTestCase {
public void testCollapsedSpecAddedToArtifacts() throws Exception {
// GIVEN
Path folder = Files.createTempDirectory("test");
- CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "executionId");
+ CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId");
// WHEN
mojo.execute();
@@ -187,7 +204,7 @@ public class CodeGenMojoTest extends BaseTestCase {
public void testAnyInputSpecMustBeProvided() throws Exception {
// GIVEN
Path folder = Files.createTempDirectory("test");
- CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "executionId");
+ CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId");
mojo.inputSpec = null;
mojo.inputSpecRootDirectory = null;
@@ -201,7 +218,7 @@ public class CodeGenMojoTest extends BaseTestCase {
public void testInputSpecRootDirectoryDoesNotRequireInputSpec() throws Exception {
// GIVEN
Path folder = Files.createTempDirectory("test");
- CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "executionId");
+ CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId");
mojo.inputSpec = null;
mojo.inputSpecRootDirectory = "src/test/resources/default";
@@ -214,14 +231,14 @@ public class CodeGenMojoTest extends BaseTestCase {
assertTrue(hashFolder.resolve("_merged_spec.yaml-executionId.sha256").toFile().exists());
}
- protected CodeGenMojo loadMojo(File temporaryFolder, String projectRoot) throws Exception {
- return loadMojo(temporaryFolder, projectRoot, "default");
+ protected CodeGenMojo loadMojo(File temporaryFolder, String projectRoot, String profile) throws Exception {
+ return loadMojo(temporaryFolder, projectRoot, profile, "default");
}
- protected CodeGenMojo loadMojo(File temporaryFolder, String projectRoot, String executionId) throws Exception {
+ protected CodeGenMojo loadMojo(File temporaryFolder, String projectRoot, String profile, String executionId) throws Exception {
File file = new File(projectRoot);
FileUtils.copyDirectory(file, temporaryFolder);
- MavenProject project = readMavenProject(temporaryFolder);
+ MavenProject project = readMavenProject(temporaryFolder, profile);
MavenSession session = newMavenSession(project);
MojoExecution execution = newMojoExecution("generate");
MojoExecution executionWithId = copyWithExecutionId(executionId, execution);
@@ -234,15 +251,22 @@ public class CodeGenMojoTest extends BaseTestCase {
return executionWithId;
}
- protected MavenProject readMavenProject(File basedir)
+ protected MavenProject readMavenProject(File basedir, String profile)
throws Exception {
File pom = new File(basedir, "pom.xml");
+ LocalRepository localRepo = new LocalRepository(new File(basedir, "local-repo"));
+ DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
+ session.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory().newInstance(session, localRepo));
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
request.setBaseDirectory(basedir);
+ if (profile != null) {
+ request.addActiveProfile(profile);
+ }
ProjectBuildingRequest configuration = request.getProjectBuildingRequest();
- configuration.setRepositorySession(new DefaultRepositorySystemSession());
+ configuration.setRepositorySession(session);
+ configuration.setResolveDependencies(true);
MavenProject project = lookup(ProjectBuilder.class).build(pom, configuration).getProject();
assertNotNull(project);
return project;
}
-}
\ No newline at end of file
+}
diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.jar b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.jar
new file mode 100644
index 00000000000..5b4d1c0860f
Binary files /dev/null and b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.jar differ
diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.pom b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.pom
new file mode 100644
index 00000000000..bd1c51309d9
--- /dev/null
+++ b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.pom
@@ -0,0 +1,9 @@
+
+
+ 4.0.0
+ petstore
+ schema
+ 1
+ POM was created from install:install-file
+
diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/maven-metadata-local.xml b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/maven-metadata-local.xml
new file mode 100644
index 00000000000..d66c798366f
--- /dev/null
+++ b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/maven-metadata-local.xml
@@ -0,0 +1,12 @@
+
+
+ petstore
+ schema
+
+ 1
+
+ 1
+
+ 20210724220722
+
+
diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/default/pom.xml b/modules/openapi-generator-maven-plugin/src/test/resources/default/pom.xml
index a2b3a7b26f6..67a74ce3745 100644
--- a/modules/openapi-generator-maven-plugin/src/test/resources/default/pom.xml
+++ b/modules/openapi-generator-maven-plugin/src/test/resources/default/pom.xml
@@ -1,5 +1,5 @@
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-xml
- ${jackson-version}
-
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-xml
+ ${jackson-version}
+
{{/withXml}}
{{#joda}}
-
- com.fasterxml.jackson.datatype
- jackson-datatype-joda
- ${jackson-version}
-
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+ ${jackson-version}
+
{{/joda}}
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
- ${jackson-version}
-
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ ${jackson-version}
+
{{#useBeanValidation}}
-
-
- jakarta.validation
- jakarta.validation-api
- ${beanvalidation-version}
- provided
-
+
+
+ jakarta.validation
+ jakarta.validation-api
+ ${beanvalidation-version}
+ provided
+
{{/useBeanValidation}}
{{#performBeanValidation}}
-
-
- org.hibernate
- hibernate-validator
- 5.4.3.Final
-
+
+
+ org.hibernate
+ hibernate-validator
+ 5.4.3.Final
+
{{/performBeanValidation}}
{{#parcelableModel}}
-
-
- com.google.android
- android
- 4.1.1.4
- provided
-
+
+
+ com.google.android
+ android
+ 4.1.1.4
+ provided
+
{{/parcelableModel}}
{{#openApiNullable}}
@@ -337,8 +336,8 @@
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter-api${junit-version}test
@@ -366,6 +365,6 @@
{{#useBeanValidation}}
3.0.2
{{/useBeanValidation}}
- 4.13.2
+ 5.10.2
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache
index dbd86f35b4e..af05d6595fb 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache
@@ -14,6 +14,11 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+{{#useBeanValidation}}
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+{{/useBeanValidation}}
import feign.*;
{{>generatedAnnotation}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache
index de27c161011..1db841158dc 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache
@@ -13,6 +13,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+{{#useBeanValidation}}
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+{{/useBeanValidation}}
/**
* API tests for {{classname}}
*/
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/model.mustache
index 108748f607e..5fa9bca806e 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/model.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/model.mustache
@@ -59,8 +59,8 @@ import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
-import {{javaxPackage}}.validation.constraints.*;
-import {{javaxPackage}}.validation.Valid;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache
index 6450f5a2718..a1d8ecc3ae5 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache
@@ -336,6 +336,15 @@
${jakarta-annotation-version}provided
+ {{#useBeanValidation}}
+
+
+ jakarta.validation
+ jakarta.validation-api
+ ${beanvalidation-version}
+ provided
+
+ {{/useBeanValidation}}
@@ -398,6 +407,9 @@
{{^useJakartaEe}}
1.3.5
{{/useJakartaEe}}
+ {{#useBeanValidation}}
+ 3.0.2
+ {{/useBeanValidation}}
5.10.01.0.08.3.3
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache
index f4bac8ac543..bfb939f9552 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache
@@ -4,8 +4,8 @@ package {{package}};
{{#imports}}import {{import}};
{{/imports}}
-import org.junit.Test;
-import org.junit.Ignore;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.time.LocalDate;
@@ -18,12 +18,12 @@ import java.util.Map;
/**
* API tests for {{classname}}
*/
-@Ignore
public class {{classname}}Test {
private final {{classname}} api = new {{classname}}();
- {{#operations}}{{#operation}}
+ {{#operations}}
+ {{#operation}}
/**
* {{summary}}
*
@@ -37,9 +37,12 @@ public class {{classname}}Test {
{{#allParams}}
{{{dataType}}} {{paramName}} = null;
{{/allParams}}
- {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
+ // uncomment below to test the API function
+ //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
// TODO: test validations
}
- {{/operation}}{{/operations}}
+
+ {{/operation}}
+ {{/operations}}
}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache
index 8444791d7d4..0bbe3ae5143 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache
@@ -63,7 +63,7 @@
org.apache.maven.pluginsmaven-surefire-plugin
- 2.12
+ 2.22.2
@@ -73,7 +73,6 @@
-Xms512m -Xmx1500mmethods
- pertest
@@ -295,8 +294,8 @@
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter-api${junit-version}test
@@ -326,6 +325,6 @@
1.3.5
{{/useJakartaEe}}
1.0.0
- 4.13.2
+ 5.10.2
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache
index a9ba62f69eb..dd91399c573 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache
@@ -12,8 +12,8 @@ import {{javaxPackage}}.ws.rs.core.GenericType;
{{/imports}}
{{#useBeanValidation}}
-import {{javaxPackage}}.validation.constraints.*;
-import {{javaxPackage}}.validation.Valid;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
{{/useBeanValidation}}
import java.util.ArrayList;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache
index fc4ecf4d470..7b8214bd48a 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache
@@ -16,6 +16,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+{{#useBeanValidation}}
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+{{/useBeanValidation}}
/**
* API tests for {{classname}}
*/
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache
index 2758278acee..1904ee40ea4 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache
@@ -42,8 +42,8 @@ import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
-import {{javaxPackage}}.validation.constraints.*;
-import {{javaxPackage}}.validation.Valid;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache
index a9ba62f69eb..dd91399c573 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache
@@ -12,8 +12,8 @@ import {{javaxPackage}}.ws.rs.core.GenericType;
{{/imports}}
{{#useBeanValidation}}
-import {{javaxPackage}}.validation.constraints.*;
-import {{javaxPackage}}.validation.Valid;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
{{/useBeanValidation}}
import java.util.ArrayList;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_test.mustache
index fc4ecf4d470..7b8214bd48a 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_test.mustache
@@ -16,6 +16,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+{{#useBeanValidation}}
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+{{/useBeanValidation}}
/**
* API tests for {{classname}}
*/
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model.mustache
index 2758278acee..1904ee40ea4 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model.mustache
@@ -42,8 +42,8 @@ import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
-import {{javaxPackage}}.validation.constraints.*;
-import {{javaxPackage}}.validation.Valid;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache
index 58d2d5f5c18..377dfc2c910 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache
@@ -1,10 +1,19 @@
-# {{appName}} - MicroProfile Rest Client
+# {{appName}} - MicroProfile Rest Client & MicroProfile Server
{{#appDescriptionWithNewLines}}
{{{.}}}
{{/appDescriptionWithNewLines}}
+{{^microprofileServer}}
## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
[MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling
REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes.
+{{/microprofileServer}}
+
+{{#microprofileServer}}
+## Overview
+This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+The generated server contains an interface which acts as the server, you can inject it into the controller class.
+This module is intended to provide additional server features, like accessing an operations response object, when multiple responses where specified.
+{{/microprofileServer}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache
index 91eab8c6e0b..6e25c1f1012 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache
@@ -38,7 +38,9 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
*/
{{/appName}}
-@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}}
+{{^microprofileServer}}
+@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}}{{#configKeyFromClassName}}{{#operations}}(configKey="{{configKey}}"){{/operations}}{{/configKeyFromClassName}}
+{{/microprofileServer}}
@RegisterProvider(ApiExceptionMapper.class)
@Path("{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}{{commonPath}}")
public interface {{classname}} {
@@ -70,7 +72,7 @@ public interface {{classname}} {
@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} })
{{/hasProduces}}
{{^useSingleRequestParameter}}
- {{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException;
+ {{^vendorExtensions.x-java-is-response-void}}{{#microprofileServer}}{{> server_operation}}{{/microprofileServer}}{{^microprofileServer}}{{> client_operation}}{{/microprofileServer}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException;
{{/useSingleRequestParameter}}
{{#useSingleRequestParameter}}
{{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#hasNonBodyParams}}@BeanParam {{operationIdCamelCase}}Request request{{/hasNonBodyParams}}{{#bodyParams}}{{#hasNonBodyParams}}, {{/hasNonBodyParams}}{{>bodyParams}}{{/bodyParams}}) throws ApiException, ProcessingException;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache
index a6567c3eba0..d9af87719b4 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache
@@ -4,9 +4,13 @@ package {{package}};
{{#imports}}import {{import}};
{{/imports}}
-import org.junit.Test;
-import org.junit.Before;
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Assertions;
+{{#generateSpringBootApplication}}
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+{{/generateSpringBootApplication}}
import org.eclipse.microprofile.rest.client.RestClientBuilder;
@@ -26,7 +30,7 @@ import java.util.Set;
* API tests for {{classname}}
*/
{{#generateSpringBootApplication}}
-@RunWith(SpringJUnit4ClassRunner.class)
+@ExtendWith(SpringExtension.class)
@SpringApplicationConfiguration(classes = SpringBootApplication.class)
@WebAppConfiguration
@IntegrationTest("server.port=0")
@@ -36,7 +40,7 @@ public class {{classname}}Test {
private {{classname}} client;
private String baseUrl = "http://localhost:9080";
- @Before
+ @BeforeEach
public void setup() throws MalformedURLException {
{{#microprofile3}}
// TODO initialize the client
@@ -69,7 +73,7 @@ public class {{classname}}Test {
{{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}}
{{/allParams}}
//{{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}} response = {{/vendorExtensions.x-java-is-response-void}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
- //{{#returnType}}assertNotNull(response);{{/returnType}}
+ //{{#returnType}}Assertions.assertNotNull(response);{{/returnType}}
}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/client_operation.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/client_operation.mustache
new file mode 100644
index 00000000000..403918ddc70
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/client_operation.mustache
@@ -0,0 +1 @@
+{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/kumuluzee.pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/kumuluzee.pom.mustache
index ac235b7edf5..195aa9d4454 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/kumuluzee.pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/kumuluzee.pom.mustache
@@ -18,7 +18,7 @@
1.2.31.4.13.2.6
- 4.13
+ 5.10.22.28
@@ -70,8 +70,8 @@
${cxf-rt-rs-extension-providers.version}
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter-api${junit-version}test
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache
index 5b0f260635d..870bf32c1ca 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache
@@ -62,7 +62,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
{{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}}
public {{classname}}(
{{#readOnlyVars}}
- {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nillable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}{{#required}}, required = true{{/required}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}
+ {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nillable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(value = JSON_PROPERTY_{{nameInSnakeCase}}{{#required}}, required = true{{/required}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}
{{/readOnlyVars}}
) {
{{#readOnlyVars}}
@@ -170,4 +170,4 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
}
return o.toString().replace("\n", "\n ");
}
-}
\ No newline at end of file
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache
index c91673c896c..47aa6b9e234 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache
@@ -58,9 +58,9 @@
-
- junit
- junit
+
+ org.junit.jupiter
+ junit-jupiter-api${junit.version}test
@@ -212,7 +212,7 @@
${java.version}1.5.189.2.9.v20150224
- 4.13.2
+ 5.10.21.4.14
{{#useBeanValidation}}
3.0.2
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache
index 038b0e28a23..3cda34fa7ec 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache
@@ -58,9 +58,9 @@
-
- junit
- junit
+
+ org.junit.jupiter
+ junit-jupiter-api${junit.version}test
@@ -205,7 +205,7 @@
${java.version}1.5.189.2.9.v20150224
- 4.13.2
+ 5.10.21.4.14
{{#useBeanValidation}}
3.0.1
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/server_operation.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/server_operation.mustache
new file mode 100644
index 00000000000..d6fa9054d4d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/server_operation.mustache
@@ -0,0 +1 @@
+{{#vendorExtensions.x-multiple-2xx-response-operation}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}Response{{/microprofileMutiny}}{{/vendorExtensions.x-multiple-2xx-response-operation}}{{^vendorExtensions.x-multiple-2xx-response-operation}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-multiple-2xx-response-operation}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache
index 7255bd4cf5f..a80dcbac8d6 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache
@@ -14,8 +14,9 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
{{#useBeanValidation}}
-import {{javaxPackage}}.validation.constraints.*;
-import {{javaxPackage}}.validation.Valid;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
{{/useBeanValidation}}
{{#hasFormParamsInSpec}}
import org.apache.http.HttpEntity;
@@ -371,7 +372,10 @@ public class {{classname}} {
}
{{/isArray}}
{{^isArray}}
- localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}"));
+ String queryString = {{paramName}}.toUrlQueryString("{{baseName}}");
+ if (!queryString.isBlank()) {
+ localVarQueryStringJoiner.add(queryString);
+ }
{{/isArray}}
}
{{/isDeepObject}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_test.mustache
index dc56ce78474..497bd5308d4 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_test.mustache
@@ -5,8 +5,8 @@ package {{package}};
import {{invokerPackage}}.ApiException;
{{#imports}}import {{import}};
{{/imports}}
-import org.junit.Test;
-import org.junit.Ignore;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.HashMap;
@@ -18,10 +18,15 @@ import java.util.Set;
import java.util.concurrent.CompletableFuture;
{{/asyncNative}}
+{{#useBeanValidation}}
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+{{/useBeanValidation}}
/**
* API tests for {{classname}}
*/
-@Ignore
+@Disabled
public class {{classname}}Test {
private final {{classname}} api = new {{classname}}();
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache
index f0a051ee90c..b706f454f4a 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache
@@ -74,7 +74,7 @@ ext {
{{/swagger2AnnotationLibrary}}
jackson_version = "2.14.1"
jakarta_annotation_version = "1.3.5"
- junit_version = "4.13.2"
+ junit_version = "5.10.2"
{{#hasFormParamsInSpec}}
httpmime_version = "4.5.13"
{{/hasFormParamsInSpec}}
@@ -97,7 +97,7 @@ dependencies {
{{#hasFormParamsInSpec}}
implementation "org.apache.httpcomponents:httpmime:$httpmime_version"
{{/hasFormParamsInSpec}}
- testImplementation "junit:junit:$junit_version"
+ testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
}
// Use spotless plugin to automatically format code, remove unused import, etc
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache
index b3beca8d327..cd2a85a2226 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache
@@ -47,8 +47,8 @@ import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
-import {{javaxPackage}}.validation.constraints.*;
-import {{javaxPackage}}.validation.Valid;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache
index c440057eb76..15bd2f96d24 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache
@@ -593,4 +593,8 @@ static {
JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings);
}
{{/discriminator}}
+{{#generateBuilders}}
+
+ {{>javaBuilder}}
+{{/generateBuilders}}
}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache
index a8be8d1ed99..4f8cebb65a7 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache
@@ -64,7 +64,7 @@
maven-surefire-plugin
- 3.0.0-M7
+ 3.2.5conf/log4j.properties
@@ -255,6 +255,15 @@
${jakarta-annotation-version}provided
+ {{#useBeanValidation}}
+
+
+ jakarta.validation
+ jakarta.validation-api
+ ${beanvalidation-version}
+ provided
+
+ {{/useBeanValidation}}
{{#hasFormParamsInSpec}}
org.apache.httpcomponents
@@ -265,8 +274,8 @@
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter-api${junit-version}test
@@ -290,10 +299,13 @@
{{^useJakartaEe}}
1.3.5
{{/useJakartaEe}}
+ {{#useBeanValidation}}
+ 3.0.2
+ {{/useBeanValidation}}
{{#hasFormParamsInSpec}}
4.5.14
{{/hasFormParamsInSpec}}
- 4.13.2
+ 5.10.22.27.2
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/anyof_model.mustache
index 33d93192d4c..18447fc12d0 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/anyof_model.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/anyof_model.mustache
@@ -54,8 +54,8 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
{{/isArray}}
{{#isArray}}
- final Type typeInstance = new TypeToken<{{{dataType}}}>(){}.getType();
- final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance));
+ final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType();
+ final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}));
{{/isArray}}
{{/anyOf}}
{{/composedSchemas}}
@@ -210,13 +210,11 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
}
- {{#anyOf}}
- public {{classname}}({{{.}}} o) {
+ public {{classname}}(Object o) {
super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
setActualInstance(o);
}
- {{/anyOf}}
static {
{{#composedSchemas}}
{{#anyOf}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache
index fe08469b577..8549641079c 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache
@@ -26,8 +26,8 @@ import io.swagger.v3.oas.models.parameters.Parameter;
import java.io.IOException;
{{#useBeanValidation}}
-import {{javaxPackage}}.validation.constraints.*;
-import {{javaxPackage}}.validation.Valid;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import {{javaxPackage}}.validation.ConstraintViolation;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache
index bf1ac11aa48..29f682678b5 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache
@@ -16,6 +16,11 @@ import java.util.Map;
import java.io.InputStream;
{{/supportStreaming}}
+{{#useBeanValidation}}
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+{{/useBeanValidation}}
/**
* API tests for {{classname}}
*/
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache
index 71dbcc85300..859d322d08e 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache
@@ -135,9 +135,9 @@ dependencies {
implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.30'
{{/dynamicOperations}}
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
- testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'
+ testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
testImplementation 'org.mockito:mockito-core:3.12.4'
- testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
+ testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
}
javadoc {
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache
index 05ec20bff2c..68d9e7fc8ef 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache
@@ -35,7 +35,7 @@ lazy val root = (project in file(".")).
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
"com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
- "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test",
+ "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test",
"org.mockito" % "mockito-core" % "3.12.4" % "test"
)
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/model.mustache
index 3a1cca8d7d4..c82b0fbe2ac 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/model.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/model.mustache
@@ -21,8 +21,8 @@ import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
-import {{javaxPackage}}.validation.constraints.*;
-import {{javaxPackage}}.validation.Valid;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache
index 4a34934dce7..31c63263e1c 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache
@@ -48,15 +48,21 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
{{#composedSchemas}}
{{#oneOf}}
{{^isArray}}
+ {{^isMap}}
{{^vendorExtensions.x-duplicated-data-type}}
final TypeAdapter<{{{dataType}}}> adapter{{{dataType}}} = gson.getDelegateAdapter(this, TypeToken.get({{{dataType}}}.class));
{{/vendorExtensions.x-duplicated-data-type}}
+ {{/isMap}}
{{/isArray}}
{{#isArray}}
- final Type typeInstance = new TypeToken<{{{dataType}}}>(){}.getType();
- final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance));
+ final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType();
+ final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}));
{{/isArray}}
+ {{#isMap}}
+ final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType();
+ final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}));
+ {{/isMap}}
{{/oneOf}}
{{/composedSchemas}}
@@ -72,11 +78,18 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
{{#oneOf}}
{{^vendorExtensions.x-duplicated-data-type}}
// check if the actual instance is of the type `{{{dataType}}}`
- if (value.getActualInstance() instanceof {{#isArray}}List>{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) {
+ if (value.getActualInstance() instanceof {{#isArray}}List>{{/isArray}}{{#isMap}}Map, ?>{{/isMap}}{{^isMap}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isMap}}) {
{{#isPrimitiveType}}
+ {{^isMap}}
JsonPrimitive primitive = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonPrimitive();
elementAdapter.write(out, primitive);
return;
+ {{/isMap}}
+ {{#isMap}}
+ JsonObject object = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonObject();
+ elementAdapter.write(out, object);
+ return;
+ {{/isMap}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{#isArray}}
@@ -88,6 +101,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
}
{{/isArray}}
{{/isPrimitiveType}}
+ {{^isMap}}
{{^isArray}}
{{^isPrimitiveType}}
JsonElement element = adapter{{{dataType}}}.toJsonTree(({{{dataType}}})value.getActualInstance());
@@ -95,6 +109,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
return;
{{/isPrimitiveType}}
{{/isArray}}
+ {{/isMap}}
}
{{/vendorExtensions.x-duplicated-data-type}}
{{/oneOf}}
@@ -143,6 +158,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
try {
// validate the JSON object to see if any exception is thrown
{{^isArray}}
+ {{^isMap}}
{{#isNumber}}
if (!jsonElement.getAsJsonPrimitive().isNumber()) {
throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString()));
@@ -163,6 +179,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}};
{{/isPrimitiveType}}
{{/isNumber}}
+ {{/isMap}}
{{/isArray}}
{{#isArray}}
if (!jsonElement.isJsonArray()) {
@@ -194,6 +211,38 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
}
actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}};
{{/isArray}}
+ {{#isMap}}
+ if (!jsonElement.isJsonObject()) {
+ throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString()));
+ }
+
+ {{^isFreeFormObject}}
+ Map map = jsonElement.getAsJsonObject().asMap();
+ // validate map items
+ for(JsonElement element : map.values()) {
+ {{#items}}
+ {{#isNumber}}
+ if (!jsonElement.getAsJsonPrimitive().isNumber()) {
+ throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString()));
+ }
+ {{/isNumber}}
+ {{^isNumber}}
+ {{#isPrimitiveType}}
+ if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) {
+ throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString()));
+ }
+ {{/isPrimitiveType}}
+ {{/isNumber}}
+ {{^isNumber}}
+ {{^isPrimitiveType}}
+ {{{dataType}}}.validateJsonElement(element);
+ {{/isPrimitiveType}}
+ {{/isNumber}}
+ {{/items}}
+ }
+ {{/isFreeFormObject}}
+ actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}};
+ {{/isMap}}
match++;
log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'");
} catch (Exception e) {
@@ -239,13 +288,11 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
}
- {{#oneOf}}
- public {{classname}}({{{.}}} o) {
+ public {{classname}}(Object o) {
super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
setActualInstance(o);
}
- {{/oneOf}}
static {
{{#composedSchemas}}
{{#oneOf}}
@@ -280,7 +327,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
{{#composedSchemas}}
{{#oneOf}}
{{^vendorExtensions.x-duplicated-data-type}}
- if (instance instanceof {{#isArray}}List>{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) {
+ if (instance instanceof {{#isArray}}List>{{/isArray}}{{#isMap}}Map, ?>{{/isMap}}{{^isMap}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isMap}}) {
{{#isArray}}
List> list = (List>) instance;
if (list.get(0) instanceof {{{items.dataType}}}) {
@@ -322,7 +369,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
* @return The actual instance of `{{{dataType}}}`
* @throws ClassCastException if the instance is not `{{{dataType}}}`
*/
- public {{{dataType}}} get{{#isArray}}{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}() throws ClassCastException {
+ public {{{dataType}}} get{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}() throws ClassCastException {
return ({{{dataType}}})super.getActualInstance();
}
{{/vendorExtensions.x-duplicated-data-type}}
@@ -345,6 +392,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
// validate the json string with {{{dataType}}}
try {
{{^hasVars}}
+ {{^isMap}}
{{^isArray}}
{{#isNumber}}
if (!jsonElement.getAsJsonPrimitive().isNumber()) {
@@ -364,6 +412,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
{{/isPrimitiveType}}
{{/isNumber}}
{{/isArray}}
+ {{/isMap}}
{{#isArray}}
if (!jsonElement.isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString()));
@@ -392,6 +441,37 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
{{/items}}
}
{{/isArray}}
+ {{#isMap}}
+ if (!jsonElement.isJsonObject()) {
+ throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString()));
+ }
+
+ {{^isFreeFormObject}}
+ Map map = jsonElement.getAsJsonObject().asMap();
+ // validate map items
+ for(JsonElement element : map.values()) {
+ {{#items}}
+ {{#isNumber}}
+ if (!jsonElement.getAsJsonPrimitive().isNumber()) {
+ throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString()));
+ }
+ {{/isNumber}}
+ {{^isNumber}}
+ {{#isPrimitiveType}}
+ if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) {
+ throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString()));
+ }
+ {{/isPrimitiveType}}
+ {{/isNumber}}
+ {{^isNumber}}
+ {{^isPrimitiveType}}
+ {{{dataType}}}.validateJsonElement(element);
+ {{/isPrimitiveType}}
+ {{/isNumber}}
+ {{/items}}
+ }
+ {{/isFreeFormObject}}
+ {{/isMap}}
{{/hasVars}}
{{#hasVars}}
{{{.}}}.validateJsonElement(jsonElement);
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
index 7d2d6337336..eb30fa5a18b 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
@@ -432,13 +432,13 @@
{{^useJakartaEe}}
1.3.5
{{/useJakartaEe}}
-{{#performBeanValidation}}
+ {{#performBeanValidation}}
3.0.3
-{{/performBeanValidation}}
-{{#useBeanValidation}}
+ {{/performBeanValidation}}
+ {{#useBeanValidation}}
3.0.2
-{{/useBeanValidation}}
- 5.10.0
+ {{/useBeanValidation}}
+ 5.10.21.10.02.1.11.1.1
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache
index 8ccff676f1a..5ae6e5057b0 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache
@@ -33,8 +33,8 @@ import io.swagger.v3.oas.annotations.security.*;
{{/swagger2AnnotationLibrary}}
{{#useBeanValidation}}
-import {{javaxPackage}}.validation.constraints.*;
-import {{javaxPackage}}.validation.Valid;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
{{/useBeanValidation}}
import java.lang.reflect.Type;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache
index aa1c47a2684..d63c511a90c 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache
@@ -18,6 +18,12 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
+{{#useBeanValidation}}
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+{{/useBeanValidation}}
import static io.restassured.config.ObjectMapperConfig.objectMapperConfig;
import static io.restassured.config.RestAssuredConfig.config;
import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jackson}}JacksonObjectMapper.jackson{{/jackson}};
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache
index f618e9b3d3a..a892488a245 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache
@@ -363,9 +363,9 @@
{{^useJakartaEe}}
1.3.5
{{/useJakartaEe}}
-{{#useBeanValidation}}
+ {{#useBeanValidation}}
3.0.2
-{{/useBeanValidation}}
+ {{/useBeanValidation}}
3.6.04.13.2
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache
new file mode 100644
index 00000000000..d6e0baeaee0
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache
@@ -0,0 +1,750 @@
+package {{invokerPackage}};
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import java.util.function.Consumer;
+{{#openApiNullable}}
+import org.openapitools.jackson.nullable.JsonNullableModule;
+{{/openApiNullable}}
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.InvalidMediaTypeException;
+import org.springframework.http.MediaType;
+ import org.springframework.http.converter.HttpMessageConverter;
+ import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+{{#withXml}}
+ import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter;
+{{/withXml}}
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.util.StringUtils;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.util.UriComponentsBuilder;
+import org.springframework.web.client.RestClient;
+import org.springframework.web.client.RestClient.ResponseSpec;
+import java.util.Optional;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TimeZone;
+
+import {{javaxPackage}}.annotation.Nullable;
+
+{{#jsr310}}
+import java.time.OffsetDateTime;
+{{/jsr310}}
+
+import {{invokerPackage}}.auth.Authentication;
+import {{invokerPackage}}.auth.HttpBasicAuth;
+import {{invokerPackage}}.auth.HttpBearerAuth;
+import {{invokerPackage}}.auth.ApiKeyAuth;
+{{#hasOAuthMethods}}
+import {{invokerPackage}}.auth.OAuth;
+{{/hasOAuthMethods}}
+
+{{>generatedAnnotation}}
+public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
+ public enum CollectionFormat {
+ CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
+
+ private final String separator;
+ CollectionFormat(String separator) {
+ this.separator = separator;
+ }
+
+ private String collectionToString(Collection> collection) {
+ return StringUtils.collectionToDelimitedString(collection, separator);
+ }
+ }
+
+ private final HttpHeaders defaultHeaders = new HttpHeaders();
+ private final MultiValueMap defaultCookies = new LinkedMultiValueMap<>();
+
+ private String basePath = "{{basePath}}";
+
+ private final RestClient restClient;
+ private final DateFormat dateFormat;
+ private final ObjectMapper objectMapper;
+
+ private Map authentications;
+
+
+ public ApiClient() {
+ this.dateFormat = createDefaultDateFormat();
+ this.objectMapper = createDefaultObjectMapper(this.dateFormat);
+ this.restClient = buildRestClient(this.objectMapper);
+ this.init();
+ }
+
+ public ApiClient(RestClient restClient) {
+ this(Optional.ofNullable(restClient).orElseGet(ApiClient::buildRestClient), createDefaultDateFormat());
+ }
+
+ public ApiClient(ObjectMapper mapper, DateFormat format) {
+ this(buildRestClient(mapper.copy()), format);
+ }
+
+ public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) {
+ this(Optional.ofNullable(restClient).orElseGet(() -> buildRestClient(mapper.copy())), format);
+ }
+
+ private ApiClient(RestClient restClient, DateFormat format) {
+ this.restClient = restClient;
+ this.dateFormat = format;
+ this.objectMapper = createDefaultObjectMapper(format);
+ this.init();
+ }
+
+ public static DateFormat createDefaultDateFormat() {
+ DateFormat dateFormat = new RFC3339DateFormat();
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+ return dateFormat;
+ }
+
+ public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) {
+ if (null == dateFormat) {
+ dateFormat = createDefaultDateFormat();
+ }
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.setDateFormat(dateFormat);
+ mapper.registerModule(new JavaTimeModule());
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ {{#openApiNullable}}
+ JsonNullableModule jnm = new JsonNullableModule();
+ mapper.registerModule(jnm);
+ {{/openApiNullable}}
+ return mapper;
+ }
+
+ protected void init() {
+ // Setup authentications (key: authentication name, value: authentication).
+ authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}}
+ authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}}
+ authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}}
+ authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}}
+ authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+ }
+
+ /**
+ * Build the RestClientBuilder used to make RestClient.
+ * @param mapper ObjectMapper used for serialize/deserialize
+ * @return RestClient
+ */
+ public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) {
+ {{#withXml}}
+ XmlMapper xmlMapper = new XmlMapper();
+ xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true);
+ {{#openApiNullable}}
+ xmlMapper.registerModule(new JsonNullableModule());
+ {{/openApiNullable}}
+
+ {{/withXml}}
+ Consumer>> messageConverters = converters -> {
+ converters.add(new MappingJackson2HttpMessageConverter(mapper));
+ {{#withXml}}
+ converters.add(new MappingJackson2XmlHttpMessageConverter(xmlMapper));
+ {{/withXml}}
+ };
+
+ return RestClient.builder().messageConverters(messageConverters);
+ }
+
+ /**
+ * Build the RestClientBuilder used to make RestClient.
+ * @return RestClient
+ */
+ public static RestClient.Builder buildRestClientBuilder() {
+ return buildRestClientBuilder(createDefaultObjectMapper(null));
+ }
+
+ /**
+ * Build the RestClient used to make HTTP requests.
+ * @param mapper ObjectMapper used for serialize/deserialize
+ * @return RestClient
+ */
+ public static RestClient buildRestClient(ObjectMapper mapper) {
+ return buildRestClientBuilder(mapper).build();
+ }
+
+ /**
+ * Build the RestClient used to make HTTP requests.
+ * @return RestClient
+ */
+ public static RestClient buildRestClient() {
+ return buildRestClientBuilder(createDefaultObjectMapper(null)).build();
+ }
+
+ /**
+ * Get the current base path
+ * @return String the base path
+ */
+ public String getBasePath() {
+ return basePath;
+ }
+
+ /**
+ * Set the base path, which should include the host
+ * @param basePath the base path
+ * @return ApiClient this client
+ */
+ public ApiClient setBasePath(String basePath) {
+ this.basePath = basePath;
+ return this;
+ }
+
+ /**
+ * Get authentications (key: authentication name, value: authentication).
+ * @return Map the currently configured authentication types
+ */
+ public Map getAuthentications() {
+ return authentications;
+ }
+
+ /**
+ * Get authentication for the given name.
+ *
+ * @param authName The authentication name
+ * @return The authentication, null if not found
+ */
+ public Authentication getAuthentication(String authName) {
+ return authentications.get(authName);
+ }
+
+ /**
+ * Helper method to set access token for the first Bearer authentication.
+ * @param bearerToken Bearer token
+ */
+ public void setBearerToken(String bearerToken) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBearerAuth) {
+ ((HttpBearerAuth) auth).setBearerToken(bearerToken);
+ return;
+ }
+ }
+ throw new RuntimeException("No Bearer authentication configured!");
+ }
+
+ /**
+ * Helper method to set username for the first HTTP basic authentication.
+ * @param username the username
+ */
+ public void setUsername(String username) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setUsername(username);
+ return;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set password for the first HTTP basic authentication.
+ * @param password the password
+ */
+ public void setPassword(String password) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setPassword(password);
+ return;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key value for the first API key authentication.
+ * @param apiKey the API key
+ */
+ public void setApiKey(String apiKey) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKey(apiKey);
+ return;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key prefix for the first API key authentication.
+ * @param apiKeyPrefix the API key prefix
+ */
+ public void setApiKeyPrefix(String apiKeyPrefix) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
+ return;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ {{#hasOAuthMethods}}
+ /**
+ * Helper method to set access token for the first OAuth2 authentication.
+ * @param accessToken the access token
+ */
+ public void setAccessToken(String accessToken) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setAccessToken(accessToken);
+ return;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ {{/hasOAuthMethods}}
+ /**
+ * Set the User-Agent header's value (by adding to the default header map).
+ * @param userAgent the user agent string
+ * @return ApiClient this client
+ */
+ public ApiClient setUserAgent(String userAgent) {
+ addDefaultHeader("User-Agent", userAgent);
+ return this;
+ }
+
+ /**
+ * Add a default header.
+ *
+ * @param name The header's name
+ * @param value The header's value
+ * @return ApiClient this client
+ */
+ public ApiClient addDefaultHeader(String name, String value) {
+ if (defaultHeaders.containsKey(name)) {
+ defaultHeaders.remove(name);
+ }
+ defaultHeaders.add(name, value);
+ return this;
+ }
+
+ /**
+ * Add a default cookie.
+ *
+ * @param name The cookie's name
+ * @param value The cookie's value
+ * @return ApiClient this client
+ */
+ public ApiClient addDefaultCookie(String name, String value) {
+ if (defaultCookies.containsKey(name)) {
+ defaultCookies.remove(name);
+ }
+ defaultCookies.add(name, value);
+ return this;
+ }
+
+ /**
+ * Get the date format used to parse/format date parameters.
+ * @return DateFormat format
+ */
+ public DateFormat getDateFormat() {
+ return dateFormat;
+ }
+
+ /**
+ * Parse the given string into Date object.
+ */
+ public Date parseDate(String str) {
+ try {
+ return dateFormat.parse(str);
+ } catch (ParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Format the given Date object into string.
+ */
+ public String formatDate(Date date) {
+ return dateFormat.format(date);
+ }
+
+ /**
+ * Get the ObjectMapper used to make HTTP requests.
+ * @return ObjectMapper objectMapper
+ */
+ public ObjectMapper getObjectMapper() {
+ return objectMapper;
+ }
+
+ /**
+ * Get the RestClient used to make HTTP requests.
+ * @return RestClient restClient
+ */
+ public RestClient getRestClient() {
+ return restClient;
+ }
+
+ /**
+ * Format the given parameter object into string.
+ * @param param the object to convert
+ * @return String the parameter represented as a String
+ */
+ public String parameterToString(Object param) {
+ if (param == null) {
+ return "";
+ } else if (param instanceof Date) {
+ return formatDate( (Date) param);
+ } {{#jsr310}}else if (param instanceof OffsetDateTime) {
+ return formatOffsetDateTime((OffsetDateTime) param);
+ } {{/jsr310}}else if (param instanceof Collection) {
+ StringBuilder b = new StringBuilder();
+ for(Object o : (Collection>) param) {
+ if(b.length() > 0) {
+ b.append(",");
+ }
+ b.append(String.valueOf(o));
+ }
+ return b.toString();
+ } else {
+ return String.valueOf(param);
+ }
+ }
+
+ /**
+ * Converts a parameter to a {@link MultiValueMap} for use in REST requests
+ * @param collectionFormat The format to convert to
+ * @param name The name of the parameter
+ * @param value The parameter's value
+ * @return a Map containing the String value(s) of the input parameter
+ */
+ public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) {
+ final MultiValueMap params = new LinkedMultiValueMap<>();
+
+ if (name == null || name.isEmpty() || value == null) {
+ return params;
+ }
+
+ if(collectionFormat == null) {
+ collectionFormat = CollectionFormat.CSV;
+ }
+
+ if (value instanceof Map) {
+ @SuppressWarnings("unchecked")
+ final Map valuesMap = (Map) value;
+ for (final Entry entry : valuesMap.entrySet()) {
+ params.add(entry.getKey(), parameterToString(entry.getValue()));
+ }
+ return params;
+ }
+
+ Collection> valueCollection = null;
+ if (value instanceof Collection) {
+ valueCollection = (Collection>) value;
+ } else {
+ params.add(name, parameterToString(value));
+ return params;
+ }
+
+ if (valueCollection.isEmpty()){
+ return params;
+ }
+
+ if (collectionFormat.equals(CollectionFormat.MULTI)) {
+ for (Object item : valueCollection) {
+ params.add(name, parameterToString(item));
+ }
+ return params;
+ }
+
+ List values = new ArrayList<>();
+ for(Object o : valueCollection) {
+ values.add(parameterToString(o));
+ }
+ params.add(name, collectionFormat.collectionToString(values));
+
+ return params;
+ }
+
+ /**
+ * Check if the given {@code String} is a JSON MIME.
+ * @param mediaType the input MediaType
+ * @return boolean true if the MediaType represents JSON, false otherwise
+ */
+ public boolean isJsonMime(String mediaType) {
+ // "* / *" is default to JSON
+ if ("*/*".equals(mediaType)) {
+ return true;
+ }
+
+ try {
+ return isJsonMime(MediaType.parseMediaType(mediaType));
+ } catch (InvalidMediaTypeException e) {
+ }
+ return false;
+ }
+
+ /**
+ * Check if the given MIME is a JSON MIME.
+ * JSON MIME examples:
+ * application/json
+ * application/json; charset=UTF8
+ * APPLICATION/JSON
+ * @param mediaType the input MediaType
+ * @return boolean true if the MediaType represents JSON, false otherwise
+ */
+ public boolean isJsonMime(MediaType mediaType) {
+ return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$"));
+ }
+
+ /**
+ * Check if the given {@code String} is a Problem JSON MIME (RFC-7807).
+ * @param mediaType the input MediaType
+ * @return boolean true if the MediaType represents Problem JSON, false otherwise
+ */
+ public boolean isProblemJsonMime(String mediaType) {
+ return "application/problem+json".equalsIgnoreCase(mediaType);
+ }
+
+ /**
+ * Select the Accept header's value from the given accepts array:
+ * if JSON exists in the given array, use it;
+ * otherwise use all of them (joining into a string)
+ *
+ * @param accepts The accepts array to select from
+ * @return List The list of MediaTypes to use for the Accept header
+ */
+ public List selectHeaderAccept(String[] accepts) {
+ if (accepts.length == 0) {
+ return null;
+ }
+ for (String accept : accepts) {
+ MediaType mediaType = MediaType.parseMediaType(accept);
+ if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) {
+ return Collections.singletonList(mediaType);
+ }
+ }
+ return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts));
+ }
+
+ /**
+ * Select the Content-Type header's value from the given array:
+ * if JSON exists in the given array, use it;
+ * otherwise use the first one of the array.
+ *
+ * @param contentTypes The Content-Type array to select from
+ * @return MediaType The Content-Type header to use. If the given array is empty, null will be returned.
+ */
+ public MediaType selectHeaderContentType(String[] contentTypes) {
+ if (contentTypes.length == 0) {
+ return null;
+ }
+ for (String contentType : contentTypes) {
+ MediaType mediaType = MediaType.parseMediaType(contentType);
+ if (isJsonMime(mediaType)) {
+ return mediaType;
+ }
+ }
+ return MediaType.parseMediaType(contentTypes[0]);
+ }
+
+ /**
+ * Select the body to use for the request
+ *
+ * @param obj the body object
+ * @param formParams the form parameters
+ * @param contentType the content type of the request
+ * @return Object the selected body
+ */
+ protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) {
+ boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType);
+ return isForm ? formParams : obj;
+ }
+
+ /**
+ * Invoke API by sending HTTP request with the given options.
+ *
+ * @param the return type to use
+ * @param path The sub-path of the HTTP URL
+ * @param method The request method
+ * @param pathParams The path parameters
+ * @param queryParams The query parameters
+ * @param body The request body object
+ * @param headerParams The header parameters
+ * @param formParams The form parameters
+ * @param accept The request's Accept header
+ * @param contentType The request's Content-Type header
+ * @param authNames The authentications to apply
+ * @param returnType The return type into which to deserialize the response
+ * @return The response body in chosen type
+ */
+ public ResponseSpec invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException {
+ final RestClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames);
+ return requestBuilder.retrieve();
+ }
+
+ /**
+ * Include queryParams in uriParams taking into account the paramName
+ * @param queryParams The query parameters
+ * @param uriParams The path parameters
+ * return templatized query string
+ */
+ private String generateQueryUri(MultiValueMap queryParams, Map uriParams) {
+ StringBuilder queryBuilder = new StringBuilder();
+ queryParams.forEach((name, values) -> {
+ if (CollectionUtils.isEmpty(values)) {
+ if (queryBuilder.length() != 0) {
+ queryBuilder.append('&');
+ }
+ queryBuilder.append(name);
+ } else {
+ int valueItemCounter = 0;
+ for (Object value : values) {
+ if (queryBuilder.length() != 0) {
+ queryBuilder.append('&');
+ }
+ queryBuilder.append(name);
+ if (value != null) {
+ String templatizedKey = name + valueItemCounter++;
+ uriParams.put(templatizedKey, value.toString());
+ queryBuilder.append('=').append("{").append(templatizedKey).append("}");
+ }
+ }
+ }
+ });
+ return queryBuilder.toString();
+ }
+
+ private RestClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams,
+ MultiValueMap queryParams, Object body, HttpHeaders headerParams,
+ MultiValueMap cookieParams, MultiValueMap formParams, List accept,
+ MediaType contentType, String[] authNames) {
+ updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
+
+ final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
+
+ String finalUri = builder.build(false).toUriString();
+ Map uriParams = new HashMap<>();
+ uriParams.putAll(pathParams);
+
+ if (queryParams != null && !queryParams.isEmpty()) {
+ //Include queryParams in uriParams taking into account the paramName
+ String queryUri = generateQueryUri(queryParams, uriParams);
+ //Append to finalUri the templatized query string like "?param1={param1Value}&.......
+ finalUri += "?" + queryUri;
+ }
+
+ final RestClient.RequestBodySpec requestBuilder = restClient.method(method).uri(finalUri, uriParams);
+
+ if (accept != null) {
+ requestBuilder.accept(accept.toArray(new MediaType[accept.size()]));
+ }
+ if(contentType != null) {
+ requestBuilder.contentType(contentType);
+ }
+
+ addHeadersToRequest(headerParams, requestBuilder);
+ addHeadersToRequest(defaultHeaders, requestBuilder);
+ addCookiesToRequest(cookieParams, requestBuilder);
+ addCookiesToRequest(defaultCookies, requestBuilder);
+
+ var selectedBody = selectBody(body, formParams, contentType);
+ if (selectedBody != null) {
+ requestBuilder.body(selectedBody);
+ }
+
+ return requestBuilder;
+ }
+
+ /**
+ * Add headers to the request that is being built
+ * @param headers The headers to add
+ * @param requestBuilder The current request
+ */
+ protected void addHeadersToRequest(HttpHeaders headers, RestClient.RequestBodySpec requestBuilder) {
+ for (Entry> entry : headers.entrySet()) {
+ List values = entry.getValue();
+ for(String value : values) {
+ if (value != null) {
+ requestBuilder.header(entry.getKey(), value);
+ }
+ }
+ }
+ }
+
+ /**
+ * Add cookies to the request that is being built
+ *
+ * @param cookies The cookies to add
+ * @param requestBuilder The current request
+ */
+ protected void addCookiesToRequest(MultiValueMap cookies, RestClient.RequestBodySpec requestBuilder) {
+ if (!cookies.isEmpty()) {
+ requestBuilder.header("Cookie", buildCookieHeader(cookies));
+ }
+ }
+
+ /**
+ * Build cookie header. Keeps a single value per cookie (as per
+ * RFC6265 section 5.3).
+ *
+ * @param cookies map all cookies
+ * @return header string for cookies.
+ */
+ private String buildCookieHeader(MultiValueMap cookies) {
+ final StringBuilder cookieValue = new StringBuilder();
+ String delimiter = "";
+ for (final Map.Entry> entry : cookies.entrySet()) {
+ final String value = entry.getValue().get(entry.getValue().size() - 1);
+ cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value));
+ delimiter = "; ";
+ }
+ return cookieValue.toString();
+ }
+
+ /**
+ * Update query and header parameters based on authentication settings.
+ *
+ * @param authNames The authentications to apply
+ * @param queryParams The query parameters
+ * @param headerParams The header parameters
+ * @param cookieParams the cookie parameters
+ */
+ protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) {
+ for (String authName : authNames) {
+ Authentication auth = authentications.get(authName);
+ if (auth == null) {
+ throw new RestClientException("Authentication undefined: " + authName);
+ }
+ auth.applyToParams(queryParams, headerParams, cookieParams);
+ }
+ }
+
+ /**
+ * Formats the specified collection path parameter to a string value.
+ *
+ * @param collectionFormat The collection format of the parameter.
+ * @param values The values of the parameter.
+ * @return String representation of the parameter
+ */
+ public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection> values) {
+ // create the value based on the collection format
+ if (CollectionFormat.MULTI.equals(collectionFormat)) {
+ // not valid for path params
+ return parameterToString(values);
+ }
+
+ // collectionFormat is assumed to be "csv" by default
+ if(collectionFormat == null) {
+ collectionFormat = CollectionFormat.CSV;
+ }
+
+ return collectionFormat.collectionToString(values);
+ }
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache
new file mode 100644
index 00000000000..247b48b0e19
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache
@@ -0,0 +1,248 @@
+# {{artifactId}}
+
+{{appName}}
+
+- API version: {{appVersion}}
+{{^hideGenerationTimestamp}}
+
+- Build date: {{generatedDate}}
+{{/hideGenerationTimestamp}}
+
+- Generator version: {{generatorVersion}}
+
+{{{appDescriptionWithNewLines}}}
+
+{{#infoUrl}}
+ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
+{{/infoUrl}}
+
+*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
+
+## Requirements
+
+Building the API client library requires:
+
+1. Java 17+
+{{#jersey2}}
+2. Maven (3.8.3+)/Gradle (7.2+)
+{{/jersey2}}
+{{^jersey2}}
+2. Maven/Gradle
+{{/jersey2}}
+
+## Installation
+
+To install the API client library to your local Maven repository, simply execute:
+
+```shell
+mvn clean install
+```
+
+To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
+
+```shell
+mvn clean deploy
+```
+
+Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
+
+### Maven users
+
+Add this dependency to your project's POM:
+
+```xml
+
+ {{{groupId}}}
+ {{{artifactId}}}
+ {{{artifactVersion}}}
+ compile
+
+```
+
+### Gradle users
+
+Add this dependency to your project's build file:
+
+```groovy
+ repositories {
+ mavenCentral() // Needed if the '{{{artifactId}}}' jar has been published to maven central.
+ mavenLocal() // Needed if the '{{{artifactId}}}' jar has been published to the local maven repo.
+ }
+
+ dependencies {
+ implementation "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}"
+ }
+```
+
+### Others
+
+At first generate the JAR by executing:
+
+```shell
+mvn clean package
+```
+
+Then manually install the following JARs:
+
+- `target/{{{artifactId}}}-{{{artifactVersion}}}.jar`
+- `target/lib/*.jar`
+
+{{#jersey2}}
+## Usage
+
+To add a HTTP proxy for the API client, use `ClientConfig`:
+```java
+{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
+import org.glassfish.jersey.apache.connector.ApacheConnectorProvider;
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.ClientProperties;
+import {{{invokerPackage}}}.*;
+import {{{package}}}.{{{classname}}};
+
+...
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+ClientConfig clientConfig = defaultClient.getClientConfig();
+clientConfig.connectorProvider(new ApacheConnectorProvider());
+clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here");
+clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username");
+clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password");
+defaultClient.setClientConfig(clientConfig);
+
+{{{classname}}} apiInstance = new {{{classname}}}(defaultClient);
+{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
+```
+
+{{/jersey2}}
+## Getting Started
+
+Please follow the [installation](#installation) instruction and execute the following Java code:
+
+```java
+{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
+import {{{invokerPackage}}}.*;
+import {{{invokerPackage}}}.auth.*;
+import {{{modelPackage}}}.*;
+import {{{package}}}.{{{classname}}};
+
+public class {{{classname}}}Example {
+
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("{{{basePath}}}");
+ {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}}
+ // Configure HTTP basic authorization: {{{name}}}
+ HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}");
+ {{{name}}}.setUsername("YOUR USERNAME");
+ {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}}
+ // Configure HTTP bearer authorization: {{{name}}}
+ HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}");
+ {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}}
+ // Configure API key authorization: {{{name}}}
+ ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}");
+ {{{name}}}.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}}
+ // Configure OAuth2 access token for authorization: {{{name}}}
+ OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}");
+ {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}{{#isHttpSignature}}
+ // Configure HTTP signature authorization: {{{name}}}
+ HttpSignatureAuth {{{name}}} = (HttpSignatureAuth) defaultClient.getAuthentication("{{{name}}}");
+ // All the HTTP signature parameters below should be customized to your environment.
+ // Configure the keyId
+ {{{name}}}.setKeyId("YOUR KEY ID");
+ // Configure the signature algorithm
+ {{{name}}}.setSigningAlgorithm(SigningAlgorithm.HS2019);
+ // Configure the specific cryptographic algorithm
+ {{{name}}}.setAlgorithm(Algorithm.ECDSA_SHA256);
+ // Configure the cryptographic algorithm parameters, if applicable
+ {{{name}}}.setAlgorithmParameterSpec(null);
+ // Set the cryptographic digest algorithm.
+ {{{name}}}.setDigestAlgorithm("SHA-256");
+ // Set the HTTP headers that should be included in the HTTP signature.
+ {{{name}}}.setHeaders(Arrays.asList("date", "host"));
+ // Set the private key used to sign the HTTP messages
+ {{{name}}}.setPrivateKey();{{/isHttpSignature}}
+ {{/authMethods}}
+ {{/hasAuthMethods}}
+
+ {{{classname}}} apiInstance = new {{{classname}}}(defaultClient);
+ {{#allParams}}
+ {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
+ {{/allParams}}
+ try {
+ {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}}
+ System.out.println(result);{{/returnType}}
+ } catch (ApiException e) {
+ System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *{{basePath}}*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}}
+{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
+
+## Documentation for Models
+
+{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md)
+{{/model}}{{/models}}
+
+
+## Documentation for Authorization
+
+{{^authMethods}}Endpoints do not require authorization.{{/authMethods}}
+{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}}
+{{#authMethods}}
+
+### {{name}}
+
+{{#isApiKey}}
+
+- **Type**: API key
+- **API key parameter name**: {{keyParamName}}
+- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
+{{/isApiKey}}
+{{#isBasicBasic}}
+
+- **Type**: HTTP basic authentication
+{{/isBasicBasic}}
+{{#isBasicBearer}}
+
+- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
+{{/isBasicBearer}}
+{{#isHttpSignature}}
+
+- **Type**: HTTP signature authentication
+{{/isHttpSignature}}
+{{#isOAuth}}
+
+- **Type**: OAuth
+- **Flow**: {{flow}}
+- **Authorization URL**: {{authorizationUrl}}
+- **Scopes**: {{^scopes}}N/A{{/scopes}}
+{{#scopes}} - {{scope}}: {{description}}
+{{/scopes}}
+{{/isOAuth}}
+
+{{/authMethods}}
+
+## Recommendation
+
+It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
+
+## Author
+
+{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
+{{/-last}}{{/apis}}{{/apiInfo}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/api.mustache
new file mode 100644
index 00000000000..1475fc0f4ec
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/api.mustache
@@ -0,0 +1,185 @@
+package {{package}};
+
+import {{invokerPackage}}.ApiClient;
+
+{{#imports}}import {{import}};
+{{/imports}}
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.web.client.RestClient.ResponseSpec;
+import org.springframework.web.client.RestClientResponseException;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+
+{{>generatedAnnotation}}
+{{#operations}}
+public class {{classname}} {
+ private ApiClient apiClient;
+
+ public {{classname}}() {
+ this(new ApiClient());
+ }
+
+ @Autowired
+ public {{classname}}(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ {{#operation}}
+ /**
+ * {{summary}}
+ * {{notes}}
+{{#responses}} *
{{code}}{{#message}} - {{.}}{{/message}}
+{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}}
+{{/allParams}}{{#returnType}} * @return {{.}}
+{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API
+{{#externalDocs}}
+ * {{description}}
+ * @see {{summary}} Documentation
+{{/externalDocs}}
+{{#isDeprecated}}
+ * @deprecated
+{{/isDeprecated}}
+ */
+ {{#isDeprecated}}
+ @Deprecated
+ {{/isDeprecated}}
+ private ResponseSpec {{operationId}}RequestCreation({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException {
+ Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
+ {{#allParams}}
+ {{#required}}
+ // verify the required parameter '{{paramName}}' is set
+ if ({{paramName}} == null) {
+ throw new RestClientResponseException("Missing the required parameter '{{paramName}}' when calling {{operationId}}", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ {{/required}}
+ {{/allParams}}
+ // create path and map variables
+ final Map pathParams = new HashMap<>();
+ {{#hasPathParams}}
+
+ {{#pathParams}}
+ pathParams.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), {{/collectionFormat}}{{{paramName}}}{{#collectionFormat}}){{/collectionFormat}});
+ {{/pathParams}}
+ {{/hasPathParams}}
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap<>();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap<>();
+ final MultiValueMap formParams = new LinkedMultiValueMap<>();
+ {{#hasQueryParams}}
+
+ {{#queryParams}}{{#isExplode}}{{#hasVars}}{{#vars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}.{{getter}}()));
+ {{/vars}}{{/hasVars}}{{^hasVars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));
+ {{/hasVars}}{{/isExplode}}{{^isExplode}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));
+ {{/isExplode}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}}
+
+ {{#headerParams}}
+ if ({{paramName}} != null)
+ headerParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}}
+ {{/-last}}
+ {{/headerParams}}
+ {{/hasHeaderParams}}
+ {{#hasCookieParams}}
+
+ {{#cookieParams}}
+ cookieParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));
+ {{/cookieParams}}
+ {{/hasCookieParams}}
+ {{#hasFormParams}}
+
+ {{#formParams}}
+ if ({{paramName}} != null)
+ formParams.add{{#collectionFormat}}All{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});
+ {{/formParams}}
+ {{/hasFormParams}}
+
+ final String[] localVarAccepts = { {{#hasProduces}}
+ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}
+ {{/hasProduces}}};
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { {{#hasConsumes}}
+ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}
+ {{/hasConsumes}}};
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };
+
+ {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}
+ return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+
+ /**
+ * {{summary}}
+ * {{notes}}
+{{#responses}} *
{{code}}{{#message}} - {{.}}{{/message}}
+{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}}
+{{/allParams}}{{#returnType}} * @return {{.}}
+{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API
+{{#externalDocs}}
+ * {{description}}
+ * @see {{summary}} Documentation
+{{/externalDocs}}
+ */
+ public {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException {
+ {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}
+ {{#returnType}}return {{/returnType}}{{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).body(localVarReturnType);
+ }
+
+ /**
+ * {{summary}}
+ * {{notes}}
+{{#responses}} *
{{code}}{{#message}} - {{.}}{{/message}}
+{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}}
+{{/allParams}}{{#returnType}} * @return ResponseEntity<{{.}}>
+{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API
+{{#externalDocs}}
+ * {{description}}
+ * @see {{summary}} Documentation
+{{/externalDocs}}
+ */
+ public {{#returnType}}ResponseEntity<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}ResponseEntity{{/returnType}} {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException {
+ {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}
+ return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).toEntity(localVarReturnType);
+ }
+
+ /**
+ * {{summary}}
+ * {{notes}}
+{{#responses}} *