Compare commits

..

3 Commits

Author SHA1 Message Date
William Cheng
8ecf9e352d fix additional properties any type 2023-07-30 16:25:18 +08:00
William Cheng
07d4f7d534 update template and samples 2023-07-30 16:20:45 +08:00
William Cheng
659885f509 better additional properties support 2023-07-30 16:15:07 +08:00
3719 changed files with 12615 additions and 131948 deletions

View File

@@ -204,8 +204,8 @@ jobs:
- command_build_and_test:
nodeNo: "3"
node4:
machine:
image: ubuntu-2004:202201-02
docker:
- image: fkrull/multi-python
working_directory: ~/OpenAPITools/openapi-generator
shell: /bin/bash --login
environment:
@@ -215,7 +215,7 @@ jobs:
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
steps:
- checkout
- command_build_and_test:
- command_docker_build_and_test:
nodeNo: "4"
workflows:
version: 2

View File

@@ -800,6 +800,12 @@
"Client: Python"
]
},
{
"input": "python-server-flask-petstore-python2.sh",
"matches": [
"Server: Python"
]
},
{
"input": "python-server-flask-petstore.sh",
"matches": [

View File

@@ -45,7 +45,7 @@ jobs:
${{ runner.os }}-gradle-
- name: Setup Maven
uses: s4u/setup-maven-action@v1.9.0
uses: s4u/setup-maven-action@v1.8.0
with:
java-version: ${{ matrix.java }}
maven-version: 3.8.8
@@ -87,7 +87,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v3
- name: Setup Maven
uses: s4u/setup-maven-action@v1.9.0
uses: s4u/setup-maven-action@v1.8.0
with:
java-version: 11
maven-version: 3.8.8

View File

@@ -1,36 +0,0 @@
name: Samples Haskell
on:
push:
paths:
- samples/server/petstore/haskell-yesod/**
- samples/server/petstore/haskell-servant/**
- samples/client/petstore/haskell-http-client/**
pull_request:
paths:
- samples/server/petstore/haskell-yesod/**
- samples/server/petstore/haskell-servant/**
- samples/client/petstore/haskell-http-client/**
jobs:
build:
name: Build stack projects
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
# servers
- samples/server/petstore/haskell-yesod/
- samples/server/petstore/haskell-servant/
- samples/client/petstore/haskell-http-client/
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
with:
# ghc-version: '8.8.4' # Exact version of ghc to use
# cabal-version: 'latest'. Omitted, but defaults to 'latest'
enable-stack: true
stack-version: 'latest'
- name: stack test
working-directory: ${{ matrix.sample }}
run: stack test

View File

@@ -49,8 +49,6 @@ jobs:
- samples/client/petstore/java/rest-assured-jackson
- samples/client/petstore/java/microprofile-rest-client
- samples/client/petstore/java/microprofile-rest-client-3.0
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
- samples/client/petstore/java/apache-httpclient
- samples/client/petstore/java/feign
- samples/client/petstore/java/jersey1
@@ -78,4 +76,4 @@ jobs:
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Build
working-directory: ${{ matrix.sample }}
run: mvn clean package
run: mvn clean package

View File

@@ -4,11 +4,9 @@ on:
push:
branches:
- 'samples/client/petstore/kotlin*/**'
- 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**'
pull_request:
paths:
- 'samples/client/petstore/kotlin*/**'
- 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**'
env:
GRADLE_VERSION: 6.9
@@ -51,7 +49,6 @@ jobs:
- samples/client/petstore/kotlin-array-simple-string-multiplatform
- samples/client/petstore/kotlin-bigdecimal-default-multiplatform
- samples/client/petstore/kotlin-bigdecimal-default-okhttp4
- samples/client/petstore/kotlin-jvm-jackson
- samples/client/petstore/kotlin-jvm-ktor-jackson
- samples/client/petstore/kotlin-jvm-ktor-gson
- samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization
@@ -63,7 +60,6 @@ jobs:
- samples/client/petstore/kotlin-jvm-spring-3-webclient
- samples/client/petstore/kotlin-spring-cloud
- samples/client/petstore/kotlin-name-parameter-mappings
- samples/client/others/kotlin-jvm-okhttp-parameter-tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3

View File

@@ -4,13 +4,9 @@ on:
push:
branches:
- 'samples/server/petstore/kotlin-springboot-3*/**'
# comment out due to gradle build failure
# - samples/server/petstore/kotlin-spring-default/**
pull_request:
paths:
- 'samples/server/petstore/kotlin-springboot-3*/**'
# comment out due to gradle build failure
# - samples/server/petstore/kotlin-spring-default/**
env:
GRADLE_VERSION: 7.4
@@ -25,8 +21,6 @@ jobs:
sample:
# server
- samples/server/petstore/kotlin-springboot-3
# comment out due to gradle build failure
# - samples/server/petstore/kotlin-spring-default/
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3

View File

@@ -3,16 +3,10 @@ name: Samples Kotlin server
on:
push:
branches:
- samples/server/others/kotlin-server/jaxrs-spec/**
- 'samples/server/petstore/kotlin*/**'
# comment out due to gradle build failure
#- samples/server/petstore/kotlin-spring-default/**
pull_request:
paths:
- samples/server/others/kotlin-server/jaxrs-spec/**
- 'samples/server/petstore/kotlin*/**'
# comment out due to gradle build failure
# - samples/server/petstore/kotlin-spring-default/**
env:
GRADLE_VERSION: 6.9
@@ -35,11 +29,7 @@ jobs:
- samples/server/petstore/kotlin-springboot-springfox
- samples/server/petstore/kotlin-server/ktor
- samples/server/petstore/kotlin-server/jaxrs-spec
- samples/server/petstore/kotlin-server/jaxrs-spec-mutiny
- samples/server/petstore/kotlin-server-modelMutable
- samples/server/others/kotlin-server/jaxrs-spec
# comment out due to gradle build failure
#- samples/server/petstore/kotlin-spring-default
# no build.gradle file
#- samples/server/petstore/kotlin-vertx-modelMutable
steps:

View File

@@ -27,7 +27,6 @@ jobs:
- 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
- samples/server/petstore/scalatra
- samples/server/petstore/scala-finch # cannot be tested with jdk11
steps:

View File

@@ -33,7 +33,6 @@ jobs:
- samples/server/petstore/springboot-beanvalidation
- samples/server/petstore/springboot-useoptional
- samples/server/petstore/springboot-reactive
- samples/server/petstore/springboot-reactive-noResponseEntity
- samples/server/petstore/springboot-implicitHeaders
- samples/openapi3/server/petstore/springboot-implicitHeaders
- samples/server/petstore/springboot-delegate

View File

@@ -1,50 +0,0 @@
name: Samples Swift
on:
push:
paths:
- samples/client/petstore/swift5/**
pull_request:
paths:
- samples/client/petstore/swift5/**
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-latest]
sample:
- samples/client/petstore/swift5/alamofireLibrary
- samples/client/petstore/swift5/anycodableLibrary
- samples/client/petstore/swift5/asyncAwaitLibrary
- samples/client/petstore/swift5/combineLibrary
- samples/client/petstore/swift5/default
- samples/client/petstore/swift5/deprecated
- samples/client/petstore/swift5/frozenEnums
- samples/client/petstore/swift5/nonPublicApi
- samples/client/petstore/swift5/objcCompatible
- samples/client/petstore/swift5/oneOf
- samples/client/petstore/swift5/promisekitLibrary
- samples/client/petstore/swift5/readonlyProperties
- samples/client/petstore/swift5/resultLibrary
- samples/client/petstore/swift5/rxswiftLibrary
- samples/client/petstore/swift5/urlsessionLibrary
- samples/client/petstore/swift5/validation
# NOTE: disabled as vaporLibrary doesnt build when adding this CI config
#- samples/client/petstore/swift5/vaporLibrary
- samples/client/petstore/swift5/x-swift-hashable
include:
- os: ubuntu-latest
sample: samples/client/petstore/swift5/alamofireLibrary
name: Build Swift samples
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: swift-actions/setup-swift@v1
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
swift-version: '5'
- name: Build
working-directory: ${{ matrix.sample }}
run: swift build

View File

@@ -39,7 +39,7 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Setup Maven
uses: s4u/setup-maven-action@v1.9.0
uses: s4u/setup-maven-action@v1.8.0
with:
java-version: ${{ matrix.java }}
maven-version: 3.8.8

5
.gitignore vendored
View File

@@ -173,13 +173,14 @@ samples/client/petstore/csharp-refactor/OpenAPIClient/nuget.exe
# Python
*.pyc
__pycache__
.venv/
samples/client/petstore/python/dev-requirements.txt.log
samples/client/petstore/python/swagger_client.egg-info/SOURCES.txt
samples/client/petstore/python/.coverage
samples/client/petstore/python/.projectile
samples/client/petstore/python/.venv/
samples/client/petstore/python-asyncio/.venv/
samples/client/petstore/python-asyncio/.pytest_cache/
samples/client/petstore/python-tornado/.venv/
# PHP
samples/client/petstore/php/OpenAPIClient-php/composer.lock

View File

@@ -136,7 +136,7 @@ script:
# run integration tests defined in maven pom.xml
# WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet.
# show "error" only to reduce the log size
- ./mvnw -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -DskipTests -Dmaven.javadoc.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error
- ./mvnw -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -DskipTests -Dmaven.javadoc.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error 2>&1 | grep -i error
after_success:
# push to maven repo
- if [ $SONATYPE_USERNAME ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then

View File

@@ -9,6 +9,15 @@ set -e
export NODE_ENV=test
function cleanup {
# Show logs of 'petstore.swagger' container to troubleshoot Unit Test failures, if any.
if [ "$NODE_INDEX" != "4" ]; then
docker logs petstore.swagger # container name specified in circle.yml
fi
}
trap cleanup EXIT
if [ "$NODE_INDEX" = "1" ]; then
echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..."
java -version

View File

@@ -115,9 +115,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
| OpenAPI Generator Version | Release Date | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
| 7.0.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.0.1-SNAPSHOT/) | 08.09.2023 | Patch release (enhancements, bug fixes, etc) |
| [7.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.0.0) (latest stable release) | 25.08.2023 | Major release with breaking changes (no fallback) |
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) | 11.05.2023 | Minor release with breaking changes (with fallback) |
| 7.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.0.0-SNAPSHOT/) | Jul/Aug 2023 | Major release with breaking changes (no fallback) |
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) (latest stable release) | 11.05.2023 | Minor release with breaking changes (with fallback) |
| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) |
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
@@ -179,16 +178,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o
<!-- RELEASE_VERSION -->
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar`
For **Mac/Linux** users:
```sh
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -423,7 +422,7 @@ openapi-generator-cli version
To use a specific version of "openapi-generator-cli"
```sh
openapi-generator-cli version-manager set 7.0.0
openapi-generator-cli version-manager set 6.6.0
```
Or install it as dev-dependency:
@@ -447,7 +446,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
<!-- RELEASE_VERSION -->
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar)
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar)
<!-- /RELEASE_VERSION -->
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
@@ -1140,7 +1139,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) |
| C | @zhemant (2018/11) @ityuhui (2019/12) @michelealbano (2020/03) |
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) |
| C# | @mandrean (2017/08) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) @iBicha (2023/07) |
| C# | @mandrean (2017/08) @frankyjuang (2019/09) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) @iBicha (2023/07) |
| Clojure | |
| Crystal | @cyangle (2021/01) |
| Dart | @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08) |
@@ -1153,8 +1152,8 @@ If you want to join the committee, please kindly apply by sending an email to te
| GraphQL | @renepardon (2018/12) |
| Groovy | |
| Haskell | |
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @martin-mfg (2023/08) |
| Java Spring | @cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) @martin-mfg (2023/08) |
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) |
| Java Spring | @cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) |
| JMeter | @kannkyo (2021/01) |
| Jetbrains HTTP Client | @jlengrand (2023/01) |
| Julia | @tanmaykm (2023/01) |

View File

@@ -2,6 +2,3 @@ generatorName: c
outputDir: samples/client/petstore/c
inputSpec: modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/C-libcurl
modelNameMappings:
another_model: MappedModel
another_property: mappedProperty

View File

@@ -7,12 +7,3 @@ additionalProperties:
moduleName: Petstore
shardName: petstore
strictSpecBehavior: false
modelNameMappings:
PropertyNameMapping: AnotherPropertyNameMapping
nameMappings:
_type: underscore_type
type_: type_with_underscore
type-: type_with_dash
parameterNameMappings:
_type: underscore_type
type_: type_with_underscore

View File

@@ -10,9 +10,6 @@ parameterNameMappings:
_type: UnderscoreType
type_: TypeWithUnderscore
http_debug_operation: HttpDebugOperation
modelNameMappings:
Environment: Env
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
hideGenerationTimestamp: "true"
targetFramework: net6.0

View File

@@ -4,10 +4,3 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-e
templateDir: modules/openapi-generator/src/main/resources/elixir
additionalProperties:
invokerPackage: OpenapiPetstore
modelNameMappings:
DeprecatedObject: DeprecatedModel
# the following options have no effect on elixir client gen which uses baseName
nameMappings:
deprecatedRef: deprecatedReference
parameterNameMapping:
ioutils: ioutils_parameter

View File

@@ -1,6 +1,6 @@
generatorName: go-server
outputDir: samples/server/petstore/go-chi-server
inputSpec: modules/openapi-generator/src/test/resources/3_0/go-server/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/go-server
additionalProperties:
hideGenerationTimestamp: "true"

View File

@@ -1,6 +1,6 @@
generatorName: go-server
outputDir: samples/openapi3/server/petstore/go/go-petstore
inputSpec: modules/openapi-generator/src/test/resources/3_0/go-server/petstore_with_test_endpoint.yaml
outputDir: samples/server/petstore/go-server-required
inputSpec: modules/openapi-generator/src/test/resources/3_0/server-required.yaml
templateDir: modules/openapi-generator/src/main/resources/go-server
additionalProperties:
hideGenerationTimestamp: "true"

View File

@@ -1,4 +1,4 @@
generatorName: haskell
outputDir: samples/server/petstore/haskell-servant
inputSpec: modules/openapi-generator/src/test/resources/3_0/haskell/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/haskell-servant

View File

@@ -1,6 +1,6 @@
generatorName: haskell-yesod
outputDir: samples/server/petstore/haskell-yesod
inputSpec: modules/openapi-generator/src/test/resources/3_0/haskell/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/haskell-yesod
additionalProperties:
hideGenerationTimestamp: "true"

View File

@@ -1,11 +0,0 @@
generatorName: java
outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
library: microprofile
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
withXml: true
additionalProperties:
serializationLibrary: jackson
artifactId: microprofile-rest-client-3-jackson-with-xml
configKey: petstore
microprofileRestClientVersion: "3.0"

View File

@@ -1,10 +0,0 @@
generatorName: java
outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson
library: microprofile
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
serializationLibrary: jackson
artifactId: microprofile-rest-client-3-jackson
configKey: petstore
microprofileRestClientVersion: "3.0"

View File

@@ -7,4 +7,3 @@ additionalProperties:
artifactId: petstore-okhttp-gson
hideGenerationTimestamp: "true"
supportStreaming: true
serializableModel: true

View File

@@ -1,8 +1,8 @@
generatorName: java
outputDir: samples/client/petstore/java/resteasy
library: resteasy
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: petstore-resteasy
hideGenerationTimestamp: "true"
library: resteasy

View File

@@ -5,10 +5,3 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-
templateDir: modules/openapi-generator/src/main/resources/Javascript
additionalProperties:
appName: PetstoreClient
modelNameMappings:
HealthCheckResult: HealthCheckStatus
parameterNameMappings:
query_1: queryOne
# the following has no effect as js client gen use baseName directly
nameMappings:
NullableMessage: nullable_field

View File

@@ -1,13 +1,9 @@
generatorName: julia-client
outputDir: samples/client/petstore/julia
inputSpec: modules/openapi-generator/src/test/resources/3_0/julia/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/julia-client
additionalProperties:
hideGenerationTimestamp: "true"
packageName: OpenAPIGenPetStoreClient
exportOperations: "true"
exportModels: "true"
modelNameMappings:
another_model: MappedModel
nameMappings:
another_property: mappedProperty
exportModels: "true"

View File

@@ -1,9 +1,9 @@
generatorName: julia-server
outputDir: samples/server/petstore/julia
inputSpec: modules/openapi-generator/src/test/resources/3_0/julia/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/julia-server
additionalProperties:
hideGenerationTimestamp: "true"
packageName: OpenAPIGenPetStoreServer
exportOperations: "true"
exportModels: "true"
exportModels: "true"

View File

@@ -1,9 +0,0 @@
generatorName: kotlin
outputDir: samples/client/petstore/kotlin-jvm-jackson
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
artifactId: kotlin-petstore-jvm-jackson
enumUnknownDefaultCase: true
serializationLibrary: jackson
library: jvm-retrofit2

View File

@@ -1,7 +0,0 @@
generatorName: kotlin
outputDir: samples/client/others/kotlin-jvm-okhttp-parameter-tests
library: jvm-okhttp4
inputSpec: modules/openapi-generator/src/test/resources/3_0/parameter-test-spec.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
artifactId: kotlin-petstore-okhttp4-parameter-tests

View File

@@ -1,9 +0,0 @@
generatorName: kotlin-server
outputDir: samples/server/petstore/kotlin-server/jaxrs-spec-mutiny
library: jaxrs-spec
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-server
additionalProperties:
returnResponse: "true"
interfaceOnly: "true"
useMutiny: "true"

View File

@@ -1,7 +0,0 @@
generatorName: kotlin-server
outputDir: samples/server/others/kotlin-server/jaxrs-spec
library: jaxrs-spec
inputSpec: modules/openapi-generator/src/test/resources/3_0/parameter-test-spec.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-server
additionalProperties:
useCoroutines: "true"

View File

@@ -1,14 +0,0 @@
generatorName: kotlin-spring
outputDir: samples/server/petstore/kotlin-spring-default
library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
# comment out below to use default settings
#additionalProperties:
# documentationProvider: none
# annotationLibrary: none
# useSwaggerUI: "false"
# serviceImplementation: "true"
# serializableModel: "true"
# beanValidations: "true"
# useSpringBoot3: "true"

View File

@@ -1,11 +1,4 @@
generatorName: php
outputDir: samples/client/petstore/php/OpenAPIClient-php
inputSpec: modules/openapi-generator/src/test/resources/3_0/php/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/php
nameMappings:
_type: underscore_type
type_: type_with_underscore
type-: type_with_dash
parameterNameMappings:
_type: underscore_type
type_: type_with_underscore

View File

@@ -1,12 +0,0 @@
generatorName: php
outputDir: samples/client/petstore/php/psr-18
inputSpec: modules/openapi-generator/src/test/resources/3_0/php/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/php
library: psr-18
nameMappings:
_type: underscore_type
type_: type_with_underscore
type-: type_with_dash
parameterNameMappings:
_type: underscore_type
type_: type_with_underscore

View File

@@ -4,12 +4,6 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/r
httpUserAgent: PetstoreAgent
library: httr2
modelNameMappings:
dummy_model: JustModel
parameterNameMappings:
path_array: path_array_parameter
nameMappings:
percent_description: percent
additionalProperties:
packageName: petstore
exceptionPackage: rlang
@@ -17,4 +11,3 @@ additionalProperties:
returnExceptionOnFailure: true
errorObjectType: "ModelApiResponse"
operationIdNaming: snake_case

View File

@@ -1,16 +0,0 @@
generatorName: rust
outputDir: samples/client/petstore/rust/reqwest/name-mapping
library: reqwest
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/rust-name-mapping-test.yaml
templateDir: modules/openapi-generator/src/main/resources/rust
additionalProperties:
supportAsync: false
packageName: petstore-name-mapping
nameMappings:
_type: underscore_type
type_: type_with_underscore
-type: dash_type
parameterNameMappings:
_type: underscore_type
type_: type_with_underscore
-type: dash_type

View File

@@ -1,7 +0,0 @@
generatorName: scala-akka-http-server
outputDir: samples/server/petstore/scala-pekko-http-server
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/scala-akka-http-server
additionalProperties:
artifactId: openapi-scala-pekko-http-server
useApachePekko: true

View File

@@ -1,12 +0,0 @@
generatorName: spring
outputDir: samples/server/petstore/springboot-reactive-noResponseEntity
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: springboot-reactive-noResponseEntity
documentationProvider: springfox
reactive: "true"
hideGenerationTimestamp: "true"
delegatePattern: "true"
useResponseEntity: "false"

View File

@@ -10,12 +10,3 @@ additionalProperties:
nonPublicApi: true
projectName: PetstoreClient
podHomepage: https://github.com/openapitools/openapi-generator
nameMappings:
_type: underscoreType
type_: typeWithUnderscore
-type: dashType
parameterNameMappings:
_type: underscoreType
type_: typeWithUnderscore
-type: dashType

View File

@@ -0,0 +1,6 @@
generatorName: python-flask
outputDir: samples/openapi3/server/petstore/python-flask-python2
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml
templateDir: modules/openapi-generator/src/main/resources/python-flask
additionalProperties:
supportPython2: true

View File

@@ -413,18 +413,10 @@ One can map the property name using `nameMappings` option and parameter name usi
Here is an example to use `nameMappings` and `parameterNameMapping` in CLI:
```sh
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml -o /tmp/java2/ --name-mappings _type=underscoreType,type_=typeWithUnderscore, --parameter-name-mappings _type=paramType,type_=typeParam
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml -o /tmp/java2/ --name-mappings _type=underscoreType, type_=typeWithUnderscore, --parameter-name-mappings _type=paramType, type_=typeParam
```
To map model names, use `modelNameMappings` option, e.g.
```sh
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g csharp -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /tmp/csharp/ --model-name-mappings Tag=Label
```
will rename the `Tag` schema to `Label` instead.
Not all generators support thess features yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly. We also welcome PRs to add these features to generators. Related PRs for reference: #16209, #16234 (modelNameMappings), #16194, #16206 (nameMappings, parameterNameMappings).
NOTE: some generators use `baseName` (original name obtained direclty from OpenAPI spec, e.g. `shipping-date`) mustache tag in the templates so the mapping feature won't work.
(Not all generators support this feature yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly.)
## Schema Mapping

View File

@@ -197,7 +197,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>string</li>
<li>struct</li>
<li>switch</li>
<li>system</li>
<li>this</li>
<li>throw</li>
<li>true</li>

View File

@@ -190,7 +190,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>string</li>
<li>struct</li>
<li>switch</li>
<li>system</li>
<li>this</li>
<li>throw</li>
<li>true</li>

View File

@@ -192,7 +192,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>string</li>
<li>struct</li>
<li>switch</li>
<li>system</li>
<li>this</li>
<li>throw</li>
<li>true</li>

View File

@@ -169,9 +169,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -189,7 +187,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -119,7 +119,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|x-content-type|Specify custom value for 'Content-Type' header for operation|OPERATION|null
|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null
|x-field-extra-annotation|List of custom annotations to be added to property|FIELD|null
|x-operation-extra-annotation|List of custom annotations to be added to operation|OPERATION|null
|x-spring-paginated|Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters|OPERATION|false
|x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|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|null
@@ -208,9 +207,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -228,7 +225,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -162,9 +162,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -182,7 +180,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -164,9 +164,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -184,7 +182,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -166,9 +166,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -186,7 +184,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -194,9 +194,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -214,7 +212,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>pathvariable</li>
<li>private</li>

View File

@@ -194,9 +194,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -214,7 +212,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>pathvariable</li>
<li>private</li>

View File

@@ -172,9 +172,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -192,7 +190,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -173,9 +173,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -193,7 +191,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -176,9 +176,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -196,7 +194,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -166,9 +166,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -186,7 +184,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -166,9 +166,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -186,7 +184,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -169,9 +169,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -189,7 +187,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -149,6 +149,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
## LANGUAGE PRIMITIVES
<ul class="column-ul">
<li>BigDecimal</li>
<li>Boolean</li>
<li>Double</li>
<li>Float</li>
@@ -197,9 +198,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -217,7 +216,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -180,9 +180,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -200,7 +198,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -171,9 +171,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -191,7 +189,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -194,9 +194,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -214,7 +212,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -189,9 +189,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -209,7 +207,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -173,9 +173,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -193,7 +191,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -173,9 +173,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -193,7 +191,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -172,9 +172,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -192,7 +190,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -180,9 +180,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -200,7 +198,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -45,7 +45,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useBeanValidation|Use BeanValidation API annotations. This option is currently supported only when using jaxrs-spec library.| |false|
|useCoroutines|Whether to use the Coroutines. This option is currently supported only when using jaxrs-spec library.| |false|
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|
|useMutiny|Whether to use Mutiny (should not be used with useCoroutines). This option is currently supported only when using jaxrs-spec library.| |false|
## IMPORT MAPPING

View File

@@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false|
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|idea|Add IntellJ Idea plugin and mark Kotlin main and test folders as source folders.| |false|
|library|Library template (sub-template) to use|<dl><dt>**jvm-ktor**</dt><dd>Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).</dd><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-okhttp3**</dt><dd>Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0. (DEPRECATED: this option will be remove in 7.x release)</dd><dt>**jvm-spring-webclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.</dd><dt>**jvm-volley**</dt><dd>Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9</dd><dt>**jvm-vertx**</dt><dd>Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.</dd></dl>|jvm-okhttp4|
|library|Library template (sub-template) to use|<dl><dt>**jvm-ktor**</dt><dd>Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).</dd><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-okhttp3**</dt><dd>Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-spring-webclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.</dd><dt>**jvm-volley**</dt><dd>Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9</dd><dt>**jvm-vertx**</dt><dd>Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.</dd></dl>|jvm-okhttp4|
|modelMutable|Create mutable models| |false|
|moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false|
|nullableReturnType|Nullable return type| |false|

View File

@@ -31,7 +31,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|hideGenerationTimestamp|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |true|
|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|library|HTTP library template (sub-template) to use|<dl><dt>**guzzle**</dt><dd>Guzzle</dd><dt>**psr-18**</dt><dd>psr/http-client-implementation, also known as PSR-18. (beta support)</dd></dl>|guzzle|
|licenseName|The name of the license| |null|
|modelPackage|package for generated models| |null|
|packageName|The main package name for classes. e.g. GeneratedPetstore| |null|

View File

@@ -37,7 +37,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |null|
|useApachePekko|Use apache pekko-http instead of akka-http.| |false|
## IMPORT MAPPING

View File

@@ -112,7 +112,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|x-content-type|Specify custom value for 'Content-Type' header for operation|OPERATION|null
|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null
|x-field-extra-annotation|List of custom annotations to be added to property|FIELD|null
|x-operation-extra-annotation|List of custom annotations to be added to operation|OPERATION|null
|x-spring-paginated|Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters|OPERATION|false
|x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|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|null
@@ -201,9 +200,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>int</li>
<li>interface</li>
<li>list</li>
<li>localdate</li>
<li>localreturntype</li>
<li>localtime</li>
<li>localvaraccept</li>
<li>localvaraccepts</li>
<li>localvarauthnames</li>
@@ -221,7 +218,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>new</li>
<li>null</li>
<li>object</li>
<li>offsetdatetime</li>
<li>package</li>
<li>private</li>
<li>protected</li>

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

@@ -86,9 +86,6 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
@Option(name = {"--parameter-name-mappings"}, title = "parameter name mappings", description = "displays the parameter name mappings (none)")
private Boolean parameterNameMappings;
@Option(name = {"--model-name-mappings"}, title = "model name mappings", description = "displays the model name mappings (none)")
private Boolean modelNameMappings;
@Option(name = {"--openapi-normalizer"}, title = "openapi normalizer rules", description = "displays the OpenAPI normalizer rules (none)")
private Boolean openapiNormalizer;
@@ -530,18 +527,6 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
sb.append(newline);
}
if (Boolean.TRUE.equals(modelNameMappings)) {
sb.append(newline).append("MODEL NAME MAPPING").append(newline).append(newline);
Map<String, String> map = config.modelNameMapping()
.entrySet()
.stream()
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a, b) -> {
throw new IllegalStateException(String.format(Locale.ROOT, "Duplicated options! %s and %s", a, b));
}, TreeMap::new));
writePlainTextFromMap(sb, map, optIndent, optNestedIndent, "model name", "Mapped to");
sb.append(newline);
}
if (Boolean.TRUE.equals(openapiNormalizer)) {
sb.append(newline).append("OPENAPI NORMALIZER RULES").append(newline).append(newline);
Map<String, String> map = config.openapiNormalizer()

View File

@@ -202,13 +202,6 @@ public class Generate extends OpenApiGeneratorCommand {
+ " You can also have multiple occurrences of this option.")
private List<String> parameterNameMappings = new ArrayList<>();
@Option(
name = {"--model-name-mappings"},
title = "model name mappings",
description = "specifies mappings between the model name and the new name in the format of model_name=AnotherName,model_name2=OtherName2."
+ " You can also have multiple occurrences of this option.")
private List<String> modelNameMappings = new ArrayList<>();
@Option(
name = {"--openapi-normalizer"},
title = "OpenAPI normalizer rules",
@@ -491,7 +484,6 @@ public class Generate extends OpenApiGeneratorCommand {
applyInlineSchemaOptionsKvpList(inlineSchemaOptions, configurator);
applyNameMappingsKvpList(nameMappings, configurator);
applyParameterNameMappingsKvpList(parameterNameMappings, configurator);
applyModelNameMappingsKvpList(modelNameMappings, configurator);
applyOpenAPINormalizerKvpList(openapiNormalizer, configurator);
applyTypeMappingsKvpList(typeMappings, configurator);
applyAdditionalPropertiesKvpList(additionalProperties, configurator);

View File

@@ -6,7 +6,7 @@
<artifactId>openapi-generator-project</artifactId>
<groupId>org.openapitools</groupId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

@@ -55,7 +55,6 @@ public final class GeneratorSettings implements Serializable {
private final Map<String, String> inlineSchemaOptions;
private final Map<String, String> nameMappings;
private final Map<String, String> parameterNameMappings;
private final Map<String, String> modelNameMappings;
private final Map<String, String> openapiNormalizer;
private final Set<String> languageSpecificPrimitives;
private final Map<String, String> reservedWordsMappings;
@@ -286,15 +285,6 @@ public final class GeneratorSettings implements Serializable {
return parameterNameMappings;
}
/**
* Gets model name mappings between a model name and the new name.
*
* @return the model name mappings
*/
public Map<String, String> getModelNameMappings() {
return modelNameMappings;
}
/**
* Gets OpenAPI normalizer rules
*
@@ -424,7 +414,6 @@ public final class GeneratorSettings implements Serializable {
inlineSchemaOptions = Collections.unmodifiableMap(builder.inlineSchemaOptions);
nameMappings = Collections.unmodifiableMap(builder.nameMappings);
parameterNameMappings = Collections.unmodifiableMap(builder.parameterNameMappings);
modelNameMappings = Collections.unmodifiableMap(builder.modelNameMappings);
openapiNormalizer = Collections.unmodifiableMap(builder.openapiNormalizer);
languageSpecificPrimitives = Collections.unmodifiableSet(builder.languageSpecificPrimitives);
reservedWordsMappings = Collections.unmodifiableMap(builder.reservedWordsMappings);
@@ -501,7 +490,6 @@ public final class GeneratorSettings implements Serializable {
inlineSchemaOptions = Collections.unmodifiableMap(new HashMap<>(0));
nameMappings = Collections.unmodifiableMap(new HashMap<>(0));
parameterNameMappings = Collections.unmodifiableMap(new HashMap<>(0));
modelNameMappings = Collections.unmodifiableMap(new HashMap<>(0));
openapiNormalizer = Collections.unmodifiableMap(new HashMap<>(0));
languageSpecificPrimitives = Collections.unmodifiableSet(new HashSet<>(0));
reservedWordsMappings = Collections.unmodifiableMap(new HashMap<>(0));
@@ -569,9 +557,6 @@ public final class GeneratorSettings implements Serializable {
if (copy.getParameterNameMappings() != null) {
builder.parameterNameMappings.putAll(copy.getParameterNameMappings());
}
if (copy.getModelNameMappings() != null) {
builder.modelNameMappings.putAll(copy.getModelNameMappings());
}
if (copy.getOpenAPINormalizer() != null) {
builder.openapiNormalizer.putAll(copy.getOpenAPINormalizer());
}
@@ -619,7 +604,6 @@ public final class GeneratorSettings implements Serializable {
private Map<String, String> inlineSchemaOptions;
private Map<String, String> nameMappings;
private Map<String, String> parameterNameMappings;
private Map<String, String> modelNameMappings;
private Map<String, String> openapiNormalizer;
private Set<String> languageSpecificPrimitives;
private Map<String, String> reservedWordsMappings;
@@ -643,7 +627,6 @@ public final class GeneratorSettings implements Serializable {
inlineSchemaOptions = new HashMap<>();
nameMappings = new HashMap<>();
parameterNameMappings = new HashMap<>();
modelNameMappings = new HashMap<>();
openapiNormalizer = new HashMap<>();
languageSpecificPrimitives = new HashSet<>();
reservedWordsMappings = new HashMap<>();
@@ -1017,32 +1000,6 @@ public final class GeneratorSettings implements Serializable {
return this;
}
/**
* Sets the {@code modelNameMappings} and returns a reference to this Builder so that the methods can be chained together.
*
* @param modelNameMappings the {@code modelNameMappings} to set
* @return a reference to this Builder
*/
public Builder withModelNameMappings(Map<String, String> modelNameMappings) {
this.modelNameMappings = modelNameMappings;
return this;
}
/**
* Sets a single {@code modelNameMappings} and returns a reference to this Builder so that the methods can be chained together.
*
* @param key A key for the name mapping
* @param value The value of name mapping
* @return a reference to this Builder
*/
public Builder withModelNameMapping(String key, String value) {
if (this.modelNameMappings == null) {
this.modelNameMappings = new HashMap<>();
}
this.modelNameMappings.put(key, value);
return this;
}
/**
* Sets the {@code openapiNormalizer} and returns a reference to this Builder so that the methods can be chained together.
*
@@ -1259,7 +1216,6 @@ public final class GeneratorSettings implements Serializable {
Objects.equals(getInlineSchemaOptions(), that.getInlineSchemaOptions()) &&
Objects.equals(getNameMappings(), that.getNameMappings()) &&
Objects.equals(getParameterNameMappings(), that.getParameterNameMappings()) &&
Objects.equals(getModelNameMappings(), that.getModelNameMappings()) &&
Objects.equals(getOpenAPINormalizer(), that.getOpenAPINormalizer()) &&
Objects.equals(getLanguageSpecificPrimitives(), that.getLanguageSpecificPrimitives()) &&
Objects.equals(getReservedWordsMappings(), that.getReservedWordsMappings()) &&
@@ -1294,7 +1250,6 @@ public final class GeneratorSettings implements Serializable {
getInlineSchemaOptions(),
getNameMappings(),
getParameterNameMappings(),
getModelNameMappings(),
getOpenAPINormalizer(),
getLanguageSpecificPrimitives(),
getReservedWordsMappings(),

View File

@@ -239,21 +239,6 @@ apply plugin: 'org.openapi.generator'
|None
|specifies mappings between the schema and the new name in the format of schema_a=Cat,schema_b=Bird. https://openapi-generator.tech/docs/customization/#schema-mapping
|nameMappings
|Map(String,String)
|None
|specifies mappings between the property name and the new name in the format of property_a=firstProperty,property_b=secondProperty. https://openapi-generator.tech/docs/customization/#name-mapping
|modelNameMappings
|Map(String,String)
|None
|specifies mappings between the model name and the new name in the format of model_a=FirstModel,property_b=SecondModel. https://openapi-generator.tech/docs/customization/#name-mapping
|parameterNameMappings
|Map(String,String)
|None
|specifies mappings between the parameter name and the new name in the format of parameter_a=firstParameter,parameter_b=secondParameter. https://openapi-generator.tech/docs/customization/#name-mapping
|inlineSchemaNameMappings
|Map(String,String)
|None

View File

@@ -1,5 +1,5 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.0.0
openApiGeneratorVersion=7.0.0-SNAPSHOT
# /RELEASE_VERSION
# BEGIN placeholders

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

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

View File

@@ -177,11 +177,6 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
*/
val parameterNameMappings = project.objects.mapProperty<String, String>()
/**
* Specifies mappings between a model name and the new name
*/
val modelNameMappings = project.objects.mapProperty<String, String>()
/**
* Specifies mappings (rules) in OpenAPI normalizer
*/

View File

@@ -286,13 +286,6 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
@Input
val parameterNameMappings = project.objects.mapProperty<String, String>()
/**
* Specifies mappings between the model name and the new name
*/
@Optional
@Input
val modelNameMappings = project.objects.mapProperty<String, String>()
/**
* Specifies mappings (rules) in OpenAPI normalizer
*/
@@ -840,12 +833,6 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
}
}
if (modelNameMappings.isPresent) {
modelNameMappings.get().forEach { entry ->
configurator.addModelNameMapping(entry.key, entry.value)
}
}
if (openapiNormalizer.isPresent) {
openapiNormalizer.get().forEach { entry ->
configurator.addOpenAPINormalizer(entry.key, entry.value)

View File

@@ -86,9 +86,6 @@ mvn clean compile
| `importMappings` | `openapi.generator.maven.plugin.importMappings` | specifies mappings between a given class and the import that should be used for that class in the format of type=import,type=import. You can also have multiple occurrences of this option
| `typeMappings` | `openapi.generator.maven.plugin.typeMappings` | sets mappings between OpenAPI spec types and generated code types in the format of OpenAPIType=generatedType,OpenAPIType=generatedType. For example: `array=List,map=Map,string=String`. You can also have multiple occurrences of this option. To map a specified format, use type+format, e.g. string+password=EncryptedString will map `type: string, format: password` to `EncryptedString`.
| `schemaMappings` | `openapi.generator.maven.plugin.schemaMappings` | specifies mappings between the schema and the new name in the format of schema_a=Cat,schema_b=Bird. https://openapi-generator.tech/docs/customization/#schema-mapping
| `nameMappings` | `openapi.generator.maven.plugin.nameMappings` | specifies mappings between the property name and the new name in the format of property_a=firstProperty,property_b=secondProperty. https://openapi-generator.tech/docs/customization/#name-mapping
| `modelNameMappings` | `openapi.generator.maven.plugin.modelNameMappings` | specifies mappings between the model name and the new name in the format of model_a=FirstModel,model_b=SecondModel. https://openapi-generator.tech/docs/customization/#name-mapping
| `parameterNameMappings` | `openapi.generator.maven.plugin.parameterNameMappings` | specifies mappings between the parameter name and the new name in the format of param_a=first_parameter,param_b=second_parameter. https://openapi-generator.tech/docs/customization/#name-mapping
| `inlineSchemaNameMappings` | `openapi.generator.maven.plugin.inlineSchemaNameMappings` | specifies mappings between the inline schema name and the new name in the format of inline_object_2=Cat,inline_object_5=Bird.
| `inlineSchemaOptions` | `openapi.generator.maven.plugin.inlineSchemaOptions` | specifies the options used when naming inline schema in inline model resolver
| `languageSpecificPrimitives` | `openapi.generator.maven.plugin.languageSpecificPrimitives` | specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: `String,boolean,Boolean,Double`. You can also have multiple occurrences of this option

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -15,7 +15,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -19,7 +19,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<dependencies>
<dependency>

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -20,7 +20,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -5,7 +5,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>
@@ -27,31 +27,28 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.9.4</version>
<scope>provided</scope>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.9.4</version>
<version>3.8.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.9.4</version>
<scope>test</scope>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.9.4</version>
<scope>provided</scope>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.9.0</version>
<version>3.6.4</version>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
@@ -75,28 +72,13 @@
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.3.0</version>
<scope>test</scope>
<exclusions>
<!-- excludes due to https://devhub.checkmarx.com/cve-details/CVE-2018-1002200 -->
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.5.1</version>
<version>3.5.0</version>
<scope>test</scope>
</dependency>
<!-- explicit dependency due to https://devhub.checkmarx.com/cve-details/CVE-2018-1002200 (see exclusion in maven-plugin-testing-harness) -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
@@ -104,7 +86,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.9.0</version>
<version>3.6.4</version>
<configuration>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
@@ -162,7 +144,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.6.0</version>
<version>3.2.2</version>
<configuration>
<debug>false</debug>
<failIfNoProjects>true</failIfNoProjects>

View File

@@ -344,12 +344,6 @@ public class CodeGenMojo extends AbstractMojo {
@Parameter(name = "parameterNameMappings", property = "openapi.generator.maven.plugin.parameterNameMappings")
private List<String> parameterNameMappings;
/**
* A map of model names and the new names
*/
@Parameter(name = "modelNameMappings", property = "openapi.generator.maven.plugin.modelNameMappings")
private List<String> modelNameMappings;
/**
* A set of rules for OpenAPI normalizer
*/
@@ -829,11 +823,6 @@ public class CodeGenMojo extends AbstractMojo {
applyParameterNameMappingsKvpList(parameterNameMappings, configurator);
}
// Apply Model Name Mappings
if (modelNameMappings != null && (configOptions == null || !configOptions.containsKey("model-name-mappings"))) {
applyModelNameMappingsKvpList(modelNameMappings, configurator);
}
// Apply OpenAPI normalizer rules
if (openapiNormalizer != null && (configOptions == null || !configOptions.containsKey("openapi-normalizer"))) {
applyOpenAPINormalizerKvpList(openapiNormalizer, configurator);

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.0</version>
<version>7.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

@@ -151,8 +151,6 @@ public interface CodegenConfig {
Map<String, String> parameterNameMapping();
Map<String, String> modelNameMapping();
Map<String, String> openapiNormalizer();
Map<String, String> apiTemplateFiles();

View File

@@ -149,13 +149,27 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
public String additionalPropertiesType;
/**
* True if additionalProperties is set to true (boolean value), any type, free form object, etc
*
* TODO: we may rename this to isAdditionalPropertiesEnabled or something
* else to avoid confusions
* True if additionalProperties is set to true (boolean value)
*/
public boolean isAdditionalPropertiesTrue;
/**
* True if additional properties is set to any type
*/
public boolean isAdditionalPropertiesAnyType;
/**
* True if additional properties is set to free form object
*/
public boolean isAdditionalPropertiesFreeFormObject;
/**
* True if additional properties is enabled (boolean or any type)
*/
public boolean isAdditionalPropertiesEnabled() {
return isAdditionalPropertiesTrue || isAdditionalPropertiesAnyType || isAdditionalPropertiesFreeFormObject;
}
private Integer maxProperties;
private Integer minProperties;
private boolean uniqueItems;
@@ -1091,6 +1105,8 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
Objects.equals(externalDocumentation, that.externalDocumentation) &&
Objects.equals(vendorExtensions, that.vendorExtensions) &&
Objects.equals(additionalPropertiesType, that.additionalPropertiesType) &&
Objects.equals(isAdditionalPropertiesAnyType, that.isAdditionalPropertiesAnyType) &&
Objects.equals(isAdditionalPropertiesFreeFormObject, that.isAdditionalPropertiesFreeFormObject) &&
Objects.equals(isAdditionalPropertiesTrue, that.isAdditionalPropertiesTrue) &&
Objects.equals(getMaxProperties(), that.getMaxProperties()) &&
Objects.equals(getMinProperties(), that.getMinProperties()) &&
@@ -1125,7 +1141,8 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
getAdditionalPropertiesIsAnyType(), hasDiscriminatorWithNonEmptyMapping,
isAnyType, getComposedSchemas(), hasMultipleTypes, isDecimal, isUuid, requiredVarsMap, ref,
uniqueItemsBoolean, schemaIsFromAdditionalProperties, isBooleanSchemaTrue, isBooleanSchemaFalse,
format, dependentRequired, contains);
format, dependentRequired, contains, isAdditionalPropertiesTrue, isAdditionalPropertiesFreeFormObject,
isAdditionalPropertiesFreeFormObject);
}
@Override
@@ -1197,7 +1214,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
sb.append(", externalDocumentation=").append(externalDocumentation);
sb.append(", vendorExtensions=").append(vendorExtensions);
sb.append(", additionalPropertiesType='").append(additionalPropertiesType).append('\'');
sb.append(", isAdditionalPropertiesTrue='").append(isAdditionalPropertiesTrue).append('\'');
sb.append(", maxProperties=").append(maxProperties);
sb.append(", minProperties=").append(minProperties);
sb.append(", uniqueItems=").append(uniqueItems);
@@ -1232,6 +1248,9 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
sb.append(", format=").append(format);
sb.append(", dependentRequired=").append(dependentRequired);
sb.append(", contains=").append(contains);
sb.append(", isAdditionalPropertiesAnyType=").append(isAdditionalPropertiesAnyType);
sb.append(", isAdditionalPropertiesFreeFormObject=").append(isAdditionalPropertiesFreeFormObject);
sb.append(", isAdditionalPropertiesTrue=").append(isAdditionalPropertiesTrue);
sb.append('}');
return sb.toString();
}

View File

@@ -29,7 +29,7 @@ import java.util.*;
public class CodegenParameter implements IJsonSchemaValidationProperties {
public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam,
isCookieParam, isBodyParam, isContainer,
isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isMatrix, isAllowEmptyValue;
isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isAllowEmptyValue;
public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, contentType,
collectionFormat, description, unescapedDescription, baseType, defaultValue, enumDefaultValue, enumName, style;
@@ -251,7 +251,6 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
output.isExplode = this.isExplode;
output.style = this.style;
output.isDeepObject = this.isDeepObject;
output.isMatrix = this.isMatrix;
output.isAllowEmptyValue = this.isAllowEmptyValue;
output.contentType = this.contentType;
@@ -260,7 +259,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
@Override
public int hashCode() {
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, containerType, containerTypeMapped, defaultValue, enumDefaultValue, enumName, style, isDeepObject, isMatrix, isAllowEmptyValue, example, examples, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, isEnumRef, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, isVoid, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties);
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, containerType, containerTypeMapped, defaultValue, enumDefaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, examples, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, isEnumRef, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, isVoid, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties);
}
@Override
@@ -342,7 +341,6 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
Objects.equals(enumName, that.enumName) &&
Objects.equals(style, that.style) &&
Objects.equals(isDeepObject, that.isDeepObject) &&
Objects.equals(isMatrix, that.isMatrix) &&
Objects.equals(isAllowEmptyValue, that.isAllowEmptyValue) &&
Objects.equals(example, that.example) &&
Objects.equals(examples, that.examples) &&
@@ -407,7 +405,6 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
sb.append(", enumName='").append(enumName).append('\'');
sb.append(", style='").append(style).append('\'');
sb.append(", deepObject='").append(isDeepObject).append('\'');
sb.append(", isMatrix='").append(isMatrix).append('\'');
sb.append(", allowEmptyValue='").append(isAllowEmptyValue).append('\'');
sb.append(", example='").append(example).append('\'');
sb.append(", examples='").append(examples).append('\'');

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