Compare commits

..

7 Commits

Author SHA1 Message Date
William Cheng
fa9ec3c2cb update readme 2025-09-15 17:25:02 +08:00
William Cheng
265e0d1fee update doc 2025-09-15 16:05:04 +08:00
William Cheng
8160b63c43 various fix to java dubbo server generator 2025-09-15 15:50:43 +08:00
William Cheng
5c112b2a1d Merge branch 'dubbo-feature' of https://github.com/redoom/openapi-generator into redoom-dubbo-feature 2025-09-15 14:56:21 +08:00
redoom
f928462267 fix: fix Dubbo protocol extension issue in test environment
- Set registry address to N/A to avoid ZooKeeper dependency
- Change protocol from 'triple' to 'tri' to resolve extension loading error
2025-09-08 16:44:23 +08:00
redoom
e12665b573 feat: Add dubbo sample with CI validation
Adds a new sample generator configuration for dubbo.

The existing GitHub workflow for Java samples is updated to build and test this new sample automatically.
2025-09-07 16:42:22 +08:00
redoom
55d4eae3d2 feat: add Apache Dubbo code generator with multi-registry support
- Add comprehensive Dubbo microservice code generator
- Support Zookeeper and Nacos registries with auto-dependency selection
- Implement version-aware dependency management (Dubbo 3.2 vs 3.3+)
- Generate service interfaces, implementations, and Spring Boot REST controllers
- Include complete Spring Boot application structure with configuration
- Add detailed documentation and usage examples
- Support async operations and generic response wrappers
- Provide flexible configuration options for packages, versions, and features
2025-09-06 14:48:33 +08:00
1374 changed files with 13074 additions and 31643 deletions

View File

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

View File

@@ -4,24 +4,20 @@ on:
push:
branches:
paths:
#- 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-json_serializable/**
- samples/openapi3/client/petstore/dart-dio/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/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/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-json_serializable/**
- samples/openapi3/client/petstore/dart-dio/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/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:
@@ -31,14 +27,12 @@ jobs:
os: [ubuntu-latest, windows-latest]
sdk: ["3.9.0"]
sample:
#- 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-json_serializable/
- samples/openapi3/client/petstore/dart-dio/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/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

View File

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

View File

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

View File

@@ -43,7 +43,6 @@ 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:

View File

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

View File

@@ -6,17 +6,12 @@ on:
- '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
@@ -28,9 +23,6 @@ jobs:
- '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

View File

@@ -5,7 +5,6 @@ on:
paths:
- 'samples/client/petstore/java/**'
- samples/client/petstore/jaxrs-cxf-client/**
- samples/client/petstore/jaxrs-cxf-client-swagger2/**
- samples/client/petstore/java-micronaut-client/**
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters/**
- samples/openapi3/client/petstore/java/jersey2-java8-swagger1/**
@@ -18,17 +17,12 @@ 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:
paths:
- 'samples/client/petstore/java/**'
- samples/client/petstore/jaxrs-cxf-client/**
- samples/client/petstore/jaxrs-cxf-client-swagger2/**
- samples/client/petstore/java-micronaut-client/**
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters/**
- samples/openapi3/client/petstore/java/jersey2-java8-swagger1/**
@@ -41,10 +35,6 @@ 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:
@@ -56,7 +46,6 @@ jobs:
matrix:
sample:
# clients
- samples/client/petstore/jaxrs-cxf-client-swagger2
- samples/client/petstore/jaxrs-cxf-client
- samples/client/petstore/java/native
- samples/client/petstore/java/native-async
@@ -108,10 +97,6 @@ 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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,21 +1,34 @@
name: Samples Scala/sbt server
name: Samples Scala/sbt
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
name: Build sbt/Scala client, servers
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

View File

@@ -11,7 +11,6 @@ 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
@@ -22,7 +21,6 @@ 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)
@@ -41,7 +39,6 @@ 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

View File

@@ -60,7 +60,6 @@ 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
View File

@@ -16,7 +16,6 @@ modules/openapi-generator-gradle-plugin/bin/
.classpath
lib/*
build/*
.kotlin
generated-files/*
generated-sources/*
generated-code/*

37
CI/.travis.yml.bash Normal file
View File

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

View File

@@ -56,6 +56,11 @@ 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
@@ -116,4 +121,22 @@ 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

View File

@@ -16,7 +16,9 @@
<div align="center">
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.16.0`):
[![Build Status](https://api.travis-ci.com/OpenAPITools/openapi-generator.svg?branch=master&status=passed)](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
[![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/master?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67)
</div>

119
appveyor.yml Normal file
View File

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

View File

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

View File

@@ -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-localhost.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'

View File

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

View File

@@ -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-localhost.yaml
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/go
additionalProperties:
packageName: petstore

View File

@@ -1,8 +0,0 @@
generatorName: jaxrs-cxf-client
outputDir: samples/client/petstore/jaxrs-cxf-client-swagger2
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf
additionalProperties:
artifactId: jaxrs-cxf-petstore-swagger2
documentationProvider: swagger2
annotationLibrary: swagger2

View File

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

View File

@@ -1,7 +1,7 @@
generatorName: ruby
outputDir: samples/client/petstore/ruby-faraday
library: faraday
inputSpec: modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/ruby-client
additionalProperties:
gemVersion: 1.0.0

View File

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

View File

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

View File

@@ -151,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-deprecated (deprecated)](generators/scala-lagom-server-deprecated.md)
* [scala-lagom-server](generators/scala-lagom-server.md)
* [scala-play-server](generators/scala-play-server.md)
* [scalatra](generators/scalatra.md)
* [spring](generators/spring.md)

View File

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

View File

@@ -22,7 +22,6 @@ 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|
@@ -40,7 +39,6 @@ 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|

View File

@@ -23,7 +23,6 @@ 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|
@@ -41,7 +40,6 @@ 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|

View File

@@ -23,7 +23,6 @@ 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|
@@ -41,7 +40,6 @@ 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|

View File

@@ -67,8 +67,6 @@ 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

View File

@@ -1,17 +1,17 @@
---
title: Documentation for the scala-lagom-server-deprecated Generator
title: Documentation for the scala-lagom-server Generator
---
## METADATA
| Property | Value | Notes |
| -------- | ----- | ----- |
| generator name | scala-lagom-server-deprecated | pass this to the generate command after -g |
| generator stability | DEPRECATED | |
| generator name | scala-lagom-server | pass this to the generate command after -g |
| generator stability | STABLE | |
| generator type | SERVER | |
| generator language | Scala | |
| generator default templating engine | mustache | |
| helpTxt | Generates a Lagom API server (Beta) in scala. IMPORTANT: this generator has been deprecated | |
| helpTxt | Generates a Lagom API server (Beta) in scala | |
## 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.

View File

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

View File

@@ -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.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-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>
<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>

View File

@@ -232,8 +232,8 @@
<properties>
<swagger-annotations-version>1.5.8</swagger-annotations-version>
<jersey-version>2.27</jersey-version>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-version>2.15.2</jackson-version>
<jackson-databind-nullable-version>0.2.0</jackson-databind-nullable-version>
<jodatime-version>2.7</jodatime-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.13.2</junit-version>

View File

@@ -15,8 +15,8 @@
<properties>
<swagger-annotations-version>1.5.8</swagger-annotations-version>
<jersey-version>2.35</jersey-version>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-nullable-version>0.2.1</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>

View File

@@ -111,7 +111,7 @@
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.7</version>
<version>0.2.6</version>
</dependency>
<!-- Bean Validation API support -->
<dependency>

View File

@@ -7805,13 +7805,8 @@ public class DefaultCodegen implements CodegenConfig {
}
}
protected void updateRequestBodyForString(CodegenParameter codegenParameter, Schema schema, String name, Set<String> imports, String bodyParameterName) {
if (!StringUtils.isEmpty(name)) {
addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, false);
} else {
updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports);
}
protected void updateRequestBodyForString(CodegenParameter codegenParameter, Schema schema, Set<String> imports, String bodyParameterName) {
updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports);
if (ModelUtils.isByteArraySchema(schema)) {
codegenParameter.setIsString(false);
codegenParameter.isByteArray = true;
@@ -8012,7 +8007,7 @@ public class DefaultCodegen implements CodegenConfig {
// swagger v2 only, type file
codegenParameter.isFile = true;
} else if (ModelUtils.isStringSchema(schema)) {
updateRequestBodyForString(codegenParameter, schema, name, imports, bodyParameterName);
updateRequestBodyForString(codegenParameter, schema, imports, bodyParameterName);
} else if (ModelUtils.isNumberSchema(schema)) {
updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports);
codegenParameter.isNumeric = Boolean.TRUE;

View File

@@ -10,8 +10,6 @@ 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", ""),

View File

@@ -5,9 +5,7 @@ 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;
@@ -19,7 +17,6 @@ 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;
@@ -61,7 +58,6 @@ 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;
@@ -78,14 +74,13 @@ 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, allServers);
Map<String, Object> mergedSpec = generatedMergedSpec(openapiVersion, allPaths);
String mergedFilename = this.mergeFileName + (isJson ? ".json" : ".yaml");
Path mergedFilePath = Paths.get(inputSpecRootDirectory, mergedFilename);
@@ -99,8 +94,8 @@ public class MergedSpecBuilder {
return mergedFilePath.toString();
}
private Map<String, Object> generatedMergedSpec(String openapiVersion, List<SpecWithPaths> allPaths, List<Server> allServers) {
Map<String, Object> spec = generateHeader(openapiVersion, mergedFileInfoName, mergedFileInfoDescription, mergedFileInfoVersion, allServers);
private Map<String, Object> generatedMergedSpec(String openapiVersion, List<SpecWithPaths> allPaths) {
Map<String, Object> spec = generateHeader(openapiVersion, mergedFileInfoName, mergedFileInfoDescription, mergedFileInfoVersion);
Map<String, Object> paths = new HashMap<>();
spec.put("paths", paths);
@@ -116,7 +111,7 @@ public class MergedSpecBuilder {
return spec;
}
private static Map<String, Object> generateHeader(String openapiVersion, String title, String description, String version, List<Server> allServers) {
private static Map<String, Object> generateHeader(String openapiVersion, String title, String description, String version) {
Map<String, Object> map = new HashMap<>();
map.put("openapi", openapiVersion);
map.put("info", ImmutableMap.of(
@@ -124,17 +119,9 @@ public class MergedSpecBuilder {
"description", description,
"version", version
));
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);
map.put("servers", Collections.singleton(
ImmutableMap.of("url", "http://localhost:8080")
));
return map;
}

View File

@@ -835,16 +835,6 @@ 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
@@ -860,9 +850,7 @@ 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)
|| implementedInterfacesFields.contains(p.baseName)
)
.filter(p -> allVarsMap.containsKey(p.baseName))
.forEach(p -> p.isInherited = true);
return m;
}

View File

@@ -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, "offset_date_serializer.dart"));
supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", srcFolder, "local_date_serializer.dart"));
}
break;
default:

View File

@@ -18,7 +18,6 @@
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.*;
@@ -116,20 +115,6 @@ 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() {
@@ -142,19 +127,11 @@ 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

View File

@@ -18,7 +18,6 @@
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;
@@ -223,35 +222,12 @@ 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()) {

View File

@@ -1088,10 +1088,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen
}
}
if (!AnnotationLibrary.SWAGGER2.equals(getAnnotationLibrary())) {
codegenModel.imports.remove("Schema");
}
return codegenModel;
}

View File

@@ -642,7 +642,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
typeMapping.put("Date", "LocalDate");
typeMapping.put("Time", "LocalTime");
importMapping.put("Instant", "kotlin.time.Instant");
importMapping.put("Instant", "kotlinx.datetime.Instant");
importMapping.put("LocalDate", "kotlinx.datetime.LocalDate");
importMapping.put("LocalTime", "kotlinx.datetime.LocalTime");
}
@@ -887,6 +887,7 @@ 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"));
@@ -996,7 +997,6 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
}
return objs;
}
private Stream<List<CodegenProperty>> getAllVarProperties(CodegenModel model) {
return Stream.of(model.vars, model.allVars, model.optionalVars, model.requiredVars, model.readOnlyVars, model.readWriteVars);
}
@@ -1114,27 +1114,6 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
return false;
}
@Override
public void postProcessParameter(CodegenParameter parameter) {
super.postProcessParameter(parameter);
adjustEnumRefDefault(parameter);
}
/**
* Properly set the default value for enum (reference).
*
* @param param codegen parameter
*/
private void adjustEnumRefDefault(CodegenParameter param) {
if (StringUtils.isEmpty(param.defaultValue) || !(param.isEnum || param.isEnumRef)) {
return;
}
String type = StringUtils.defaultIfEmpty(param.datatypeWithEnum, param.dataType);
param.enumDefaultValue = toEnumVarName(param.defaultValue, type);
param.defaultValue = type + "." + param.enumDefaultValue;
}
@Override
public void postProcess() {
System.out.println("################################################################################");

View File

@@ -1012,8 +1012,6 @@ 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;
}

View File

@@ -19,8 +19,6 @@ 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;
@@ -63,10 +61,6 @@ 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");
@@ -155,12 +149,12 @@ public class ScalaLagomServerCodegen extends AbstractScalaCodegen implements Cod
@Override
public String getName() {
return "scala-lagom-server-deprecated";
return "scala-lagom-server";
}
@Override
public String getHelp() {
return "Generates a Lagom API server (Beta) in scala. IMPORTANT: this generator has been deprecated";
return "Generates a Lagom API server (Beta) in scala";
}
@Override
@@ -226,4 +220,6 @@ public class ScalaLagomServerCodegen extends AbstractScalaCodegen implements Cod
}
return objs;
}
}
}

View File

@@ -99,7 +99,6 @@ 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 {
@@ -160,8 +159,6 @@ public class SpringCodegen extends AbstractJavaCodegen
protected boolean optionalAcceptNullable = true;
@Getter @Setter
protected boolean useSpringBuiltInValidation = false;
@Getter @Setter
protected boolean useDeductionForOneOfInterfaces = false;
public SpringCodegen() {
super();
@@ -285,7 +282,6 @@ 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.");
@@ -453,7 +449,6 @@ 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());

View File

@@ -114,10 +114,10 @@ if(hasProperty('target') && target == 'android') {
ext {
swagger_annotations_version = "1.6.3"
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
{{#useBeanValidation}}

View File

@@ -114,10 +114,10 @@ if(hasProperty('target') && target == 'android') {
ext {
swagger_annotations_version = "1.6.6"
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
httpclient_version = "5.1.3"

View File

@@ -351,10 +351,10 @@
<swagger-annotations-version>2.2.15</swagger-annotations-version>
{{/swagger2AnnotationLibrary}}
<httpclient-version>5.2.1</httpclient-version>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>

View File

@@ -103,11 +103,11 @@ test {
ext {
swagger_annotations_version = "1.6.11"
{{#jackson}}
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
{{/jackson}}
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
feign_version = "13.5"

View File

@@ -98,10 +98,10 @@ if(hasProperty('target') && target == 'android') {
ext {
swagger_annotations_version = "1.6.3"
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
google_api_client_version = "1.32.2"

View File

@@ -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.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#joda}}
<jodatime-version>2.9.9</jodatime-version>

View File

@@ -104,10 +104,10 @@ ext {
{{#swagger2AnnotationLibrary}}
swagger_annotations_version = "2.2.15"
{{/swagger2AnnotationLibrary}}
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
{{#useBeanValidation}}

View File

@@ -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.19.2" % "compile",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.19.2" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.19.2" % "compile",
"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",
{{#joda}}
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.19.2" % "compile",
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile",
{{/joda}}
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.19.2" % "compile",
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile",
{{#openApiNullable}}
"org.openapitools" % "jackson-databind-nullable" % "0.2.7" % "compile",
"org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile",
{{/openApiNullable}}
{{#hasOAuthMethods}}
"com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",

View File

@@ -405,9 +405,9 @@
<swagger-annotations-version>2.2.15</swagger-annotations-version>
{{/swagger2AnnotationLibrary}}
<jersey-version>2.37</jersey-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>
<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>
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>

View File

@@ -99,10 +99,10 @@ if(hasProperty('target') && target == 'android') {
ext {
swagger_annotations_version = "1.6.5"
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
jakarta_annotation_version = "2.1.0"
{{#useBeanValidation}}

View File

@@ -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.19.2" % "compile",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.19.2" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.19.2" % "compile",
"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",
{{#joda}}
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.19.2" % "compile",
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile",
{{/joda}}
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.19.2" % "compile",
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile",
{{#openApiNullable}}
"org.openapitools" % "jackson-databind-nullable" % "0.2.7" % "compile",
"org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile",
{{/openApiNullable}}
{{#hasOAuthMethods}}
"com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",

View File

@@ -405,9 +405,9 @@
<swagger-annotations-version>2.2.15</swagger-annotations-version>
{{/swagger2AnnotationLibrary}}
<jersey-version>3.1.1</jersey-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>
<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>
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>

View File

@@ -72,7 +72,7 @@ ext {
{{#swagger2AnnotationLibrary}}
swagger_annotations_version = "2.2.9"
{{/swagger2AnnotationLibrary}}
jackson_version = "2.19.2"
jackson_version = "2.17.1"
{{#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.7"
implementation "org.openapitools:jackson-databind-nullable:0.2.1"
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
{{#useBeanValidation}}
implementation "jakarta.validation:jakarta.validation-api:$beanvalidation_version"

View File

@@ -299,8 +299,8 @@
{{/swagger2AnnotationLibrary}}
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>

View File

@@ -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.7'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
{{/openApiNullable}}
{{#withAWSV4Signature}}
implementation 'software.amazon.awssdk:auth:2.20.157'

View File

@@ -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.7",
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
{{/openApiNullable}}
{{#withAWSV4Signature}}
"software.amazon.awssdk" % "auth" % "2.20.157",

View File

@@ -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.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#joda}}
<jodatime-version>2.12.0</jodatime-version>

View File

@@ -106,10 +106,10 @@ ext {
rest_assured_version = "5.5.6"
junit_version = "5.10.3"
{{#jackson}}
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
{{/jackson}}
{{#gson}}

View File

@@ -14,11 +14,11 @@ lazy val root = (project in file(".")).
"io.rest-assured" % "scala-support" % "5.5.6",
"com.google.code.findbugs" % "jsr305" % "3.0.2",
{{#jackson}}
"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",
"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",
{{#openApiNullable}}
"org.openapitools" % "jackson-databind-nullable" % "0.2.7",
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
{{/openApiNullable}}
{{#withXml}}
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.13.4.1",

View File

@@ -352,9 +352,9 @@
<jodatime-version>2.10.5</jodatime-version>
{{/joda}}
{{#jackson}}
<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>
<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}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>

View File

@@ -103,10 +103,10 @@ ext {
{{#swagger2AnnotationLibrary}}
swagger_annotations_version = "2.2.9"
{{/swagger2AnnotationLibrary}}
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
spring_web_version = "6.1.21"
jakarta_annotation_version = "2.1.1"

View File

@@ -67,12 +67,7 @@ public {{>sealed}}class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#v
{{#gson}}
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{/gson}}
{{^isDiscriminator}}
{{>nullable_var_annotations}}{{! prevent indent}}
{{/isDiscriminator}}
{{#isDiscriminator}}
// The discriminator does not have Nullability-annotation since it is added during serialization by the @JsonTypeName annotation
{{/isDiscriminator}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{/vendorExtensions.x-field-extra-annotation}}

View File

@@ -347,10 +347,10 @@
<swagger-annotations-version>2.2.15</swagger-annotations-version>
{{/swagger2AnnotationLibrary}}
<spring-web-version>6.1.21</spring-web-version>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{/openApiNullable}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
{{#joda}}

View File

@@ -98,10 +98,10 @@ if(hasProperty('target') && target == 'android') {
ext {
swagger_annotations_version = "1.6.3"
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
threetenbp_version = "2.9.10"

View File

@@ -298,10 +298,10 @@
<swagger-annotations-version>2.2.15</swagger-annotations-version>
{{/swagger2AnnotationLibrary}}
<resteasy-version>4.7.6.Final</resteasy-version>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>

View File

@@ -145,7 +145,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
// Set default User-Agent.
setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}");
setUserAgent("Java-SDK");
// Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}}

View File

@@ -115,10 +115,10 @@ ext {
{{#swagger2AnnotationLibrary}}
swagger_annotations_version = "2.2.9"
{{/swagger2AnnotationLibrary}}
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
{{#useJakartaEe}}
spring_web_version = "6.2.8"

View File

@@ -67,12 +67,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{#gson}}
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{/gson}}
{{^isDiscriminator}}
{{>nullable_var_annotations}}{{! prevent indent}}
{{/isDiscriminator}}
{{#isDiscriminator}}
// The discriminator does not have Nullability-annotation since it is added during serialization by the @JsonTypeName annotation
{{/isDiscriminator}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{/vendorExtensions.x-field-extra-annotation}}

View File

@@ -361,10 +361,10 @@
{{#swagger2AnnotationLibrary}}
<swagger-annotations-version>2.2.15</swagger-annotations-version>
{{/swagger2AnnotationLibrary}}
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#useJakartaEe}}
<spring-web-version>6.2.8</spring-web-version>

View File

@@ -100,11 +100,11 @@ ext {
oltu_version = "1.0.1"
retrofit_version = "2.11.0"
{{#jackson}}
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
javax_ws_rs_api_version = "2.1.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
{{/jackson}}
{{#usePlayWS}}

View File

@@ -383,10 +383,10 @@
{{/gson}}
<swagger-annotations-version>1.6.3</swagger-annotations-version>
{{#jackson}}
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
<jackson-version>2.17.1</jackson-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{/openApiNullable}}
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
{{/jackson}}

View File

@@ -30,12 +30,12 @@ task execute(type:JavaExec) {
ext {
swagger_annotations_version = "1.5.21"
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
vertx_version = "{{#supportVertxFuture}}4.0.0{{/supportVertxFuture}}{{^supportVertxFuture}}3.5.2{{/supportVertxFuture}}"
junit_version = "5.10.3"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
}

View File

@@ -306,9 +306,9 @@
{{#swagger2AnnotationLibrary}}
<swagger-annotations-version>2.2.15</swagger-annotations-version>
{{/swagger2AnnotationLibrary}}
<jackson-version>2.19.2</jackson-version>
<jackson-databind>2.19.2</jackson-databind>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind>2.17.1</jackson-databind>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
{{/useJakartaEe}}

View File

@@ -144,10 +144,10 @@ ext {
reactor_version = "3.4.34"
reactor_netty_version = "1.2.8"
{{/useJakartaEe}}
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.6"
{{/openApiNullable}}
{{#joda}}
jodatime_version = "2.9.9"

View File

@@ -67,12 +67,7 @@ public {{>sealed}}class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#v
{{#gson}}
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{/gson}}
{{^isDiscriminator}}
{{>nullable_var_annotations}}{{! prevent indent}}
{{/isDiscriminator}}
{{#isDiscriminator}}
// The discriminator does not have Nullability-annotation since it is added during serialization by the @JsonTypeName annotation
{{/isDiscriminator}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{/vendorExtensions.x-field-extra-annotation}}

View File

@@ -167,10 +167,10 @@
{{#swagger2AnnotationLibrary}}
<swagger-annotations-version>2.2.15</swagger-annotations-version>
{{/swagger2AnnotationLibrary}}
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#useJakartaEe}}
<spring-boot-version>3.0.12</spring-boot-version>

View File

@@ -3,40 +3,20 @@ package {{package}};
{{#imports}}import {{import}};
{{/imports}}
{{#useAbstractionForFiles}}
import java.io.InputStream;
{{/useAbstractionForFiles}}
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import {{javaxPackage}}.ws.rs.*;
{{#useGenericResponse}}
import {{javaxPackage}}.ws.rs.core.Response;
{{/useGenericResponse}}
{{#addConsumesProducesJson}}
import {{javaxPackage}}.ws.rs.core.MediaType;
{{/addConsumesProducesJson}}
import org.apache.cxf.jaxrs.ext.multipart.*;
{{#swagger1AnnotationLibrary}}
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
{{/swagger2AnnotationLibrary}}
{{#useBeanValidation}}
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
@@ -53,18 +33,7 @@ import {{javaxPackage}}.validation.Valid;
*/
{{/appName}}
@Path("{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}{{commonPath}}")
{{#swagger1AnnotationLibrary}}
@Api(value = "/", description = "{{description}}")
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
@OpenAPIDefinition(
info = @Info(
{{#appName}}title = "{{{appName}}}",{{/appName}}
{{#appDescription}}description = "{{{appDescription}}}",{{/appDescription}}
version = "{{{appVersion}}}"
)
)
{{/swagger2AnnotationLibrary}}
{{#addConsumesProducesJson}}
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@@ -91,7 +60,6 @@ public interface {{classname}} {
{{#hasProduces}}
@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} })
{{/hasProduces}}
{{#swagger1AnnotationLibrary}}
@ApiOperation(value = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} })
{{#implicitHeadersParams.0}}
@io.swagger.annotations.ApiImplicitParams({
@@ -102,19 +70,6 @@ public interface {{classname}} {
{{/implicitHeadersParams.0}}
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{#isFile}}{{#useAbstractionForFiles}}InputStream{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{baseType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{baseType}}}{{/isFile}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} })
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
@Operation(operationId = "{{{operationIdOriginal}}}"{{#summary}}, summary = "{{{.}}}"{{/summary}}, {{#isDeprecated}}deprecated = true, {{/isDeprecated}} tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} })
@ApiResponses(value = { {{#responses}}
@ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, content = @Content({{#containerType}}array = @ArraySchema({{/containerType}}schema = @Schema(implementation = {{#isFile}}{{#useAbstractionForFiles}}InputStream{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{baseType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{baseType}}}{{/isFile}}.class){{#containerType}}){{/containerType}}){{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} })
{{#implicitHeadersParams.0}}
@Parameters({
{{#implicitHeadersParams}}
{{>paramDoc}}{{^-last}},{{/-last}}
{{/implicitHeadersParams}}
})
{{/implicitHeadersParams.0}}
{{/swagger2AnnotationLibrary}}
public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}});
{{/operation}}
}

View File

@@ -15,6 +15,7 @@ import org.apache.cxf.jaxrs.model.wadl.DocTarget;
import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api;
{{#useSpringAnnotationConfig}}
import org.springframework.stereotype.Service;
{{/useSpringAnnotationConfig}}

View File

@@ -8,9 +8,7 @@ import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
{{#useBeanValidation}}
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
import {{javaxPackage}}.ws.rs.core.Response;
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
import org.apache.cxf.jaxrs.client.ClientConfiguration;

View File

@@ -1 +0,0 @@
@Parameter(name = "{{{baseName}}}"{{#isDeprecated}}, deprecated = true{{/isDeprecated}}, description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#isPathParam}}, in = ParameterIn.PATH{{/isPathParam}}{{#isQueryParam}}, in = ParameterIn.QUERY{{/isQueryParam}}{{#isCookieParam}}, in = ParameterIn.COOKIE{{/isCookieParam}}{{#isHeaderParam}}, in = ParameterIn.HEADER{{/isHeaderParam}})

View File

@@ -1,12 +1,4 @@
{{#swagger1AnnotationLibrary}}
{{#description}}
import io.swagger.annotations.ApiModel;
{{/description}}
import io.swagger.annotations.ApiModelProperty;
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
import io.swagger.v3.oas.annotations.media.Schema;
{{/swagger2AnnotationLibrary}}
import java.util.Objects;
{{#withXml}}
import {{javaxPackage}}.xml.bind.annotation.XmlElement;
@@ -21,14 +13,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
{{#description}}
/**
* {{{description}}}
*/
{{#swagger1AnnotationLibrary}}
* {{{description}}}
**/
@ApiModel(description="{{{description}}}")
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
@Schema(description="{{{description}}}")
{{/swagger2AnnotationLibrary}}
{{/description}}
{{>additionalModelTypeAnnotations}}{{>xmlPojoAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}
{{#vendorExtensions.x-class-extra-annotation}}
@@ -38,23 +25,16 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
{{#vars}}{{#isEnum}}{{^isContainer}}
{{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}}
{{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}}
{{#description}}
/**
* {{{.}}}
*/
{{/description}}
{{#withXml}}
@XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}})
{{/withXml}}
{{#swagger1AnnotationLibrary}}
@ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
@Schema(description = "{{{description}}}"{{#example}}, example = "{{{example}}}"{{/example}}{{#required}}, requiredMode = Schema.RequiredMode.REQUIRED{{/required}})
{{/swagger2AnnotationLibrary}}
{{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{#useBeanValidation}}
@Valid
{{/useBeanValidation}}{{/isFile}}{{/isString}}{{/isDateTime}}{{/isDate}}{{/isPrimitiveType}}
@ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{#useBeanValidation}}
@Valid{{/useBeanValidation}}{{/isFile}}{{/isString}}{{/isDateTime}}{{/isDate}}{{/isPrimitiveType}}
{{#description}}
/**
* {{{.}}}
**/
{{/description}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{/vendorExtensions.x-field-extra-annotation}}

View File

@@ -111,7 +111,6 @@
</dependencies>
</dependencyManagement>
<dependencies>
{{#swagger1AnnotationLibrary}}
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
@@ -126,14 +125,6 @@ for this project used jakarta.validation-api -->
</exclusion>
</exclusions>
</dependency>
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-annotations-version}</version>
</dependency>
{{/swagger2AnnotationLibrary}}
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
@@ -247,12 +238,7 @@ for this project used jakarta.validation-api -->
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
{{#swagger1AnnotationLibrary}}
<swagger-core-version>1.6.6</swagger-core-version>
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
<swagger-annotations-version>2.2.7</swagger-annotations-version>
{{/swagger2AnnotationLibrary}}
<swagger-core-version>1.5.18</swagger-core-version>
<jetty-version>9.2.9.v20150224</jetty-version>
<junit-version>4.13.2</junit-version>
<logback-version>1.5.13</logback-version>

View File

@@ -34,7 +34,6 @@
{{/useSpringAnnotationConfig}}
{{#useSwaggerFeature}}
{{#swagger1AnnotationLibrary}}
<!-- CXF Swagger2Feature -->
{{! http://cxf.apache.org/docs/swagger2feature.html }}
<bean id="swagger2Feature" class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
@@ -49,7 +48,6 @@
<property name="license" value="${swagger.license}" />
<property name="licenseUrl" value="${swagger.licenseUrl}" /-->
</bean>
{{/swagger1AnnotationLibrary}}
{{/useSwaggerFeature}}
<cxf:bus>

View File

@@ -120,7 +120,6 @@
</dependencies>
</dependencyManagement>
<dependencies>
{{#swagger1AnnotationLibrary}}
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
@@ -135,14 +134,6 @@ for this project used jakarta.validation-api -->
</exclusion>
</exclusions>
</dependency>
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-annotations-version}</version>
</dependency>
{{/swagger2AnnotationLibrary}}
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
@@ -193,12 +184,7 @@ for this project used jakarta.validation-api -->
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
{{#swagger1AnnotationLibrary}}
<artifactId>cxf-rt-rs-service-description-swagger</artifactId>
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
<artifactId>cxf-rt-rs-service-description-openapi-v3</artifactId>
{{/swagger2AnnotationLibrary}}
<version>${cxf-version}</version>
<scope>compile</scope>
</dependency>
@@ -303,12 +289,7 @@ for this project used jakarta.validation-api -->
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
{{#swagger1AnnotationLibrary}}
<swagger-core-version>1.6.6</swagger-core-version>
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
<swagger-annotations-version>2.2.7</swagger-annotations-version>
{{/swagger2AnnotationLibrary}}
<swagger-core-version>1.5.22</swagger-core-version>
<jetty-version>9.2.9.v20150224</jetty-version>
<junit-version>4.13.2</junit-version>
<logback-version>1.5.13</logback-version>

View File

@@ -176,7 +176,7 @@
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jackson-version>2.19.2</jackson-version>
<jackson-version>2.17.1</jackson-version>
<junit-version>4.13.2</junit-version>
<joda-version>2.10.13</joda-version>
{{#useJakartaEe}}
@@ -200,7 +200,7 @@
<jakarta.ws.rs-version>2.1.6</jakarta.ws.rs-version>
{{/useJakartaEe}}
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{/openApiNullable}}
</properties>
</project>

View File

@@ -208,7 +208,7 @@
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.7</version>
<version>0.2.6</version>
</dependency>
{{/openApiNullable}}
{{#useBeanValidation}}

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