mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 08:46:55 +00:00
Compare commits
71 Commits
follow-up-
...
ruby-githu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d25263e32 | ||
|
|
9a2d997398 | ||
|
|
d920f72020 | ||
|
|
152c87ee18 | ||
|
|
3acc76a48b | ||
|
|
efd2fe60ad | ||
|
|
f02acaf27e | ||
|
|
75804e4e31 | ||
|
|
fe6da71327 | ||
|
|
2f69ad9f26 | ||
|
|
e5437e06a3 | ||
|
|
7e9b9615db | ||
|
|
731668b199 | ||
|
|
43c78856f5 | ||
|
|
564f4e023d | ||
|
|
117773f14c | ||
|
|
260787b0a1 | ||
|
|
ef0aef28d7 | ||
|
|
324d773123 | ||
|
|
2760903274 | ||
|
|
9d29eb98bc | ||
|
|
c2a8e11b45 | ||
|
|
2b3947ea1a | ||
|
|
33fdad9554 | ||
|
|
dceb03a8f0 | ||
|
|
24d7c3e904 | ||
|
|
71a6901d1e | ||
|
|
f1a273de16 | ||
|
|
3a63c2f7d2 | ||
|
|
73c8728343 | ||
|
|
ac3c37095d | ||
|
|
a55525c634 | ||
|
|
ec0edf433a | ||
|
|
1c950018c8 | ||
|
|
7a5d0d1a71 | ||
|
|
327599996d | ||
|
|
5bdb691fb6 | ||
|
|
fec88b3e88 | ||
|
|
0e1cba6eb6 | ||
|
|
45e4fa1633 | ||
|
|
46de9c8c16 | ||
|
|
ab6c827098 | ||
|
|
e68e3e88b3 | ||
|
|
8b01ebb5c2 | ||
|
|
7dcef20355 | ||
|
|
6e48cf4247 | ||
|
|
6278512122 | ||
|
|
5c04b754ab | ||
|
|
b7749712b8 | ||
|
|
c30fb413bb | ||
|
|
6b692739e8 | ||
|
|
ee4cb9ac22 | ||
|
|
ec28d6261c | ||
|
|
0edcc9d204 | ||
|
|
59eac42b0f | ||
|
|
5efe16c66b | ||
|
|
8a061acc7c | ||
|
|
177b94b1b4 | ||
|
|
58fde20e2c | ||
|
|
8300794c5e | ||
|
|
9b692e5ef7 | ||
|
|
d523903827 | ||
|
|
5f647b8477 | ||
|
|
6825d9ccaa | ||
|
|
0e42edc95b | ||
|
|
278d7ae4c9 | ||
|
|
7b3de8dbce | ||
|
|
bdfbb32cdd | ||
|
|
6e089f5f03 | ||
|
|
e62908e30e | ||
|
|
6164836b57 |
51
.github/workflows/samples-clojure.yaml
vendored
Normal file
51
.github/workflows/samples-clojure.yaml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: Samples Clojure Client
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/clojure/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/clojure/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build Clojure Client (JDK11)
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/clojure/
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
ports:
|
||||
- 80:8080
|
||||
env:
|
||||
SWAGGER_HOST: http://petstore.swagger.io
|
||||
SWAGGER_BASE_PATH: /v2
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Add hosts to /etc/hosts
|
||||
run: |
|
||||
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- 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: Install Leiningen (if using Leiningen)
|
||||
run: |
|
||||
curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > lein
|
||||
chmod +x lein
|
||||
sudo mv lein /usr/local/bin/
|
||||
- name: Run tests (Leiningen)
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: lein test
|
||||
18
.github/workflows/samples-dart-build-test.yaml
vendored
18
.github/workflows/samples-dart-build-test.yaml
vendored
@@ -4,20 +4,24 @@ on:
|
||||
push:
|
||||
branches:
|
||||
paths:
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/**
|
||||
#- samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/**
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/**
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/**
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/**
|
||||
- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/**
|
||||
- samples/openapi3/client/petstore/dart-dio/oneof/**
|
||||
- samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/**
|
||||
- samples/openapi3/client/petstore/dart-dio/binary_response/**
|
||||
- samples/openapi3/client/petstore/dart-dio/petstore-timemachine/**
|
||||
pull_request:
|
||||
paths:
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/**
|
||||
#- samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/**
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/**
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/**
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/**
|
||||
- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/**
|
||||
- samples/openapi3/client/petstore/dart-dio/oneof/**
|
||||
- samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/**
|
||||
- samples/openapi3/client/petstore/dart-dio/binary_response/**
|
||||
- samples/openapi3/client/petstore/dart-dio/petstore-timemachine/**
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -27,12 +31,14 @@ jobs:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
sdk: ["3.9.0"]
|
||||
sample:
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/
|
||||
#- samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/
|
||||
#- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/
|
||||
- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/
|
||||
- samples/openapi3/client/petstore/dart-dio/oneof/
|
||||
- samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/
|
||||
- samples/openapi3/client/petstore/dart-dio/binary_response/
|
||||
- samples/openapi3/client/petstore/dart-dio/petstore-timemachine/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
|
||||
37
.github/workflows/samples-dotnet-petstore.yml
vendored
Normal file
37
.github/workflows/samples-dotnet-petstore.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Samples C# .Net Client (Petstore)
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/Petstore/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/Petstore/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build clients
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
ports:
|
||||
- 80:8080
|
||||
env:
|
||||
SWAGGER_HOST: http://petstore.swagger.io
|
||||
SWAGGER_BASE_PATH: /v2
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/Petstore/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.0.0
|
||||
with:
|
||||
dotnet-version: '7.0.x'
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet build Org.OpenAPITools.sln
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet test Org.OpenAPITools.sln
|
||||
54
.github/workflows/samples-dotnet7-client.yml
vendored
Normal file
54
.github/workflows/samples-dotnet7-client.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Samples C# .Net 7 Client
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
# the .NET Core 3.0 runtime is no longer supported as it reached its end-of-life on March 3, 2020
|
||||
#- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/**
|
||||
- samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/**
|
||||
- samples/client/petstore/csharp/restsharp/net4.7/Petstore/**
|
||||
- samples/client/petstore/csharp/restsharp/net4.8/Petstore/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/ParameterMappings/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/EnumMappings/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/Petstore/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/**
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/**
|
||||
pull_request:
|
||||
paths:
|
||||
#- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/**
|
||||
- samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/**
|
||||
- samples/client/petstore/csharp/restsharp/net4.7/Petstore/**
|
||||
- samples/client/petstore/csharp/restsharp/net4.8/Petstore/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/ParameterMappings/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/EnumMappings/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/Petstore/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/**
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build clients
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
#- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/
|
||||
- samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/
|
||||
- samples/client/petstore/csharp/restsharp/net4.7/Petstore/
|
||||
- samples/client/petstore/csharp/restsharp/net4.8/Petstore/
|
||||
- samples/client/petstore/csharp/restsharp/net8/ParameterMappings/
|
||||
- samples/client/petstore/csharp/restsharp/net8/EnumMappings/
|
||||
- samples/client/petstore/csharp/restsharp/net8/Petstore/
|
||||
- samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.0.0
|
||||
with:
|
||||
dotnet-version: '7.0.x'
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet build Org.OpenAPITools.sln
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet test Org.OpenAPITools.sln
|
||||
1
.github/workflows/samples-dotnet9.yaml
vendored
1
.github/workflows/samples-dotnet9.yaml
vendored
@@ -43,6 +43,7 @@ jobs:
|
||||
- samples/client/petstore/csharp/restsharp/net9/EnumMappings
|
||||
# httpclient
|
||||
- samples/client/petstore/csharp/httpclient/net9/Petstore
|
||||
- samples/client/petstore/csharp/httpclient/net9/Petstore-nonPublicApi
|
||||
# unity
|
||||
#- samples/client/petstore/csharp/unityWebRequest/net9/Petstore
|
||||
steps:
|
||||
|
||||
45
.github/workflows/samples-go-client-petstore.yaml
vendored
Normal file
45
.github/workflows/samples-go-client-petstore.yaml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Samples Go Clients (Petstore)
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/go/**
|
||||
- samples/openapi3/client/petstore/go/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/go/**
|
||||
- samples/openapi3/client/petstore/go/**
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Go
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
ports:
|
||||
- 80:8080
|
||||
env:
|
||||
SWAGGER_HOST: http://petstore.swagger.io
|
||||
SWAGGER_BASE_PATH: /v2
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/go/
|
||||
- samples/openapi3/client/petstore/go/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Add hosts to /etc/hosts
|
||||
run: |
|
||||
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
|
||||
- uses: actions/setup-go@v6
|
||||
- run: go version
|
||||
- name: Install Dependencies
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: |
|
||||
go mod tidy
|
||||
- name: Run test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: go test -mod=mod -v
|
||||
|
||||
16
.github/workflows/samples-go-client.yaml
vendored
16
.github/workflows/samples-go-client.yaml
vendored
@@ -4,10 +4,19 @@ on:
|
||||
push:
|
||||
paths:
|
||||
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
|
||||
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
|
||||
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
|
||||
- samples/client/others/go/allof_multiple_ref_and_discriminator/**
|
||||
- samples/client/others/go/oneof-anyof-required/**
|
||||
- samples/client/others/go/oneof-discriminator-lookup/**
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
|
||||
|
||||
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
|
||||
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
|
||||
- samples/client/others/go/allof_multiple_ref_and_discriminator/**
|
||||
- samples/client/others/go/oneof-anyof-required/**
|
||||
- samples/client/others/go/oneof-discriminator-lookup/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build Go
|
||||
@@ -17,6 +26,11 @@ jobs:
|
||||
matrix:
|
||||
sample:
|
||||
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/'
|
||||
- 'samples/openapi3/client/petstore/go-petstore-withXml/'
|
||||
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/
|
||||
- samples/client/others/go/allof_multiple_ref_and_discriminator/
|
||||
- samples/client/others/go/oneof-anyof-required/
|
||||
- samples/client/others/go/oneof-discriminator-lookup/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-go@v6
|
||||
|
||||
12
.github/workflows/samples-java-client-jdk11.yaml
vendored
12
.github/workflows/samples-java-client-jdk11.yaml
vendored
@@ -17,6 +17,10 @@ on:
|
||||
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
|
||||
- samples/client/others/java/jersey2-oneOf-duplicates/**
|
||||
- samples/client/others/java/jersey2-oneOf-Mixed/**
|
||||
- samples/client/petstore/java/jersey3-oneOf/**
|
||||
- samples/client/others/java/okhttp-gson-streaming/**
|
||||
- samples/client/others/java/resteasy/**
|
||||
- samples/client/others/java/apache-httpclient/**
|
||||
- samples/client/others/java/resttemplate-list-schema-validation/**
|
||||
- samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/**
|
||||
pull_request:
|
||||
@@ -35,6 +39,10 @@ on:
|
||||
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
|
||||
- samples/client/others/java/jersey2-oneOf-duplicates/**
|
||||
- samples/client/others/java/jersey2-oneOf-Mixed/**
|
||||
- samples/client/petstore/java/jersey3-oneOf/**
|
||||
- samples/client/others/java/okhttp-gson-streaming/**
|
||||
- samples/client/others/java/resteasy/**
|
||||
- samples/client/others/java/apache-httpclient/**
|
||||
- samples/client/others/java/resttemplate-list-schema-validation/**
|
||||
- samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/**
|
||||
jobs:
|
||||
@@ -97,6 +105,10 @@ jobs:
|
||||
- samples/client/others/java/jersey2-oneOf-Mixed/
|
||||
- samples/client/others/java/resttemplate-list-schema-validation/
|
||||
- samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/
|
||||
- samples/client/petstore/java/jersey3-oneOf/
|
||||
- samples/client/others/java/okhttp-gson-streaming/
|
||||
- samples/client/petstore/java/resteasy/
|
||||
- samples/client/petstore/java/apache-httpclient/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-java@v5
|
||||
|
||||
39
.github/workflows/samples-java-dubbo.yaml
vendored
Normal file
39
.github/workflows/samples-java-dubbo.yaml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Samples Java Dubbo
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'samples/server/petstore/java-dubbo/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/server/petstore/java-dubbo/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Java Dubbo
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
# servers
|
||||
- samples/server/petstore/java-dubbo
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-java@v5
|
||||
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: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: mvn clean package --no-transfer-progress -DskipTests
|
||||
# add -DskipTests as the app compiles but fails to start
|
||||
#run: mvn clean package --no-transfer-progress
|
||||
65
.github/workflows/samples-java-petsore-client-jdk11.yaml
vendored
Normal file
65
.github/workflows/samples-java-petsore-client-jdk11.yaml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
# run java client tests with petstore server
|
||||
name: Samples Java Petsore Client JDK11
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/java/jersey2-java8/**
|
||||
- samples/openapi3/client/petstore/java/jersey2-java8/**
|
||||
- samples/client/petstore/java/jersey3/**
|
||||
- samples/client/petstore/java/okhttp-gson/**
|
||||
- samples/client/petstore/java/okhttp-gson-3.1/**
|
||||
- samples/client/petstore/java/okhttp-gson-dynamicOperations/**
|
||||
- samples/client/petstore/java-micronaut-client/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/java/jersey2-java8/**
|
||||
- samples/openapi3/client/petstore/java/jersey2-java8/**
|
||||
- samples/client/petstore/java/jersey3/**
|
||||
- samples/client/petstore/java/okhttp-gson/**
|
||||
- samples/client/petstore/java/okhttp-gson-3.1/**
|
||||
- samples/client/petstore/java/okhttp-gson-dynamicOperations/**
|
||||
- samples/client/petstore/java-micronaut-client/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build Java Client JDK11
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/java/jersey2-java8
|
||||
- samples/openapi3/client/petstore/java/jersey2-java8
|
||||
- samples/client/petstore/java/jersey3
|
||||
- samples/client/petstore/java/okhttp-gson
|
||||
- samples/client/petstore/java/okhttp-gson-3.1
|
||||
- samples/client/petstore/java/okhttp-gson-dynamicOperations
|
||||
- samples/client/petstore/java-micronaut-client
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
ports:
|
||||
- 80:8080
|
||||
env:
|
||||
SWAGGER_HOST: http://petstore.swagger.io
|
||||
SWAGGER_BASE_PATH: /v2
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Add hosts to /etc/hosts
|
||||
run: |
|
||||
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- 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 with Maven
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: mvn clean package --no-transfer-progress
|
||||
38
.github/workflows/samples-java-sbt.yaml
vendored
Normal file
38
.github/workflows/samples-java-sbt.yaml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Samples Java (sbt)
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'samples/client/petstore/java/okhttp-gson/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/client/petstore/java/okhttp-gson/**'
|
||||
jobs:
|
||||
build:
|
||||
name: Build sbt/Java client, servers
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/petstore/java/okhttp-gson
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Setup sbt launcher
|
||||
uses: sbt/setup-sbt@v1
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
path: |
|
||||
~/.ivy2
|
||||
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/build.sbt') }}
|
||||
- name: Build and test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: sbt -v +test
|
||||
2
.github/workflows/samples-jaxrs.yaml
vendored
2
.github/workflows/samples-jaxrs.yaml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
|
||||
1
.github/workflows/samples-kotlin-server.yaml
vendored
1
.github/workflows/samples-kotlin-server.yaml
vendored
@@ -38,6 +38,7 @@ jobs:
|
||||
- samples/server/petstore/kotlin-springboot-source-swagger1
|
||||
- samples/server/petstore/kotlin-springboot-source-swagger2
|
||||
- samples/server/petstore/kotlin-springboot-springfox
|
||||
- samples/server/petstore/kotlin-springboot-x-kotlin-implements
|
||||
- samples/server/petstore/kotlin-server/ktor
|
||||
- samples/server/petstore/kotlin-server/ktor2
|
||||
- samples/server/petstore/kotlin-server/jaxrs-spec
|
||||
|
||||
40
.github/workflows/samples-powershell.yaml
vendored
Normal file
40
.github/workflows/samples-powershell.yaml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Samples PowerShell
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/powershell/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/powershell/**
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
name: Test Powershell Clients
|
||||
strategy:
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/powershell/
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
ports:
|
||||
- 80:8080
|
||||
env:
|
||||
SWAGGER_HOST: http://petstore.swagger.io
|
||||
SWAGGER_BASE_PATH: /v2
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Build the client
|
||||
working-directory: ${{ matrix.sample }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
./Build.ps1
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
Import-Module -Name './src/PSPetstore'
|
||||
Invoke-Pester -PassThru
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ jobs:
|
||||
sample:
|
||||
- samples/openapi3/client/petstore/python-aiohttp
|
||||
- samples/openapi3/client/petstore/python
|
||||
- samples/openapi3/client/petstore/python-lazyImports
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
|
||||
43
.github/workflows/samples-ruby-client-echo-api.yaml
vendored
Normal file
43
.github/workflows/samples-ruby-client-echo-api.yaml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Samples Ruby
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'samples/client/echo_api/ruby-httpx/**'
|
||||
- 'samples/client/echo_api/ruby-faraday/**'
|
||||
- 'samples/client/echo_api/ruby-typhoeus/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/client/echo_api/ruby-httpx/**'
|
||||
- 'samples/client/echo_api/ruby-faraday/**'
|
||||
- 'samples/client/echo_api/ruby-typhoeus/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Ruby
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- 'samples/client/echo_api/ruby-httpx/'
|
||||
- 'samples/client/echo_api/ruby-faraday/'
|
||||
- 'samples/client/echo_api/ruby-typhoeus/'
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Setup node.js
|
||||
uses: actions/setup-node@v5
|
||||
- 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 &)
|
||||
- uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 3.2
|
||||
bundler-cache: true
|
||||
- name: Install bundle
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: bundle install
|
||||
- name: Run rspec
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: rspec
|
||||
47
.github/workflows/samples-ruby.yaml
vendored
47
.github/workflows/samples-ruby.yaml
vendored
@@ -1,16 +1,18 @@
|
||||
name: Samples Ruby
|
||||
name: Samples Ruby
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'samples/client/echo_api/ruby-httpx/**'
|
||||
- 'samples/client/echo_api/ruby-faraday/**'
|
||||
- 'samples/client/echo_api/ruby-typhoeus/**'
|
||||
- samples/client/petstore/ruby/**
|
||||
- samples/client/petstore/ruby-faraday/**
|
||||
- samples/client/petstore/ruby-httpx/**
|
||||
- samples/client/petstore/ruby-autoload/**
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/client/echo_api/ruby-httpx/**'
|
||||
- 'samples/client/echo_api/ruby-faraday/**'
|
||||
- 'samples/client/echo_api/ruby-typhoeus/**'
|
||||
- samples/client/petstore/ruby/**
|
||||
- samples/client/petstore/ruby-faraday/**
|
||||
- samples/client/petstore/ruby-httpx/**
|
||||
- samples/client/petstore/ruby-autoload/**
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -20,21 +22,28 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- 'samples/client/echo_api/ruby-httpx/'
|
||||
- 'samples/client/echo_api/ruby-faraday/'
|
||||
- 'samples/client/echo_api/ruby-typhoeus/'
|
||||
- samples/client/petstore/ruby/
|
||||
#- samples/client/petstore/ruby-faraday/
|
||||
#- samples/client/petstore/ruby-httpx/
|
||||
#- samples/client/petstore/ruby-autoload/
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
ports:
|
||||
- 80:8080
|
||||
env:
|
||||
SWAGGER_HOST: http://petstore.swagger.io
|
||||
SWAGGER_BASE_PATH: /v2
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Setup node.js
|
||||
uses: actions/setup-node@v5
|
||||
- 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 &)
|
||||
- uses: actions/setup-ruby@v1
|
||||
#- name: Add hosts to /etc/hosts
|
||||
# run: |
|
||||
# sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
|
||||
# cat /etc/hosts
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 3.0
|
||||
bundler-cache: true
|
||||
ruby-version: '3.4' # Not needed with a .ruby-version, .tool-versions or mise.toml
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
- name: Install bundle
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: bundle install
|
||||
|
||||
70
.github/workflows/samples-scala-client.yaml
vendored
Normal file
70
.github/workflows/samples-scala-client.yaml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
name: Samples Scala/sbt client
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/scalaz/**
|
||||
- samples/client/petstore/scala-pekko/**
|
||||
- samples/client/petstore/scala-http4s/**
|
||||
- samples/client/petstore/scala-sttp4-jsoniter/**
|
||||
- samples/client/petstore/scala-akka/**
|
||||
- samples/client/petstore/scala-sttp/**
|
||||
- samples/client/petstore/scala-sttp-circe/**
|
||||
- samples/client/petstore/scala-sttp4/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/scalaz/**
|
||||
- samples/client/petstore/scala-pekko/**
|
||||
- samples/client/petstore/scala-http4s/**
|
||||
- samples/client/petstore/scala-sttp4-jsoniter/**
|
||||
- samples/client/petstore/scala-akka/**
|
||||
- samples/client/petstore/scala-sttp/**
|
||||
- samples/client/petstore/scala-sttp-circe/**
|
||||
- samples/client/petstore/scala-sttp4/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build sbt/Scala
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/petstore/scalaz
|
||||
- samples/client/petstore/scala-pekko
|
||||
- samples/client/petstore/scala-http4s
|
||||
- samples/client/petstore/scala-sttp4-jsoniter
|
||||
- samples/client/petstore/scala-akka
|
||||
- samples/client/petstore/scala-sttp
|
||||
- samples/client/petstore/scala-sttp-circe
|
||||
- samples/client/petstore/scala-sttp4
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
ports:
|
||||
- 80:8080
|
||||
env:
|
||||
SWAGGER_HOST: http://petstore.swagger.io
|
||||
SWAGGER_BASE_PATH: /v2
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Add hosts to /etc/hosts
|
||||
run: |
|
||||
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Setup sbt launcher
|
||||
uses: sbt/setup-sbt@v1
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
path: |
|
||||
~/.ivy2
|
||||
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/build.sbt') }}
|
||||
- name: Build and test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: sbt -v test
|
||||
@@ -1,34 +1,21 @@
|
||||
name: Samples Scala/sbt
|
||||
name: Samples Scala/sbt server
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'samples/client/petstore/scala**'
|
||||
- 'samples/server/petstore/scala**'
|
||||
- 'samples/client/petstore/java/okhttp-gson/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/client/petstore/scala**'
|
||||
- 'samples/server/petstore/scala**'
|
||||
- 'samples/client/petstore/java/okhttp-gson/**'
|
||||
jobs:
|
||||
build:
|
||||
name: Build sbt/Scala client, servers
|
||||
name: Build sbt/Scala
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/petstore/java/okhttp-gson
|
||||
- samples/client/petstore/scalaz
|
||||
- samples/client/petstore/scala-pekko
|
||||
- samples/client/petstore/scala-http4s
|
||||
- samples/client/petstore/scala-sttp4-jsoniter
|
||||
#- samples/client/petstore/scala-sttp
|
||||
#- samples/client/petstore/scala-sttp-circe
|
||||
# servers
|
||||
- samples/server/petstore/scala-lagom-server
|
||||
- samples/server/petstore/scala-play-server
|
||||
- samples/server/petstore/scala-akka-http-server
|
||||
- samples/server/petstore/scala-pekko-http-server
|
||||
3
.github/workflows/samples-spring-jdk17.yaml
vendored
3
.github/workflows/samples-spring-jdk17.yaml
vendored
@@ -11,6 +11,7 @@ on:
|
||||
- samples/server/petstore/springboot-file-delegate-optional
|
||||
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
||||
- samples/server/petstore/spring-boot-oneof-sealed
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-interface
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/openapi3/client/petstore/spring-cloud-3-with-optional
|
||||
@@ -21,6 +22,7 @@ on:
|
||||
- samples/server/petstore/springboot-file-delegate-optional
|
||||
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
||||
- samples/server/petstore/spring-boot-oneof-sealed
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-interface
|
||||
jobs:
|
||||
build:
|
||||
name: Build Java Spring (JDK17)
|
||||
@@ -39,6 +41,7 @@ jobs:
|
||||
- samples/server/petstore/springboot-file-delegate-optional
|
||||
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
||||
- samples/server/petstore/spring-boot-oneof-sealed
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-interface
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-java@v5
|
||||
|
||||
1
.github/workflows/samples-spring.yaml
vendored
1
.github/workflows/samples-spring.yaml
vendored
@@ -60,6 +60,7 @@ jobs:
|
||||
- samples/server/petstore/springboot-spring-provide-args
|
||||
- samples/server/petstore/springboot-useoptional
|
||||
- samples/server/petstore/springboot-virtualan
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-interface
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-java@v5
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,6 +16,7 @@ modules/openapi-generator-gradle-plugin/bin/
|
||||
.classpath
|
||||
lib/*
|
||||
build/*
|
||||
.kotlin
|
||||
generated-files/*
|
||||
generated-sources/*
|
||||
generated-code/*
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
sudo: required
|
||||
language: java
|
||||
jdk:
|
||||
- openjdk8
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
- $HOME/.ivy2
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
addons:
|
||||
hosts:
|
||||
- petstore.swagger.io
|
||||
|
||||
before_install:
|
||||
# to run petstore server locally via docker
|
||||
- docker pull swaggerapi/petstore
|
||||
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
|
||||
- docker ps -a
|
||||
# Add bats test framework and cURL for Bash script integration tests
|
||||
- sudo add-apt-repository ppa:duggan/bats --yes
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq bats
|
||||
- sudo apt-get install -qq curl
|
||||
|
||||
# show host table to confirm petstore.swagger.io is mapped to localhost
|
||||
- cat /etc/hosts
|
||||
|
||||
script:
|
||||
# fail fast
|
||||
- set -e
|
||||
# run integration tests defined in maven pom.xml
|
||||
- cp pom.xml.bash pom.xml
|
||||
- mvn --no-snapshot-updates --batch-mode verify -Psamples
|
||||
@@ -56,11 +56,6 @@ elif [ "$NODE_INDEX" = "2" ]; then
|
||||
sudo ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true
|
||||
source ~/.cpprc # activate cpp environment variables
|
||||
|
||||
# run go integration tests
|
||||
(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)
|
||||
(cd samples/client/petstore/cpp-restsdk/client && mvn integration-test)
|
||||
|
||||
elif [ "$NODE_INDEX" = "3" ]; then
|
||||
@@ -121,22 +116,4 @@ else
|
||||
echo "Running node $NODE_INDEX ..."
|
||||
java -version
|
||||
|
||||
(cd samples/client/petstore/scala-akka && mvn integration-test)
|
||||
(cd samples/client/petstore/scala-sttp && mvn integration-test)
|
||||
(cd samples/client/petstore/scala-sttp-circe && mvn integration-test)
|
||||
(cd samples/client/petstore/scala-sttp4 && mvn integration-test)
|
||||
(cd samples/client/petstore/clojure && mvn integration-test)
|
||||
(cd samples/client/petstore/java/jersey2-java8 && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/java/jersey2-java8 && mvn integration-test)
|
||||
(cd samples/client/petstore/java/jersey3 && mvn integration-test)
|
||||
(cd samples/client/petstore/java/jersey3-oneOf && mvn integration-test)
|
||||
(cd samples/client/others/java/okhttp-gson-streaming && mvn integration-test)
|
||||
(cd samples/client/petstore/java/okhttp-gson && mvn integration-test)
|
||||
(cd samples/client/petstore/java/okhttp-gson-3.1 && mvn integration-test)
|
||||
(cd samples/client/petstore/java/okhttp-gson-dynamicOperations && mvn integration-test)
|
||||
(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
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.16.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)
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
|
||||
</div>
|
||||
@@ -1143,6 +1141,7 @@ Here is a list of template creators:
|
||||
* Haskell Servant: @algas
|
||||
* Haskell Yesod: @yotsuya
|
||||
* Java Camel: @carnevalegiacomo
|
||||
* Java Dubbo: @redoom
|
||||
* Java MSF4J: @sanjeewa-malalgoda
|
||||
* Java Spring Boot: @diyfr
|
||||
* Java Undertow: @stevehu
|
||||
@@ -1259,7 +1258,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| JMeter | @kannkyo (2021/01) |
|
||||
| Jetbrains HTTP Client | @jlengrand (2023/01) |
|
||||
| Julia | @tanmaykm (2023/01) |
|
||||
| Kotlin | @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) @stefankoppier (2022/06) @e5l (2024/10) |
|
||||
| Kotlin | @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) @stefankoppier (2022/06) @e5l (2024/10) |
|
||||
| Lua | @daurnimator (2017/08) |
|
||||
| N4JS | @mmews-n4 (2023/03) |
|
||||
| Nim | |
|
||||
|
||||
119
appveyor.yml
119
appveyor.yml
@@ -1,119 +0,0 @@
|
||||
version: '{branch}-{build}'
|
||||
image: Visual Studio 2022
|
||||
hosts:
|
||||
petstore.swagger.io: 127.0.0.1
|
||||
install:
|
||||
- cmd: SET PATH=C:\maven\apache-maven-3.8.3\bin;C:\gradle\gradle-7.6\bin;%JAVA_HOME%\bin;%PATH%
|
||||
- cmd: SET MAVEN_OPTS=-Xmx4g
|
||||
- cmd: SET JAVA_OPTS=-Xmx4g
|
||||
- cmd: SET M2_HOME=C:\maven\apache-maven-3.8.3
|
||||
- cmd: java -version
|
||||
- cmd: dir/w
|
||||
- cmd: docker pull swaggerapi/petstore
|
||||
- cmd: docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
|
||||
- ps: Start-Sleep -s 120
|
||||
- ps: $PSVersionTable.PSVersion
|
||||
- ps: Install-Module -Name Pester -Force -Scope CurrentUser -SkipPublisherCheck
|
||||
build_script:
|
||||
- dotnet --info
|
||||
# build C# aspnetcore 5.0 server
|
||||
#- dotnet build samples\server\petstore\aspnetcore-5.0\Org.OpenAPITools.sln
|
||||
## build C# aspnetcore 3.1 server
|
||||
#- dotnet build samples\server\petstore\aspnetcore-3.1\Org.OpenAPITools.sln
|
||||
## build C# aspnetcore 3.0 server
|
||||
#- dotnet build samples\server\petstore\aspnetcore-3.0\Org.OpenAPITools.sln
|
||||
## build C# aspnetcore 2.2 server
|
||||
#- dotnet build samples\server\petstore\aspnetcore\Org.OpenAPITools.sln
|
||||
## build C# API client (multiple frameworks)
|
||||
#- dotnet build samples\client\petstore\csharp\OpenAPIClientCoreAndNet47\Org.OpenAPITools.sln
|
||||
## build C# API client (httpclient)
|
||||
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-httpclient\Org.OpenAPITools.sln
|
||||
## build C# API client (generichost)
|
||||
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-generichost-netstandard2.0\Org.OpenAPITools.sln
|
||||
## build C# API client (netcore)
|
||||
#- dotnet build samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln
|
||||
#- dotnet build samples\client\petstore\csharp\OpenAPIClientCore\Org.OpenAPITools.sln
|
||||
## build C# API client (.net framework 4.7)
|
||||
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-net47\Org.OpenAPITools.sln
|
||||
## build C# API client (.net framework 4.8)
|
||||
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-net48\Org.OpenAPITools.sln
|
||||
## build C# API client (.net 5.0)
|
||||
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-net5.0\Org.OpenAPITools.sln
|
||||
## build C# API client (.net 5.0 with ConditionalSerialization)
|
||||
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-ConditionalSerialization\Org.OpenAPITools.sln
|
||||
|
||||
test_script:
|
||||
- dotnet test samples\client\petstore\csharp\generichost\latest\ComposedEnum\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\latest\InlineEnumAnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\latest\Tags\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\latest\HelloWorld\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\latest\OneOfList\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# - dotnet test samples\client\petstore\csharp\generichost\net9\ManualSourceGenerationTests\ManualTests.Latest.UseSourceGeneration\ManualTests.Latest.UseSourceGeneration.csproj
|
||||
# - dotnet test samples\client\petstore\csharp\generichost\net9\ManualPetstoreTests\OpenAPIClient-generichost-manual-tests\OpenAPIClient-generichost-manual-tests.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\NullReferenceTypes\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\SourceGeneration\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\ManualSourceGenerationTests\ManualTests.Latest.UseSourceGeneration\ManualTests.Latest.UseSourceGeneration.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\ManualPetstoreTests\OpenAPIClient-generichost-manual-tests\OpenAPIClient-generichost-manual-tests.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\NullReferenceTypes\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\SourceGeneration\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
- dotnet test samples\client\petstore\csharp\generichost\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.8\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.8\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.8\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.8\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.8\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.7\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.7\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.7\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.7\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.7\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.7\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net4.7\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
- dotnet test samples\client\petstore\csharp\httpclient\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net4.7\MultipleFrameworks\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net4.7\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net4.8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net8\ParameterMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net8\EnumMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\standard2.0\ConditionalSerialization\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
### TODO: Execute all generators via powershell or other
|
||||
# generate all petstore clients
|
||||
# - .\bin\windows\run-all-petstore.cmd
|
||||
# generate all petstore clients (openapi3)
|
||||
# - .\bin\openapi3\windows\run-all-petstore.cmd
|
||||
|
||||
# test ps petstore
|
||||
- ps: |
|
||||
cd samples\client\petstore\powershell\
|
||||
.\CIRunTest.ps1
|
||||
cache:
|
||||
- C:\maven\
|
||||
- C:\gradle\
|
||||
- C:\Users\appveyor\.m2
|
||||
14
bin/configs/csharp-httpclient-net9-nonPublicApi.yaml
Normal file
14
bin/configs/csharp-httpclient-net9-nonPublicApi.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
# for .net standard httpclient
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/httpclient/net9/Petstore-nonPublicApi
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
library: httpclient
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useOneOfDiscriminatorLookup: true
|
||||
targetFramework: net9.0
|
||||
equatable: true
|
||||
nonPublicApi: true
|
||||
@@ -2,7 +2,7 @@
|
||||
generatorName: csharp
|
||||
library: restsharp
|
||||
outputDir: samples/client/petstore/csharp/restsharp/standard2.0/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types-localhost.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
|
||||
14
bin/configs/dart-dio-petstore-timemachine.yaml
Normal file
14
bin/configs/dart-dio-petstore-timemachine.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
generatorName: dart-dio
|
||||
outputDir: samples/openapi3/client/petstore/dart-dio/petstore-timemachine
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
|
||||
typeMappings:
|
||||
Client: "ModelClient"
|
||||
File: "ModelFile"
|
||||
EnumClass: "ModelEnumClass"
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
enumUnknownDefaultCase: "true"
|
||||
dateLibrary: "timemachine"
|
||||
reservedWordsMappings:
|
||||
class: "classField"
|
||||
@@ -1,6 +1,6 @@
|
||||
generatorName: go
|
||||
outputDir: samples/client/petstore/go/go-petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-localhost.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/go
|
||||
additionalProperties:
|
||||
packageName: petstore
|
||||
|
||||
9
bin/configs/go-petstore-withXml.yaml
Normal file
9
bin/configs/go-petstore-withXml.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: go
|
||||
outputDir: samples/openapi3/client/petstore/go-petstore-withXml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/go
|
||||
additionalProperties:
|
||||
enumClassPrefix: "true"
|
||||
packageName: petstore
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
withXml: true
|
||||
15
bin/configs/java-dubbo-server.yaml
Normal file
15
bin/configs/java-dubbo-server.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
generatorName: java-dubbo
|
||||
outputDir: samples/server/petstore/java-dubbo
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/java-dubbo
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
artifactId: openapi-dubbo-server-petstore
|
||||
basePackage: "org.openapitools.example"
|
||||
title: "OpenAPI Petstore"
|
||||
serviceInterface: true
|
||||
serviceImplementation: true
|
||||
useTags: true
|
||||
dubboVersion: "3.2.18"
|
||||
javaVersion: "17"
|
||||
registryAddress: "zookeeper://127.0.0.1:2181"
|
||||
@@ -1,7 +1,7 @@
|
||||
generatorName: kotlin
|
||||
outputDir: samples/client/petstore/kotlin-jvm-ktor-gson
|
||||
library: jvm-ktor
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
|
||||
additionalProperties:
|
||||
artifactId: kotlin-petstore-jvm-ktor-gson
|
||||
|
||||
14
bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml
Normal file
14
bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
generatorName: kotlin-spring
|
||||
outputDir: samples/server/petstore/kotlin-springboot-x-kotlin-implements
|
||||
library: spring-boot
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
|
||||
additionalProperties:
|
||||
documentationProvider: none
|
||||
annotationLibrary: none
|
||||
useSwaggerUI: "false"
|
||||
serviceImplementation: "false"
|
||||
skipDefaultInterface: "true"
|
||||
interfaceOnly: "true"
|
||||
serializableModel: "true"
|
||||
beanValidations: "true"
|
||||
18
bin/configs/python-lazyImports.yaml
Normal file
18
bin/configs/python-lazyImports.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
generatorName: python
|
||||
outputDir: samples/openapi3/client/petstore/python-lazyImports
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/python
|
||||
additionalProperties:
|
||||
packageName: petstore_api
|
||||
useOneOfDiscriminatorLookup: "true"
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
mapNumberTo: StrictFloat
|
||||
lazyImports: 'true'
|
||||
nameMappings:
|
||||
_type: underscore_type
|
||||
type_: type_with_underscore
|
||||
modelNameMappings:
|
||||
# The OpenAPI spec ApiResponse conflicts with the internal ApiResponse
|
||||
ApiResponse: ModelApiResponse
|
||||
openapiNormalizer:
|
||||
SIMPLIFY_ONEOF_ANYOF_ENUM: false
|
||||
@@ -13,3 +13,5 @@ additionalProperties:
|
||||
nameMappings:
|
||||
_type: underscore_type
|
||||
type_: type_with_underscore
|
||||
openapiNormalizer:
|
||||
SIMPLIFY_ONEOF_ANYOF_ENUM: false
|
||||
|
||||
@@ -13,3 +13,5 @@ nameMappings:
|
||||
modelNameMappings:
|
||||
# The OpenAPI spec ApiResponse conflicts with the internal ApiResponse
|
||||
ApiResponse: ModelApiResponse
|
||||
openapiNormalizer:
|
||||
SIMPLIFY_ONEOF_ANYOF_ENUM: false
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
generatorName: ruby
|
||||
outputDir: samples/client/petstore/ruby-faraday
|
||||
library: faraday
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/ruby-client
|
||||
additionalProperties:
|
||||
gemVersion: 1.0.0
|
||||
|
||||
12
bin/configs/spring-boot-oneof-interface.yaml
Normal file
12
bin/configs/spring-boot-oneof-interface.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
generatorName: spring
|
||||
outputDir: samples/openapi3/server/petstore/spring-boot-oneof-interface
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
|
||||
additionalProperties:
|
||||
groupId: org.openapitools.openapi3
|
||||
documentationProvider: springdoc
|
||||
artifactId: springboot-oneof
|
||||
snapshotVersion: "true"
|
||||
hideGenerationTimestamp: "true"
|
||||
useOneOfInterfaces: "true"
|
||||
useDeductionForOneOfInterfaces: "true"
|
||||
@@ -1,6 +0,0 @@
|
||||
systemProperties:
|
||||
skipFormModel: "true"
|
||||
generatorName: scala-lagom-server
|
||||
outputDir: samples/server/petstore/scala-lagom-server
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/scala-lagom-server
|
||||
@@ -564,6 +564,15 @@ Example:
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/simplifyAnyOfStringAndEnumString_test.yaml -o /tmp/java-okhttp/ --openapi-normalizer SIMPLIFY_ANYOF_STRING_AND_ENUM_STRING=true
|
||||
```
|
||||
|
||||
- `SIMPLIFY_ONEOF_ANYOF_ENUM`: when set to true, oneOf/anyOf with only enum sub-schemas all containing enum values will be converted to a single enum
|
||||
This is enabled by default
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/simplifyOneOfWithEnums_test.yaml -o /tmp/java-okhttp/ --openapi-normalizer SIMPLIFY_ONEOF_ANYOF_ENUM=true
|
||||
```
|
||||
|
||||
- `SIMPLIFY_BOOLEAN_ENUM`: when set to `true`, convert boolean enum to just enum.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -106,6 +106,7 @@ The following generators are available:
|
||||
* [haskell](generators/haskell.md)
|
||||
* [haskell-yesod (beta)](generators/haskell-yesod.md)
|
||||
* [java-camel](generators/java-camel.md)
|
||||
* [java-dubbo (beta)](generators/java-dubbo.md)
|
||||
* [java-helidon-server (beta)](generators/java-helidon-server.md)
|
||||
* [java-inflector](generators/java-inflector.md)
|
||||
* [java-micronaut-server (beta)](generators/java-micronaut-server.md)
|
||||
@@ -150,7 +151,7 @@ The following generators are available:
|
||||
* [scala-cask](generators/scala-cask.md)
|
||||
* [scala-finch](generators/scala-finch.md)
|
||||
* [scala-http4s-server](generators/scala-http4s-server.md)
|
||||
* [scala-lagom-server](generators/scala-lagom-server.md)
|
||||
* [scala-lagom-server-deprecated (deprecated)](generators/scala-lagom-server-deprecated.md)
|
||||
* [scala-play-server](generators/scala-play-server.md)
|
||||
* [scalatra](generators/scalatra.md)
|
||||
* [spring](generators/spring.md)
|
||||
|
||||
@@ -99,6 +99,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|title|server title name or client service name| |OpenAPI Spring|
|
||||
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
|
||||
|useBeanValidation|Use BeanValidation API annotations| |true|
|
||||
|useDeductionForOneOfInterfaces|whether to use deduction for generated oneOf interfaces| |false|
|
||||
|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false|
|
||||
|useFeignClientContextId|Whether to generate Feign client with contextId parameter.| |true|
|
||||
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
|
||||
|
||||
351
docs/generators/java-dubbo.md
Normal file
351
docs/generators/java-dubbo.md
Normal file
@@ -0,0 +1,351 @@
|
||||
---
|
||||
title: Documentation for the java-dubbo Generator
|
||||
---
|
||||
|
||||
## METADATA
|
||||
|
||||
| Property | Value | Notes |
|
||||
| -------- | ----- | ----- |
|
||||
| generator name | java-dubbo | pass this to the generate command after -g |
|
||||
| generator stability | BETA | |
|
||||
| generator type | SERVER | |
|
||||
| generator language | Java | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates a Java Apache Dubbo server application. | |
|
||||
|
||||
## 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|
|
||||
|apiPackage|package for generated api classes| |org.openapitools.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-dubbo|
|
||||
|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|
|
||||
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
|
||||
|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|
|
||||
|configPackage|configuration package for generated code| |org.openapitools.configuration|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|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.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|
||||
|dubboVersion|Dubbo version| |3.2.18|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
|
||||
|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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|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|
|
||||
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|
||||
|invokerPackage|root package for generated code| |org.openapitools|
|
||||
|javaVersion|Java version| |17|
|
||||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|licenseName|The name of the license| |Unlicense|
|
||||
|licenseUrl|The URL of the license| |http://unlicense.org|
|
||||
|modelPackage|package for generated models| |org.openapitools.model|
|
||||
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|registry-address|Registry address (e.g., zookeeper://127.0.0.1:2181 or nacos://127.0.0.1:8848)| |zookeeper://127.0.0.1:2181|
|
||||
|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|
|
||||
|serviceImplementation|Generate service implementation| |true|
|
||||
|serviceInterface|Generate service interface| |true|
|
||||
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd></dl>|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|
|
||||
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|
||||
|title|API title name| |null|
|
||||
|useGenericResponse|Use generic response wrapper| |false|
|
||||
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |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|
|
||||
|useTags|use tags for creating interface and controller classnames| |true|
|
||||
|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, OPERATION_PARAMETER|null
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|Array|java.util.List|
|
||||
|ArrayList|java.util.ArrayList|
|
||||
|Arrays|java.util.Arrays|
|
||||
|BigDecimal|java.math.BigDecimal|
|
||||
|BigInteger|java.math.BigInteger|
|
||||
|Date|java.util.Date|
|
||||
|DateTime|org.joda.time.*|
|
||||
|File|java.io.File|
|
||||
|HashMap|java.util.HashMap|
|
||||
|HashSet|java.util.HashSet|
|
||||
|LinkedHashSet|java.util.LinkedHashSet|
|
||||
|List|java.util.List|
|
||||
|LocalDate|java.time.LocalDate|
|
||||
|LocalDateTime|java.time.LocalDateTime|
|
||||
|LocalTime|java.time.LocalTime|
|
||||
|Map|java.util.Map|
|
||||
|MultipartFile|org.springframework.web.multipart.MultipartFile|
|
||||
|OffsetDateTime|java.time.OffsetDateTime|
|
||||
|Set|java.util.Set|
|
||||
|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
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>Boolean</li>
|
||||
<li>Double</li>
|
||||
<li>Float</li>
|
||||
<li>Integer</li>
|
||||
<li>List</li>
|
||||
<li>Long</li>
|
||||
<li>Map</li>
|
||||
<li>Object</li>
|
||||
<li>Set</li>
|
||||
<li>String</li>
|
||||
<li>boolean</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
<li>apiresponse</li>
|
||||
<li>assert</li>
|
||||
<li>boolean</li>
|
||||
<li>break</li>
|
||||
<li>byte</li>
|
||||
<li>case</li>
|
||||
<li>catch</li>
|
||||
<li>char</li>
|
||||
<li>class</li>
|
||||
<li>configuration</li>
|
||||
<li>const</li>
|
||||
<li>continue</li>
|
||||
<li>default</li>
|
||||
<li>do</li>
|
||||
<li>double</li>
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
<li>for</li>
|
||||
<li>goto</li>
|
||||
<li>if</li>
|
||||
<li>implements</li>
|
||||
<li>import</li>
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localdate</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localtime</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
<li>localvarauthnames</li>
|
||||
<li>localvarcollectionqueryparams</li>
|
||||
<li>localvarcontenttype</li>
|
||||
<li>localvarcontenttypes</li>
|
||||
<li>localvarcookieparams</li>
|
||||
<li>localvarformparams</li>
|
||||
<li>localvarheaderparams</li>
|
||||
<li>localvarpath</li>
|
||||
<li>localvarpostbody</li>
|
||||
<li>localvarqueryparams</li>
|
||||
<li>long</li>
|
||||
<li>native</li>
|
||||
<li>new</li>
|
||||
<li>null</li>
|
||||
<li>object</li>
|
||||
<li>offsetdatetime</li>
|
||||
<li>package</li>
|
||||
<li>private</li>
|
||||
<li>protected</li>
|
||||
<li>public</li>
|
||||
<li>return</li>
|
||||
<li>short</li>
|
||||
<li>static</li>
|
||||
<li>strictfp</li>
|
||||
<li>stringutil</li>
|
||||
<li>super</li>
|
||||
<li>switch</li>
|
||||
<li>synchronized</li>
|
||||
<li>this</li>
|
||||
<li>throw</li>
|
||||
<li>throws</li>
|
||||
<li>transient</li>
|
||||
<li>try</li>
|
||||
<li>void</li>
|
||||
<li>volatile</li>
|
||||
<li>while</li>
|
||||
</ul>
|
||||
|
||||
## FEATURE SET
|
||||
|
||||
|
||||
### Client Modification Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasePath|✓|ToolingExtension
|
||||
|Authorizations|✗|ToolingExtension
|
||||
|UserAgent|✗|ToolingExtension
|
||||
|MockServer|✗|ToolingExtension
|
||||
|
||||
### Data Type Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Custom|✗|OAS2,OAS3
|
||||
|Int32|✓|OAS2,OAS3
|
||||
|Int64|✓|OAS2,OAS3
|
||||
|Float|✓|OAS2,OAS3
|
||||
|Double|✓|OAS2,OAS3
|
||||
|Decimal|✓|ToolingExtension
|
||||
|String|✓|OAS2,OAS3
|
||||
|Byte|✓|OAS2,OAS3
|
||||
|Binary|✓|OAS2,OAS3
|
||||
|Boolean|✓|OAS2,OAS3
|
||||
|Date|✓|OAS2,OAS3
|
||||
|DateTime|✓|OAS2,OAS3
|
||||
|Password|✓|OAS2,OAS3
|
||||
|File|✓|OAS2
|
||||
|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
|
||||
@@ -64,6 +64,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|returnJBossResponse|Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. This flag cannot be combined with `returnResponse` flag. It requires the flag `interfaceOnly` and `useJakartaEE` set to true, because `org.jboss.resteasy.reactive.RestResponse` was introduced in Quarkus 2.x| |false|
|
||||
|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.| |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|
|
||||
|
||||
@@ -22,6 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger1|
|
||||
|apiPackage|package for generated api classes| |org.openapitools.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-jaxrs-client|
|
||||
@@ -39,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|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.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**swagger1**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using Swagger-Core 1.x.</dd><dt>**swagger2**</dt><dd>Generate an OpenAPI 3 specification using Swagger-Core 2.x.</dd></dl>|swagger1|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
|
||||
|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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|false|
|
||||
|
||||
@@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger1|
|
||||
|apiPackage|package for generated api classes| |org.openapitools.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-cxf-server|
|
||||
@@ -40,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|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.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**swagger1**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using Swagger-Core 1.x.</dd><dt>**swagger2**</dt><dd>Generate an OpenAPI 3 specification using Swagger-Core 2.x.</dd></dl>|swagger1|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
|
||||
|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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|false|
|
||||
|
||||
@@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger1|
|
||||
|apiPackage|package for generated api classes| |org.openapitools.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-cxf-server|
|
||||
@@ -40,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|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.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**swagger1**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using Swagger-Core 1.x.</dd><dt>**swagger2**</dt><dd>Generate an OpenAPI 3 specification using Swagger-Core 2.x.</dd></dl>|swagger1|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
|
||||
|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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|false|
|
||||
|
||||
@@ -65,6 +65,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|returnJBossResponse|Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. This flag cannot be combined with `returnResponse` flag. It requires the flag `interfaceOnly` and `useJakartaEE` set to true, because `org.jboss.resteasy.reactive.RestResponse` was introduced in Quarkus 2.x| |false|
|
||||
|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.| |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|
|
||||
|
||||
@@ -67,6 +67,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null
|
||||
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-kotlin-implements|Ability to specify interfaces that model must implement|MODEL|empty array
|
||||
|x-kotlin-implements-fields|Specify attributes that are implemented by the interface(s) added via `x-kotlin-implements`|MODEL|empty array
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
@@ -24,6 +24,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.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false|
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||
|lazyImports|Enable lazy imports.| |false|
|
||||
|library|library template (sub-template) to use: asyncio, tornado (deprecated), urllib3| |urllib3|
|
||||
|mapNumberTo|Map number to Union[StrictFloat, StrictInt], StrictStr or float.| |Union[StrictFloat, StrictInt]|
|
||||
|packageName|python package name (convention: snake_case).| |openapi_client|
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
title: Documentation for the scala-lagom-server Generator
|
||||
title: Documentation for the scala-lagom-server-deprecated Generator
|
||||
---
|
||||
|
||||
## METADATA
|
||||
|
||||
| Property | Value | Notes |
|
||||
| -------- | ----- | ----- |
|
||||
| generator name | scala-lagom-server | pass this to the generate command after -g |
|
||||
| generator stability | STABLE | |
|
||||
| generator name | scala-lagom-server-deprecated | pass this to the generate command after -g |
|
||||
| generator stability | DEPRECATED | |
|
||||
| generator type | SERVER | |
|
||||
| generator language | Scala | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates a Lagom API server (Beta) in scala | |
|
||||
| helpTxt | Generates a Lagom API server (Beta) in scala. IMPORTANT: this generator has been deprecated | |
|
||||
|
||||
## 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.
|
||||
@@ -92,6 +92,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|title|server title name or client service name| |OpenAPI Spring|
|
||||
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
|
||||
|useBeanValidation|Use BeanValidation API annotations| |true|
|
||||
|useDeductionForOneOfInterfaces|whether to use deduction for generated oneOf interfaces| |false|
|
||||
|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false|
|
||||
|useFeignClientContextId|Whether to generate Feign client with contextId parameter.| |true|
|
||||
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
|
||||
|
||||
@@ -81,6 +81,10 @@ tasks.withType(ReleaseNexusStagingRepository).configureEach {
|
||||
onlyIf { nexusPublishing.useStaging.get() }
|
||||
}
|
||||
|
||||
tasks.named("validatePlugins").configure {
|
||||
enableStricterValidation = true
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
website = "https://openapi-generator.tech/"
|
||||
vcsUrl = "https://github.com/OpenAPITools/openapi-generator"
|
||||
|
||||
@@ -62,43 +62,43 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
/**
|
||||
* The verbosity of generation
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val verbose = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
* Whether an input specification should be validated upon generation.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val validateSpec = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
* The name of the generator which will handle codegen. (see "openApiGenerators" task)
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val generatorName = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* This is the configuration for reference paths where schemas for openapi generation are stored
|
||||
* The directory which contains the additional schema files
|
||||
*/
|
||||
@Optional
|
||||
@InputDirectory
|
||||
@PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:Optional
|
||||
@get:InputDirectory
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
val schemaLocation = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* The output target directory into which code will be generated.
|
||||
*/
|
||||
@Optional
|
||||
@get:Optional
|
||||
@get:OutputDirectory
|
||||
val outputDir = project.objects.property<String>()
|
||||
|
||||
@Suppress("unused")
|
||||
@set:Option(option = "input", description = "The input specification.")
|
||||
@Internal
|
||||
@get:Internal
|
||||
var input: String? = null
|
||||
set(value) {
|
||||
inputSpec.set(value)
|
||||
@@ -111,9 +111,9 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* changes to any $ref referenced files. Use the `inputSpecRootDirectory` property to have Gradle track changes to
|
||||
* an entire directory of spec files.
|
||||
*/
|
||||
@Optional
|
||||
@get:Optional
|
||||
@get:InputFile
|
||||
@PathSensitive(PathSensitivity.RELATIVE)
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
val inputSpec = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
@@ -122,60 +122,60 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* By default, a merged spec file will be generated based on the contents of the directory. To disable this, set the
|
||||
* `inputSpecRootDirectorySkipMerge` property.
|
||||
*/
|
||||
@Optional
|
||||
@get:Optional
|
||||
@get:InputDirectory
|
||||
@PathSensitive(PathSensitivity.RELATIVE)
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
val inputSpecRootDirectory = project.objects.property<String>();
|
||||
|
||||
/**
|
||||
* Skip bundling all spec files into a merged spec file, if true.
|
||||
*/
|
||||
@Input
|
||||
@Optional
|
||||
@get:Input
|
||||
@get:Optional
|
||||
val inputSpecRootDirectorySkipMerge = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
* Name of the file that will contain all merged specs
|
||||
*/
|
||||
@Input
|
||||
@Optional
|
||||
@get:Input
|
||||
@get:Optional
|
||||
val mergedFileName = project.objects.property<String>();
|
||||
|
||||
/**
|
||||
* The remote Open API 2.0/3.x specification URL location.
|
||||
*/
|
||||
@Input
|
||||
@Optional
|
||||
@get:Input
|
||||
@get:Optional
|
||||
val remoteInputSpec = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* The template directory holding a custom template.
|
||||
*/
|
||||
@Optional
|
||||
@InputDirectory
|
||||
@PathSensitive(PathSensitivity.RELATIVE)
|
||||
@get:Optional
|
||||
@get:InputDirectory
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
val templateDir = project.objects.property<String?>()
|
||||
|
||||
/**
|
||||
* Resource path containing template files.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val templateResourcePath = project.objects.property<String?>()
|
||||
|
||||
/**
|
||||
* Adds authorization headers when fetching the OpenAPI definitions remotely.
|
||||
* Pass in a URL-encoded string of name:header with a comma separating multiple values
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val auth = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* Sets specified global properties.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val globalProperties = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
@@ -183,271 +183,271 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* File content should be in a json format { "optionKey":"optionValue", "optionKey1":"optionValue1"...}
|
||||
* Supported options can be different for each language. Run config-help -g {generator name} command for language specific config options.
|
||||
*/
|
||||
@Optional
|
||||
@InputFile
|
||||
@PathSensitive(PathSensitivity.RELATIVE)
|
||||
@get:Optional
|
||||
@get:InputFile
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
val configFile = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* Specifies if the existing files should be overwritten during the generation.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val skipOverwrite = project.objects.property<Boolean?>()
|
||||
|
||||
/**
|
||||
* Package for generated classes (where supported)
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val packageName = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* Package for generated api classes
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val apiPackage = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* Package for generated models
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val modelPackage = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* Prefix that will be prepended to all model names. Default is the empty string.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val modelNamePrefix = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* Suffix that will be appended to all model names. Default is the empty string.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val modelNameSuffix = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* Suffix that will be appended to all api names. Default is the empty string.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val apiNameSuffix = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* Sets instantiation type mappings.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val instantiationTypes = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Sets mappings between OpenAPI spec types and generated code types.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val typeMappings = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Sets additional properties that can be referenced by the mustache templates in the format of name=value,name=value.
|
||||
* You can also have multiple occurrences of this option.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val additionalProperties = project.objects.mapProperty<String, Any>()
|
||||
|
||||
/**
|
||||
* Sets server variable for server URL template substitution, in the format of name=value,name=value.
|
||||
* You can also have multiple occurrences of this option.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val serverVariables = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val languageSpecificPrimitives = project.objects.listProperty<String>()
|
||||
|
||||
/**
|
||||
* Specifies .openapi-generator-ignore list in the form of relative/path/to/file1,relative/path/to/file2. For example: README.md,pom.xml.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val openapiGeneratorIgnoreList = project.objects.listProperty<String>()
|
||||
|
||||
/**
|
||||
* Specifies mappings between a given class and the import that should be used for that class.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val importMappings = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Specifies mappings between a given schema and the new one.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val schemaMappings = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Specifies mappings between the inline scheme name and the new name
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val inlineSchemaNameMappings = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Specifies options for inline schemas
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val inlineSchemaOptions = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Specifies mappings between the property name and the new name
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val nameMappings = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Specifies mappings between the parameter name and the new name
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val parameterNameMappings = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Specifies mappings between the model name and the new name
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val modelNameMappings = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Specifies mappings between the enum name and the new name
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val enumNameMappings = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Specifies mappings between the operation id name and the new name
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val operationIdNameMappings = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Specifies mappings (rules) in OpenAPI normalizer
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val openapiNormalizer = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Root package for generated code.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val invokerPackage = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* GroupId in generated pom.xml/build.gradle.kts or other build script. Language-specific conversions occur in non-jvm generators.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val groupId = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* ArtifactId in generated pom.xml/build.gradle.kts or other build script. Language-specific conversions occur in non-jvm generators.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val id = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* Artifact version in generated pom.xml/build.gradle.kts or other build script. Language-specific conversions occur in non-jvm generators.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val version = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* Reference the library template (sub-template) of a generator.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val library = project.objects.property<String?>()
|
||||
|
||||
/**
|
||||
* Git host, e.g. gitlab.com.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val gitHost = project.objects.property<String?>()
|
||||
|
||||
/**
|
||||
* Git user ID, e.g. openapitools.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val gitUserId = project.objects.property<String?>()
|
||||
|
||||
/**
|
||||
* Git repo ID, e.g. openapi-generator.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val gitRepoId = project.objects.property<String?>()
|
||||
|
||||
/**
|
||||
* Release note, default to 'Minor update'.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val releaseNote = project.objects.property<String?>()
|
||||
|
||||
/**
|
||||
* HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}/{language}'
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val httpUserAgent = project.objects.property<String?>()
|
||||
|
||||
/**
|
||||
* Specifies how a reserved name should be escaped to.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val reservedWordsMappings = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.
|
||||
*/
|
||||
@Optional
|
||||
@InputFile
|
||||
@PathSensitive(PathSensitivity.RELATIVE)
|
||||
@get:Optional
|
||||
@get:InputFile
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
val ignoreFileOverride = project.objects.property<String?>()
|
||||
|
||||
/**
|
||||
* Remove prefix of operationId, e.g. config_getId => getId
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val removeOperationIdPrefix = project.objects.property<Boolean?>()
|
||||
|
||||
/**
|
||||
* Remove examples defined in the operation
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val skipOperationExample = project.objects.property<Boolean?>()
|
||||
|
||||
/**
|
||||
@@ -459,8 +459,8 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* in others being disabled. That is, OpenAPI Generator considers any one of these to define a subset of generation.
|
||||
* For more control over generation of individual files, configure an ignore file and refer to it via [ignoreFileOverride].
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val apiFilesConstrainedTo = project.objects.listProperty<String>()
|
||||
|
||||
/**
|
||||
@@ -470,8 +470,8 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* in others being disabled. That is, OpenAPI Generator considers any one of these to define a subset of generation.
|
||||
* For more control over generation of individual files, configure an ignore file and refer to it via [ignoreFileOverride].
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val modelFilesConstrainedTo = project.objects.listProperty<String>()
|
||||
|
||||
/**
|
||||
@@ -484,8 +484,8 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* in others being disabled. That is, OpenAPI Generator considers any one of these to define a subset of generation.
|
||||
* For more control over generation of individual files, configure an ignore file and refer to it via [ignoreFileOverride].
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val supportingFilesConstrainedTo = project.objects.listProperty<String>()
|
||||
|
||||
/**
|
||||
@@ -496,8 +496,8 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* For more control over generation of individual files, configure an ignore file and
|
||||
* refer to it via [ignoreFileOverride].
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val generateModelTests = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
@@ -508,8 +508,8 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* For more control over generation of individual files, configure an ignore file and
|
||||
* refer to it via [ignoreFileOverride].
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val generateModelDocumentation = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
@@ -520,8 +520,8 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* For more control over generation of individual files, configure an ignore file and
|
||||
* refer to it via [ignoreFileOverride].
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val generateApiTests = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
@@ -532,15 +532,15 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* For more control over generation of individual files, configure an ignore file and
|
||||
* refer to it via [ignoreFileOverride].
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val generateApiDocumentation = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
* To write all log messages (not just errors) to STDOUT
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val logToStderr = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
@@ -549,15 +549,15 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* LANG_POST_PROCESS_FILE (e.g. GO_POST_PROCESS_FILE, SCALA_POST_PROCESS_FILE). Please open an issue if your target
|
||||
* generator does not support this functionality.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val enablePostProcessFile = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
* To skip spec validation. When true, we will skip the default behavior of validating a spec before generation.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val skipValidateSpec = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
@@ -565,37 +565,37 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
* definitions generated as top-level Array-of-items, List-of-items, Map-of-items definitions.
|
||||
* When true, A model representation either containing or extending the array,list,map (depending on specific generator implementation) will be generated.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val generateAliasAsModel = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
* A dynamic map of options specific to a generator.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val configOptions = project.objects.mapProperty<String, String>()
|
||||
|
||||
/**
|
||||
* Templating engine: "mustache" (default) or "handlebars" (beta)
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val engine = project.objects.property<String?>()
|
||||
|
||||
/**
|
||||
* Defines whether the output dir should be cleaned up before generating the output.
|
||||
*
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val cleanupOutput = project.objects.property<Boolean>()
|
||||
|
||||
/**
|
||||
* Defines whether the generator should run in dry-run mode.
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val dryRun = project.objects.property<Boolean>()
|
||||
|
||||
private fun <T : Any?> Property<T>.ifNotEmpty(block: Property<T>.(T) -> Unit) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.internal.logging.text.StyledTextOutput
|
||||
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
||||
import org.gradle.kotlin.dsl.listProperty
|
||||
import org.gradle.work.DisableCachingByDefault
|
||||
import org.openapitools.codegen.CodegenConfigLoader
|
||||
import org.openapitools.codegen.CodegenType
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata
|
||||
@@ -36,6 +37,7 @@ import org.openapitools.codegen.meta.Stability
|
||||
*
|
||||
* @author Jim Schubert
|
||||
*/
|
||||
@DisableCachingByDefault(because = "not worth caching")
|
||||
open class GeneratorsTask : DefaultTask() {
|
||||
/**
|
||||
* A list of stability indexes to include (value: all,beta,stable,experimental,deprecated). Excludes deprecated by default.
|
||||
|
||||
@@ -21,6 +21,7 @@ import io.swagger.v3.parser.core.models.ParseOptions
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.GradleException
|
||||
import org.gradle.api.logging.Logging
|
||||
import org.gradle.api.tasks.CacheableTask
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputFile
|
||||
import org.gradle.api.tasks.Internal
|
||||
@@ -51,17 +52,18 @@ import org.openapitools.codegen.validations.oas.RuleConfiguration
|
||||
*
|
||||
* @author Jim Schubert
|
||||
*/
|
||||
@CacheableTask
|
||||
open class ValidateTask : DefaultTask() {
|
||||
@get:InputFile
|
||||
@PathSensitive(PathSensitivity.RELATIVE)
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
val inputSpec = project.objects.property<String>()
|
||||
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val recommend = project.objects.property<Boolean>().convention(true)
|
||||
|
||||
@Optional
|
||||
@Input
|
||||
@get:Optional
|
||||
@get:Input
|
||||
val treatWarningsAsErrors = project.objects.property<Boolean>().convention(false)
|
||||
|
||||
@get:Internal
|
||||
|
||||
@@ -217,9 +217,9 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<swagger-annotations-version>2.2.16</swagger-annotations-version>
|
||||
<jersey-version>2.35</jersey-version>
|
||||
<jackson-version>2.17.1</jackson-version>
|
||||
<jackson-databind-version>2.17.1</jackson-databind-version>
|
||||
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<scribejava-apis-version>8.3.3</scribejava-apis-version>
|
||||
|
||||
@@ -232,8 +232,8 @@
|
||||
<properties>
|
||||
<swagger-annotations-version>1.5.8</swagger-annotations-version>
|
||||
<jersey-version>2.27</jersey-version>
|
||||
<jackson-version>2.15.2</jackson-version>
|
||||
<jackson-databind-nullable-version>0.2.0</jackson-databind-nullable-version>
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
<jodatime-version>2.7</jodatime-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<properties>
|
||||
<swagger-annotations-version>1.5.8</swagger-annotations-version>
|
||||
<jersey-version>2.35</jersey-version>
|
||||
<jackson-version>2.17.1</jackson-version>
|
||||
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
<jodatime-version>2.7</jodatime-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>5.10.2</junit-version>
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.6</version>
|
||||
<version>0.2.7</version>
|
||||
</dependency>
|
||||
<!-- Bean Validation API support -->
|
||||
<dependency>
|
||||
|
||||
@@ -454,4 +454,6 @@ public class CodegenConstants {
|
||||
public static final String WAIT_TIME_OF_THREAD = "waitTimeMillis";
|
||||
|
||||
public static final String USE_DEFAULT_VALUES_FOR_REQUIRED_VARS = "useDefaultValuesForRequiredVars";
|
||||
|
||||
public static final String DEFAULT_TO_EMPTY_CONTAINER = "defaultToEmptyContainer";
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.DEFAULT_TO_EMPTY_CONTAINER;
|
||||
import static org.openapitools.codegen.CodegenConstants.UNSUPPORTED_V310_SPEC_MSG;
|
||||
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
|
||||
import static org.openapitools.codegen.utils.OnceLogger.once;
|
||||
@@ -338,7 +339,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
@Setter @Getter boolean arrayDefaultToEmpty, arrayNullableDefaultToEmpty, arrayOptionalNullableDefaultToEmpty, arrayOptionalDefaultToEmpty;
|
||||
@Setter @Getter boolean mapDefaultToEmpty, mapNullableDefaultToEmpty, mapOptionalNullableDefaultToEmpty, mapOptionalDefaultToEmpty;
|
||||
@Setter @Getter protected boolean defaultToEmptyContainer;
|
||||
final String DEFAULT_TO_EMPTY_CONTAINER = "defaultToEmptyContainer";
|
||||
|
||||
final List EMPTY_LIST = new ArrayList();
|
||||
|
||||
@Override
|
||||
@@ -4289,7 +4290,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
} else { // required
|
||||
if (cp.isNullable && mapNullableDefaultToEmpty) { // nullable
|
||||
p.setDefault(EMPTY_LIST);
|
||||
} else if (!cp.isNullable && mapOptionalDefaultToEmpty) { // non-nullable
|
||||
} else if (!cp.isNullable && mapDefaultToEmpty) { // non-nullable
|
||||
p.setDefault(EMPTY_LIST);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,9 @@ public class OpenAPINormalizer {
|
||||
// when set to true, boolean enum will be converted to just boolean
|
||||
final String SIMPLIFY_BOOLEAN_ENUM = "SIMPLIFY_BOOLEAN_ENUM";
|
||||
|
||||
// when set to true, oneOf/anyOf with enum sub-schemas containing single values will be converted to a single enum
|
||||
final String SIMPLIFY_ONEOF_ANYOF_ENUM = "SIMPLIFY_ONEOF_ANYOF_ENUM";
|
||||
|
||||
// when set to a string value, tags in all operations will be reset to the string value provided
|
||||
final String SET_TAGS_FOR_ALL_OPERATIONS = "SET_TAGS_FOR_ALL_OPERATIONS";
|
||||
String setTagsForAllOperations;
|
||||
@@ -205,11 +208,12 @@ public class OpenAPINormalizer {
|
||||
ruleNames.add(FILTER);
|
||||
ruleNames.add(SET_CONTAINER_TO_NULLABLE);
|
||||
ruleNames.add(SET_PRIMITIVE_TYPES_TO_NULLABLE);
|
||||
|
||||
ruleNames.add(SIMPLIFY_ONEOF_ANYOF_ENUM);
|
||||
|
||||
// rules that are default to true
|
||||
rules.put(SIMPLIFY_ONEOF_ANYOF, true);
|
||||
rules.put(SIMPLIFY_BOOLEAN_ENUM, true);
|
||||
rules.put(SIMPLIFY_ONEOF_ANYOF_ENUM, true);
|
||||
|
||||
processRules(inputRules);
|
||||
|
||||
@@ -972,6 +976,8 @@ public class OpenAPINormalizer {
|
||||
// Remove duplicate oneOf entries
|
||||
ModelUtils.deduplicateOneOfSchema(schema);
|
||||
|
||||
schema = processSimplifyOneOfEnum(schema);
|
||||
|
||||
// simplify first as the schema may no longer be a oneOf after processing the rule below
|
||||
schema = processSimplifyOneOf(schema);
|
||||
|
||||
@@ -1000,6 +1006,11 @@ public class OpenAPINormalizer {
|
||||
}
|
||||
|
||||
protected Schema normalizeAnyOf(Schema schema, Set<Schema> visitedSchemas) {
|
||||
//transform anyOf into enums if needed
|
||||
schema = processSimplifyAnyOfEnum(schema);
|
||||
if (schema.getAnyOf() == null) {
|
||||
return schema;
|
||||
}
|
||||
for (int i = 0; i < schema.getAnyOf().size(); i++) {
|
||||
// normalize anyOf sub schemas one by one
|
||||
Object item = schema.getAnyOf().get(i);
|
||||
@@ -1275,6 +1286,161 @@ public class OpenAPINormalizer {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If the schema is anyOf and all sub-schemas are enums (with one or more values),
|
||||
* then simplify it to a single enum schema containing all the values.
|
||||
*
|
||||
* @param schema Schema
|
||||
* @return Schema
|
||||
*/
|
||||
protected Schema processSimplifyAnyOfEnum(Schema schema) {
|
||||
if (!getRule(SIMPLIFY_ONEOF_ANYOF_ENUM)) {
|
||||
return schema;
|
||||
}
|
||||
|
||||
if (schema.getAnyOf() == null || schema.getAnyOf().isEmpty()) {
|
||||
return schema;
|
||||
}
|
||||
if(schema.getOneOf() != null && !schema.getOneOf().isEmpty() ||
|
||||
schema.getAllOf() != null && !schema.getAllOf().isEmpty() ||
|
||||
schema.getNot() != null) {
|
||||
//only convert to enum if anyOf is the only composition
|
||||
return schema;
|
||||
}
|
||||
|
||||
return simplifyComposedSchemaWithEnums(schema, schema.getAnyOf(), "anyOf");
|
||||
}
|
||||
|
||||
/**
|
||||
* If the schema is oneOf and all sub-schemas are enums (with one or more values),
|
||||
* then simplify it to a single enum schema containing all the values.
|
||||
*
|
||||
* @param schema Schema
|
||||
* @return Schema
|
||||
*/
|
||||
protected Schema processSimplifyOneOfEnum(Schema schema) {
|
||||
if (!getRule(SIMPLIFY_ONEOF_ANYOF_ENUM)) {
|
||||
return schema;
|
||||
}
|
||||
|
||||
if (schema.getOneOf() == null || schema.getOneOf().isEmpty()) {
|
||||
return schema;
|
||||
}
|
||||
if(schema.getAnyOf() != null && !schema.getAnyOf().isEmpty() ||
|
||||
schema.getAllOf() != null && !schema.getAllOf().isEmpty() ||
|
||||
schema.getNot() != null) {
|
||||
//only convert to enum if oneOf is the only composition
|
||||
return schema;
|
||||
}
|
||||
|
||||
return simplifyComposedSchemaWithEnums(schema, schema.getOneOf(), "oneOf");
|
||||
}
|
||||
|
||||
/**
|
||||
* Simplifies a composed schema (oneOf/anyOf) where all sub-schemas are enums
|
||||
* to a single enum schema containing all the values.
|
||||
*
|
||||
* @param schema Schema to modify
|
||||
* @param subSchemas List of sub-schemas to check
|
||||
* @param schemaType Type of composed schema ("oneOf" or "anyOf")
|
||||
* @return Simplified schema
|
||||
*/
|
||||
protected Schema simplifyComposedSchemaWithEnums(Schema schema, List<Object> subSchemas, String composedType) {
|
||||
Map<Object, String> enumValues = new LinkedHashMap<>();
|
||||
|
||||
if(schema.getTypes() != null && schema.getTypes().size() > 1) {
|
||||
// we cannot handle enums with multiple types
|
||||
return schema;
|
||||
}
|
||||
|
||||
if(subSchemas.size() < 2) {
|
||||
//do not process if there's less than 2 sub-schemas. It will be normalized later, and this prevents
|
||||
//named enum schemas from being converted to inline enum schemas
|
||||
return schema;
|
||||
}
|
||||
String schemaType = ModelUtils.getType(schema);
|
||||
|
||||
for (Object item : subSchemas) {
|
||||
if (!(item instanceof Schema)) {
|
||||
return schema;
|
||||
}
|
||||
|
||||
Schema subSchema = ModelUtils.getReferencedSchema(openAPI, (Schema) item);
|
||||
|
||||
// Check if this sub-schema has an enum (with one or more values)
|
||||
if (subSchema.getEnum() == null || subSchema.getEnum().isEmpty()) {
|
||||
return schema;
|
||||
}
|
||||
|
||||
// Ensure all sub-schemas have the same type (if type is specified)
|
||||
if(subSchema.getTypes() != null && subSchema.getTypes().size() > 1) {
|
||||
// we cannot handle enums with multiple types
|
||||
return schema;
|
||||
}
|
||||
String subSchemaType = ModelUtils.getType(subSchema);
|
||||
if (subSchemaType != null) {
|
||||
if (schemaType == null) {
|
||||
schemaType = subSchemaType;
|
||||
} else if (!schemaType.equals(subSchema.getType())) {
|
||||
return schema;
|
||||
}
|
||||
}
|
||||
// Add all enum values from this sub-schema to our collection
|
||||
if(subSchema.getEnum().size() == 1) {
|
||||
String description = subSchema.getTitle() == null ? "" : subSchema.getTitle();
|
||||
if(subSchema.getDescription() != null) {
|
||||
if(!description.isEmpty()) {
|
||||
description += " - ";
|
||||
}
|
||||
description += subSchema.getDescription();
|
||||
}
|
||||
enumValues.put(subSchema.getEnum().get(0), description);
|
||||
} else {
|
||||
for(Object e: subSchema.getEnum()) {
|
||||
enumValues.put(e, "");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return createSimplifiedEnumSchema(schema, enumValues, schemaType, composedType);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a simplified enum schema from collected enum values.
|
||||
*
|
||||
* @param originalSchema Original schema to modify
|
||||
* @param enumValues Collected enum values
|
||||
* @param schemaType Consistent type across sub-schemas
|
||||
* @param composedType Type of composed schema being simplified
|
||||
* @return Simplified enum schema
|
||||
*/
|
||||
protected Schema createSimplifiedEnumSchema(Schema originalSchema, Map<Object, String> enumValues, String schemaType, String composedType) {
|
||||
// Clear the composed schema type
|
||||
if ("oneOf".equals(composedType)) {
|
||||
originalSchema.setOneOf(null);
|
||||
} else if ("anyOf".equals(composedType)) {
|
||||
originalSchema.setAnyOf(null);
|
||||
}
|
||||
|
||||
if (ModelUtils.getType(originalSchema) == null && schemaType != null) {
|
||||
//if type was specified in subschemas, keep it in the main schema
|
||||
ModelUtils.setType(originalSchema, schemaType);
|
||||
}
|
||||
|
||||
originalSchema.setEnum(new ArrayList<>(enumValues.keySet()));
|
||||
if(enumValues.values().stream().anyMatch(e -> !e.isEmpty())) {
|
||||
//set x-enum-descriptions only if there's at least one non-empty description
|
||||
originalSchema.addExtension("x-enum-descriptions", new ArrayList<>(enumValues.values()));
|
||||
}
|
||||
|
||||
LOGGER.debug("Simplified {} with enum sub-schemas to single enum: {}", composedType, originalSchema);
|
||||
|
||||
return originalSchema;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If the schema is oneOf and the sub-schemas is null, set `nullable: true`
|
||||
* instead.
|
||||
|
||||
@@ -10,6 +10,8 @@ import java.util.List;
|
||||
public enum VendorExtension {
|
||||
|
||||
X_IMPLEMENTS("x-implements", ExtensionLevel.MODEL, "Ability to specify interfaces that model must implements", "empty array"),
|
||||
X_KOTLIN_IMPLEMENTS("x-kotlin-implements", ExtensionLevel.MODEL, "Ability to specify interfaces that model must implement", "empty array"),
|
||||
X_KOTLIN_IMPLEMENTS_FIELDS("x-kotlin-implements-fields", ExtensionLevel.MODEL, "Specify attributes that are implemented by the interface(s) added via `x-kotlin-implements`", "empty array"),
|
||||
X_SPRING_PAGINATED("x-spring-paginated", ExtensionLevel.OPERATION, "Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object.", "false"),
|
||||
X_SPRING_PROVIDE_ARGS("x-spring-provide-args", ExtensionLevel.OPERATION, "Allows adding additional hidden parameters in the API specification to allow access to content such as header values or properties", "empty array"),
|
||||
X_DISCRIMINATOR_VALUE("x-discriminator-value", ExtensionLevel.MODEL, "Used with model inheritance to specify value for discriminator that identifies current model", ""),
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import io.swagger.parser.OpenAPIParser;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import io.swagger.v3.parser.core.models.ParseOptions;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.openapitools.codegen.auth.AuthParser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -17,6 +19,7 @@ import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -58,6 +61,7 @@ public class MergedSpecBuilder {
|
||||
ParseOptions options = new ParseOptions();
|
||||
options.setResolve(true);
|
||||
List<SpecWithPaths> allPaths = new ArrayList<>();
|
||||
List<Server> allServers = new ArrayList<>();
|
||||
|
||||
for (String specRelatedPath : specRelatedPaths) {
|
||||
String specPath = inputSpecRootDirectory + File.separator + specRelatedPath;
|
||||
@@ -74,13 +78,14 @@ public class MergedSpecBuilder {
|
||||
isJson = true;
|
||||
}
|
||||
}
|
||||
allServers.addAll(ObjectUtils.defaultIfNull(result.getServers(), Collections.emptyList()));
|
||||
allPaths.add(new SpecWithPaths(specRelatedPath, result.getPaths().keySet()));
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Failed to read file: {}. It would be ignored", specPath);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> mergedSpec = generatedMergedSpec(openapiVersion, allPaths);
|
||||
Map<String, Object> mergedSpec = generatedMergedSpec(openapiVersion, allPaths, allServers);
|
||||
String mergedFilename = this.mergeFileName + (isJson ? ".json" : ".yaml");
|
||||
Path mergedFilePath = Paths.get(inputSpecRootDirectory, mergedFilename);
|
||||
|
||||
@@ -94,8 +99,8 @@ public class MergedSpecBuilder {
|
||||
return mergedFilePath.toString();
|
||||
}
|
||||
|
||||
private Map<String, Object> generatedMergedSpec(String openapiVersion, List<SpecWithPaths> allPaths) {
|
||||
Map<String, Object> spec = generateHeader(openapiVersion, mergedFileInfoName, mergedFileInfoDescription, mergedFileInfoVersion);
|
||||
private Map<String, Object> generatedMergedSpec(String openapiVersion, List<SpecWithPaths> allPaths, List<Server> allServers) {
|
||||
Map<String, Object> spec = generateHeader(openapiVersion, mergedFileInfoName, mergedFileInfoDescription, mergedFileInfoVersion, allServers);
|
||||
Map<String, Object> paths = new HashMap<>();
|
||||
spec.put("paths", paths);
|
||||
|
||||
@@ -111,7 +116,7 @@ public class MergedSpecBuilder {
|
||||
return spec;
|
||||
}
|
||||
|
||||
private static Map<String, Object> generateHeader(String openapiVersion, String title, String description, String version) {
|
||||
private static Map<String, Object> generateHeader(String openapiVersion, String title, String description, String version, List<Server> allServers) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("openapi", openapiVersion);
|
||||
map.put("info", ImmutableMap.of(
|
||||
@@ -119,9 +124,17 @@ public class MergedSpecBuilder {
|
||||
"description", description,
|
||||
"version", version
|
||||
));
|
||||
map.put("servers", Collections.singleton(
|
||||
ImmutableMap.of("url", "http://localhost:8080")
|
||||
));
|
||||
|
||||
Set<ImmutableMap<String, String>> servers = allServers.stream()
|
||||
.map(Server::getUrl)
|
||||
.distinct()
|
||||
.map(url -> ImmutableMap.of("url", url))
|
||||
.collect(Collectors.collectingAndThen(Collectors.toSet(), Optional::of))
|
||||
.filter(Predicate.not(Set::isEmpty))
|
||||
.orElseGet(() -> Collections.singleton(ImmutableMap.of("url", "http://localhost:8080")));
|
||||
|
||||
map.put("servers", servers);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
@@ -835,6 +835,16 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
@Override
|
||||
public CodegenModel fromModel(String name, Schema schema) {
|
||||
CodegenModel m = super.fromModel(name, schema);
|
||||
List<String> implementedInterfacesClasses = (List<String>) m.getVendorExtensions().getOrDefault(VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), List.of());
|
||||
List<String> implementedInterfacesFields = Optional.ofNullable((List<String>) m.getVendorExtensions().get(VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName()))
|
||||
.map(xKotlinImplementsFields -> {
|
||||
if (implementedInterfacesClasses.isEmpty() && !xKotlinImplementsFields.isEmpty()) {
|
||||
LOGGER.warn("Annotating {} with {} without {} is not supported. {} will be ignored.",
|
||||
name, VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName(), VendorExtension.X_KOTLIN_IMPLEMENTS.getName(),
|
||||
VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName());
|
||||
}
|
||||
return xKotlinImplementsFields;
|
||||
}).orElse(List.of());
|
||||
m.optionalVars = m.optionalVars.stream().distinct().collect(Collectors.toList());
|
||||
// Update allVars/requiredVars/optionalVars with isInherited
|
||||
// Each of these lists contains elements that are similar, but they are all cloned
|
||||
@@ -850,7 +860,9 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
// Update any other vars (requiredVars, optionalVars)
|
||||
Stream.of(m.requiredVars, m.optionalVars)
|
||||
.flatMap(List::stream)
|
||||
.filter(p -> allVarsMap.containsKey(p.baseName))
|
||||
.filter(p -> allVarsMap.containsKey(p.baseName)
|
||||
|| implementedInterfacesFields.contains(p.baseName)
|
||||
)
|
||||
.forEach(p -> p.isInherited = true);
|
||||
return m;
|
||||
}
|
||||
@@ -1119,6 +1131,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
}
|
||||
|
||||
protected interface DataTypeAssigner {
|
||||
void setIsVoid(Boolean isVoid);
|
||||
|
||||
void setReturnType(String returnType);
|
||||
|
||||
void setReturnContainer(String returnContainer);
|
||||
@@ -1131,6 +1145,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
protected void doDataTypeAssignment(final String returnType, DataTypeAssigner dataTypeAssigner) {
|
||||
if (returnType == null) {
|
||||
dataTypeAssigner.setReturnType("Unit");
|
||||
dataTypeAssigner.setIsVoid(true);
|
||||
} else if (returnType.startsWith("kotlin.collections.List")) {
|
||||
int end = returnType.lastIndexOf(">");
|
||||
if (end > 0) {
|
||||
|
||||
@@ -317,7 +317,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
||||
imports.put("OffsetDate", "package:time_machine/time_machine.dart");
|
||||
imports.put("OffsetDateTime", "package:time_machine/time_machine.dart");
|
||||
if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) {
|
||||
supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", srcFolder, "local_date_serializer.dart"));
|
||||
supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", srcFolder, "offset_date_serializer.dart"));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.openapitools.codegen.*;
|
||||
@@ -115,6 +116,20 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
|
||||
return "jaxrs-cxf-client";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DocumentationProvider> supportedDocumentationProvider() {
|
||||
return List.of(DocumentationProvider.NONE, DocumentationProvider.SWAGGER1, DocumentationProvider.SWAGGER2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AnnotationLibrary> supportedAnnotationLibraries() {
|
||||
return List.of(AnnotationLibrary.NONE, AnnotationLibrary.SWAGGER1, AnnotationLibrary.SWAGGER2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocumentationProvider defaultDocumentationProvider() {
|
||||
return DocumentationProvider.SWAGGER1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenType getTag() {
|
||||
@@ -127,11 +142,19 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
|
||||
co.subresourceOperation = !co.path.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenModel fromModel(String name, Schema model) {
|
||||
CodegenModel m = super.fromModel(name, model);
|
||||
m.imports.remove("ApiModel");
|
||||
return m;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
|
||||
super.postProcessModelProperty(model, property);
|
||||
model.imports.remove("ApiModelProperty");
|
||||
model.imports.remove("ApiModel");
|
||||
model.imports.remove("JsonTypeName");
|
||||
|
||||
if (jackson) {
|
||||
//Add jackson imports when model has inner enum
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import lombok.Setter;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.languages.features.CXFServerFeatures;
|
||||
import org.openapitools.codegen.languages.features.GzipTestFeatures;
|
||||
@@ -222,12 +223,35 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
|
||||
return "jaxrs-cxf";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DocumentationProvider> supportedDocumentationProvider() {
|
||||
return List.of(DocumentationProvider.NONE, DocumentationProvider.SWAGGER1, DocumentationProvider.SWAGGER2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AnnotationLibrary> supportedAnnotationLibraries() {
|
||||
return List.of(AnnotationLibrary.NONE, AnnotationLibrary.SWAGGER1, AnnotationLibrary.SWAGGER2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocumentationProvider defaultDocumentationProvider() {
|
||||
return DocumentationProvider.SWAGGER1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenModel fromModel(String name, Schema model) {
|
||||
CodegenModel m = super.fromModel(name, model);
|
||||
m.imports.remove("ApiModel");
|
||||
return m;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
|
||||
super.postProcessModelProperty(model, property);
|
||||
model.imports.remove("ApiModelProperty");
|
||||
model.imports.remove("ApiModel");
|
||||
model.imports.remove("JsonFormat");
|
||||
model.imports.remove("JsonTypeName");
|
||||
|
||||
//Add imports for Jackson when model has inner enum
|
||||
if (isJackson()) {
|
||||
|
||||
@@ -1088,6 +1088,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
}
|
||||
}
|
||||
|
||||
if (!AnnotationLibrary.SWAGGER2.equals(getAnnotationLibrary())) {
|
||||
codegenModel.imports.remove("Schema");
|
||||
}
|
||||
|
||||
return codegenModel;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,885 @@
|
||||
/*
|
||||
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law of or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.openapitools.codegen.*;
|
||||
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.model.ModelMap;
|
||||
import org.openapitools.codegen.model.ModelsMap;
|
||||
import org.openapitools.codegen.model.OperationMap;
|
||||
import org.openapitools.codegen.model.OperationsMap;
|
||||
import org.openapitools.codegen.templating.mustache.TrimWhitespaceLambda;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
|
||||
|
||||
import org.openapitools.codegen.utils.CamelizeOption;
|
||||
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
|
||||
|
||||
public class JavaDubboServerCodegen extends AbstractJavaCodegen {
|
||||
private final Logger LOGGER = LoggerFactory.getLogger(JavaDubboServerCodegen.class);
|
||||
|
||||
public static final String TITLE = "title";
|
||||
public static final String CONFIG_PACKAGE = "configPackage";
|
||||
public static final String BASE_PACKAGE = "basePackage";
|
||||
public static final String INTERFACE_ONLY = "interfaceOnly";
|
||||
public static final String USE_TAGS = "useTags";
|
||||
public static final String DUBBO_VERSION = "dubboVersion";
|
||||
public static final String JAVA_VERSION = "javaVersion";
|
||||
public static final String SERVICE_INTERFACE = "serviceInterface";
|
||||
public static final String SERVICE_IMPLEMENTATION = "serviceImplementation";
|
||||
public static final String USE_GENERIC_RESPONSE = "useGenericResponse";
|
||||
public static final String REGISTRY_ADDRESS = "registry-address";
|
||||
|
||||
@Setter
|
||||
protected String title = null;
|
||||
@Getter
|
||||
@Setter
|
||||
protected String configPackage = "org.openapitools.configuration";
|
||||
@Getter
|
||||
@Setter
|
||||
protected String basePackage = "org.openapitools";
|
||||
|
||||
@Setter
|
||||
protected boolean interfaceOnly = false;
|
||||
@Setter
|
||||
protected boolean useTags = true;
|
||||
@Setter
|
||||
protected String javaVersion = "17";
|
||||
@Setter
|
||||
protected String dubboVersion = "3.2.18";
|
||||
@Setter
|
||||
protected boolean serviceInterface = true;
|
||||
@Setter
|
||||
protected boolean serviceImplementation = true;
|
||||
@Setter
|
||||
protected boolean useGenericResponse = false;
|
||||
@Setter
|
||||
protected String registryAddress = "zookeeper://127.0.0.1:2181";
|
||||
|
||||
public JavaDubboServerCodegen() {
|
||||
super();
|
||||
|
||||
modifyFeatureSet(features -> features
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
|
||||
.securityFeatures(EnumSet.of(SecurityFeature.OAuth2_Implicit, SecurityFeature.OAuth2_AuthorizationCode,
|
||||
SecurityFeature.OAuth2_ClientCredentials, SecurityFeature.OAuth2_Password,
|
||||
SecurityFeature.ApiKey, SecurityFeature.BasicAuth))
|
||||
.excludeGlobalFeatures(GlobalFeature.Callbacks, GlobalFeature.LinkObjects, GlobalFeature.ParameterStyling)
|
||||
.includeSchemaSupportFeatures(SchemaSupportFeature.Polymorphism)
|
||||
.excludeParameterFeatures(ParameterFeature.Cookie));
|
||||
|
||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||
.stability(Stability.BETA)
|
||||
.build();
|
||||
|
||||
dateLibrary = "java8";
|
||||
|
||||
useBeanValidation = false;
|
||||
serializableModel = true;
|
||||
outputFolder = "generated-code/java-dubbo";
|
||||
embeddedTemplateDir = templateDir = "java-dubbo";
|
||||
invokerPackage = "org.openapitools";
|
||||
apiPackage = invokerPackage + ".api";
|
||||
modelPackage = invokerPackage + ".model";
|
||||
artifactId = "openapi-dubbo";
|
||||
|
||||
additionalProperties.put("hideGenerationTimestamp", true);
|
||||
additionalProperties.put("withXml", false);
|
||||
|
||||
importMapping.remove("ApiModel");
|
||||
importMapping.remove("ApiModelProperty");
|
||||
|
||||
setDocumentationProvider(DocumentationProvider.NONE);
|
||||
setAnnotationLibrary(AnnotationLibrary.NONE);
|
||||
|
||||
supportsInheritance = false;
|
||||
supportsMixins = false;
|
||||
|
||||
importMapping.remove("ApiModel");
|
||||
importMapping.remove("ApiModelProperty");
|
||||
importMapping.remove("Schema");
|
||||
importMapping.remove("io.swagger.annotations.ApiModel");
|
||||
importMapping.remove("io.swagger.annotations.ApiModelProperty");
|
||||
importMapping.remove("io.swagger.v3.oas.annotations.media.Schema");
|
||||
|
||||
typeMapping.clear();
|
||||
typeMapping.put("integer", "Integer");
|
||||
typeMapping.put("long", "Long");
|
||||
typeMapping.put("float", "Float");
|
||||
typeMapping.put("double", "Double");
|
||||
typeMapping.put("boolean", "Boolean");
|
||||
typeMapping.put("string", "String");
|
||||
typeMapping.put("array", "List");
|
||||
typeMapping.put("map", "Map");
|
||||
typeMapping.put("object", "Object");
|
||||
typeMapping.put("date", "LocalDate");
|
||||
typeMapping.put("DateTime", "OffsetDateTime");
|
||||
typeMapping.put("date-time", "OffsetDateTime");
|
||||
typeMapping.put("number", "BigDecimal");
|
||||
typeMapping.put("decimal", "BigDecimal");
|
||||
typeMapping.put("binary", "byte[]");
|
||||
typeMapping.put("file", "org.springframework.web.multipart.MultipartFile");
|
||||
typeMapping.put("uuid", "UUID");
|
||||
typeMapping.put("byte", "byte[]");
|
||||
typeMapping.put("ByteArray", "byte[]");
|
||||
typeMapping.put("binary", "byte[]");
|
||||
typeMapping.put("password", "String");
|
||||
|
||||
languageSpecificPrimitives.clear();
|
||||
languageSpecificPrimitives.add("String");
|
||||
languageSpecificPrimitives.add("boolean");
|
||||
languageSpecificPrimitives.add("Boolean");
|
||||
languageSpecificPrimitives.add("Double");
|
||||
languageSpecificPrimitives.add("Integer");
|
||||
languageSpecificPrimitives.add("Long");
|
||||
languageSpecificPrimitives.add("Float");
|
||||
languageSpecificPrimitives.add("Object");
|
||||
languageSpecificPrimitives.add("List");
|
||||
languageSpecificPrimitives.add("Map");
|
||||
languageSpecificPrimitives.add("Set");
|
||||
|
||||
importMapping.put("List", "java.util.List");
|
||||
importMapping.put("Map", "java.util.Map");
|
||||
importMapping.put("Set", "java.util.Set");
|
||||
importMapping.put("ArrayList", "java.util.ArrayList");
|
||||
importMapping.put("HashMap", "java.util.HashMap");
|
||||
importMapping.put("HashSet", "java.util.HashSet");
|
||||
importMapping.put("Date", "java.util.Date");
|
||||
importMapping.put("Arrays", "java.util.Arrays");
|
||||
importMapping.put("OffsetDateTime", "java.time.OffsetDateTime");
|
||||
importMapping.put("LocalDate", "java.time.LocalDate");
|
||||
importMapping.put("LocalTime", "java.time.LocalTime");
|
||||
importMapping.put("LocalDateTime", "java.time.LocalDateTime");
|
||||
importMapping.put("BigDecimal", "java.math.BigDecimal");
|
||||
importMapping.put("BigInteger", "java.math.BigInteger");
|
||||
importMapping.put("UUID", "java.util.UUID");
|
||||
importMapping.put("MultipartFile", "org.springframework.web.multipart.MultipartFile");
|
||||
|
||||
typeMapping.put("List", "List");
|
||||
typeMapping.put("Set", "Set");
|
||||
typeMapping.put("Map", "Map");
|
||||
|
||||
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
|
||||
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
|
||||
|
||||
apiTestTemplateFiles.clear();
|
||||
|
||||
apiTemplateFiles.clear();
|
||||
apiTemplateFiles.put("api.mustache", ".java");
|
||||
apiTemplateFiles.put("apiDubbo.mustache", ".java");
|
||||
apiTemplateFiles.put("apiController.mustache", ".java");
|
||||
apiDocTemplateFiles.clear();
|
||||
|
||||
modelTemplateFiles.clear();
|
||||
modelTemplateFiles.put("model.mustache", ".java");
|
||||
modelDocTemplateFiles.clear();
|
||||
|
||||
additionalProperties.put("dubboVersion", dubboVersion);
|
||||
additionalProperties.put("javaVersion", javaVersion);
|
||||
|
||||
cliOptions.add(new CliOption(TITLE, "API title name").defaultValue(title));
|
||||
cliOptions.add(new CliOption(CONFIG_PACKAGE, "configuration package for generated code")
|
||||
.defaultValue(this.getConfigPackage()));
|
||||
cliOptions.add(new CliOption(BASE_PACKAGE, "base package (invokerPackage) for generated code")
|
||||
.defaultValue(this.getBasePackage()));
|
||||
cliOptions.add(CliOption.newBoolean(INTERFACE_ONLY,
|
||||
"Whether to generate only API interface stubs without the server files.", interfaceOnly));
|
||||
cliOptions.add(CliOption.newBoolean(USE_TAGS, "use tags for creating interface and controller classnames", useTags));
|
||||
cliOptions.add(new CliOption(DUBBO_VERSION, "Dubbo version").defaultValue(dubboVersion));
|
||||
cliOptions.add(new CliOption(JAVA_VERSION, "Java version").defaultValue(javaVersion));
|
||||
cliOptions.add(CliOption.newBoolean(SERVICE_INTERFACE, "Generate service interface", serviceInterface));
|
||||
cliOptions.add(CliOption.newBoolean(SERVICE_IMPLEMENTATION, "Generate service implementation", serviceImplementation));
|
||||
cliOptions.add(CliOption.newBoolean(USE_GENERIC_RESPONSE, "Use generic response wrapper", useGenericResponse));
|
||||
cliOptions.add(new CliOption(REGISTRY_ADDRESS, "Registry address (e.g., zookeeper://127.0.0.1:2181 or nacos://127.0.0.1:8848)")
|
||||
.defaultValue(registryAddress));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenType getTag() {
|
||||
return CodegenType.SERVER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "java-dubbo";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp() {
|
||||
return "Generates a Java Apache Dubbo server application.";
|
||||
}
|
||||
|
||||
private boolean isOutputFolderPointingToSourceDirectory() {
|
||||
if (outputFolder == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String normalizedPath = outputFolder.replace('\\', '/');
|
||||
return normalizedPath.endsWith("/src/main/java") || normalizedPath.endsWith("src/main/java");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String outputFolder() {
|
||||
if (isOutputFolderPointingToSourceDirectory()) {
|
||||
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
|
||||
|
||||
for (StackTraceElement element : stackTrace) {
|
||||
String methodName = element.getMethodName();
|
||||
String className = element.getClassName();
|
||||
|
||||
if (className.equals("org.openapitools.codegen.DefaultGenerator")) {
|
||||
if (methodName.equals("generateVersionMetadata") ||
|
||||
methodName.equals("generateFilesMetadata")) {
|
||||
|
||||
return outputFolder + File.separator + ".." + File.separator + ".." + File.separator + "..";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return outputFolder;
|
||||
}
|
||||
|
||||
public String getIgnoreFileOutputPath() {
|
||||
if (isOutputFolderPointingToSourceDirectory()) {
|
||||
return outputFolder + File.separator + ".." + File.separator + ".." + File.separator + "..";
|
||||
}
|
||||
return outputFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processOpts() {
|
||||
final List<org.apache.commons.lang3.tuple.Pair<String, String>> configOptions =
|
||||
additionalProperties.entrySet().stream()
|
||||
.filter(e -> !Arrays.asList("hideGenerationTimestamp").contains(e.getKey()))
|
||||
.filter(e -> cliOptions.stream().map(CliOption::getOpt).anyMatch(opt -> opt.equals(e.getKey())))
|
||||
.map(e -> org.apache.commons.lang3.tuple.Pair.of(e.getKey(), e.getValue().toString()))
|
||||
.collect(Collectors.toList());
|
||||
additionalProperties.put("configOptions", configOptions);
|
||||
|
||||
super.processOpts();
|
||||
|
||||
supportingFiles.removeIf(sf -> sf.getDestinationFilename().equals(".openapi-generator-ignore"));
|
||||
|
||||
openapiGeneratorIgnoreList = new HashSet<>();
|
||||
openapiGeneratorIgnoreList.add("# Dubbo generator explicitly disables .openapi-generator-ignore");
|
||||
|
||||
importMapping.remove("ApiModel");
|
||||
importMapping.remove("ApiModelProperty");
|
||||
importMapping.remove("io.swagger.annotations.ApiModel");
|
||||
importMapping.remove("io.swagger.annotations.ApiModelProperty");
|
||||
importMapping.remove("Schema");
|
||||
importMapping.remove("io.swagger.v3.oas.annotations.media.Schema");
|
||||
|
||||
String userTitle = (String) additionalProperties.get(TITLE);
|
||||
boolean userProvidedTitle = userTitle != null && !userTitle.equals("OpenAPI Dubbo");
|
||||
|
||||
if (userProvidedTitle) {
|
||||
this.title = userTitle;
|
||||
}
|
||||
|
||||
additionalProperties.put("userProvidedTitle", userProvidedTitle);
|
||||
|
||||
additionalProperties.put("title", this.title);
|
||||
|
||||
if (additionalProperties.containsKey(CONFIG_PACKAGE)) {
|
||||
this.setConfigPackage((String) additionalProperties.get(CONFIG_PACKAGE));
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(BASE_PACKAGE)) {
|
||||
String basePackageName = (String) additionalProperties.get(BASE_PACKAGE);
|
||||
this.setBasePackage(basePackageName);
|
||||
this.setInvokerPackage(basePackageName);
|
||||
|
||||
this.apiPackage = basePackageName + ".api";
|
||||
this.modelPackage = basePackageName + ".model";
|
||||
|
||||
if (!additionalProperties.containsKey(CONFIG_PACKAGE)) {
|
||||
this.configPackage = basePackageName + ".configuration";
|
||||
}
|
||||
|
||||
updateOption(CodegenConstants.API_PACKAGE, this.apiPackage);
|
||||
updateOption(CodegenConstants.MODEL_PACKAGE, this.modelPackage);
|
||||
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(INTERFACE_ONLY)) {
|
||||
this.interfaceOnly = Boolean.parseBoolean(additionalProperties.get(INTERFACE_ONLY).toString());
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(USE_TAGS)) {
|
||||
this.useTags = Boolean.parseBoolean(additionalProperties.get(USE_TAGS).toString());
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(DUBBO_VERSION)) {
|
||||
this.dubboVersion = (String) additionalProperties.get(DUBBO_VERSION);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(JAVA_VERSION)) {
|
||||
this.javaVersion = (String) additionalProperties.get(JAVA_VERSION);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(SERVICE_INTERFACE)) {
|
||||
this.serviceInterface = Boolean.parseBoolean(additionalProperties.get(SERVICE_INTERFACE).toString());
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(SERVICE_IMPLEMENTATION)) {
|
||||
this.serviceImplementation = Boolean.parseBoolean(additionalProperties.get(SERVICE_IMPLEMENTATION).toString());
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(USE_GENERIC_RESPONSE)) {
|
||||
this.useGenericResponse = Boolean.parseBoolean(additionalProperties.get(USE_GENERIC_RESPONSE).toString());
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(REGISTRY_ADDRESS)) {
|
||||
this.registryAddress = (String) additionalProperties.get(REGISTRY_ADDRESS);
|
||||
}
|
||||
|
||||
additionalProperties.put("title", this.title);
|
||||
additionalProperties.put("configPackage", this.configPackage);
|
||||
additionalProperties.put("basePackage", this.basePackage);
|
||||
additionalProperties.put("apiPackage", this.apiPackage);
|
||||
additionalProperties.put("modelPackage", this.modelPackage);
|
||||
additionalProperties.put("invokerPackage", this.getInvokerPackage());
|
||||
additionalProperties.put("interfaceOnly", interfaceOnly);
|
||||
additionalProperties.put("useTags", useTags);
|
||||
additionalProperties.put("dubboVersion", dubboVersion);
|
||||
additionalProperties.put("javaVersion", javaVersion);
|
||||
additionalProperties.put("serviceInterface", serviceInterface);
|
||||
additionalProperties.put("serviceImplementation", serviceImplementation);
|
||||
additionalProperties.put("useGenericResponse", useGenericResponse);
|
||||
additionalProperties.put("registryAddress", registryAddress);
|
||||
|
||||
supportingFiles.clear();
|
||||
|
||||
if (isOutputFolderPointingToSourceDirectory()) {
|
||||
String rootPath = ".." + File.separator + ".." + File.separator + "..";
|
||||
supportingFiles.add(new SupportingFile("pom.mustache", rootPath, "pom.xml"));
|
||||
supportingFiles.add(new SupportingFile("README.mustache", rootPath, "README.md"));
|
||||
|
||||
} else {
|
||||
supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml"));
|
||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||
}
|
||||
|
||||
if (serviceImplementation && !interfaceOnly) {
|
||||
String mainClassName;
|
||||
boolean isUserTitle = (Boolean) additionalProperties.getOrDefault("userProvidedTitle", false);
|
||||
|
||||
if (isUserTitle) {
|
||||
String titleName = (String) additionalProperties.get(TITLE);
|
||||
mainClassName = (camelize(titleName.trim(), CamelizeOption.UPPERCASE_FIRST_CHAR) + "Application").replaceAll("\\s+", "");
|
||||
;
|
||||
} else {
|
||||
mainClassName = "OpenApiGeneratorApplication";
|
||||
}
|
||||
|
||||
String testClassName = mainClassName + "Tests";
|
||||
additionalProperties.put("mainClassName", mainClassName);
|
||||
additionalProperties.put("testClassName", testClassName);
|
||||
|
||||
if (isOutputFolderPointingToSourceDirectory()) {
|
||||
supportingFiles.add(new SupportingFile("mainApplication.mustache",
|
||||
basePackage.replace(".", File.separator),
|
||||
mainClassName + ".java"));
|
||||
|
||||
supportingFiles.add(new SupportingFile("applicationTest.mustache",
|
||||
".." + File.separator + ".." + File.separator + ".." + File.separator + "src" + File.separator + "test" + File.separator + "java" + File.separator + basePackage.replace(".", File.separator),
|
||||
testClassName + ".java"));
|
||||
|
||||
supportingFiles.add(new SupportingFile("application.mustache",
|
||||
".." + File.separator + ".." + File.separator + ".." + File.separator + "src" + File.separator + "main" + File.separator + "resources",
|
||||
"application.yml"));
|
||||
} else {
|
||||
supportingFiles.add(new SupportingFile("mainApplication.mustache",
|
||||
(sourceFolder + File.separator + basePackage).replace(".", File.separator),
|
||||
mainClassName + ".java"));
|
||||
|
||||
supportingFiles.add(new SupportingFile("applicationTest.mustache",
|
||||
(testFolder + File.separator + basePackage).replace(".", File.separator),
|
||||
testClassName + ".java"));
|
||||
|
||||
supportingFiles.add(new SupportingFile("application.mustache",
|
||||
"src/main/resources".replace("/", File.separator),
|
||||
"application.yml"));
|
||||
}
|
||||
}
|
||||
|
||||
additionalProperties.put("lambdaTrimWhitespace", new TrimWhitespaceLambda());
|
||||
|
||||
additionalProperties.put("documentationProvider", "none");
|
||||
additionalProperties.put("annotationLibrary", "none");
|
||||
additionalProperties.put("hideGenerationTimestamp", true);
|
||||
additionalProperties.put("useBeanValidation", false);
|
||||
additionalProperties.put("performBeanValidation", false);
|
||||
|
||||
}
|
||||
|
||||
private boolean isDubbo33OrHigher(String version) {
|
||||
if (version == null || version.trim().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
String cleanVersion = version.split("-")[0];
|
||||
String[] parts = cleanVersion.split("\\.");
|
||||
if (parts.length >= 2) {
|
||||
int major = Integer.parseInt(parts[0]);
|
||||
int minor = Integer.parseInt(parts[1]);
|
||||
|
||||
return major > 3 || (major == 3 && minor >= 3);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
LOGGER.warn("Unable to parse Dubbo version: " + version);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs) {
|
||||
generateYAMLSpecFile(objs);
|
||||
objs = super.postProcessSupportingFileData(objs);
|
||||
|
||||
objs.put("interfacePackage", apiPackage + ".interfaces");
|
||||
objs.put("consumerPackage", apiPackage + ".consumer");
|
||||
objs.put("providerPackage", apiPackage + ".provider");
|
||||
|
||||
objs.put("registryAddress", registryAddress);
|
||||
|
||||
boolean isDubbo33Plus = isDubbo33OrHigher(dubboVersion);
|
||||
objs.put("isDubbo33Plus", isDubbo33Plus);
|
||||
|
||||
boolean isZookeeperRegistry = registryAddress != null && registryAddress.startsWith("zookeeper://");
|
||||
boolean isNacosRegistry = registryAddress != null && registryAddress.startsWith("nacos://");
|
||||
objs.put("isZookeeperRegistry", isZookeeperRegistry);
|
||||
objs.put("isNacosRegistry", isNacosRegistry);
|
||||
|
||||
String nacosClientVersion = isDubbo33Plus ? "2.5.0" : "2.2.4";
|
||||
objs.put("nacosClientVersion", nacosClientVersion);
|
||||
|
||||
return objs;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<ModelMap> allModels) {
|
||||
OperationsMap results = super.postProcessOperationsWithModels(objs, allModels);
|
||||
|
||||
if (results.getImports() != null) {
|
||||
boolean hasJavaUtilImports = false;
|
||||
Iterator<Map<String, String>> importIterator = results.getImports().iterator();
|
||||
while (importIterator.hasNext()) {
|
||||
Map<String, String> importMap = importIterator.next();
|
||||
String importName = importMap.get("import");
|
||||
if (importName != null && importName.startsWith("java.util.") &&
|
||||
!importName.equals("java.util.*") &&
|
||||
!importName.equals("java.util.UUID")) {
|
||||
importIterator.remove();
|
||||
hasJavaUtilImports = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasJavaUtilImports) {
|
||||
Map<String, String> utilImport = new HashMap<>();
|
||||
utilImport.put("import", "java.util.*");
|
||||
utilImport.put("classname", "*");
|
||||
results.getImports().add(utilImport);
|
||||
}
|
||||
}
|
||||
|
||||
OperationMap operations = results.getOperations();
|
||||
if (operations != null) {
|
||||
String baseName = (String) operations.get("baseName");
|
||||
String originalClassName = (String) operations.get("classname");
|
||||
|
||||
if (baseName == null) {
|
||||
baseName = originalClassName;
|
||||
if (baseName != null && baseName.endsWith("Service")) {
|
||||
baseName = baseName.substring(0, baseName.length() - 7).toLowerCase(java.util.Locale.ROOT);
|
||||
} else if (baseName != null && baseName.endsWith("Api")) {
|
||||
baseName = baseName.substring(0, baseName.length() - 3).toLowerCase(java.util.Locale.ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
if (baseName != null) {
|
||||
if ("ashares".equals(baseName)) {
|
||||
operations.put("baseName", "a");
|
||||
} else if ("usdata".equals(baseName)) {
|
||||
operations.put("baseName", "us");
|
||||
} else if ("kline".equals(baseName)) {
|
||||
operations.put("baseName", "kline");
|
||||
}
|
||||
}
|
||||
|
||||
if (originalClassName != null) {
|
||||
String serviceName = originalClassName;
|
||||
if (serviceName.endsWith("Api")) {
|
||||
serviceName = serviceName.replace("Api", "Service");
|
||||
} else if (serviceName.endsWith("Service")) {
|
||||
serviceName = originalClassName;
|
||||
}
|
||||
operations.put("serviceName", serviceName);
|
||||
operations.put("serviceVarName", camelize(serviceName, LOWERCASE_FIRST_LETTER));
|
||||
|
||||
operations.put("servicePackage", apiPackage + ".interfaces");
|
||||
operations.put("serviceImport", apiPackage + ".interfaces." + serviceName);
|
||||
operations.put("interfacePackage", apiPackage + ".interfaces");
|
||||
operations.put("consumerPackage", apiPackage + ".consumer");
|
||||
operations.put("providerPackage", apiPackage + ".provider");
|
||||
}
|
||||
|
||||
List<CodegenOperation> ops = operations.getOperation();
|
||||
for (CodegenOperation operation : ops) {
|
||||
if (useGenericResponse) {
|
||||
operation.vendorExtensions.put("x-generic-response", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
results.put("interfacePackage", apiPackage + ".interfaces");
|
||||
results.put("consumerPackage", apiPackage + ".consumer");
|
||||
results.put("providerPackage", apiPackage + ".provider");
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiFileFolder() {
|
||||
if (isOutputFolderPointingToSourceDirectory()) {
|
||||
return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar);
|
||||
} else {
|
||||
return outputFolder + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator + apiPackage().replace('.', File.separatorChar);
|
||||
}
|
||||
}
|
||||
|
||||
public String getFileFolderForTemplate(String templateName) {
|
||||
String baseFolder;
|
||||
if (isOutputFolderPointingToSourceDirectory()) {
|
||||
baseFolder = outputFolder + File.separator + apiPackage().replace('.', File.separatorChar);
|
||||
} else {
|
||||
baseFolder = outputFolder + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator + apiPackage().replace('.', File.separatorChar);
|
||||
}
|
||||
|
||||
if ("api.mustache".equals(templateName)) {
|
||||
return baseFolder + File.separator + "interfaces";
|
||||
} else if ("apiController.mustache".equals(templateName)) {
|
||||
return baseFolder + File.separator + "consumer";
|
||||
} else if ("apiDubbo.mustache".equals(templateName)) {
|
||||
return baseFolder + File.separator + "provider";
|
||||
}
|
||||
|
||||
return baseFolder;
|
||||
}
|
||||
|
||||
public String getPackageForTemplate(String templateName) {
|
||||
if ("api.mustache".equals(templateName)) {
|
||||
return apiPackage() + ".interfaces";
|
||||
} else if ("apiController.mustache".equals(templateName)) {
|
||||
return apiPackage() + ".consumer";
|
||||
} else if ("apiDubbo.mustache".equals(templateName)) {
|
||||
return apiPackage() + ".provider";
|
||||
}
|
||||
return apiPackage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelFileFolder() {
|
||||
if (isOutputFolderPointingToSourceDirectory()) {
|
||||
return outputFolder + File.separator + modelPackage().replace('.', File.separatorChar);
|
||||
} else {
|
||||
return outputFolder + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator + modelPackage().replace('.', File.separatorChar);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String apiFilename(String templateName, String tag) {
|
||||
String suffix = apiTemplateFiles().get(templateName);
|
||||
if (suffix == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String folder = getFileFolderForTemplate(templateName);
|
||||
String filename;
|
||||
|
||||
String apiName = toApiName(tag);
|
||||
|
||||
if ("api.mustache".equals(templateName)) {
|
||||
filename = apiName;
|
||||
} else if ("apiDubbo.mustache".equals(templateName)) {
|
||||
filename = apiName + "Impl";
|
||||
} else if ("apiController.mustache".equals(templateName)) {
|
||||
filename = apiName + "Controller";
|
||||
} else {
|
||||
filename = toApiFilename(tag);
|
||||
}
|
||||
|
||||
return folder + File.separator + filename + suffix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toApiName(String name) {
|
||||
if (name.length() == 0) {
|
||||
return "DefaultService";
|
||||
}
|
||||
name = sanitizeName(name);
|
||||
String apiName = camelize(name, CamelizeOption.UPPERCASE_FIRST_CHAR);
|
||||
|
||||
if (!apiName.endsWith("Service")) {
|
||||
apiName = apiName + "Service";
|
||||
}
|
||||
|
||||
return apiName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map<String, List<CodegenOperation>> operations) {
|
||||
if (useTags) {
|
||||
String basePath = resourcePath;
|
||||
if (basePath.startsWith("/")) {
|
||||
basePath = basePath.substring(1);
|
||||
}
|
||||
int pos = basePath.indexOf("/");
|
||||
if (pos > 0) {
|
||||
basePath = basePath.substring(0, pos);
|
||||
}
|
||||
|
||||
if (basePath.length() == 0) {
|
||||
basePath = "default";
|
||||
} else {
|
||||
String subPath = resourcePath;
|
||||
if (subPath.startsWith("/" + basePath)) {
|
||||
subPath = subPath.substring(("/" + basePath).length());
|
||||
}
|
||||
if (subPath.isEmpty()) {
|
||||
subPath = "/";
|
||||
}
|
||||
co.vendorExtensions.put("x-sub-path", subPath);
|
||||
co.subresourceOperation = !subPath.equals("/");
|
||||
|
||||
co.vendorExtensions.put("x-base-path", "/" + basePath);
|
||||
|
||||
if ("a".equals(basePath)) {
|
||||
basePath = "ashares";
|
||||
} else if ("us".equals(basePath)) {
|
||||
basePath = "usdata";
|
||||
}
|
||||
}
|
||||
List<CodegenOperation> opList = operations.computeIfAbsent(basePath, k -> new ArrayList<>());
|
||||
opList.add(co);
|
||||
co.baseName = basePath;
|
||||
} else {
|
||||
super.addOperationToGroup(tag, resourcePath, operation, co, operations);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDataTypeString(String dataType) {
|
||||
return "String".equals(dataType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeDeclaration(Schema p) {
|
||||
if (ModelUtils.isArraySchema(p)) {
|
||||
Schema inner = ModelUtils.getSchemaItems(p);
|
||||
String innerType = getTypeDeclaration(inner);
|
||||
return "List<" + innerType + ">";
|
||||
} else if (ModelUtils.isMapSchema(p)) {
|
||||
Schema inner = ModelUtils.getAdditionalProperties(p);
|
||||
String innerType = getTypeDeclaration(inner);
|
||||
return "Map<String, " + innerType + ">";
|
||||
}
|
||||
return super.getTypeDeclaration(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSchemaType(Schema p) {
|
||||
String openAPIType = super.getSchemaType(p);
|
||||
if (typeMapping.containsKey(openAPIType)) {
|
||||
return typeMapping.get(openAPIType);
|
||||
}
|
||||
return openAPIType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Set<String> defaultIncludes() {
|
||||
return new HashSet<String>(
|
||||
Arrays.asList(
|
||||
"double",
|
||||
"int",
|
||||
"long",
|
||||
"short",
|
||||
"char",
|
||||
"float",
|
||||
"String",
|
||||
"boolean",
|
||||
"Boolean",
|
||||
"Double",
|
||||
"Void",
|
||||
"Integer",
|
||||
"Long",
|
||||
"Float")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toModelImport(String name) {
|
||||
if ("ApiModel".equals(name) || "ApiModelProperty".equals(name)) {
|
||||
return null;
|
||||
}
|
||||
if ("".equals(modelPackage())) {
|
||||
return name;
|
||||
} else {
|
||||
return modelPackage() + "." + name;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeDeclaration(String name) {
|
||||
if ("ApiModel".equals(name) || "ApiModelProperty".equals(name)) {
|
||||
return null;
|
||||
}
|
||||
return super.getTypeDeclaration(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needToImport(String type) {
|
||||
if ("ApiModel".equals(type) ||
|
||||
"ApiModelProperty".equals(type) ||
|
||||
"io.swagger.annotations.ApiModel".equals(type) ||
|
||||
"io.swagger.annotations.ApiModelProperty".equals(type) ||
|
||||
"Schema".equals(type) ||
|
||||
"io.swagger.v3.oas.annotations.media.Schema".equals(type)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ("LocalDate".equals(type) ||
|
||||
"LocalDateTime".equals(type) ||
|
||||
"LocalTime".equals(type) ||
|
||||
"OffsetDateTime".equals(type) ||
|
||||
"BigDecimal".equals(type) ||
|
||||
"BigInteger".equals(type) ||
|
||||
"UUID".equals(type)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.needToImport(type);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ModelsMap postProcessModels(ModelsMap objs) {
|
||||
objs = super.postProcessModels(objs);
|
||||
|
||||
for (ModelMap modelMap : objs.getModels()) {
|
||||
CodegenModel model = modelMap.getModel();
|
||||
model.imports.remove("ApiModel");
|
||||
model.imports.remove("ApiModelProperty");
|
||||
model.imports.remove("io.swagger.annotations.ApiModel");
|
||||
model.imports.remove("io.swagger.annotations.ApiModelProperty");
|
||||
model.imports.remove("Schema");
|
||||
model.imports.remove("io.swagger.v3.oas.annotations.media.Schema");
|
||||
|
||||
boolean hasJavaUtilImports = false;
|
||||
Set<String> javaUtilImports = new HashSet<>();
|
||||
Iterator<String> iterator = model.imports.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String importName = iterator.next();
|
||||
if (importName.startsWith("java.util.") &&
|
||||
!importName.equals("java.util.*") &&
|
||||
!importName.equals("java.util.UUID")) {
|
||||
javaUtilImports.add(importName);
|
||||
iterator.remove();
|
||||
hasJavaUtilImports = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasJavaUtilImports) {
|
||||
model.imports.add("java.util.*");
|
||||
}
|
||||
|
||||
for (CodegenProperty var : model.vars) {
|
||||
if (var.allowableValues != null && var.allowableValues.get("imports") != null) {
|
||||
((Set<String>) var.allowableValues.get("imports")).remove("ApiModel");
|
||||
((Set<String>) var.allowableValues.get("imports")).remove("ApiModelProperty");
|
||||
((Set<String>) var.allowableValues.get("imports")).remove("io.swagger.annotations.ApiModel");
|
||||
((Set<String>) var.allowableValues.get("imports")).remove("io.swagger.annotations.ApiModelProperty");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (objs.getImports() != null) {
|
||||
objs.getImports().removeIf(importMap -> {
|
||||
String className = importMap.get("classname");
|
||||
return "ApiModel".equals(className) || "ApiModelProperty".equals(className);
|
||||
});
|
||||
|
||||
boolean hasJavaUtilImports = false;
|
||||
Iterator<Map<String, String>> importIterator = objs.getImports().iterator();
|
||||
while (importIterator.hasNext()) {
|
||||
Map<String, String> importMap = importIterator.next();
|
||||
String importName = importMap.get("import");
|
||||
if (importName != null && importName.startsWith("java.util.") &&
|
||||
!importName.equals("java.util.*") &&
|
||||
!importName.equals("java.util.UUID")) {
|
||||
importIterator.remove();
|
||||
hasJavaUtilImports = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasJavaUtilImports) {
|
||||
Map<String, String> utilImport = new HashMap<>();
|
||||
utilImport.put("import", "java.util.*");
|
||||
utilImport.put("classname", "*");
|
||||
objs.getImports().add(utilImport);
|
||||
}
|
||||
}
|
||||
|
||||
return objs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toModelDocFilename(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toApiDocFilename(String name) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import java.util.Locale;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -37,6 +38,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
|
||||
public static final String INTERFACE_ONLY = "interfaceOnly";
|
||||
public static final String RETURN_RESPONSE = "returnResponse";
|
||||
public static final String RETURN_JBOSS_RESPONSE = "returnJBossResponse";
|
||||
public static final String GENERATE_POM = "generatePom";
|
||||
public static final String USE_SWAGGER_ANNOTATIONS = "useSwaggerAnnotations";
|
||||
public static final String USE_MICROPROFILE_OPENAPI_ANNOTATIONS = "useMicroProfileOpenAPIAnnotations";
|
||||
@@ -52,6 +54,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
|
||||
private boolean interfaceOnly = false;
|
||||
private boolean returnResponse = false;
|
||||
private boolean returnJbossResponse = false;
|
||||
private boolean generatePom = true;
|
||||
private boolean useSwaggerAnnotations = true;
|
||||
private boolean useMicroProfileOpenAPIAnnotations = false;
|
||||
@@ -128,6 +131,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
cliOptions.add(CliOption.newBoolean(GENERATE_POM, "Whether to generate pom.xml if the file does not already exist.").defaultValue(String.valueOf(generatePom)));
|
||||
cliOptions.add(CliOption.newBoolean(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.").defaultValue(String.valueOf(interfaceOnly)));
|
||||
cliOptions.add(CliOption.newBoolean(RETURN_RESPONSE, "Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.").defaultValue(String.valueOf(returnResponse)));
|
||||
cliOptions.add(CliOption.newBoolean(RETURN_JBOSS_RESPONSE, "Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. This flag cannot be combined with `returnResponse` flag. It requires the flag `interfaceOnly` and `useJakartaEE` set to true, because `org.jboss.resteasy.reactive.RestResponse` was introduced in Quarkus 2.x").defaultValue(String.valueOf(returnJbossResponse)));
|
||||
cliOptions.add(CliOption.newBoolean(USE_SWAGGER_ANNOTATIONS, "Whether to generate Swagger annotations.", useSwaggerAnnotations));
|
||||
cliOptions.add(CliOption.newBoolean(USE_MICROPROFILE_OPENAPI_ANNOTATIONS, "Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.", useMicroProfileOpenAPIAnnotations));
|
||||
cliOptions.add(CliOption.newString(OPEN_API_SPEC_FILE_LOCATION, "Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string."));
|
||||
@@ -142,6 +146,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
|
||||
convertPropertyToBooleanAndWriteBack(INTERFACE_ONLY, value -> interfaceOnly = value);
|
||||
convertPropertyToBooleanAndWriteBack(RETURN_RESPONSE, value -> returnResponse = value);
|
||||
convertPropertyToBooleanAndWriteBack(RETURN_JBOSS_RESPONSE, value -> returnJbossResponse = value);
|
||||
convertPropertyToBooleanAndWriteBack(SUPPORT_ASYNC, this::setSupportAsync);
|
||||
if (QUARKUS_LIBRARY.equals(library) || THORNTAIL_LIBRARY.equals(library) || HELIDON_LIBRARY.equals(library) || OPEN_LIBERTY_LIBRARY.equals(library) || KUMULUZEE_LIBRARY.equals(library)) {
|
||||
useSwaggerAnnotations = false;
|
||||
@@ -218,6 +223,18 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
.doNotOverwrite());
|
||||
supportingFiles.add(new SupportingFile("dockerignore.mustache", "", ".dockerignore")
|
||||
.doNotOverwrite());
|
||||
if(returnResponse && returnJbossResponse) {
|
||||
String msg = String.format(Locale.ROOT,
|
||||
"You cannot combine [%s] and [%s] since they are mutually exclusive",
|
||||
RETURN_RESPONSE, RETURN_JBOSS_RESPONSE);
|
||||
throw new IllegalArgumentException(msg);
|
||||
}
|
||||
if(returnJbossResponse && !useJakartaEe) {
|
||||
String msg = String.format(Locale.ROOT,
|
||||
"The [%s] requires [%s] to be true, because org.jboss.resteasy.reactive.RestResponse was introduced in Quarkus 2.x",
|
||||
RETURN_JBOSS_RESPONSE, USE_JAKARTA_EE);
|
||||
throw new IllegalArgumentException(msg);
|
||||
}
|
||||
} else if (OPEN_LIBERTY_LIBRARY.equals(library)) {
|
||||
supportingFiles.add(new SupportingFile("server.xml.mustache", "src/main/liberty/config", "server.xml")
|
||||
.doNotOverwrite());
|
||||
|
||||
@@ -642,7 +642,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
|
||||
typeMapping.put("Date", "LocalDate");
|
||||
typeMapping.put("Time", "LocalTime");
|
||||
|
||||
importMapping.put("Instant", "kotlinx.datetime.Instant");
|
||||
importMapping.put("Instant", "kotlin.time.Instant");
|
||||
importMapping.put("LocalDate", "kotlinx.datetime.LocalDate");
|
||||
importMapping.put("LocalTime", "kotlinx.datetime.LocalTime");
|
||||
}
|
||||
@@ -887,7 +887,6 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
|
||||
|
||||
// multiplatform specific supporting files
|
||||
supportingFiles.add(new SupportingFile("infrastructure/Base64ByteArray.kt.mustache", infrastructureFolder, "Base64ByteArray.kt"));
|
||||
supportingFiles.add(new SupportingFile("infrastructure/Bytes.kt.mustache", infrastructureFolder, "Bytes.kt"));
|
||||
supportingFiles.add(new SupportingFile("infrastructure/HttpResponse.kt.mustache", infrastructureFolder, "HttpResponse.kt"));
|
||||
supportingFiles.add(new SupportingFile("infrastructure/OctetByteArray.kt.mustache", infrastructureFolder, "OctetByteArray.kt"));
|
||||
|
||||
|
||||
@@ -418,6 +418,11 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanVa
|
||||
}
|
||||
|
||||
doDataTypeAssignment(resp.dataType, new DataTypeAssigner() {
|
||||
@Override
|
||||
public void setIsVoid(Boolean isVoid) {
|
||||
resp.isVoid = isVoid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReturnType(final String returnType) {
|
||||
resp.dataType = returnType;
|
||||
@@ -432,6 +437,10 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanVa
|
||||
}
|
||||
|
||||
doDataTypeAssignment(operation.returnType, new DataTypeAssigner() {
|
||||
@Override
|
||||
public void setIsVoid(Boolean isVoid) {
|
||||
operation.isVoid = isVoid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReturnType(final String returnType) {
|
||||
|
||||
@@ -880,6 +880,11 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
resp.baseType = getNonMutableContainerTypeIfNeeded(resp.baseType);
|
||||
|
||||
doDataTypeAssignment(resp.dataType, new DataTypeAssigner() {
|
||||
@Override
|
||||
public void setIsVoid(Boolean isVoid) {
|
||||
resp.isVoid = isVoid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReturnType(final String returnType) {
|
||||
resp.dataType = returnType;
|
||||
@@ -904,6 +909,10 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
}
|
||||
|
||||
doDataTypeAssignment(operation.returnType, new DataTypeAssigner() {
|
||||
@Override
|
||||
public void setIsVoid(Boolean isVoid) {
|
||||
operation.isVoid = isVoid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReturnType(final String returnType) {
|
||||
@@ -1003,6 +1012,8 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
extensions.add(VendorExtension.X_DISCRIMINATOR_VALUE);
|
||||
extensions.add(VendorExtension.X_FIELD_EXTRA_ANNOTATION);
|
||||
extensions.add(VendorExtension.X_PATTERN_MESSAGE);
|
||||
extensions.add(VendorExtension.X_KOTLIN_IMPLEMENTS);
|
||||
extensions.add(VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS);
|
||||
return extensions;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
|
||||
public static final String DATE_FORMAT = "dateFormat";
|
||||
public static final String SET_ENSURE_ASCII_TO_FALSE = "setEnsureAsciiToFalse";
|
||||
public static final String POETRY1_FALLBACK = "poetry1";
|
||||
public static final String LAZY_IMPORTS = "lazyImports";
|
||||
|
||||
@Setter protected String packageUrl;
|
||||
protected String apiDocPath = "docs/";
|
||||
@@ -151,6 +152,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
|
||||
.defaultValue("%Y-%m-%d"));
|
||||
cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC).defaultValue("false"));
|
||||
cliOptions.add(new CliOption(POETRY1_FALLBACK, "Fallback to formatting pyproject.toml to Poetry 1.x format."));
|
||||
cliOptions.add(new CliOption(LAZY_IMPORTS, "Enable lazy imports.").defaultValue(Boolean.FALSE.toString()));
|
||||
|
||||
supportedLibraries.put("urllib3", "urllib3-based client");
|
||||
supportedLibraries.put("asyncio", "asyncio-based client");
|
||||
@@ -264,6 +266,10 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
|
||||
additionalProperties.put(DATE_FORMAT, dateFormat);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(LAZY_IMPORTS)) {
|
||||
additionalProperties.put(LAZY_IMPORTS, Boolean.valueOf(additionalProperties.get(LAZY_IMPORTS).toString()));
|
||||
}
|
||||
|
||||
String modelPath = packagePath() + File.separatorChar + modelPackage.replace('.', File.separatorChar);
|
||||
String apiPath = packagePath() + File.separatorChar + apiPackage.replace('.', File.separatorChar);
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ package org.openapitools.codegen.languages;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.model.ModelMap;
|
||||
import org.openapitools.codegen.model.ModelsMap;
|
||||
@@ -61,6 +63,10 @@ public class ScalaLagomServerCodegen extends AbstractScalaCodegen implements Cod
|
||||
)
|
||||
);
|
||||
|
||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||
.stability(Stability.DEPRECATED)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code/scala-lagom-server";
|
||||
modelTemplateFiles.put("model.mustache", ".scala");
|
||||
apiTemplateFiles.put("api.mustache", ".scala");
|
||||
@@ -149,12 +155,12 @@ public class ScalaLagomServerCodegen extends AbstractScalaCodegen implements Cod
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "scala-lagom-server";
|
||||
return "scala-lagom-server-deprecated";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp() {
|
||||
return "Generates a Lagom API server (Beta) in scala";
|
||||
return "Generates a Lagom API server (Beta) in scala. IMPORTANT: this generator has been deprecated";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -220,6 +226,4 @@ public class ScalaLagomServerCodegen extends AbstractScalaCodegen implements Cod
|
||||
}
|
||||
return objs;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -99,6 +99,7 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
public static final String USE_SEALED = "useSealed";
|
||||
public static final String OPTIONAL_ACCEPT_NULLABLE = "optionalAcceptNullable";
|
||||
public static final String USE_SPRING_BUILT_IN_VALIDATION = "useSpringBuiltInValidation";
|
||||
public static final String USE_DEDUCTION_FOR_ONE_OF_INTERFACES = "useDeductionForOneOfInterfaces";
|
||||
|
||||
@Getter
|
||||
public enum RequestMappingMode {
|
||||
@@ -159,6 +160,8 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
protected boolean optionalAcceptNullable = true;
|
||||
@Getter @Setter
|
||||
protected boolean useSpringBuiltInValidation = false;
|
||||
@Getter @Setter
|
||||
protected boolean useDeductionForOneOfInterfaces = false;
|
||||
|
||||
public SpringCodegen() {
|
||||
super();
|
||||
@@ -282,6 +285,7 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
"Use `ofNullable` instead of just `of` to accept null values when using Optional.",
|
||||
optionalAcceptNullable));
|
||||
|
||||
cliOptions.add(CliOption.newBoolean(USE_DEDUCTION_FOR_ONE_OF_INTERFACES, "whether to use deduction for generated oneOf interfaces", useDeductionForOneOfInterfaces));
|
||||
supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application.");
|
||||
supportedLibraries.put(SPRING_CLOUD_LIBRARY,
|
||||
"Spring-Cloud-Feign client with Spring-Boot auto-configured settings.");
|
||||
@@ -449,6 +453,7 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
}
|
||||
convertPropertyToBooleanAndWriteBack(OPTIONAL_ACCEPT_NULLABLE, this::setOptionalAcceptNullable);
|
||||
convertPropertyToBooleanAndWriteBack(USE_SPRING_BUILT_IN_VALIDATION, this::setUseSpringBuiltInValidation);
|
||||
convertPropertyToBooleanAndWriteBack(USE_DEDUCTION_FOR_ONE_OF_INTERFACES, this::setUseDeductionForOneOfInterfaces);
|
||||
|
||||
additionalProperties.put("springHttpStatus", new SpringHttpStatusLambda());
|
||||
|
||||
|
||||
@@ -2179,6 +2179,22 @@ public class ModelUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set schema type.
|
||||
* For 3.1 spec, set as types, for 3.0, type
|
||||
*
|
||||
* @param schema the schema
|
||||
* @return schema type
|
||||
*/
|
||||
public static void setType(Schema schema, String type) {
|
||||
if (schema instanceof JsonSchema) {
|
||||
schema.setTypes(null);
|
||||
schema.addType(type);
|
||||
} else {
|
||||
schema.setType(type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if any of the common attributes of the schema (e.g. readOnly, default, maximum, etc) is defined.
|
||||
*
|
||||
|
||||
@@ -114,10 +114,10 @@ if(hasProperty('target') && target == 'android') {
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.6.3"
|
||||
jackson_version = "2.17.1"
|
||||
jackson_databind_version = "2.17.1"
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.6"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
{{#useBeanValidation}}
|
||||
|
||||
@@ -114,10 +114,10 @@ if(hasProperty('target') && target == 'android') {
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.6.6"
|
||||
jackson_version = "2.17.1"
|
||||
jackson_databind_version = "2.17.1"
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.6"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
httpclient_version = "5.1.3"
|
||||
|
||||
@@ -351,10 +351,10 @@
|
||||
<swagger-annotations-version>2.2.15</swagger-annotations-version>
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
<httpclient-version>5.2.1</httpclient-version>
|
||||
<jackson-version>2.17.1</jackson-version>
|
||||
<jackson-databind-version>2.17.1</jackson-databind-version>
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
|
||||
@@ -103,11 +103,11 @@ test {
|
||||
ext {
|
||||
swagger_annotations_version = "1.6.11"
|
||||
{{#jackson}}
|
||||
jackson_version = "2.17.1"
|
||||
jackson_databind_version = "2.17.1"
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{/jackson}}
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.6"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
feign_version = "13.5"
|
||||
|
||||
@@ -98,10 +98,10 @@ if(hasProperty('target') && target == 'android') {
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.6.3"
|
||||
jackson_version = "2.17.1"
|
||||
jackson_databind_version = "2.17.1"
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.6"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
google_api_client_version = "1.32.2"
|
||||
|
||||
@@ -310,10 +310,10 @@
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
<google-api-client-version>2.2.0</google-api-client-version>
|
||||
<jersey-common-version>2.40</jersey-common-version>
|
||||
<jackson-version>2.17.1</jackson-version>
|
||||
<jackson-databind-version>2.17.1</jackson-databind-version>
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#joda}}
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
|
||||
@@ -104,10 +104,10 @@ ext {
|
||||
{{#swagger2AnnotationLibrary}}
|
||||
swagger_annotations_version = "2.2.15"
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
jackson_version = "2.17.1"
|
||||
jackson_databind_version = "2.17.1"
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.6"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
{{#useBeanValidation}}
|
||||
|
||||
@@ -16,15 +16,15 @@ lazy val root = (project in file(".")).
|
||||
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35",
|
||||
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35",
|
||||
"org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.19.2" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.19.2" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.19.2" % "compile",
|
||||
{{#joda}}
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile",
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.19.2" % "compile",
|
||||
{{/joda}}
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile",
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.19.2" % "compile",
|
||||
{{#openApiNullable}}
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7" % "compile",
|
||||
{{/openApiNullable}}
|
||||
{{#hasOAuthMethods}}
|
||||
"com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",
|
||||
|
||||
@@ -405,9 +405,9 @@
|
||||
<swagger-annotations-version>2.2.15</swagger-annotations-version>
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
<jersey-version>2.37</jersey-version>
|
||||
<jackson-version>2.17.1</jackson-version>
|
||||
<jackson-databind-version>2.17.1</jackson-databind-version>
|
||||
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
<beanvalidation-version>3.0.2</beanvalidation-version>
|
||||
|
||||
@@ -99,10 +99,10 @@ if(hasProperty('target') && target == 'android') {
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.6.5"
|
||||
jackson_version = "2.17.1"
|
||||
jackson_databind_version = "2.17.1"
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.6"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "2.1.0"
|
||||
{{#useBeanValidation}}
|
||||
|
||||
@@ -16,15 +16,15 @@ lazy val root = (project in file(".")).
|
||||
"org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4",
|
||||
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4",
|
||||
"org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.19.2" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.19.2" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.19.2" % "compile",
|
||||
{{#joda}}
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile",
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.19.2" % "compile",
|
||||
{{/joda}}
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile",
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.19.2" % "compile",
|
||||
{{#openApiNullable}}
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7" % "compile",
|
||||
{{/openApiNullable}}
|
||||
{{#hasOAuthMethods}}
|
||||
"com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",
|
||||
|
||||
@@ -405,9 +405,9 @@
|
||||
<swagger-annotations-version>2.2.15</swagger-annotations-version>
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
<jersey-version>3.1.1</jersey-version>
|
||||
<jackson-version>2.17.1</jackson-version>
|
||||
<jackson-databind-version>2.17.1</jackson-databind-version>
|
||||
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
<beanvalidation-version>3.0.2</beanvalidation-version>
|
||||
|
||||
@@ -72,7 +72,7 @@ ext {
|
||||
{{#swagger2AnnotationLibrary}}
|
||||
swagger_annotations_version = "2.2.9"
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
jackson_version = "2.17.1"
|
||||
jackson_version = "2.19.2"
|
||||
{{#useJakartaEe}}
|
||||
jakarta_annotation_version = "2.1.1"
|
||||
beanvalidation_version = "3.0.2"
|
||||
@@ -102,7 +102,7 @@ dependencies {
|
||||
implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||||
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
|
||||
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
|
||||
implementation "org.openapitools:jackson-databind-nullable:0.2.1"
|
||||
implementation "org.openapitools:jackson-databind-nullable:0.2.7"
|
||||
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
|
||||
{{#useBeanValidation}}
|
||||
implementation "jakarta.validation:jakarta.validation-api:$beanvalidation_version"
|
||||
|
||||
@@ -299,8 +299,8 @@
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<jackson-version>2.17.1</jackson-version>
|
||||
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
<beanvalidation-version>3.0.2</beanvalidation-version>
|
||||
|
||||
@@ -289,8 +289,8 @@ public class ApiClient {
|
||||
/**
|
||||
* Set base path
|
||||
*
|
||||
* @param basePath Base path of the URL (e.g {{{basePath}}}
|
||||
* @return An instance of OkHttpClient
|
||||
* @param basePath Base path of the URL (e.g {{{basePath}}})
|
||||
* @return An instance of ApiClient
|
||||
*/
|
||||
public ApiClient setBasePath(String basePath) {
|
||||
this.basePath = basePath;
|
||||
@@ -338,7 +338,7 @@ public class ApiClient {
|
||||
* Set HTTP client, which must never be null.
|
||||
*
|
||||
* @param newHttpClient An instance of OkHttpClient
|
||||
* @return Api Client
|
||||
* @return ApiClient
|
||||
* @throws java.lang.NullPointerException when newHttpClient is null
|
||||
*/
|
||||
public ApiClient setHttpClient(OkHttpClient newHttpClient) {
|
||||
|
||||
@@ -132,7 +132,7 @@ dependencies {
|
||||
implementation 'io.gsonfire:gson-fire:1.9.0'
|
||||
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
|
||||
{{#openApiNullable}}
|
||||
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
|
||||
implementation 'org.openapitools:jackson-databind-nullable:0.2.7'
|
||||
{{/openApiNullable}}
|
||||
{{#withAWSV4Signature}}
|
||||
implementation 'software.amazon.awssdk:auth:2.20.157'
|
||||
|
||||
@@ -16,7 +16,7 @@ lazy val root = (project in file(".")).
|
||||
"org.apache.commons" % "commons-lang3" % "3.18.0",
|
||||
"jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6",
|
||||
{{#openApiNullable}}
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7",
|
||||
{{/openApiNullable}}
|
||||
{{#withAWSV4Signature}}
|
||||
"software.amazon.awssdk" % "auth" % "2.20.157",
|
||||
|
||||
@@ -416,7 +416,7 @@
|
||||
<gson-version>2.10.1</gson-version>
|
||||
<commons-lang3-version>3.18.0</commons-lang3-version>
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#joda}}
|
||||
<jodatime-version>2.12.0</jodatime-version>
|
||||
|
||||
@@ -98,18 +98,18 @@ if(hasProperty('target') && target == 'android') {
|
||||
|
||||
ext {
|
||||
{{#swagger1AnnotationLibrary}}
|
||||
swagger_annotations_version = "1.6.6"
|
||||
swagger_annotations_version = "1.6.16"
|
||||
{{/swagger1AnnotationLibrary}}
|
||||
{{#swagger2AnnotationLibrary}}
|
||||
swagger_annotations_version = "2.2.15"
|
||||
swagger_annotations_version = "2.2.36"
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
rest_assured_version = "5.3.2"
|
||||
rest_assured_version = "5.5.6"
|
||||
junit_version = "5.10.3"
|
||||
{{#jackson}}
|
||||
jackson_version = "2.17.1"
|
||||
jackson_databind_version = "2.17.1"
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.6"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
{{/jackson}}
|
||||
{{#gson}}
|
||||
|
||||
@@ -9,16 +9,16 @@ lazy val root = (project in file(".")).
|
||||
Compile / packageDoc / publishArtifact := false,
|
||||
resolvers += Resolver.mavenLocal,
|
||||
libraryDependencies ++= Seq(
|
||||
"io.swagger" % "swagger-annotations" % "1.6.6",
|
||||
"io.rest-assured" % "rest-assured" % "4.5.1",
|
||||
"io.rest-assured" % "scala-support" % "4.5.1",
|
||||
"io.swagger" % "swagger-annotations" % "1.6.16",
|
||||
"io.rest-assured" % "rest-assured" % "5.5.6",
|
||||
"io.rest-assured" % "scala-support" % "5.5.6",
|
||||
"com.google.code.findbugs" % "jsr305" % "3.0.2",
|
||||
{{#jackson}}
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.13.4",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.19.2",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.19.2",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.19.2",
|
||||
{{#openApiNullable}}
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7",
|
||||
{{/openApiNullable}}
|
||||
{{#withXml}}
|
||||
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.13.4.1",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user