Compare commits

..

2 Commits

Author SHA1 Message Date
William Cheng
c317c753f0 comment out to speed up tests 2021-05-05 17:02:05 +08:00
William Cheng
d0a427a84c add elm client test 2021-05-05 17:01:50 +08:00
4558 changed files with 25552 additions and 175616 deletions

View File

@@ -82,6 +82,7 @@ jobs:
- ~/.bundle
- ~/.go_workspace
- ~/.gradle
- ~/.pub-cache
- ~/.cache/bower
- ".git"
- ~/.stack

1
.gitattributes vendored
View File

@@ -1,2 +1 @@
**/*.mustache linguist-vendored=true
* text=auto eol=lf

View File

@@ -1,19 +0,0 @@
name: 'Run samples'
description: 'Runs sample integration test profile with Maven'
inputs:
name:
description: 'The Maven profile name'
required: true
goal:
description: 'Maven goal'
required: false
default: 'verify'
args:
description: 'Additional maven arguments'
required: false
default: ''
runs:
using: "composite"
steps:
- run: mvn --no-snapshot-updates --batch-mode --quiet ${{ inputs.goal }} -P${{ inputs.name }} -Dintegration-test -Dmaven.javadoc.skip=true ${{ inputs.args }}
shell: bash

View File

@@ -26,17 +26,16 @@ jobs:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- uses: actions/cache@v2.1.6
- uses: actions/cache@v2.1.5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/cache@v2.1.6
- uses: actions/cache@v2.1.5
with:
path: |
~/.gradle/caches
@@ -50,7 +49,7 @@ jobs:
run: mvn -nsu -B --quiet -Djacoco.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error --no-transfer-progress clean install --file pom.xml ${{ matrix.flags }}
- name: Upload Maven build artifact
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v2.2.3
if: matrix.java == '8' && matrix.os == 'ubuntu-latest'
with:
name: artifact
@@ -81,7 +80,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v2
- name: Download build artifact
uses: actions/download-artifact@v2.0.10
uses: actions/download-artifact@v2.0.8
with:
name: artifact
- name: Run Ensures Script
@@ -90,6 +89,6 @@ jobs:
git config --global core.fileMode false
git config --global core.safecrlf false
git config --global core.autocrlf true
mvn clean package -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
# test with java (jersey2) client generation only as ensure-uptodate script is run in another job instead
./bin/generate-samples.sh ./bin/configs/java-jersey2-8.yaml
mkdir -p modules/openapi-generator-cli/target/
mv artifact/openapi-generator-cli.jar modules/openapi-generator-cli/target/
./bin/utils/ensure-up-to-date ${{ matrix.flags }}

View File

@@ -1,19 +0,0 @@
name: OpenAPI Generator Test Report
on:
workflow_run:
workflows: ['OpenAPI Generator']
types:
- completed
# separate workflow required due to https://github.com/dorny/test-reporter#recommended-setup-for-public-repositories
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
with:
artifact: surefire-test-results
name: JUnit Test results
path: '**/surefire-reports/TEST-*.xml'
reporter: java-junit

View File

@@ -1,214 +0,0 @@
name: OpenAPI Generator
on:
push:
branches:
- master
- '[5-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[5-9]+.[0-9]+.x'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2.1.6
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Run maven
run: mvn --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error
- run: ls -la modules/openapi-generator-cli/target
- name: Upload openapi-generator-cli.jar artifact
uses: actions/upload-artifact@v2.2.4
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
retention-days: 1
test:
name: Unit tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2.1.6
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Run unit tests
run: mvn --no-snapshot-updates --batch-mode --quiet --fail-at-end test -Dorg.slf4j.simpleLogger.defaultLogLevel=error
- name: Publish unit test reports
if: ${{ always() }}
uses: actions/upload-artifact@v2.2.4
with:
name: surefire-test-results
path: '**/surefire-reports/TEST-*.xml'
documentation:
name: Docs up-to-date
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Download openapi-generator-cli.jar artifact
uses: actions/download-artifact@v2.0.10
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target
- name: Generate docs
run: |
bash bin/meta-codegen.sh
bash bin/utils/export_docs_generators.sh
bash bin/utils/copy-to-website.sh
bash bin/utils/export_generators_readme.sh
- name: Verify git status
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
echo "UNCOMMITTED CHANGES ERROR"
echo "There are uncommitted changes in working tree after execution of 'bin/ensure-up-to-date'"
echo "Perform git diff"
git --no-pager diff
echo "Perform git status"
git status
echo -e "\nThis script runs in pull requests against the anticipated merge commit (as if the PR was merged now)."
echo "When you see unexpected files here, it likely means that there are newer commits in master that you need to "
echo -e "rebase or merge into your branch.\n"
echo "Please run 'bin/utils/ensure-up-to-date' locally and commit changes (UNCOMMITTED CHANGES ERROR)"
exit 1
fi
samples:
name: Samples up-to-date
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Download openapi-generator-cli.jar artifact
uses: actions/download-artifact@v2.0.10
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target
- name: Generate samples
run: bash bin/generate-samples.sh
- name: Verify git status
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
echo "UNCOMMITTED CHANGES ERROR"
echo "There are uncommitted changes in working tree after execution of 'bin/generate-samples.sh'"
echo "Perform git diff"
git --no-pager diff
echo "Perform git status"
git status
echo -e "\nThis script runs in pull requests against the anticipated merge commit (as if the PR was merged now)."
echo "When you see unexpected files here, it likely means that there are newer commits in master that you need to "
echo -e "rebase or merge into your branch.\n"
echo "Please run 'bin/generate-samples.sh' locally and commit changes (UNCOMMITTED CHANGES ERROR)"
exit 1
fi
test-maven-plugin:
name: Maven plugin tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache maven dependencies
uses: actions/cache@v2.1.6
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-test-maven-plugin-${{ env.cache-name }}-
${{ runner.os }}-test-maven-plugin-
- name: Run tests
run: |
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
test-gradle-plugin:
name: Gradle plugin tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache maven dependencies
uses: actions/cache@v2.1.6
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/modules-2/modules-2.lock
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-test-gradle-plugin-${{ env.cache-name }}-
${{ runner.os }}-test-gradle-plugin-
- name: Run tests
run: |
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk)
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate)

View File

@@ -1,80 +0,0 @@
name: Samples Dart
on:
push:
branches:
- master
- '[5-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[5-9]+.[0-9]+.x'
paths:
- 'samples/openapi3/client/petstore/dart*/**'
jobs:
tests-dart-2-10:
name: Tests Dart 2.10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2.1.6
env:
cache-name: maven-repository
with:
path: |
~/.m2/repository
~/.gradle
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Cache test dependencies
uses: actions/cache@v2.1.6
env:
cache-name: pub-cache
with:
path: $PUB_CACHE
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('samples/**/pubspec.yaml') }}
- uses: dart-lang/setup-dart@v1
with:
sdk: 2.10.5
- name: Run tests
uses: ./.github/actions/run-samples
with:
name: samples.dart-2.10
tests-dart-2-13:
name: Tests Dart 2.13
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2.1.6
env:
cache-name: maven-repository
with:
path: |
~/.m2/repository
~/.gradle
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Cache test dependencies
uses: actions/cache@v2.1.6
env:
cache-name: pub-cache
with:
path: $PUB_CACHE
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('samples/**/pubspec.yaml') }}
- uses: dart-lang/setup-dart@v1
with:
sdk: 2.13.0
- name: Run tests
uses: ./.github/actions/run-samples
with:
name: samples.dart-2.13

View File

@@ -1,66 +0,0 @@
name: Samples Kotlin
on:
push:
branches:
- master
- '[5-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[5-9]+.[0-9]+.x'
paths:
- 'samples/client/petstore/kotlin*/**'
env:
GRADLE_VERSION: 6.9
jobs:
build:
name: Build Kotlin
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
- samples/client/petstore/kotlin
- samples/client/petstore/kotlin-gson
- samples/client/petstore/kotlin-jackson
# needs Android configured
#- samples/client/petstore/kotlin-json-request-string
- samples/client/petstore/kotlin-jvm-okhttp4-coroutines
- samples/client/petstore/kotlin-moshi-codegen
# need some special setup
#- samples/client/petstore/kotlin-multiplatform
- samples/client/petstore/kotlin-nonpublic
- samples/client/petstore/kotlin-nullable
- samples/client/petstore/kotlin-okhttp3
- samples/client/petstore/kotlin-retrofit2
- samples/client/petstore/kotlin-retrofit2-kotlinx_serialization
- samples/client/petstore/kotlin-retrofit2-rx3
- samples/client/petstore/kotlin-string
- samples/client/petstore/kotlin-threetenbp
- samples/client/petstore/kotlin-uppercase-enum
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 8
- name: Cache maven dependencies
uses: actions/cache@v2.1.6
env:
cache-name: maven-repository
with:
path: |
~/.gradle
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Install Gradle wrapper
uses: eskatos/gradle-command-action@v1
with:
gradle-version: ${{ env.GRADLE_VERSION }}
build-root-directory: ${{ matrix.sample }}
arguments: wrapper
- name: Build
working-directory: ${{ matrix.sample }}
run: ./gradlew build -x test

View File

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

2
.gitignore vendored
View File

@@ -177,6 +177,7 @@ samples/client/petstore/python-tornado/.venv/
# PHP
samples/client/petstore/php/OpenAPIClient-php/composer.lock
samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/composer.lock
samples/openapi3/server/petstore/php-mezzio-ph/composer.lock
samples/server/petstore/php-laravel/lib/composer.lock
samples/server/petstore/php-lumen/lib/composer.lock
samples/server/petstore/php-slim4/composer.lock
@@ -212,7 +213,6 @@ cabal.project.local
samples/client/petstore/haskell-http-client/docs/haddock-bundle.min.js
samples/client/petstore/haskell-http-client/docs/meta.json
samples/client/petstore/haskell-http-client/docs/quick-jump.css
samples/server/petstore/haskell-servant/stack.yaml.lock
# R
.Rproj.user

View File

@@ -76,11 +76,11 @@ before_install:
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
- docker ps -a
# install crystal
- echo 'deb http://download.opensuse.org/repositories/devel:/languages:/crystal/xUbuntu_16.04/ /' | sudo tee /etc/apt/sources.list.d/devel:languages:crystal.list
- curl -fsSL https://download.opensuse.org/repositories/devel:languages:crystal/xUbuntu_16.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_languages_crystal.gpg > /dev/null
- sudo apt update
- curl -sSL https://dist.crystal-lang.org/apt/setup.sh | sudo bash
- curl -sL "https://keybase.io/crystal/pgp_keys.asc" | sudo apt-key add -
- echo "deb https://dist.crystal-lang.org/apt crystal main" | sudo tee /etc/apt/sources.list.d/crystal.list
- sudo apt-get update
- sudo apt install crystal
- crystal --version
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.0
- export PATH="$HOME/.yarn/bin:$PATH"
# install rust

View File

@@ -1,61 +1,61 @@
kind: pipeline
name: default
steps:
# test Elm client
- name: elm
image: odesimple/elm:0.19
commands:
- (cd samples/openapi3/client/petstore/elm && ./elm-compile-test)
# test Java 11 HTTP client
- name: java11-test
image: openjdk:11.0
commands:
- ./mvnw --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
- ./mvnw --quiet verify -Psamples.droneio -Dorg.slf4j.simpleLogger.defaultLogLevel=error
# test java native client
- ./mvnw clean test -f samples/client/petstore/java/native/pom.xml
- ./mvnw clean test -f samples/client/petstore/java/native-async/pom.xml
- ./mvnw clean test -f samples/openapi3/client/petstore/java/native/pom.xml
# test all generators with fake petstore spec (2.0, 3.0)
- /bin/bash bin/utils/test-fake-petstore-for-all.sh
# generate test scripts
- /bin/bash bin/tests/run-all-test
# test nim client
- name: nim-client-test
image: nimlang/nim
commands:
- (cd samples/client/petstore/nim/ && nim c sample_client.nim)
# test protobuf schema generator
- name: protobuf-schema-test
image: nanoservice/protobuf-go
commands:
- protoc --version
- mkdir /var/tmp/go/
- cd samples/config/petstore/protobuf-schema
- protoc --go_out=/var/tmp/go/ services/*
- protoc --go_out=/var/tmp/go/ models/*
# test aspnetcore 3.x
- name: aspnetcore-test
image: mcr.microsoft.com/dotnet/core/sdk:3.1
commands:
- (cd samples/server/petstore/aspnetcore-3.1/ && /bin/sh build.sh)
- (cd samples/server/petstore/aspnetcore-3.0/ && /bin/sh build.sh)
# test ocaml petstore client
- name: ocaml-test
image: ocaml/opam2:4.07
commands:
- sudo apt-get -y install m4
- cd samples/client/petstore/ocaml
- opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix
- opam pin add ocaml-migrate-parsetree 1.3.1
- eval $(opam env)
- sudo chmod -R 777 .
- dune build --build-dir=./_build
# test haskell client
- name: haskell-client-test
image: haskell:8.6.5
commands:
- (cd samples/client/petstore/haskell-http-client/ && stack --allow-different-user --install-ghc --no-haddock-deps haddock --fast && stack --allow-different-user test --fast)
# test erlang client and server
- name: erlang
image: erlang:alpine
commands:
- (cd samples/client/petstore/erlang-client && rebar3 compile)
- (cd samples/client/petstore/erlang-proper && rebar3 compile)
# comment out as the tests pass locally but not in the CI
#- (cd samples/server/petstore/erlang-server && rebar3 compile)
#- name: java11-test
# image: openjdk:11.0
# commands:
# - ./mvnw --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
# - ./mvnw --quiet verify -Psamples.droneio -Dorg.slf4j.simpleLogger.defaultLogLevel=error
# # run ensure up-to-date
# - /bin/bash bin/utils/ensure-up-to-date
# # test java native client
# - ./mvnw clean test -f samples/client/petstore/java/native/pom.xml
# - ./mvnw clean test -f samples/client/petstore/java/native-async/pom.xml
# - ./mvnw clean test -f samples/openapi3/client/petstore/java/native/pom.xml
# # test all generators with fake petstore spec (2.0, 3.0)
# - /bin/bash bin/utils/test-fake-petstore-for-all.sh
# # generate test scripts
# - /bin/bash bin/tests/run-all-test
## test nim client
#- name: nim-client-test
# image: nimlang/nim
# commands:
# - (cd samples/client/petstore/nim/ && nim c sample_client.nim)
## test protobuf schema generator
#- name: protobuf-schema-test
# image: nanoservice/protobuf-go
# commands:
# - protoc --version
# - mkdir /var/tmp/go/
# - cd samples/config/petstore/protobuf-schema
# - protoc --go_out=/var/tmp/go/ services/*
# - protoc --go_out=/var/tmp/go/ models/*
## test aspnetcore 3.x
#- name: aspnetcore-test
# image: mcr.microsoft.com/dotnet/core/sdk:3.1
# commands:
# - (cd samples/server/petstore/aspnetcore-3.1/ && /bin/sh build.sh)
# - (cd samples/server/petstore/aspnetcore-3.0/ && /bin/sh build.sh)
## test ocaml petstore client
#- name: ocaml-test
# image: ocaml/opam2:4.07
# commands:
# - sudo apt-get -y install m4
# - cd samples/client/petstore/ocaml
# - opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix
# - opam pin add ocaml-migrate-parsetree 1.3.1
# - eval $(opam env)
# - sudo chmod -R 777 .
# - dune build --build-dir=./_build
## test haskell client
#- name: haskell-client-test
# image: haskell:8.6.5
# commands:
# - (cd samples/client/petstore/haskell-http-client/ && stack --install-ghc --no-haddock-deps haddock --fast && stack test --fast)

View File

@@ -14,6 +14,17 @@ function cleanup {
trap cleanup EXIT
function installDart {
# install dart2
sudo apt-get update
sudo apt-get install apt-transport-https
sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
sudo apt-get update
sudo apt-get install dart
export PATH="$PATH:/usr/lib/dart/bin"
}
if [ "$NODE_INDEX" = "1" ]; then
echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..."
java -version
@@ -24,6 +35,21 @@ if [ "$NODE_INDEX" = "1" ]; then
ls -l /home/circleci/.ivy2/cache
elif [ "$NODE_INDEX" = "2" ]; then
installDart
# run ensure-up-to-date sample script on SNAPSHOT version only
project_version=`mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout`
if [[ $project_version == *"-SNAPSHOT" ]]; then
echo "Running node $NODE_INDEX to test ensure-up-to-date"
java -version
# clear any changes to the samples
git checkout -- .
# look for outdated samples
#./bin/utils/ensure-up-to-date
# UPDATE: moved to drone.io
fi
echo "Running node $NODE_INDEX to test haskell"
# install haskell
curl -sSL https://get.haskellstack.org/ | sh

View File

@@ -48,7 +48,6 @@ Code change should conform to the programming style guide of the respective lang
- C#: https://msdn.microsoft.com/en-us/library/vstudio/ff926074.aspx
- C++: https://google.github.io/styleguide/cppguide.html
- C++ (Tizen): https://wiki.tizen.org/Native_Platform_Coding_Idiom_and_Style_Guide#C.2B.2B_Coding_Style
- C++ (Unreal Engine 4): https://docs.unrealengine.com/en-US/ProductionPipelines/DevelopmentSetup/CodingStandard/index.html
- Clojure: https://github.com/bbatsov/clojure-style-guide
- Crystal: https://crystal-lang.org/reference/conventions/coding_style.html
- Dart: https://www.dartlang.org/guides/language/effective-dart/style
@@ -88,10 +87,12 @@ To add test cases (optional) covering the change in the code generator, please r
To test the templates, please perform the following:
- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh ./bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion)
- During development, it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`.
- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh .
/bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion)
- During development it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`.
- Run the tests in the sample folder using maven `mvn integration-test -f /path/to/pom.xml`, e.g. `mvn integration-test -f samples/client/petstore/python/pom.xml`. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests)
- Finally, git commit the updated samples files: `git commit -a` (`git add -A` if added files with new test cases)
- Finally, git commit the updated samples files: `git commit -a`
(`git add -A` if added files with new test cases)
- For new test cases, please add to the [Fake Petstore spec](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml)
To start the CI tests, you can:

View File

@@ -9,18 +9,28 @@
<div align="center">
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.2.0`):
[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator)
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.1.1`):
[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator)
[![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)
[![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=master)](https://app.shippable.com/github/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-wh2wu)
[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/master)](https://cloud.drone.io/OpenAPITools/openapi-generator)
[![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/master?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67)
[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/openapitools/openapi-generator/Check%20Supported%20Java%20Versions/master?label=Check%20Supported%20Java%20Versions&logo=github&logoColor=green)](https://github.com/OpenAPITools/openapi-generator/actions?query=workflow%3A%22Check+Supported+Java+Versions%22)
[5.2.x](https://github.com/OpenAPITools/openapi-generator/tree/5.2.x) (`5.2.x`):
[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/5.2.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/5.2.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=5.2.x)](https://app.shippable.com/github/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=5.2.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/5.2.x)](https://cloud.drone.io/OpenAPITools/openapi-generator)
[![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/5.2.x?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67)
[6.0.x](https://github.com/OpenAPITools/openapi-generator/tree/6.0.x) (`6.0.x`):
[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/6.0.x.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator)
[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/6.0.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/6.0.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=6.0.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
[![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=6.0.x)](https://app.shippable.com/github/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=6.0.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/6.0.x)](https://cloud.drone.io/OpenAPITools/openapi-generator)
[![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/6.0.x?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67)
@@ -67,11 +77,11 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
| | Languages/Frameworks |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0, .NET 5.0. Libraries: RestSharp, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) |
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) |
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0, .NET 5.0. Libraries: RestSharp, HttpClient), **C++** (cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) |
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) |
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer**, **WSDL** |
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer** |
## Table of contents
@@ -110,8 +120,9 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
| OpenAPI Generator Version | Release Date | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
| 6.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.0.0-SNAPSHOT/) | Nov/Dec 2021 | Minor release with breaking changes (no fallback) |
| 5.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.2.0-SNAPSHOT/) | Jun/Jul 2021 | Minor release with breaking changes (with fallback) |
| [5.1.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.1.1) (latest stable release) | 07.05.2021 | Patch release (enhancements, bug fixes, etc) |
| 5.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.2.0-SNAPSHOT/) | May/Jun 2021 | Minor release with breaking changes (with fallback) |
| 5.1.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.1.1-SNAPSHOT/) | Apr/May 2021 | Patch release (enhancements, bug fixes, etc) |
| [5.1.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.1.0) (latest stable release) | 20.03.2021 | 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) |
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
@@ -168,16 +179,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
<!-- RELEASE_VERSION -->
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.1/openapi-generator-cli-5.1.1.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.0/openapi-generator-cli-5.1.0.jar`
For **Mac/Linux** users:
```sh
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.1/openapi-generator-cli-5.1.1.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.0/openapi-generator-cli-5.1.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/5.1.1/openapi-generator-cli-5.1.1.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.0/openapi-generator-cli-5.1.0.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -269,7 +280,7 @@ To reinstall with the latest master, run `brew uninstall openapi-generator && br
To install OpenJDK (pre-requisites), please run
```sh
brew tap AdoptOpenJDK/openjdk
brew install --cask adoptopenjdk12
brew cask install adoptopenjdk12
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home/
```
@@ -402,7 +413,7 @@ openapi-generator-cli version
To use a specific version of "openapi-generator-cli"
```sh
openapi-generator-cli version-manager set 5.1.1
openapi-generator-cli version-manager set 5.1.0
```
Or install it as dev-dependency:
@@ -426,7 +437,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/5.1.1/openapi-generator-cli-5.1.1.jar)
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.0/openapi-generator-cli-5.1.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`
@@ -564,7 +575,6 @@ Here is a list of community-contributed IDE plug-ins that integrate with OpenAPI
## [4 - Companies/Projects using OpenAPI Generator](#table-of-contents)
Here are some companies/projects (alphabetical order) using OpenAPI Generator in production. To add your company/project to the list, please visit [README.md](README.md) and click on the icon to edit the page.
- [Aalborg University](https://www.aau.dk)
- [Adaptant Solutions AG](https://www.adaptant.io/)
- [adesso SE](https://www.adesso.de/)
- [Agoda](https://www.agoda.com/)
@@ -812,11 +822,8 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- 2021-03-28 - [Trying out NestJS part 4: Generate Typescript clients from OpenAPI documents](https://dev.to/arnaudcortisse/trying-out-nestjs-part-4-generate-typescript-clients-from-openapi-documents-28mk) by [Arnaud Cortisse](https://dev.to/arnaudcortisse)
- 2021-03-31 - [Open API Server Implementation Using OpenAPI Generator](https://www.baeldung.com/java-openapi-generator-server) at [Baeldung](https://www.baeldung.com/)
- 2021-03-31 - [使用OpenAPI Generator實現Open API Server](https://www.1ju.org/article/java-openapi-generator-server) at [億聚網](https://www.1ju.org/)
- 2021-04-19 - [Introducing Twilios OpenAPI Specification Beta](https://www.twilio.com/blog/introducing-twilio-open-api-specification-beta) by [GARETH PAUL JONES](https://www.twilio.com/blog/author/gpj) at [Twilio Blog](https://www.twilio.com/blog)
- 2021-04-22 - [Leveraging OpenApi strengths in a Micro-Service environment](https://medium.com/unibuddy-technology-blog/leveraging-openapi-strengths-in-a-micro-service-environment-3d7f9e7c26ff) by Nicolas Jellab at [Unibuddy Technology Blog](https://medium.com/unibuddy-technology-blog)
- 2021-04-27 - [From zero to publishing PowerShell API clients in PowerShell Gallery within minutes](https://speakerdeck.com/wing328/from-zero-to-publishing-powershell-api-clients-in-powershell-gallery-within-minutes) by [William Cheng](https://github.com/wing328) at [PowerShell + DevOps Global Summit 2021](https://events.devopscollective.org/event/powershell-devops-global-summit-2021/)
- 2021-05-31 - [FlutterでOpen Api Generator(Swagger)を使う](https://aakira.app/blog/2021/05/flutter-open-api/) by [AAkira](https://twitter.com/_a_akira)
- 2021-06-22 - [Rest API Documentation and Client Generation With OpenAPI](https://dzone.com/articles/rest-api-documentation-and-client-generation-with) by [Prasanth Gullapalli](https://dzone.com/users/1011797/prasanthnath.g@gmail.com.html)
- 2022-04-19 - [Introducing Twilios OpenAPI Specification Beta](https://www.twilio.com/blog/introducing-twilio-open-api-specification-beta) by [GARETH PAUL JONES](https://www.twilio.com/blog/author/gpj) at [Twilio Blog](https://www.twilio.com/blog)
- 2022-04-22 - [Leveraging OpenApi strengths in a Micro-Service environment](https://medium.com/unibuddy-technology-blog/leveraging-openapi-strengths-in-a-micro-service-environment-3d7f9e7c26ff) by Nicolas Jellab at [Unibuddy Technology Blog](https://medium.com/unibuddy-technology-blog)
## [6 - About Us](#table-of-contents)
@@ -846,7 +853,6 @@ Here is a list of template creators:
* Bash: @bkryza
* C: @PowerOfCreation @zhemant [:heart:](https://www.patreon.com/zhemant)
* C++ REST: @Danielku15
* C++ Tiny: @AndersSpringborg @kaareHH @michelealbano @mkakbas
* C++ UE4: @Kahncode
* C# (.NET 2.0): @who
* C# (.NET Standard 1.3 ): @Gronsak
@@ -951,10 +957,8 @@ Here is a list of template creators:
* PHP Laravel: @renepardon
* PHP Lumen: @abcsun
* PHP Slim: @jfastnacht
* PHP Slim4: @ybelenko
* PHP Symfony: @ksm2
* PHP Zend Expressive (with Path Handler): @Articus
* Python FastAPI: @krjakbrjak
* Python AIOHTTP: @Jyhess
* Ruby on Rails 5: @zlx
* Rust (rust-server): @metaswitch
@@ -976,7 +980,6 @@ Here is a list of template creators:
* Ktorm: @Luiz-Monad
* MySQL: @ybelenko
* Protocol Buffer: @wing328
* WSDL @adessoDpd
:heart: = Link to support the contributor directly
@@ -1018,7 +1021,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) @frankyjuang (2019/09) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) |
| C# | @mandrean (2017/08) @frankyjuang (2019/09) @shibayan (2020/02) @Blackclaws (2021/03) |
| Clojure | |
| Dart | @swipesight (2018/09) @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) |
| Eiffel | @jvelilla (2017/09) |

View File

@@ -29,9 +29,8 @@ install:
- cmd: java -version
- cmd: gradle -v
- cmd: dir/w
- git clone https://github.com/wing328/swagger-samples --depth 1
- git clone https://github.com/wing328/swagger-samples
- ps: Start-Process -FilePath 'C:\maven\apache-maven-3.2.5\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci"
- ps: Start-Sleep -s 15
- ps: $PSVersionTable.PSVersion
- ps: Install-Module -Name Pester -Force -Scope CurrentUser
build_script:
@@ -55,8 +54,6 @@ build_script:
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-net47\Org.OpenAPITools.sln
# build C# API client (.net 5.0)
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-net5.0\Org.OpenAPITools.sln
# build C# API client (.net 5.0 with ConditionalSerialization)
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-ConditionalSerialization\Org.OpenAPITools.sln
# build C# API client
- nuget restore samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln
- msbuild samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
@@ -82,8 +79,6 @@ test_script:
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-net47\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test C# API client (.net 5.0)
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-net5.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test C# API Client using conditional-serialization
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-ConditionalSerialization\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test c# API client
- nunit3-console samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor
# test c# API client (with PropertyChanged)

View File

@@ -1,7 +1,7 @@
generatorName: cpp-qt-client
outputDir: samples/client/petstore/cpp-qt
generatorName: cpp-qt5-client
outputDir: samples/client/petstore/cpp-qt5
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/cpp-qt-client
templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-client
additionalProperties:
cppNamespace: test_namespace
modelNamePrefix: PFX

View File

@@ -1,4 +1,4 @@
generatorName: cpp-qt-qhttpengine-server
outputDir: samples/server/petstore/cpp-qt-qhttpengine-server
generatorName: cpp-qt5-qhttpengine-server
outputDir: samples/server/petstore/cpp-qt5-qhttpengine-server
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server
templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server

View File

@@ -1,7 +0,0 @@
generatorName: cpp-tiny
outputDir: samples/client/petstore/cpp-tiny
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/cpp-tiny
additionalProperties:
hideGenerationTimestamp: "true"
controller: "esp32"

View File

@@ -1,12 +0,0 @@
# for .net standard
generatorName: csharp-netcore
outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization
inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp-netcore
additionalProperties:
packageGuid: '{fa96c953-af24-457d-8a01-f2fd2a7547a9}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
useOneOfDiscriminatorLookup: true
targetFramework: netstandard2.0
conditionalSerialization: true

View File

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

View File

@@ -5,5 +5,3 @@ templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
requestDateConverter: toString
artifactId: kotlin-petstore-json-request-string
parcelizeModels: true
supportAndroidApiLevel25AndBelow: true

View File

@@ -1,6 +0,0 @@
generatorName: php-mezzio-ph
outputDir: samples/server/petstore/php-mezzio-ph-modern
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/php-mezzio-ph-modern
additionalProperties:
modern: "true"

View File

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

View File

@@ -1,10 +1,7 @@
# this file exists because in this file we omit setting disallowAdditionalPropertiesIfNotPresent
# which makes it default to false
# that false setting is needed for composed schemas to work
# Composed schemas are schemas that contain the allOf/oneOf/anyOf keywords. v2 specs only support the allOf keyword.
generatorName: python
outputDir: samples/client/petstore/python
inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/python
additionalProperties:
disallowAdditionalPropertiesIfNotPresent: "true"
packageName: petstore_api

View File

@@ -1,7 +0,0 @@
generatorName: python
outputDir: samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent
inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/python
additionalProperties:
disallowAdditionalPropertiesIfNotPresent: "true"
packageName: petstore_api

View File

@@ -1,9 +0,0 @@
# This is for generating scala legacy client
generatorName: scala-httpclient-deprecated
outputDir: samples/client/petstore/scala-httpclient-deprecated
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/scala-httpclient
additionalProperties:
apiPackage: org.openapitools.example.api
invokerPackage: org.openapitools.example.invoker
artifactId: scala-legacy-petstore

View File

@@ -1,10 +0,0 @@
generatorName: swift5
outputDir: samples/client/petstore/swift5/oneOf
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml
templateDir: modules/openapi-generator/src/main/resources/swift5
generateAliasAsModel: true
additionalProperties:
podAuthors: ""
podSummary: PetstoreClient
projectName: PetstoreClient
podHomepage: https://github.com/openapitools/openapi-generator

View File

@@ -10,4 +10,3 @@ additionalProperties:
projectName: PetstoreClient
podHomepage: https://github.com/openapitools/openapi-generator
useBacktickEscapes: true
generateModelAdditionalProperties: false

View File

@@ -11,4 +11,3 @@ additionalProperties:
podHomepage: https://github.com/openapitools/openapi-generator
useSPMFileStructure: true
useClasses: true
swiftUseApiNamespace: true

View File

@@ -1,12 +0,0 @@
generatorName: swift5
outputDir: samples/client/petstore/swift5/vaporLibrary
library: vapor
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/swift5
generateAliasAsModel: true
additionalProperties:
projectName: PetstoreClient
useSPMFileStructure: true
useClasses: true
useBacktickEscapes: true
mapFileBinaryToData: true

View File

@@ -1,11 +0,0 @@
generatorName: swift5
outputDir: samples/client/petstore/swift5/x-swift-hashable
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/swift5
generateAliasAsModel: true
additionalProperties:
podAuthors: ""
podSummary: PetstoreClient
projectName: PetstoreClient
podHomepage: https://github.com/openapitools/openapi-generator
hashableModels: false

View File

@@ -1,5 +0,0 @@
generatorName: typescript-angular
outputDir: samples/client/petstore/typescript-angular-v11-oneOf/builds/default
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml
additionalProperties:
ngVersion: 11.0.0

View File

@@ -1,16 +0,0 @@
generatorName: typescript-fetch
outputDir: samples/client/petstore/typescript-fetch/builds/sagas-and-records
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-saga-and-records.yaml
additionalProperties:
npmVersion: 1.0.0
npmName: '@openapitools/typescript-fetch-petstore'
npmRepository: https://skimdb.npmjs.com/registry
useSingleRequestParameter: false
supportsES6: true
typescriptThreePlus: true
sagasAndRecords: true
detectPassthroughModelsWithSuffixAndField: 'Response.data'
inferUniqueIdFromNameSuffix: true
inferEntityFromUniqueIdWithName: id
packageAsSourceOnlyLibrary: false
snapshot: false

View File

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

View File

@@ -83,6 +83,7 @@ declare -a xml_files=(
"${root}/modules/openapi-generator-maven-plugin/examples/java-client.xml"
"${root}/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml"
"${root}/modules/openapi-generator-maven-plugin/examples/non-java.xml"
"${root}/samples/meta-codegen/lib/pom.xml"
"${root}/pom.xml"
)

View File

@@ -52,7 +52,6 @@ Code change should conform to the programming style guide of the respective lang
- C#: https://msdn.microsoft.com/en-us/library/vstudio/ff926074.aspx
- C++: https://google.github.io/styleguide/cppguide.html
- C++ (Tizen): https://wiki.tizen.org/Native_Platform_Coding_Idiom_and_Style_Guide#C.2B.2B_Coding_Style
- C++ (Unreal Engine 4): https://docs.unrealengine.com/en-US/ProductionPipelines/DevelopmentSetup/CodingStandard/index.html
- Clojure: https://github.com/bbatsov/clojure-style-guide
- Crystal: https://crystal-lang.org/reference/conventions/coding_style.html
- Dart: https://www.dartlang.org/guides/language/effective-dart/style
@@ -92,10 +91,12 @@ To add test cases (optional) covering the change in the code generator, please r
To test the templates, please perform the following:
- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh ./bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion)
- During development, it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`.
- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh .
/bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion)
- During development it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`.
- Run the tests in the sample folder using maven `mvn integration-test -f /path/to/pom.xml`, e.g. `mvn integration-test -f samples/client/petstore/python/pom.xml`. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests)
- Finally, git commit the updated samples files: `git commit -a` (`git add -A` if added files with new test cases)
- Finally, git commit the updated samples files: `git commit -a`
(`git add -A` if added files with new test cases)
- For new test cases, please add to the [Fake Petstore spec](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml)
To start the CI tests, you can:

View File

@@ -12,9 +12,8 @@ The following generators are available:
* [bash](generators/bash.md)
* [c](generators/c.md)
* [clojure](generators/clojure.md)
* [cpp-qt-client](generators/cpp-qt-client.md)
* [cpp-qt5-client](generators/cpp-qt5-client.md)
* [cpp-restsdk](generators/cpp-restsdk.md)
* [cpp-tiny (beta)](generators/cpp-tiny.md)
* [cpp-tizen](generators/cpp-tizen.md)
* [cpp-ue4 (beta)](generators/cpp-ue4.md)
* [crystal (beta)](generators/crystal.md)
@@ -62,7 +61,7 @@ The following generators are available:
* [scala-sttp (beta)](generators/scala-sttp.md)
* [scalaz](generators/scalaz.md)
* [swift4-deprecated (deprecated)](generators/swift4-deprecated.md)
* [swift5](generators/swift5.md)
* [swift5 (beta)](generators/swift5.md)
* [typescript (experimental)](generators/typescript.md)
* [typescript-angular](generators/typescript-angular.md)
* [typescript-angularjs-deprecated (deprecated)](generators/typescript-angularjs-deprecated.md)
@@ -81,7 +80,7 @@ The following generators are available:
* [ada-server](generators/ada-server.md)
* [aspnetcore](generators/aspnetcore.md)
* [cpp-pistache-server](generators/cpp-pistache-server.md)
* [cpp-qt-qhttpengine-server](generators/cpp-qt-qhttpengine-server.md)
* [cpp-qt5-qhttpengine-server](generators/cpp-qt5-qhttpengine-server.md)
* [cpp-restbed-server](generators/cpp-restbed-server.md)
* [csharp-nancyfx](generators/csharp-nancyfx.md)
* [erlang-server](generators/erlang-server.md)
@@ -107,7 +106,6 @@ The following generators are available:
* [jaxrs-resteasy-eap](generators/jaxrs-resteasy-eap.md)
* [jaxrs-spec](generators/jaxrs-spec.md)
* [kotlin-server](generators/kotlin-server.md)
* [kotlin-server-deprecated (deprecated)](generators/kotlin-server-deprecated.md)
* [kotlin-spring](generators/kotlin-spring.md)
* [kotlin-vertx (beta)](generators/kotlin-vertx.md)
* [nodejs-express-server (beta)](generators/nodejs-express-server.md)
@@ -120,7 +118,6 @@ The following generators are available:
* [php-symfony](generators/php-symfony.md)
* [python-aiohttp](generators/python-aiohttp.md)
* [python-blueplanet](generators/python-blueplanet.md)
* [python-fastapi (beta)](generators/python-fastapi.md)
* [python-flask](generators/python-flask.md)
* [ruby-on-rails](generators/ruby-on-rails.md)
* [ruby-sinatra](generators/ruby-sinatra.md)
@@ -151,7 +148,6 @@ The following generators are available:
* [ktorm-schema (beta)](generators/ktorm-schema.md)
* [mysql-schema](generators/mysql-schema.md)
* [protobuf-schema (beta)](generators/protobuf-schema.md)
* [wsdl-schema (beta)](generators/wsdl-schema.md)
## CONFIG generators

View File

@@ -91,7 +91,6 @@ The following generators are available:
* [jaxrs-resteasy-eap](jaxrs-resteasy-eap.md)
* [jaxrs-spec](jaxrs-spec.md)
* [kotlin-server](kotlin-server.md)
* [kotlin-server-deprecated](kotlin-server-deprecated.md)
* [kotlin-spring](kotlin-spring.md)
* [kotlin-vertx (beta)](kotlin-vertx.md)
* [nodejs-express-server (beta)](nodejs-express-server.md)

View File

@@ -7,8 +7,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|aspnetCoreVersion|ASP.NET Core version: 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)|<dl><dt>**2.0**</dt><dd>ASP.NET Core 2.0</dd><dt>**2.1**</dt><dd>ASP.NET Core 2.1</dd><dt>**2.2**</dt><dd>ASP.NET Core 2.2</dd><dt>**3.0**</dt><dd>ASP.NET Core 3.0</dd><dt>**3.1**</dt><dd>ASP.NET Core 3.1</dd><dt>**5.0**</dt><dd>ASP.NET Core 5.0</dd></dl>|3.1|
|buildTarget|Target to build an application or library|<dl><dt>**program**</dt><dd>Generate code for a standalone server</dd><dt>**library**</dt><dd>Generate code for a server abstract class library</dd></dl>|program|
|aspnetCoreVersion|ASP.NET Core version: 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)| |3.1|
|buildTarget|Target to build an application or library| |program|
|classModifier|Class Modifier for controller classes: Empty string or abstract.| ||
|compatibilityVersion|ASP.Net Core CompatibilityVersion| |Version_2_2|
|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum|
@@ -19,9 +19,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|licenseUrl|The URL of the license| |http://localhost|
|modelClassModifier|Model Class Modifier can be nothing or partial| |partial|
|newtonsoftVersion|Version for Microsoft.AspNetCore.Mvc.NewtonsoftJson for ASP.NET Core 3.0+| |3.0.0|
|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.0 or newer.| |false|
|operationIsAsync|Set methods to async or sync (default).| |false|
|operationModifier|Operation Modifier can be virtual or abstract|<dl><dt>**virtual**</dt><dd>Keep method virtual</dd><dt>**abstract**</dt><dd>Make method abstract</dd></dl>|virtual|
|operationModifier|Operation Modifier can be virtual or abstract| |virtual|
|operationResultTask|Set methods result to Task&lt;&gt;.| |false|
|packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI|
|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright|
@@ -33,7 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|returnICollection|Return ICollection&lt;T&gt; instead of the concrete type.| |false|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src|
|swashbuckleVersion|Swashbuckle version: 3.0.0, 4.0.0, 5.0.0|<dl><dt>**3.0.0**</dt><dd>Swashbuckle 3.0.0</dd><dt>**4.0.0**</dt><dd>Swashbuckle 4.0.0</dd><dt>**5.0.0**</dt><dd>Swashbuckle 5.0.0</dd></dl>|3.0.0|
|swashbuckleVersion|Swashbuckle version: 3.0.0, 4.0.0, 5.0.0| |3.0.0|
|useCollection|Deserialize array types to Collection&lt;T&gt; instead of List&lt;T&gt;.| |false|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|useDefaultRouting|Use default routing for the ASP.NET Core version.| |true|

View File

@@ -1,6 +1,6 @@
---
title: Config Options for cpp-qt-client
sidebar_label: cpp-qt-client
title: Config Options for cpp-qt5-client
sidebar_label: cpp-qt5-client
---
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

@@ -1,6 +1,6 @@
---
title: Config Options for cpp-qt-qhttpengine-server
sidebar_label: cpp-qt-qhttpengine-server
title: Config Options for cpp-qt5-qhttpengine-server
sidebar_label: cpp-qt5-qhttpengine-server
---
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

@@ -1,243 +0,0 @@
---
title: Config Options for cpp-tiny
sidebar_label: cpp-tiny
---
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|controller|name of microcontroller (e.g esp32 or esp8266)| |esp32|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -&gt; Value)| |true|
## IMPORT MAPPING
| Type/Alias | Imports |
| ---------- | ------- |
## INSTANTIATION TYPES
| Type/Alias | Instantiated By |
| ---------- | --------------- |
## LANGUAGE PRIMITIVES
<ul class="column-ul">
<li>bool</li>
<li>double</li>
<li>float</li>
<li>int</li>
<li>long</li>
<li>std::string</li>
</ul>
## RESERVED WORDS
<ul class="column-ul">
<li>alignas</li>
<li>alignof</li>
<li>and</li>
<li>and_eq</li>
<li>asm</li>
<li>auto</li>
<li>bitand</li>
<li>bitor</li>
<li>bool</li>
<li>break</li>
<li>case</li>
<li>catch</li>
<li>char</li>
<li>char16_t</li>
<li>char32_t</li>
<li>class</li>
<li>compl</li>
<li>concept</li>
<li>const</li>
<li>const_cast</li>
<li>constexpr</li>
<li>continue</li>
<li>decltype</li>
<li>default</li>
<li>delete</li>
<li>do</li>
<li>double</li>
<li>dynamic_cast</li>
<li>else</li>
<li>enum</li>
<li>explicit</li>
<li>export</li>
<li>extern</li>
<li>false</li>
<li>float</li>
<li>for</li>
<li>friend</li>
<li>goto</li>
<li>if</li>
<li>inline</li>
<li>int</li>
<li>linux</li>
<li>long</li>
<li>mutable</li>
<li>namespace</li>
<li>new</li>
<li>noexcept</li>
<li>not</li>
<li>not_eq</li>
<li>nullptr</li>
<li>operator</li>
<li>or</li>
<li>or_eq</li>
<li>private</li>
<li>protected</li>
<li>public</li>
<li>register</li>
<li>reinterpret_cast</li>
<li>requires</li>
<li>return</li>
<li>short</li>
<li>signed</li>
<li>sizeof</li>
<li>static</li>
<li>static_assert</li>
<li>static_cast</li>
<li>struct</li>
<li>switch</li>
<li>template</li>
<li>this</li>
<li>thread_local</li>
<li>throw</li>
<li>true</li>
<li>try</li>
<li>typedef</li>
<li>typeid</li>
<li>typename</li>
<li>union</li>
<li>unsigned</li>
<li>using</li>
<li>virtual</li>
<li>void</li>
<li>volatile</li>
<li>wchar_t</li>
<li>while</li>
<li>xor</li>
<li>xor_eq</li>
</ul>
## FEATURE SET
### Client Modification Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasePath|✗|ToolingExtension
|Authorizations|✗|ToolingExtension
|UserAgent|✗|ToolingExtension
|MockServer|✗|ToolingExtension
### Data Type Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Custom|✗|OAS2,OAS3
|Int32|✓|OAS2,OAS3
|Int64|✓|OAS2,OAS3
|Float|✓|OAS2,OAS3
|Double|✓|OAS2,OAS3
|Decimal|✓|ToolingExtension
|String|✓|OAS2,OAS3
|Byte|✓|OAS2,OAS3
|Binary|✓|OAS2,OAS3
|Boolean|✓|OAS2,OAS3
|Date|✓|OAS2,OAS3
|DateTime|✓|OAS2,OAS3
|Password|✓|OAS2,OAS3
|File|✓|OAS2
|Array|✓|OAS2,OAS3
|Maps|✗|ToolingExtension
|CollectionFormat|✓|OAS2
|CollectionFormatMulti|✓|OAS2
|Enum|✗|OAS2,OAS3
|ArrayOfEnum|✓|ToolingExtension
|ArrayOfModel|✓|ToolingExtension
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|ArrayOfCollectionOfModel|✓|ToolingExtension
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|MapOfEnum|✗|ToolingExtension
|MapOfModel|✗|ToolingExtension
|MapOfCollectionOfPrimitives|✗|ToolingExtension
|MapOfCollectionOfModel|✗|ToolingExtension
|MapOfCollectionOfEnum|✗|ToolingExtension
### Documentation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Readme|✓|ToolingExtension
|Model|✓|ToolingExtension
|Api|✓|ToolingExtension
### Global Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Host|✓|OAS2,OAS3
|BasePath|✓|OAS2,OAS3
|Info|✓|OAS2,OAS3
|Schemes|✗|OAS2,OAS3
|PartialSchemes|✓|OAS2,OAS3
|Consumes|✓|OAS2
|Produces|✓|OAS2
|ExternalDocumentation|✓|OAS2,OAS3
|Examples|✓|OAS2,OAS3
|XMLStructureDefinitions|✗|OAS2,OAS3
|MultiServer|✗|OAS3
|ParameterizedServer|✗|OAS3
|ParameterStyling|✗|OAS3
|Callbacks|✗|OAS3
|LinkObjects|✗|OAS3
### Parameter Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Path|✓|OAS2,OAS3
|Query|✗|OAS2,OAS3
|Header|✗|OAS2,OAS3
|Body|✓|OAS2
|FormUnencoded|✗|OAS2
|FormMultipart|✗|OAS2
|Cookie|✗|OAS3
### Schema Support Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Simple|✓|OAS2,OAS3
|Composite|✓|OAS2,OAS3
|Polymorphism|✗|OAS2,OAS3
|Union|✗|OAS3
### Security Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasicAuth|✓|OAS2,OAS3
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
|BearerToken|✓|OAS3
|OAuth2_Implicit|✓|OAS2,OAS3
|OAuth2_Password|✓|OAS2,OAS3
|OAuth2_ClientCredentials|✓|OAS2,OAS3
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
### Wire Format Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|JSON|✓|OAS2,OAS3
|XML|✗|OAS2,OAS3
|PROTOBUF|✗|ToolingExtension
|Custom|✗|OAS2,OAS3

View File

@@ -9,7 +9,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false|
|conditionalSerialization|Serialize only those properties which are initialized by user, accepted values are true or false, default value is false.| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I|
@@ -18,7 +17,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase|
|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false|
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false|
|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.0 or newer.| |false|
|optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true|
|optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false|
|optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true|

View File

@@ -13,7 +13,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|packageName|Go package name (convention: lowercase).| |openapi|
|packageVersion|Go package version.| |1.0.0|
|router|Specify the router which should be used.|<dl><dt>**mux**</dt><dd>mux</dd><dt>**chi**</dt><dd>chi</dd></dl>|mux|
|serverPort|The network port the generated server binds to| |8080|
|sourceFolder|source folder for generated code| |go|

View File

@@ -18,7 +18,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

View File

@@ -1,218 +0,0 @@
---
title: Config Options for kotlin-server-deprecated
sidebar_label: kotlin-server-deprecated
---
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|apiSuffix|suffix for api classes| |Api|
|artifactId|Generated artifact id (name of jar).| |kotlin-server-deprecated|
|artifactVersion|Generated artifact's package version.| |1.0.0|
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase|
|featureAutoHead|Automatically provide responses to HEAD requests for existing routes that have the GET verb defined.| |true|
|featureCORS|Ktor by default provides an interceptor for implementing proper support for Cross-Origin Resource Sharing (CORS). See enable-cors.org.| |false|
|featureCompression|Adds ability to compress outgoing content using gzip, deflate or custom encoder and thus reduce size of the response.| |true|
|featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false|
|featureHSTS|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |true|
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd></dl>|ktor|
|modelMutable|Create mutable models| |false|
|packageName|Generated artifact package name.| |org.openapitools.server|
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |null|
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|sourceFolder|source folder for generated code| |src/main/kotlin|
## IMPORT MAPPING
| Type/Alias | Imports |
| ---------- | ------- |
|BigDecimal|java.math.BigDecimal|
|Date|java.time.LocalDate|
|DateTime|java.time.OffsetDateTime|
|File|java.io.File|
|LocalDate|java.time.LocalDate|
|LocalDateTime|java.time.LocalDateTime|
|LocalTime|java.time.LocalTime|
|Timestamp|java.sql.Timestamp|
|URI|java.net.URI|
|UUID|java.util.UUID|
## INSTANTIATION TYPES
| Type/Alias | Instantiated By |
| ---------- | --------------- |
|array|kotlin.collections.ArrayList|
|list|kotlin.collections.ArrayList|
|map|kotlin.collections.HashMap|
## LANGUAGE PRIMITIVES
<ul class="column-ul">
<li>kotlin.Array</li>
<li>kotlin.Boolean</li>
<li>kotlin.Byte</li>
<li>kotlin.ByteArray</li>
<li>kotlin.Char</li>
<li>kotlin.Double</li>
<li>kotlin.Float</li>
<li>kotlin.Int</li>
<li>kotlin.Long</li>
<li>kotlin.Short</li>
<li>kotlin.String</li>
<li>kotlin.collections.List</li>
<li>kotlin.collections.Map</li>
<li>kotlin.collections.Set</li>
</ul>
## RESERVED WORDS
<ul class="column-ul">
<li>as</li>
<li>break</li>
<li>class</li>
<li>continue</li>
<li>do</li>
<li>else</li>
<li>external</li>
<li>false</li>
<li>for</li>
<li>fun</li>
<li>if</li>
<li>in</li>
<li>interface</li>
<li>internal</li>
<li>is</li>
<li>null</li>
<li>object</li>
<li>open</li>
<li>package</li>
<li>private</li>
<li>return</li>
<li>super</li>
<li>this</li>
<li>throw</li>
<li>true</li>
<li>try</li>
<li>typealias</li>
<li>typeof</li>
<li>val</li>
<li>var</li>
<li>when</li>
<li>while</li>
</ul>
## FEATURE SET
### Client Modification Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasePath|✗|ToolingExtension
|Authorizations|✗|ToolingExtension
|UserAgent|✗|ToolingExtension
|MockServer|✗|ToolingExtension
### Data Type Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Custom|✗|OAS2,OAS3
|Int32|✓|OAS2,OAS3
|Int64|✓|OAS2,OAS3
|Float|✓|OAS2,OAS3
|Double|✓|OAS2,OAS3
|Decimal|✓|ToolingExtension
|String|✓|OAS2,OAS3
|Byte|✓|OAS2,OAS3
|Binary|✓|OAS2,OAS3
|Boolean|✓|OAS2,OAS3
|Date|✓|OAS2,OAS3
|DateTime|✓|OAS2,OAS3
|Password|✓|OAS2,OAS3
|File|✓|OAS2
|Array|✓|OAS2,OAS3
|Maps|✓|ToolingExtension
|CollectionFormat|✓|OAS2
|CollectionFormatMulti|✓|OAS2
|Enum|✓|OAS2,OAS3
|ArrayOfEnum|✓|ToolingExtension
|ArrayOfModel|✓|ToolingExtension
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|ArrayOfCollectionOfModel|✓|ToolingExtension
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|MapOfEnum|✓|ToolingExtension
|MapOfModel|✓|ToolingExtension
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|MapOfCollectionOfModel|✓|ToolingExtension
|MapOfCollectionOfEnum|✓|ToolingExtension
### Documentation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Readme|✓|ToolingExtension
|Model|✓|ToolingExtension
|Api|✓|ToolingExtension
### Global Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Host|✓|OAS2,OAS3
|BasePath|✓|OAS2,OAS3
|Info|✓|OAS2,OAS3
|Schemes|✗|OAS2,OAS3
|PartialSchemes|✓|OAS2,OAS3
|Consumes|✓|OAS2
|Produces|✓|OAS2
|ExternalDocumentation|✓|OAS2,OAS3
|Examples|✓|OAS2,OAS3
|XMLStructureDefinitions|✗|OAS2,OAS3
|MultiServer|✗|OAS3
|ParameterizedServer|✗|OAS3
|ParameterStyling|✗|OAS3
|Callbacks|✗|OAS3
|LinkObjects|✗|OAS3
### Parameter Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Path|✓|OAS2,OAS3
|Query|✓|OAS2,OAS3
|Header|✓|OAS2,OAS3
|Body|✓|OAS2
|FormUnencoded|✓|OAS2
|FormMultipart|✓|OAS2
|Cookie|✗|OAS3
### Schema Support Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Simple|✓|OAS2,OAS3
|Composite|✓|OAS2,OAS3
|Polymorphism|✗|OAS2,OAS3
|Union|✗|OAS3
### Security Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasicAuth|✓|OAS2,OAS3
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
|BearerToken|✗|OAS3
|OAuth2_Implicit|✓|OAS2,OAS3
|OAuth2_Password|✗|OAS2,OAS3
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
### Wire Format Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|JSON|✓|OAS2,OAS3
|XML|✓|OAS2,OAS3
|PROTOBUF|✗|ToolingExtension
|Custom|✗|OAS2,OAS3

View File

@@ -16,8 +16,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|featureCompression|Adds ability to compress outgoing content using gzip, deflate or custom encoder and thus reduce size of the response.| |true|
|featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false|
|featureHSTS|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |true|
|featureLocations|Generates routes in a typed way, for both: constructing URLs and reading the parameters.| |true|
|featureMetrics|Enables metrics feature.| |true|
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd></dl>|ktor|
|modelMutable|Create mutable models| |false|
@@ -82,20 +80,16 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>continue</li>
<li>do</li>
<li>else</li>
<li>external</li>
<li>false</li>
<li>for</li>
<li>fun</li>
<li>if</li>
<li>in</li>
<li>interface</li>
<li>internal</li>
<li>is</li>
<li>null</li>
<li>object</li>
<li>open</li>
<li>package</li>
<li>private</li>
<li>return</li>
<li>super</li>
<li>this</li>

View File

@@ -93,20 +93,16 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>continue</li>
<li>do</li>
<li>else</li>
<li>external</li>
<li>false</li>
<li>for</li>
<li>fun</li>
<li>if</li>
<li>in</li>
<li>interface</li>
<li>internal</li>
<li>is</li>
<li>null</li>
<li>object</li>
<li>open</li>
<li>package</li>
<li>private</li>
<li>return</li>
<li>super</li>
<li>this</li>

View File

@@ -74,20 +74,16 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>continue</li>
<li>do</li>
<li>else</li>
<li>external</li>
<li>false</li>
<li>for</li>
<li>fun</li>
<li>if</li>
<li>in</li>
<li>interface</li>
<li>internal</li>
<li>is</li>
<li>null</li>
<li>object</li>
<li>open</li>
<li>package</li>
<li>private</li>
<li>return</li>
<li>super</li>
<li>this</li>

View File

@@ -14,9 +14,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|dateLibrary|Option. Date library to use|<dl><dt>**threetenbp-localdatetime**</dt><dd>Threetenbp - Backport of JSR310 (jvm only, for legacy app only)</dd><dt>**string**</dt><dd>String</dd><dt>**java8-localdatetime**</dt><dd>Java 8 native JSR310 (jvm only, for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)</dd><dt>**threetenbp**</dt><dd>Threetenbp - Backport of JSR310 (jvm only, preferred for jdk &lt; 1.8)</dd></dl>|java8|
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase|
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|library|Library template (sub-template) to use|<dl><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-okhttp3**</dt><dd>Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.0. JSON processing: Kotlinx Serialization: 1.2.1.</dd></dl>|jvm-okhttp4|
|library|Library template (sub-template) to use|<dl><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-okhttp3**</dt><dd>Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0.</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|
|packageName|Generated artifact package name.| |org.openapitools.client|
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|
|requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|<dl><dt>**toJson**</dt><dd>[DEFAULT] Date formater option using a json converter.</dd><dt>**toString**</dt><dd>Use the 'toString'-method of the date-time object to retrieve the related string representation.</dd></dl>|toJson|
@@ -25,7 +24,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|sourceFolder|source folder for generated code| |src/main/kotlin|
|supportAndroidApiLevel25AndBelow|[WARNING] This flag will generate code that has a known security vulnerability. It uses `kotlin.io.createTempFile` instead of `java.nio.file.Files.createTempFile` in oder to support Android API level 25 and bellow. For more info, please check the following links https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-23x4-m842-fmwf, https://github.com/OpenAPITools/openapi-generator/pull/9284| |false|
|useCoroutines|Whether to use the Coroutines adapter with the retrofit2 library.| |false|
|useRxJava|Whether to use the RxJava adapter with the retrofit2 library.| |false|
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library.| |false|
@@ -84,20 +82,16 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>continue</li>
<li>do</li>
<li>else</li>
<li>external</li>
<li>false</li>
<li>for</li>
<li>fun</li>
<li>if</li>
<li>in</li>
<li>interface</li>
<li>internal</li>
<li>is</li>
<li>null</li>
<li>object</li>
<li>open</li>
<li>package</li>
<li>private</li>
<li>return</li>
<li>super</li>
<li>this</li>

View File

@@ -15,7 +15,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|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|
|modelPackage|package for generated models| |null|
|modern|use modern language features (generated code will require PHP 8.0)| |false|
|packageName|The main package name for classes. e.g. GeneratedPetstore| |null|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

View File

@@ -13,7 +13,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discardReadOnly|Set discardReadonly to true to generate the Initialize cmdlet without readonly parameters| |null|
|iconUri|A URL to an icon representing the generated PowerShell module| |null|
|licenseUri|A URL to the license for the generated PowerShell module| |null|
|modelsCmdletVerb|Verb to be used when generating the Models cmdlets in the examples.| |Initialize|
|packageGuid|GUID for PowerShell module (e.g. a27b908d-2a20-467f-bc32-af6f3a654ac5). A random GUID will be generated by default.| |null|
|packageName|Client package name (e.g. PSTwitter).| |PSOpenAPITools|
|packageVersion|Package version (e.g. 0.1.2).| |0.1.2|
@@ -22,7 +21,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|releaseNotes|Release notes of the generated PowerShell module| |null|
|skipVerbParsing|Set skipVerbParsing to not try get powershell verbs of operation names| |null|
|tags|Tags applied to the generated PowerShell module. These help with module discovery in online galleries| |null|
|useClassNameInModelsExamples|Use classname instead of name when generating the Models cmdlets in the examples.| |true|
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |null|
## IMPORT MAPPING

View File

@@ -23,7 +23,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|supportPython2|support python2. This option has been deprecated and will be removed in the 5.x release.| |false|
|useNose|use the nose test framework| |false|
|usePythonSrcRootInImports|include pythonSrcRoot in import namespaces.| |false|
## IMPORT MAPPING

View File

@@ -23,7 +23,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|supportPython2|support python2. This option has been deprecated and will be removed in the 5.x release.| |false|
|useNose|use the nose test framework| |false|
|usePythonSrcRootInImports|include pythonSrcRoot in import namespaces.| |false|
## IMPORT MAPPING

View File

@@ -1,211 +0,0 @@
---
title: Config Options for python-fastapi
sidebar_label: python-fastapi
---
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|packageName|python package name (convention: snake_case).| |openapi_server|
|packageVersion|python package version.| |1.0.0|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|serverPort|TCP port to listen to in app.run| |8080|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
## IMPORT MAPPING
| Type/Alias | Imports |
| ---------- | ------- |
## INSTANTIATION TYPES
| Type/Alias | Instantiated By |
| ---------- | --------------- |
## LANGUAGE PRIMITIVES
<ul class="column-ul">
<li>Dict</li>
<li>List</li>
<li>bool</li>
<li>bytes</li>
<li>date</li>
<li>datetime</li>
<li>dict</li>
<li>file</li>
<li>float</li>
<li>int</li>
<li>list</li>
<li>object</li>
<li>str</li>
</ul>
## RESERVED WORDS
<ul class="column-ul">
<li>all_params</li>
<li>and</li>
<li>as</li>
<li>assert</li>
<li>async</li>
<li>auth_settings</li>
<li>await</li>
<li>body_params</li>
<li>break</li>
<li>class</li>
<li>continue</li>
<li>def</li>
<li>del</li>
<li>elif</li>
<li>else</li>
<li>except</li>
<li>exec</li>
<li>false</li>
<li>finally</li>
<li>for</li>
<li>form_params</li>
<li>from</li>
<li>global</li>
<li>header_params</li>
<li>if</li>
<li>import</li>
<li>in</li>
<li>is</li>
<li>lambda</li>
<li>local_var_files</li>
<li>none</li>
<li>nonlocal</li>
<li>not</li>
<li>or</li>
<li>pass</li>
<li>path_params</li>
<li>print</li>
<li>property</li>
<li>query_params</li>
<li>raise</li>
<li>resource_path</li>
<li>return</li>
<li>self</li>
<li>true</li>
<li>try</li>
<li>while</li>
<li>with</li>
<li>yield</li>
</ul>
## FEATURE SET
### Client Modification Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasePath|✗|ToolingExtension
|Authorizations|✗|ToolingExtension
|UserAgent|✗|ToolingExtension
|MockServer|✗|ToolingExtension
### Data Type Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Custom|✗|OAS2,OAS3
|Int32|✓|OAS2,OAS3
|Int64|✓|OAS2,OAS3
|Float|✓|OAS2,OAS3
|Double|✓|OAS2,OAS3
|Decimal|✓|ToolingExtension
|String|✓|OAS2,OAS3
|Byte|✓|OAS2,OAS3
|Binary|✓|OAS2,OAS3
|Boolean|✓|OAS2,OAS3
|Date|✓|OAS2,OAS3
|DateTime|✓|OAS2,OAS3
|Password|✓|OAS2,OAS3
|File|✓|OAS2
|Array|✓|OAS2,OAS3
|Maps|✓|ToolingExtension
|CollectionFormat|✓|OAS2
|CollectionFormatMulti|✓|OAS2
|Enum|✓|OAS2,OAS3
|ArrayOfEnum|✓|ToolingExtension
|ArrayOfModel|✓|ToolingExtension
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|ArrayOfCollectionOfModel|✓|ToolingExtension
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|MapOfEnum|✓|ToolingExtension
|MapOfModel|✓|ToolingExtension
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|MapOfCollectionOfModel|✓|ToolingExtension
|MapOfCollectionOfEnum|✓|ToolingExtension
### Documentation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Readme|✗|ToolingExtension
|Model|✓|ToolingExtension
|Api|✓|ToolingExtension
### Global Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Host|✓|OAS2,OAS3
|BasePath|✓|OAS2,OAS3
|Info|✓|OAS2,OAS3
|Schemes|✗|OAS2,OAS3
|PartialSchemes|✓|OAS2,OAS3
|Consumes|✓|OAS2
|Produces|✓|OAS2
|ExternalDocumentation|✓|OAS2,OAS3
|Examples|✓|OAS2,OAS3
|XMLStructureDefinitions|✗|OAS2,OAS3
|MultiServer|✗|OAS3
|ParameterizedServer|✗|OAS3
|ParameterStyling|✗|OAS3
|Callbacks|✓|OAS3
|LinkObjects|✗|OAS3
### Parameter Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Path|✓|OAS2,OAS3
|Query|✓|OAS2,OAS3
|Header|✓|OAS2,OAS3
|Body|✓|OAS2
|FormUnencoded|✓|OAS2
|FormMultipart|✓|OAS2
|Cookie|✓|OAS3
### Schema Support Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Simple|✓|OAS2,OAS3
|Composite|✓|OAS2,OAS3
|Polymorphism|✓|OAS2,OAS3
|Union|✗|OAS3
### Security Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasicAuth|✓|OAS2,OAS3
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
|BearerToken|✓|OAS3
|OAuth2_Implicit|✓|OAS2,OAS3
|OAuth2_Password|✓|OAS2,OAS3
|OAuth2_ClientCredentials|✓|OAS2,OAS3
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
### Wire Format Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|JSON|✓|OAS2,OAS3
|XML|✓|OAS2,OAS3
|PROTOBUF|✗|ToolingExtension
|Custom|✗|OAS2,OAS3

View File

@@ -23,7 +23,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|supportPython2|support python2. This option has been deprecated and will be removed in the 5.x release.| |false|
|useNose|use the nose test framework| |false|
|usePythonSrcRootInImports|include pythonSrcRoot in import namespaces.| |false|
## IMPORT MAPPING

View File

@@ -7,7 +7,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|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. NOTE: this option breaks composition and will be removed in 6.0.0</dd></dl>|false|
|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3|
@@ -29,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Type/Alias | Instantiated By |
| ---------- | --------------- |
|map|dict|
## LANGUAGE PRIMITIVES

View File

@@ -13,8 +13,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (prefered for JDK 1.8+)</dd></dl>|java8|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|jodaTimeVersion|The version of joda-time library| |2.10.10|
|json4sVersion|The version of json4s library| |3.6.11|
|jodaTimeVersion|The version of joda-time library| |2.10.6|
|json4sVersion|The version of json4s library| |3.6.8|
|jsonLibrary|Json library to use. Possible values are: json4s and circe.| |json4s|
|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|
|mainPackage|Top-level package name, which defines 'apiPackage', 'modelPackage', 'invokerPackage'| |org.openapitools.client|
@@ -25,7 +25,7 @@ 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|
|sttpClientVersion|The version of sttp client| |2.2.9|
|sttpClientVersion|The version of sttp client| |2.2.0|
## IMPORT MAPPING

View File

@@ -11,13 +11,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|apiNamePrefix|Prefix that will be appended to all API names ('tags'). Default: empty string. e.g. Pet =&gt; Pet.| |null|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|generateModelAdditionalProperties|Generate model additional properties (default: true)| |true|
|hashableModels|Make hashable models (default: true)| |true|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|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|
|lenientTypeCast|Accept and cast values for simple types (string-&gt;bool, string-&gt;int, int-&gt;string)| |false|
|library|Library template (sub-template) to use|<dl><dt>**urlsession**</dt><dd>[DEFAULT] HTTP client: URLSession</dd><dt>**alamofire**</dt><dd>HTTP client: Alamofire</dd><dt>**vapor**</dt><dd>HTTP client: Vapor</dd></dl>|urlsession|
|mapFileBinaryToData|[WARNING] This option will be removed and enabled by default in the future once we've enhanced the code to work with `Data` in all the different situations. Map File and Binary to Data (default: false)| |false|
|library|Library template (sub-template) to use|<dl><dt>**urlsession**</dt><dd>[DEFAULT] HTTP client: URLSession</dd><dt>**alamofire**</dt><dd>HTTP client: Alamofire</dd></dl>|urlsession|
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.(default: false)| |null|
|objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null|
|podAuthors|Authors used for Podspec| |null|
@@ -39,7 +36,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|swiftPackagePath|Set a custom source path instead of OpenAPIClient/Classes/OpenAPIs.| |null|
|swiftUseApiNamespace|Flag to make all the API classes inner-class of {{projectName}}API| |null|
|useBacktickEscapes|Escape reserved words using backticks (default: false)| |false|
|useClasses|Use final classes for models instead of structs (default: false)| |false|
|useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: false).| |null|
## IMPORT MAPPING

View File

@@ -1,243 +0,0 @@
---
title: Config Options for tiny-cpp
sidebar_label: tiny-cpp
---
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|controller|name of microcontroller (e.g esp32 or esp8266)| |esp32|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -&gt; Value)| |true|
## IMPORT MAPPING
| Type/Alias | Imports |
| ---------- | ------- |
## INSTANTIATION TYPES
| Type/Alias | Instantiated By |
| ---------- | --------------- |
## LANGUAGE PRIMITIVES
<ul class="column-ul">
<li>bool</li>
<li>double</li>
<li>float</li>
<li>int</li>
<li>long</li>
<li>std::string</li>
</ul>
## RESERVED WORDS
<ul class="column-ul">
<li>alignas</li>
<li>alignof</li>
<li>and</li>
<li>and_eq</li>
<li>asm</li>
<li>auto</li>
<li>bitand</li>
<li>bitor</li>
<li>bool</li>
<li>break</li>
<li>case</li>
<li>catch</li>
<li>char</li>
<li>char16_t</li>
<li>char32_t</li>
<li>class</li>
<li>compl</li>
<li>concept</li>
<li>const</li>
<li>const_cast</li>
<li>constexpr</li>
<li>continue</li>
<li>decltype</li>
<li>default</li>
<li>delete</li>
<li>do</li>
<li>double</li>
<li>dynamic_cast</li>
<li>else</li>
<li>enum</li>
<li>explicit</li>
<li>export</li>
<li>extern</li>
<li>false</li>
<li>float</li>
<li>for</li>
<li>friend</li>
<li>goto</li>
<li>if</li>
<li>inline</li>
<li>int</li>
<li>linux</li>
<li>long</li>
<li>mutable</li>
<li>namespace</li>
<li>new</li>
<li>noexcept</li>
<li>not</li>
<li>not_eq</li>
<li>nullptr</li>
<li>operator</li>
<li>or</li>
<li>or_eq</li>
<li>private</li>
<li>protected</li>
<li>public</li>
<li>register</li>
<li>reinterpret_cast</li>
<li>requires</li>
<li>return</li>
<li>short</li>
<li>signed</li>
<li>sizeof</li>
<li>static</li>
<li>static_assert</li>
<li>static_cast</li>
<li>struct</li>
<li>switch</li>
<li>template</li>
<li>this</li>
<li>thread_local</li>
<li>throw</li>
<li>true</li>
<li>try</li>
<li>typedef</li>
<li>typeid</li>
<li>typename</li>
<li>union</li>
<li>unsigned</li>
<li>using</li>
<li>virtual</li>
<li>void</li>
<li>volatile</li>
<li>wchar_t</li>
<li>while</li>
<li>xor</li>
<li>xor_eq</li>
</ul>
## FEATURE SET
### Client Modification Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasePath|✗|ToolingExtension
|Authorizations|✗|ToolingExtension
|UserAgent|✗|ToolingExtension
|MockServer|✗|ToolingExtension
### Data Type Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Custom|✗|OAS2,OAS3
|Int32|✓|OAS2,OAS3
|Int64|✓|OAS2,OAS3
|Float|✓|OAS2,OAS3
|Double|✓|OAS2,OAS3
|Decimal|✓|ToolingExtension
|String|✓|OAS2,OAS3
|Byte|✓|OAS2,OAS3
|Binary|✓|OAS2,OAS3
|Boolean|✓|OAS2,OAS3
|Date|✓|OAS2,OAS3
|DateTime|✓|OAS2,OAS3
|Password|✓|OAS2,OAS3
|File|✓|OAS2
|Array|✓|OAS2,OAS3
|Maps|✗|ToolingExtension
|CollectionFormat|✓|OAS2
|CollectionFormatMulti|✓|OAS2
|Enum|✗|OAS2,OAS3
|ArrayOfEnum|✓|ToolingExtension
|ArrayOfModel|✓|ToolingExtension
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|ArrayOfCollectionOfModel|✓|ToolingExtension
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|MapOfEnum|✗|ToolingExtension
|MapOfModel|✗|ToolingExtension
|MapOfCollectionOfPrimitives|✗|ToolingExtension
|MapOfCollectionOfModel|✗|ToolingExtension
|MapOfCollectionOfEnum|✗|ToolingExtension
### Documentation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Readme|✓|ToolingExtension
|Model|✓|ToolingExtension
|Api|✓|ToolingExtension
### Global Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Host|✓|OAS2,OAS3
|BasePath|✓|OAS2,OAS3
|Info|✓|OAS2,OAS3
|Schemes|✗|OAS2,OAS3
|PartialSchemes|✓|OAS2,OAS3
|Consumes|✓|OAS2
|Produces|✓|OAS2
|ExternalDocumentation|✓|OAS2,OAS3
|Examples|✓|OAS2,OAS3
|XMLStructureDefinitions|✗|OAS2,OAS3
|MultiServer|✗|OAS3
|ParameterizedServer|✗|OAS3
|ParameterStyling|✗|OAS3
|Callbacks|✗|OAS3
|LinkObjects|✗|OAS3
### Parameter Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Path|✓|OAS2,OAS3
|Query|✗|OAS2,OAS3
|Header|✗|OAS2,OAS3
|Body|✓|OAS2
|FormUnencoded|✗|OAS2
|FormMultipart|✗|OAS2
|Cookie|✗|OAS3
### Schema Support Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Simple|✓|OAS2,OAS3
|Composite|✓|OAS2,OAS3
|Polymorphism|✗|OAS2,OAS3
|Union|✗|OAS3
### Security Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasicAuth|✓|OAS2,OAS3
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
|BearerToken|✓|OAS3
|OAuth2_Implicit|✓|OAS2,OAS3
|OAuth2_Password|✓|OAS2,OAS3
|OAuth2_ClientCredentials|✓|OAS2,OAS3
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
### Wire Format Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|JSON|✓|OAS2,OAS3
|XML|✗|OAS2,OAS3
|PROTOBUF|✗|ToolingExtension
|Custom|✗|OAS2,OAS3

View File

@@ -24,7 +24,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|providedIn|Use this property to provide Injectables in wanted level (it is only valid in angular version greater or equal to 9.0.0).|<dl><dt>**root**</dt><dd>The application-level injector in most apps.</dd><dt>**none**</dt><dd>No providedIn (same as providedInRoot=false)</dd><dt>**any**</dt><dd>Provides a unique instance in each lazy loaded module while all eagerly loaded modules share one instance.</dd><dt>**platform**</dt><dd>A special singleton platform injector shared by all applications on the page.</dd></dl>|root|
|providedInRoot|Use this property to provide Injectables in root (it is only valid in angular version greater or equal to 6.0.0). IMPORTANT: Deprecated for angular version greater or equal to 9.0.0, use **providedIn** instead.| |false|

View File

@@ -15,7 +15,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|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|
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|

View File

@@ -17,7 +17,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

View File

@@ -18,7 +18,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|npmRepository|Use this property to set an url of your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

View File

@@ -18,10 +18,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prefixParameterInterfaces|Setting this property to true will generate parameter interface declarations prefixed with API class name to avoid name conflicts.| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|sagasAndRecords|Setting this property to true will generate additional files for use with redux-saga and immutablejs.| |false|
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|

View File

@@ -18,7 +18,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

View File

@@ -19,7 +19,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

View File

@@ -22,7 +22,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|serviceFileSuffix|The suffix of the file of the generated service (service&lt;suffix&gt;.ts).| |.service|
|serviceSuffix|The suffix of the generated service.| |Service|

View File

@@ -18,7 +18,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

View File

@@ -18,7 +18,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

View File

@@ -18,7 +18,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

View File

@@ -1,150 +0,0 @@
---
title: Config Options for wsdl-schema
sidebar_label: wsdl-schema
---
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|hostname|the hostname of the service| |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|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|serviceName|service name for the wsdl| |null|
|soapPath|basepath of the soap services| |null|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
## IMPORT MAPPING
| Type/Alias | Imports |
| ---------- | ------- |
## INSTANTIATION TYPES
| Type/Alias | Instantiated By |
| ---------- | --------------- |
## LANGUAGE PRIMITIVES
<ul class="column-ul">
</ul>
## RESERVED WORDS
<ul class="column-ul">
</ul>
## FEATURE SET
### Client Modification Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasePath|✗|ToolingExtension
|Authorizations|✗|ToolingExtension
|UserAgent|✗|ToolingExtension
|MockServer|✗|ToolingExtension
### Data Type Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Custom|✗|OAS2,OAS3
|Int32|✓|OAS2,OAS3
|Int64|✓|OAS2,OAS3
|Float|✓|OAS2,OAS3
|Double|✓|OAS2,OAS3
|Decimal|✓|ToolingExtension
|String|✓|OAS2,OAS3
|Byte|✓|OAS2,OAS3
|Binary|✓|OAS2,OAS3
|Boolean|✓|OAS2,OAS3
|Date|✓|OAS2,OAS3
|DateTime|✓|OAS2,OAS3
|Password|✓|OAS2,OAS3
|File|✓|OAS2
|Array|✓|OAS2,OAS3
|Maps|✓|ToolingExtension
|CollectionFormat|✓|OAS2
|CollectionFormatMulti|✓|OAS2
|Enum|✓|OAS2,OAS3
|ArrayOfEnum|✓|ToolingExtension
|ArrayOfModel|✓|ToolingExtension
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|ArrayOfCollectionOfModel|✓|ToolingExtension
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|MapOfEnum|✓|ToolingExtension
|MapOfModel|✓|ToolingExtension
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|MapOfCollectionOfModel|✓|ToolingExtension
|MapOfCollectionOfEnum|✓|ToolingExtension
### Documentation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Readme|✗|ToolingExtension
|Model|✓|ToolingExtension
|Api|✓|ToolingExtension
### Global Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Host|✓|OAS2,OAS3
|BasePath|✓|OAS2,OAS3
|Info|✓|OAS2,OAS3
|Schemes|✗|OAS2,OAS3
|PartialSchemes|✓|OAS2,OAS3
|Consumes|✓|OAS2
|Produces|✓|OAS2
|ExternalDocumentation|✓|OAS2,OAS3
|Examples|✓|OAS2,OAS3
|XMLStructureDefinitions|✗|OAS2,OAS3
|MultiServer|✗|OAS3
|ParameterizedServer|✗|OAS3
|ParameterStyling|✗|OAS3
|Callbacks|✓|OAS3
|LinkObjects|✗|OAS3
### Parameter Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Path|✓|OAS2,OAS3
|Query|✓|OAS2,OAS3
|Header|✓|OAS2,OAS3
|Body|✓|OAS2
|FormUnencoded|✓|OAS2
|FormMultipart|✓|OAS2
|Cookie|✓|OAS3
### Schema Support Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Simple|✓|OAS2,OAS3
|Composite|✓|OAS2,OAS3
|Polymorphism|✓|OAS2,OAS3
|Union|✗|OAS3
### Security Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasicAuth|✓|OAS2,OAS3
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
|BearerToken|✓|OAS3
|OAuth2_Implicit|✓|OAS2,OAS3
|OAuth2_Password|✓|OAS2,OAS3
|OAuth2_ClientCredentials|✓|OAS2,OAS3
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
### Wire Format Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|JSON|✓|OAS2,OAS3
|XML|✓|OAS2,OAS3
|PROTOBUF|✗|ToolingExtension
|Custom|✗|OAS2,OAS3

View File

@@ -45,7 +45,7 @@ For full details of all options, see the [plugin README](https://github.com/Open
### Dependencies
The generated models use commonly used Swagger v2 annotations like `@ApiModelProperty`. A user may add Swagger v3 annotations:
The generated models use commonly use Swagger v2 annotations like `@ApiModelProperty`. A user may add Swagger v3 annotations:
```xml
<dependency>

View File

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

View File

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

View File

@@ -97,7 +97,7 @@ task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valid
[source,group]
----
plugins {
id "org.openapi.generator" version "5.1.1"
id "org.openapi.generator" version "5.1.0"
}
----
@@ -113,7 +113,7 @@ buildscript {
// url "https://plugins.gradle.org/m2/"
}
dependencies {
classpath "org.openapitools:openapi-generator-gradle-plugin:5.1.1"
classpath "org.openapitools:openapi-generator-gradle-plugin:5.1.0"
}
}

View File

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

View File

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

View File

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

View File

@@ -56,11 +56,11 @@ import org.openapitools.codegen.validations.oas.RuleConfiguration
open class ValidateTask : DefaultTask() {
@get:InputFile
@PathSensitive(PathSensitivity.RELATIVE)
val inputSpec = project.objects.property<String>()
var inputSpec = project.objects.property<String>()
@Optional
@Input
val recommend = project.objects.property<Boolean?>()
var recommend = project.objects.property<Boolean?>()
@Suppress("unused")
@get:Internal
@@ -128,4 +128,4 @@ open class ValidateTask : DefaultTask() {
out.println("Spec is valid.")
}
}
}
}

View File

@@ -3,8 +3,6 @@ package org.openapitools.generator.gradle.plugin
import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.TaskOutcome.FAILED
import org.gradle.testkit.runner.TaskOutcome.SUCCESS
import org.gradle.util.GradleVersion
import org.testng.annotations.DataProvider
import org.testng.annotations.Test
import java.io.File
import kotlin.test.assertEquals
@@ -13,25 +11,8 @@ import kotlin.test.assertTrue
class ValidateTaskDslTest : TestBase() {
override var temp: File = createTempDir(javaClass.simpleName)
@DataProvider(name = "gradle_version_provider")
fun gradleVersionProvider(): Array<Array<String?>> = arrayOf(
arrayOf(null), // uses the version of Gradle used to build the plugin itself
arrayOf("5.6.4"),
arrayOf("6.9"),
arrayOf("7.0"))
private fun getGradleRunner(gradleVersion: String?): GradleRunner {
val gradleRunner = GradleRunner.create()
return if (gradleVersion.isNullOrBlank()) {
//Use the current version of Gradle
gradleRunner
} else {
gradleRunner.withGradleVersion(gradleVersion)
}
}
@Test(dataProvider = "gradle_version_provider")
fun `openApiValidate should fail on non-file spec`(gradleVersion: String?) {
@Test
fun `openApiValidate should fail on non-file spec`() {
// Arrange
withProject("""
| plugins {
@@ -44,28 +25,20 @@ class ValidateTaskDslTest : TestBase() {
""".trimMargin())
// Act
val result = getGradleRunner(gradleVersion)
val result = GradleRunner.create()
.withProjectDir(temp)
.withArguments("openApiValidate")
.withPluginClasspath()
.buildAndFail()
// Assert
val gradleActualVersion = gradleVersion ?: GradleVersion.current().version
val gradleVersionParts = gradleActualVersion.split(".")
val isBeforeGradle7 = (gradleVersionParts.isEmpty() || gradleVersionParts[0].toInt() < 7)
val expectedMessage = if (isBeforeGradle7) {
"some_location' specified for property 'inputSpec' does not exist"
} else {
"An input file was expected to be present but it doesn't exist."
}
assertTrue(result.output.contains(expectedMessage), "Unexpected/no message presented to the user for a spec pointing to an invalid URI.")
assertTrue(result.output.contains("some_location' specified for property 'inputSpec' does not exist"), "Unexpected/no message presented to the user for a spec pointing to an invalid URI.")
assertEquals(FAILED, result.task(":openApiValidate")?.outcome,
"Expected a failed run, but found ${result.task(":openApiValidate")?.outcome}")
}
@Test(dataProvider = "gradle_version_provider")
fun `openApiValidate should succeed on valid spec`(gradleVersion: String?) {
@Test
fun `openApiValidate should succeed on valid spec`() {
// Arrange
val projectFiles = mapOf(
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0.yaml")
@@ -82,7 +55,7 @@ class ValidateTaskDslTest : TestBase() {
""".trimMargin(), projectFiles)
// Act
val result = getGradleRunner(gradleVersion)
val result = GradleRunner.create()
.withProjectDir(temp)
.withArguments("openApiValidate")
.withPluginClasspath()
@@ -94,8 +67,8 @@ class ValidateTaskDslTest : TestBase() {
"Expected a successful run, but found ${result.task(":openApiValidate")?.outcome}")
}
@Test(dataProvider = "gradle_version_provider")
fun `openApiValidate should fail on invalid spec`(gradleVersion: String?) {
@Test
fun `openApiValidate should fail on invalid spec`() {
// Arrange
val projectFiles = mapOf(
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-invalid.yaml")
@@ -111,7 +84,7 @@ class ValidateTaskDslTest : TestBase() {
""".trimMargin(), projectFiles)
// Act
val result = getGradleRunner(gradleVersion)
val result = GradleRunner.create()
.withProjectDir(temp)
.withArguments("openApiValidate")
.withPluginClasspath()
@@ -123,4 +96,4 @@ class ValidateTaskDslTest : TestBase() {
"Expected a failed run, but found ${result.task(":openApiValidate")?.outcome}")
}
}
}

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>5.2.0</version>
<version>5.1.1-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>5.2.0-SNAPSHOT</version>
<version>5.1.1-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>
@@ -219,13 +219,6 @@
<artifactId>okhttp</artifactId>
<version>4.2.2</version>
</dependency>
<!-- kotlin-stdlib for lowercase, uppercase, etc -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
<properties>
@@ -236,7 +229,7 @@
<jodatime-version>2.7</jodatime-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.8.1</junit-version>
<kotlin.version>1.5.10</kotlin.version>
<kotlin.version>1.3.50</kotlin.version>
<kotlinJvmTarget>1.8</kotlinJvmTarget>
<moshi-kotlin.version>1.8.0</moshi-kotlin.version>
<migbase64.version>2.2</migbase64.version>

View File

@@ -19,7 +19,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>5.2.0</version>
<version>5.1.1-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>5.2.0</version>
<version>5.1.1-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>5.2.0</version>
<version>5.1.1-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>5.2.0-SNAPSHOT</version>
<version>5.1.1-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -5,7 +5,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>5.2.0</version>
<version>5.1.1-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>5.2.0</version>
<version>5.1.1-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

@@ -153,7 +153,7 @@ public class Generator {
List<File> files = new DefaultGenerator().opts(clientOptInput).generate();
if (files.size() > 0) {
List<File> filesToAdd = new ArrayList<>();
LOGGER.debug("adding to {}", outputFolder);
LOGGER.debug("adding to " + outputFolder);
filesToAdd.add(new File(outputFolder));
ZipUtil zip = new ZipUtil();
zip.compressFiles(filesToAdd, outputFilename);

View File

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

View File

@@ -184,9 +184,6 @@ public class CodegenConstants {
public static final String OPTIONAL_EMIT_DEFAULT_VALUES = "optionalEmitDefaultValues";
public static final String OPTIONAL_EMIT_DEFAULT_VALUES_DESC = "Set DataMember's EmitDefaultValue.";
public static final String OPTIONAL_CONDITIONAL_SERIALIZATION = "conditionalSerialization";
public static final String OPTIONAL_CONDITIONAL_SERIALIZATION_DESC = "Serialize only those properties which are initialized by user, accepted values are true or false, default value is false.";
public static final String NETCORE_PROJECT_FILE = "netCoreProjectFile";
public static final String NETCORE_PROJECT_FILE_DESC = "Use the new format (.NET Core) for .NET project files (.csproj).";
@@ -208,20 +205,12 @@ public class CodegenConstants {
public static final String MODEL_PROPERTY_NAMING = "modelPropertyNaming";
public static final String MODEL_PROPERTY_NAMING_DESC = "Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name";
public static final String PARAM_NAMING = "paramNaming";
public static final String PARAM_NAMING_DESC = "Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name";
public static final String DOTNET_FRAMEWORK = "targetFramework";
public static final String DOTNET_FRAMEWORK_DESC = "The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.0`";
public static final String NULLABLE_REFERENCE_TYPES = "nullableReferenceTypes";
public static final String NULLABLE_REFERENCE_TYPES_DESC = "Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.0 or newer.";
public static final String TEMPLATING_ENGINE = "templatingEngine";
public static final String TEMPLATING_ENGINE_DESC = "The templating engine plugin to use: \"mustache\" (default) or \"handlebars\" (beta)";
public static enum PARAM_NAMING_TYPE {camelCase, PascalCase, snake_case, original}
public static enum MODEL_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, original}
public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, original, UPPERCASE}
@@ -320,12 +309,6 @@ public class CodegenConstants {
public static final String REMOVE_OPERATION_ID_PREFIX = "removeOperationIdPrefix";
public static final String REMOVE_OPERATION_ID_PREFIX_DESC = "Remove prefix of operationId, e.g. config_getId => getId";
public static final String REMOVE_OPERATION_ID_PREFIX_DELIMITER = "removeOperationIdPrefixDelimiter";
public static final String REMOVE_OPERATION_ID_PREFIX_DELIMITER_DESC = "Character to use as a delimiter for the prefix. Default: '_'";
public static final String REMOVE_OPERATION_ID_PREFIX_COUNT = "removeOperationIdPrefixCount";
public static final String REMOVE_OPERATION_ID_PREFIX_COUNT_DESC = "Count of delimiter for the prefix. Use -1 for last Default: 1";
public static final String SKIP_OPERATION_EXAMPLE = "skipOperationExample";
public static final String SKIP_OPERATION_EXAMPLE_DESC = "Skip examples defined in operations to avoid out of memory errors.";

View File

@@ -64,7 +64,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
public String defaultValue;
public String arrayModelType;
public boolean isAlias; // Is this effectively an alias of another simple type
public boolean isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, isDate, isDateTime, isShort, isUnboundedInteger, isBoolean;
public boolean isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, isDate, isDateTime;
private boolean additionalPropertiesIsAnyType;
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>(); // all properties (without parent's properties)
public List<CodegenProperty> allVars = new ArrayList<CodegenProperty>(); // all properties (with parent's properties)
@@ -606,30 +606,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
this.isArray = isArray;
}
@Override
public boolean getIsShort() { return isShort; }
@Override
public void setIsShort(boolean isShort) {
this.isShort = isShort;
}
@Override
public boolean getIsBoolean() { return isBoolean; }
@Override
public void setIsBoolean(boolean isBoolean) {
this.isBoolean= isBoolean;
}
@Override
public boolean getIsUnboundedInteger() { return isUnboundedInteger; }
@Override
public void setIsUnboundedInteger(boolean isUnboundedInteger) {
this.isUnboundedInteger = isUnboundedInteger;
}
@Override
public CodegenProperty getAdditionalProperties() { return additionalProperties; }
@@ -776,10 +752,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
return isAlias == that.isAlias &&
isString == that.isString &&
isInteger == that.isInteger &&
isShort == that.isShort &&
isLong == that.isLong &&
isUnboundedInteger == that.isUnboundedInteger &&
isBoolean == that.isBoolean &&
isNumber == that.isNumber &&
isNumeric == that.isNumeric &&
isFloat == that.isFloat &&
@@ -866,7 +839,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
getDescription(), getClassVarName(), getModelJson(), getDataType(), getXmlPrefix(), getXmlNamespace(),
getXmlName(), getClassFilename(), getUnescapedDescription(), getDiscriminator(), getDefaultValue(),
getArrayModelType(), isAlias, isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble,
isDate, isDateTime, isNull, hasValidation, isShort, isUnboundedInteger, isBoolean,
isDate, isDateTime, isNull, hasValidation,
getVars(), getAllVars(), getRequiredVars(), getOptionalVars(), getReadOnlyVars(), getReadWriteVars(),
getParentVars(), getAllowableValues(), getMandatory(), getAllMandatory(), getImports(), hasVars,
isEmptyVars(), hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArray,
@@ -908,10 +881,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
sb.append(", isAlias=").append(isAlias);
sb.append(", isString=").append(isString);
sb.append(", isInteger=").append(isInteger);
sb.append(", isShort=").append(isShort);
sb.append(", isLong=").append(isLong);
sb.append(", isUnboundedInteger=").append(isUnboundedInteger);
sb.append(", isBoolean=").append(isBoolean);
sb.append(", isNumber=").append(isNumber);
sb.append(", isNumeric=").append(isNumeric);
sb.append(", isFloat=").append(isFloat);

View File

@@ -35,7 +35,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
public String example; // example value (x-example)
public String jsonSchema;
public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary,
isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isShort, isUnboundedInteger;
isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType;
public boolean isArray, isMap;
public boolean isFile;
public boolean isEnum;
@@ -184,9 +184,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
output.isString = this.isString;
output.isNumeric = this.isNumeric;
output.isInteger = this.isInteger;
output.isShort = this.isShort;
output.isLong = this.isLong;
output.isUnboundedInteger = this.isUnboundedInteger;
output.isDouble = this.isDouble;
output.isDecimal = this.isDecimal;
output.isFloat = this.isFloat;
@@ -211,7 +209,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
@Override
public int hashCode() {
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger);
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired);
}
@Override
@@ -233,9 +231,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
isString == that.isString &&
isNumeric == that.isNumeric &&
isInteger == that.isInteger &&
isShort == that.isShort &&
isLong == that.isLong &&
isUnboundedInteger == that.isUnboundedInteger &&
isNumber == that.isNumber &&
isFloat == that.isFloat &&
isDouble == that.isDouble &&
@@ -332,9 +328,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
sb.append(", isString=").append(isString);
sb.append(", isNumeric=").append(isNumeric);
sb.append(", isInteger=").append(isInteger);
sb.append(", isShort=").append(isShort);
sb.append(", isLong=").append(isLong);
sb.append(", isUnboundedInteger=").append(isUnboundedInteger);
sb.append(", isNumber=").append(isNumber);
sb.append(", isFloat=").append(isFloat);
sb.append(", isDouble=").append(isDouble);
@@ -566,30 +560,6 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
this.isArray = isArray;
}
@Override
public boolean getIsShort() { return isShort; }
@Override
public void setIsShort(boolean isShort) {
this.isShort = isShort;
}
@Override
public boolean getIsBoolean() { return isBoolean; }
@Override
public void setIsBoolean(boolean isBoolean) {
this.isBoolean = isBoolean;
}
@Override
public boolean getIsUnboundedInteger() { return isUnboundedInteger; }
@Override
public void setIsUnboundedInteger(boolean isUnboundedInteger) {
this.isUnboundedInteger = isUnboundedInteger;
}
@Override
public CodegenProperty getAdditionalProperties() { return additionalProperties; }

View File

@@ -118,9 +118,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
public boolean isString;
public boolean isNumeric;
public boolean isInteger;
public boolean isShort;
public boolean isLong;
public boolean isUnboundedInteger;
public boolean isNumber;
public boolean isFloat;
public boolean isDouble;
@@ -509,30 +507,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
this.isArray = isArray;
}
@Override
public boolean getIsShort() { return isShort; }
@Override
public void setIsShort(boolean isShort) {
this.isShort = isShort;
}
@Override
public boolean getIsBoolean() { return isBoolean; }
@Override
public void setIsBoolean(boolean isBoolean) {
this.isBoolean = isBoolean;
}
@Override
public boolean getIsUnboundedInteger() { return isUnboundedInteger; }
@Override
public void setIsUnboundedInteger(boolean isUnboundedInteger) {
this.isUnboundedInteger = isUnboundedInteger;
}
public Map<String, Object> getVendorExtensions() {
return vendorExtensions;
}
@@ -678,12 +652,10 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
this.maxProperties = maxProperties;
}
@Override
public Number getMultipleOf() {
return multipleOf;
}
@Override
public void setMultipleOf(Number multipleOf) {
this.multipleOf = multipleOf;
}
@@ -793,9 +765,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
sb.append(", isString=").append(isString);
sb.append(", isNumeric=").append(isNumeric);
sb.append(", isInteger=").append(isInteger);
sb.append(", isShort=").append(isShort);
sb.append(", isLong=").append(isLong);
sb.append(", isUnboundedInteger=").append(isUnboundedInteger);
sb.append(", isNumber=").append(isNumber);
sb.append(", isFloat=").append(isFloat);
sb.append(", isDouble=").append(isDouble);
@@ -868,9 +838,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
isString == that.isString &&
isNumeric == that.isNumeric &&
isInteger == that.isInteger &&
isShort == that.isShort &&
isLong == that.isLong &&
isUnboundedInteger == that.isUnboundedInteger &&
isNumber == that.isNumber &&
isFloat == that.isFloat &&
isDouble == that.isDouble &&
@@ -958,7 +926,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
hasMoreNonReadOnly, isPrimitiveType, isModel, isContainer, isString, isNumeric,
isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isFile,
isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject,
isArray, isMap, isEnum, isReadOnly, isWriteOnly, isNullable, isShort, isUnboundedInteger,
isArray, isMap, isEnum, isReadOnly, isWriteOnly, isNullable,
isSelfReference, isCircularReference, isDiscriminator, _enum, allowableValues,
items, mostInnerItems, additionalProperties, vars, requiredVars,
vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase,

View File

@@ -36,9 +36,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
public boolean isString;
public boolean isNumeric;
public boolean isInteger;
public boolean isShort;
public boolean isLong;
public boolean isUnboundedInteger;
public boolean isNumber;
public boolean isFloat;
public boolean isDouble;
@@ -91,7 +89,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBoolean, isDate,
isDateTime, isUuid, isEmail, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType,
isMap, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties,
vars, requiredVars, isNull, hasValidation, isShort, isUnboundedInteger,
vars, requiredVars, isNull, hasValidation,
getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(),
getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(),
is1xx, is2xx, is3xx, is4xx, is5xx, additionalPropertiesIsAnyType, hasVars, hasRequired);
@@ -106,9 +104,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
isString == that.isString &&
isNumeric == that.isNumeric &&
isInteger == that.isInteger &&
isShort == that.isShort &&
isLong == that.isLong &&
isUnboundedInteger == that.isUnboundedInteger &&
isNumber == that.isNumber &&
isFloat == that.isFloat &&
isDouble == that.isDouble &&
@@ -320,30 +316,6 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
this.isArray = isArray;
}
@Override
public boolean getIsShort() { return isShort; }
@Override
public void setIsShort(boolean isShort) {
this.isShort = isShort;
}
@Override
public boolean getIsBoolean() { return isBoolean; }
@Override
public void setIsBoolean(boolean isBoolean) {
this.isBoolean = isBoolean;
}
@Override
public boolean getIsUnboundedInteger() { return isUnboundedInteger; }
@Override
public void setIsUnboundedInteger(boolean isUnboundedInteger) {
this.isUnboundedInteger = isUnboundedInteger;
}
@Override
public void setIsModel(boolean isModel) {
this.isModel = isModel;
@@ -430,9 +402,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
sb.append(", isString=").append(isString);
sb.append(", isNumeric=").append(isNumeric);
sb.append(", isInteger=").append(isInteger);
sb.append(", isShort=").append(isShort);
sb.append(", isLong=").append(isLong);
sb.append(", isUnboundedInteger=").append(isUnboundedInteger);
sb.append(", isNumber=").append(isNumber);
sb.append(", isFloat=").append(isFloat);
sb.append(", isDouble=").append(isDouble);

View File

@@ -177,8 +177,6 @@ public class DefaultCodegen implements CodegenConfig {
protected List<CliOption> cliOptions = new ArrayList<CliOption>();
protected boolean skipOverwrite;
protected boolean removeOperationIdPrefix;
protected String removeOperationIdPrefixDelimiter = "_";
protected int removeOperationIdPrefixCount = 1;
protected boolean skipOperationExample;
protected final static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application\\/json(;.*)?");
@@ -256,12 +254,10 @@ public class DefaultCodegen implements CodegenConfig {
// A cache to efficiently lookup a Schema instance based on the return value of `toModelName()`.
private Map<String, Schema> modelNameToSchemaCache;
@Override
public List<CliOption> cliOptions() {
return cliOptions;
}
@Override
public void processOpts() {
if (additionalProperties.containsKey(CodegenConstants.TEMPLATE_DIR)) {
this.setTemplateDir((String) additionalProperties.get(CodegenConstants.TEMPLATE_DIR));
@@ -327,16 +323,6 @@ public class DefaultCodegen implements CodegenConfig {
.get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX).toString()));
}
if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER)) {
this.setRemoveOperationIdPrefixDelimiter(additionalProperties
.get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER).toString());
}
if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT)) {
this.setRemoveOperationIdPrefixCount(Integer.parseInt(additionalProperties
.get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT).toString()));
}
if (additionalProperties.containsKey(CodegenConstants.SKIP_OPERATION_EXAMPLE)) {
this.setSkipOperationExample(Boolean.parseBoolean(additionalProperties
.get(CodegenConstants.SKIP_OPERATION_EXAMPLE).toString()));
@@ -412,7 +398,6 @@ public class DefaultCodegen implements CodegenConfig {
}
// override with any special post-processing for all models
@Override
@SuppressWarnings({"static-method", "unchecked"})
public Map<String, Object> postProcessAllModels(Map<String, Object> objs) {
if (this.useOneOfInterfaces) {
@@ -515,7 +500,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param objs Map of models
* @return maps of models with various updates
*/
@Override
public Map<String, Object> updateAllModels(Map<String, Object> objs) {
Map<String, CodegenModel> allModels = getAllModels(objs);
@@ -628,7 +612,6 @@ public class DefaultCodegen implements CodegenConfig {
}
// override with any special post-processing
@Override
@SuppressWarnings("static-method")
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
return objs;
@@ -733,7 +716,7 @@ public class DefaultCodegen implements CodegenConfig {
* @return the sanitized value for enum
*/
public String toEnumValue(String value, String datatype) {
if ("number".equalsIgnoreCase(datatype) || "boolean".equalsIgnoreCase(datatype)) {
if ("number".equalsIgnoreCase(datatype)) {
return value;
} else {
return "\"" + escapeText(value) + "\"";
@@ -773,7 +756,6 @@ public class DefaultCodegen implements CodegenConfig {
}
// override with any message to be shown right before the process finishes
@Override
@SuppressWarnings("static-method")
public void postProcess() {
System.out.println("################################################################################");
@@ -784,33 +766,28 @@ public class DefaultCodegen implements CodegenConfig {
}
// override with any special post-processing
@Override
@SuppressWarnings("static-method")
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {
return objs;
}
// override with any special post-processing
@Override
@SuppressWarnings("static-method")
public Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs) {
return objs;
}
// override to post-process any model properties
@Override
@SuppressWarnings("unused")
public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
}
// override to post-process any parameters
@Override
@SuppressWarnings("unused")
public void postProcessParameter(CodegenParameter parameter) {
}
//override with any special handling of the entire OpenAPI spec document
@Override
@SuppressWarnings("unused")
public void preprocessOpenAPI(OpenAPI openAPI) {
if (useOneOfInterfaces) {
@@ -895,27 +872,23 @@ public class DefaultCodegen implements CodegenConfig {
}
// override with any special handling of the entire OpenAPI spec document
@Override
@SuppressWarnings("unused")
public void processOpenAPI(OpenAPI openAPI) {
}
// override with any special handling of the JMustache compiler
@Override
@SuppressWarnings("unused")
public Compiler processCompiler(Compiler compiler) {
return compiler;
}
// override with any special handling for the templating engine
@Override
@SuppressWarnings("unused")
public TemplatingEngineAdapter processTemplatingEngine(TemplatingEngineAdapter templatingEngine) {
return templatingEngine;
}
// override with any special text escaping logic
@Override
@SuppressWarnings("static-method")
public String escapeText(String input) {
if (input == null) {
@@ -942,7 +915,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param input String to be escaped
* @return escaped string
*/
@Override
public String escapeTextWhileAllowingNewLines(String input) {
if (input == null) {
return input;
@@ -963,7 +935,6 @@ public class DefaultCodegen implements CodegenConfig {
}
// override with any special encoding and escaping logic
@Override
@SuppressWarnings("static-method")
public String encodePath(String input) {
return escapeText(input);
@@ -976,7 +947,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param input String to be cleaned up
* @return string with unsafe characters removed or escaped
*/
@Override
public String escapeUnsafeCharacters(String input) {
LOGGER.warn("escapeUnsafeCharacters should be overridden in the code generator with proper logic to escape " +
"unsafe characters");
@@ -993,69 +963,56 @@ public class DefaultCodegen implements CodegenConfig {
* @param input String to be cleaned up
* @return string with quotation mark removed or escaped
*/
@Override
public String escapeQuotationMark(String input) {
LOGGER.warn("escapeQuotationMark should be overridden in the code generator with proper logic to escape " +
"single/double quote");
return input.replace("\"", "\\\"");
}
@Override
public Set<String> defaultIncludes() {
return defaultIncludes;
}
@Override
public Map<String, String> typeMapping() {
return typeMapping;
}
@Override
public Map<String, String> instantiationTypes() {
return instantiationTypes;
}
@Override
public Set<String> reservedWords() {
return reservedWords;
}
@Override
public Set<String> languageSpecificPrimitives() {
return languageSpecificPrimitives;
}
@Override
public Map<String, String> importMapping() {
return importMapping;
}
@Override
public String testPackage() {
return testPackage;
}
@Override
public String modelPackage() {
return modelPackage;
}
@Override
public String apiPackage() {
return apiPackage;
}
@Override
public String fileSuffix() {
return fileSuffix;
}
@Override
public String templateDir() {
return templateDir;
}
@Override
public String embeddedTemplateDir() {
if (embeddedTemplateDir != null) {
return embeddedTemplateDir;
@@ -1064,112 +1021,90 @@ public class DefaultCodegen implements CodegenConfig {
}
}
@Override
public Map<String, String> apiDocTemplateFiles() {
return apiDocTemplateFiles;
}
@Override
public Map<String, String> modelDocTemplateFiles() {
return modelDocTemplateFiles;
}
@Override
public Map<String, String> reservedWordsMappings() {
return reservedWordsMappings;
}
@Override
public Map<String, String> apiTestTemplateFiles() {
return apiTestTemplateFiles;
}
@Override
public Map<String, String> modelTestTemplateFiles() {
return modelTestTemplateFiles;
}
@Override
public Map<String, String> apiTemplateFiles() {
return apiTemplateFiles;
}
@Override
public Map<String, String> modelTemplateFiles() {
return modelTemplateFiles;
}
@Override
public String apiFileFolder() {
return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar);
}
@Override
public String modelFileFolder() {
return outputFolder + File.separator + modelPackage().replace('.', File.separatorChar);
}
@Override
public String apiTestFileFolder() {
return outputFolder + File.separator + testPackage().replace('.', File.separatorChar);
}
@Override
public String modelTestFileFolder() {
return outputFolder + File.separator + testPackage().replace('.', File.separatorChar);
}
@Override
public String apiDocFileFolder() {
return outputFolder;
}
@Override
public String modelDocFileFolder() {
return outputFolder;
}
@Override
public Map<String, Object> additionalProperties() {
return additionalProperties;
}
@Override
public Map<String, String> serverVariableOverrides() {
return serverVariables;
}
@Override
public Map<String, Object> vendorExtensions() {
return vendorExtensions;
}
@Override
public List<SupportingFile> supportingFiles() {
return supportingFiles;
}
@Override
public String outputFolder() {
return outputFolder;
}
@Override
public void setOutputDir(String dir) {
this.outputFolder = dir;
}
@Override
public String getOutputDir() {
return outputFolder();
}
@Override
public String getInputSpec() {
return inputSpec;
}
@Override
public void setInputSpec(String inputSpec) {
this.inputSpec = inputSpec;
}
@@ -1298,7 +1233,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the file name of the Api
* @return the file name of the Api
*/
@Override
public String toApiFilename(String name) {
return toApiName(name);
}
@@ -1309,7 +1243,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the file name of the Api
* @return the file name of the Api
*/
@Override
public String toApiDocFilename(String name) {
return toApiName(name);
}
@@ -1320,7 +1253,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the file name of the Api
* @return the file name of the Api
*/
@Override
public String toApiTestFilename(String name) {
return toApiName(name) + "Test";
}
@@ -1331,7 +1263,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the varible name of the Api
* @return the snake-cased variable name
*/
@Override
public String toApiVarName(String name) {
return lowerCamelCase(name);
}
@@ -1342,7 +1273,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the model name
* @return the file name of the model
*/
@Override
public String toModelFilename(String name) {
return camelize(name);
}
@@ -1353,7 +1283,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the model name
* @return the file name of the model
*/
@Override
public String toModelTestFilename(String name) {
return camelize(name) + "Test";
}
@@ -1364,7 +1293,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the model name
* @return the file name of the model
*/
@Override
public String toModelDocFilename(String name) {
return camelize(name);
}
@@ -1418,7 +1346,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name Codegen property object
* @return the sanitized parameter name
*/
@Override
public String toParamName(String name) {
name = removeNonNameElementToCamelCase(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
if (reservedWords.contains(name)) {
@@ -1459,7 +1386,6 @@ public class DefaultCodegen implements CodegenConfig {
* <p>
* throws Runtime exception as reserved word is not allowed (default behavior)
*/
@Override
@SuppressWarnings("static-method")
public String escapeReservedWord(String name) {
throw new RuntimeException("reserved word " + name + " not allowed");
@@ -1471,7 +1397,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the name of the "Model"
* @return the fully-qualified "Model" name for import
*/
@Override
public String toModelImport(String name) {
if ("".equals(modelPackage())) {
return name;
@@ -1486,7 +1411,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the name of the "Model"
* @return Map of fully-qualified models.
*/
@Override
public Map<String,String> toModelImportMap(String name){
return Collections.singletonMap(this.toModelImport(name),name);
}
@@ -1497,7 +1421,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the name of the "Api"
* @return the fully-qualified "Api" name for import
*/
@Override
public String toApiImport(String name) {
return apiPackage() + "." + name;
}
@@ -1669,7 +1592,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param operation OAS operation object
* @return string presentation of the example path
*/
@Override
@SuppressWarnings("static-method")
public String generateExamplePath(String path, Operation operation) {
StringBuilder sb = new StringBuilder();
@@ -2078,7 +2000,6 @@ public class DefaultCodegen implements CodegenConfig {
return "oneOf<" + String.join(",", names) + ">";
}
@Override
public Schema unaliasSchema(Schema schema, Map<String, String> usedImportMappings) {
return ModelUtils.unaliasSchema(this.openAPI, schema, usedImportMappings);
}
@@ -2221,7 +2142,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name name
* @return a string presentation of the type
*/
@Override
@SuppressWarnings("static-method")
public String getTypeDeclaration(String name) {
return name;
@@ -2233,7 +2153,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param schema property schema
* @return a string presentation of the property type
*/
@Override
public String getTypeDeclaration(Schema schema) {
if (schema == null) {
LOGGER.warn("Null schema found. Default type to `NULL_SCHEMA_ERR`");
@@ -2270,7 +2189,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the name of the property
* @return getter name based on naming convention
*/
@Override
public String toBooleanGetter(String name) {
return "get" + getterAndSetterCapitalize(name);
}
@@ -2281,7 +2199,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the name of the property
* @return getter name based on naming convention
*/
@Override
public String toGetter(String name) {
return "get" + getterAndSetterCapitalize(name);
}
@@ -2292,7 +2209,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the name of the property
* @return setter name based on naming convention
*/
@Override
public String toSetter(String name) {
return "set" + getterAndSetterCapitalize(name);
}
@@ -2304,7 +2220,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the name of the Api
* @return capitalized Api name
*/
@Override
public String toApiName(String name) {
if (name.length() == 0) {
return "DefaultApi";
@@ -2320,7 +2235,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name the name of the model
* @return capitalized model name
*/
@Override
public String toModelName(final String name) {
return camelize(modelNamePrefix + "_" + name + "_" + modelNameSuffix);
}
@@ -2357,7 +2271,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param schema OAS Model object
* @return Codegen Model object
*/
@Override
public CodegenModel fromModel(String name, Schema schema) {
Map<String, Schema> allDefinitions = ModelUtils.getSchemas(this.openAPI);
if (typeAliases == null) {
@@ -2490,13 +2403,6 @@ public class DefaultCodegen implements CodegenConfig {
if (StringUtils.isBlank(interfaceSchema.get$ref())) {
// primitive type
String languageType = getTypeDeclaration(interfaceSchema);
if (ModelUtils.isArraySchema(interfaceSchema) || ModelUtils.isMapSchema(interfaceSchema)) {
CodegenProperty cp = fromProperty("composedSchemaImports", interfaceSchema);
while (cp != null) {
addImport(m, cp.complexType);
cp = cp.items;
}
}
if (composed.getAnyOf() != null) {
if (m.anyOf.contains(languageType)) {
@@ -2626,13 +2532,8 @@ public class DefaultCodegen implements CodegenConfig {
m.isNumeric = Boolean.TRUE;
if (ModelUtils.isLongSchema(schema)) { // int64/long format
m.isLong = Boolean.TRUE;
} else {
m.isInteger = Boolean.TRUE; // older use case, int32 and unbounded int
if (ModelUtils.isShortSchema(schema)) { // int32
m.setIsShort(Boolean.TRUE);
} else { // unbounded integer
m.setIsUnboundedInteger(Boolean.TRUE);
}
} else { // int32 format
m.isInteger = Boolean.TRUE;
}
} else if (ModelUtils.isDateTimeSchema(schema)) {
// NOTE: DateTime schemas as CodegenModel is a rare use case and may be removed at a later date.
@@ -2653,8 +2554,6 @@ public class DefaultCodegen implements CodegenConfig {
} else { // type is number and without format
m.isNumber = Boolean.TRUE;
}
} else if (ModelUtils.isBooleanSchema(schema)) {
m.isBoolean = Boolean.TRUE;
} else if (ModelUtils.isFreeFormObject(openAPI, schema)) {
addAdditionPropertiesToCodeGenModel(m, schema);
}
@@ -2807,18 +2706,14 @@ public class DefaultCodegen implements CodegenConfig {
String modelName = ModelUtils.getSimpleRef(oneOf.get$ref());
CodegenProperty thisCp = discriminatorFound(composedSchemaName, oneOf, discPropName, openAPI);
if (thisCp == null) {
LOGGER.warn(
"'{}' defines discriminator '{}', but the referenced OneOf schema '{}' is missing {}",
composedSchemaName, discPropName, modelName, discPropName);
LOGGER.warn("'" + composedSchemaName + "' defines discriminator '" + discPropName + "', but the referenced OneOf schema '" + modelName + "' is missing " + discPropName);
}
if (cp.dataType == null) {
cp = thisCp;
continue;
}
if (cp != thisCp) {
LOGGER.warn(
"'{}' defines discriminator '{}', but the OneOf schema '{}' has a different {} definition than the prior OneOf schema's. Make sure the {} type and required values are the same",
composedSchemaName, discPropName, modelName, discPropName, discPropName);
LOGGER.warn("'" + composedSchemaName + "' defines discriminator '" + discPropName + "', but the OneOf schema '" + modelName + "' has a different " + discPropName + " definition than the prior OneOf schema's. Make sure the " + discPropName + " type and required values are the same");
}
}
return cp;
@@ -2830,18 +2725,14 @@ public class DefaultCodegen implements CodegenConfig {
String modelName = ModelUtils.getSimpleRef(anyOf.get$ref());
CodegenProperty thisCp = discriminatorFound(composedSchemaName, anyOf, discPropName, openAPI);
if (thisCp == null) {
LOGGER.warn(
"'{}' defines discriminator '{}', but the referenced AnyOf schema '{}' is missing {}",
composedSchemaName, discPropName, modelName, discPropName);
LOGGER.warn("'" + composedSchemaName + "' defines discriminator '" + discPropName + "', but the referenced AnyOf schema '" + modelName + "' is missing " + discPropName);
}
if (cp != null && cp.dataType == null) {
if (cp.dataType == null) {
cp = thisCp;
continue;
}
if (cp != thisCp) {
LOGGER.warn(
"'{}' defines discriminator '{}', but the AnyOf schema '{}' has a different {} definition than the prior AnyOf schema's. Make sure the {} type and required values are the same",
composedSchemaName, discPropName, modelName, discPropName, discPropName);
LOGGER.warn("'" + composedSchemaName + "' defines discriminator '" + discPropName + "', but the AnyOf schema '" + modelName + "' has a different " + discPropName + " definition than the prior AnyOf schema's. Make sure the " + discPropName + " type and required values are the same");
}
}
return cp;
@@ -2979,9 +2870,7 @@ public class DefaultCodegen implements CodegenConfig {
// schemas also has inline composed schemas
// Note: if it is only inline one level, then the inline model resolver will move it into its own
// schema and make it a $ref schema in the oneOf/anyOf location
LOGGER.warn(
"Invalid inline schema defined in oneOf/anyOf in '{}'. Per the OpenApi spec, for this case when a composed schema defines a discriminator, the oneOf/anyOf schemas must use $ref. Change this inline definition to a $ref definition",
composedSchemaName);
LOGGER.warn("Invalid inline schema defined in oneOf/anyOf in '" + composedSchemaName + "'. Per the OpenApi spec, for this case when a composed schema defines a discriminator, the oneOf/anyOf schemas must use $ref. Change this inline definition to a $ref definition");
}
CodegenProperty df = discriminatorFound(composedSchemaName, sc, discPropName, openAPI);
String modelName = ModelUtils.getSimpleRef(ref);
@@ -3001,8 +2890,7 @@ public class DefaultCodegen implements CodegenConfig {
msgSuffix += spacer + "invalid optional definition of " + discPropName + ", include it in required";
}
}
LOGGER.warn("'{}' defines discriminator '{}', but the referenced schema '{}' is incorrect. {}",
composedSchemaName, discPropName, modelName, msgSuffix);
LOGGER.warn("'" + composedSchemaName + "' defines discriminator '" + discPropName + "', but the referenced schema '" + modelName + "' is incorrect. " + msgSuffix);
}
MappedModel mm = new MappedModel(modelName, toModelName(modelName));
descendentSchemas.add(mm);
@@ -3297,11 +3185,6 @@ public class DefaultCodegen implements CodegenConfig {
}
if (p.getExtensions() != null && !p.getExtensions().isEmpty()) {
property.getVendorExtensions().putAll(p.getExtensions());
} else if (p.get$ref() != null) {
Schema referencedSchema = ModelUtils.getReferencedSchema(this.openAPI, p);
if (referencedSchema.getExtensions() != null && !referencedSchema.getExtensions().isEmpty()) {
property.getVendorExtensions().putAll(referencedSchema.getExtensions());
}
}
String type = getSchemaType(p);
@@ -3309,14 +3192,10 @@ public class DefaultCodegen implements CodegenConfig {
property.isNumeric = Boolean.TRUE;
if (ModelUtils.isLongSchema(p)) { // int64/long format
property.isLong = Boolean.TRUE;
} else {
property.isInteger = Boolean.TRUE; // older use case, int32 and unbounded int
if (ModelUtils.isShortSchema(p)) { // int32
property.setIsShort(Boolean.TRUE);
} else { // unbounded integer
property.setIsUnboundedInteger(Boolean.TRUE);
}
} else { // int32 format
property.isInteger = Boolean.TRUE;
}
} else if (ModelUtils.isBooleanSchema(p)) { // boolean type
property.isBoolean = true;
property.getter = toBooleanGetter(name);
@@ -3793,7 +3672,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param servers list of servers
* @return Codegen Operation object
*/
@Override
public CodegenOperation fromOperation(String path,
String httpMethod,
Operation operation,
@@ -3827,14 +3705,9 @@ public class DefaultCodegen implements CodegenConfig {
String operationId = getOrGenerateOperationId(operation, path, httpMethod);
// remove prefix in operationId
if (removeOperationIdPrefix) {
// The prefix is everything before the removeOperationIdPrefixCount occurrence of removeOperationIdPrefixDelimiter
String[] componenets = operationId.split("[" + removeOperationIdPrefixDelimiter + "]");
if (componenets.length > 1) {
// If removeOperationIdPrefixCount is -1 or bigger that the number of occurrences, uses the last one
int componenet_number = removeOperationIdPrefixCount == -1 ? componenets.length - 1 : removeOperationIdPrefixCount;
componenet_number = Math.min(componenet_number, componenets.length - 1);
// Reconstruct the operationId from its split elements and the delimiter
operationId = String.join(removeOperationIdPrefixDelimiter, Arrays.copyOfRange(componenets, componenet_number, componenets.length));
int offset = operationId.indexOf('_');
if (offset > -1) {
operationId = operationId.substring(offset + 1);
}
}
operationId = removeNonNameElementToCamelCase(operationId);
@@ -4194,11 +4067,6 @@ public class DefaultCodegen implements CodegenConfig {
} else if (Boolean.TRUE.equals(cp.isInteger)) {
r.isInteger = true;
r.isNumeric = true;
if (Boolean.TRUE.equals(cp.isShort)) {
r.isShort = true;
} else if (Boolean.TRUE.equals(cp.isUnboundedInteger)) {
r.isUnboundedInteger = true;
}
} else if (Boolean.TRUE.equals(cp.isNumber)) {
r.isNumber = true;
r.isNumeric = true;
@@ -4554,9 +4422,7 @@ public class DefaultCodegen implements CodegenConfig {
}).collect(Collectors.toList());
}
else {
LOGGER.warn(
"No object schema found for deepObject parameter{} deepObject won't have specific properties",
codegenParameter);
LOGGER.warn("No object schema found for deepObject parameter" + codegenParameter + " deepObject won't have specific properties");
}
}
@@ -4609,7 +4475,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param securitySchemeMap a map of OAS SecuritySchemeDefinition object
* @return a list of Codegen Security objects
*/
@Override
@SuppressWarnings("static-method")
public List<CodegenSecurity> fromSecurity(Map<String, SecurityScheme> securitySchemeMap) {
if (securitySchemeMap == null) {
@@ -4831,7 +4696,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param co Codegen Operation object
* @param operations map of Codegen operations
*/
@Override
@SuppressWarnings("static-method")
public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation
co, Map<String, List<CodegenOperation>> operations) {
@@ -4850,7 +4714,7 @@ public class DefaultCodegen implements CodegenConfig {
}
}
if (!co.operationId.equals(uniqueName)) {
LOGGER.warn("generated unique operationId `{}`", uniqueName);
LOGGER.warn("generated unique operationId `" + uniqueName + "`");
}
co.operationId = uniqueName;
co.operationIdLowerCase = uniqueName.toLowerCase(Locale.ROOT);
@@ -5005,7 +4869,7 @@ public class DefaultCodegen implements CodegenConfig {
final String key = entry.getKey();
final Schema prop = entry.getValue();
if (prop == null) {
LOGGER.warn("Please report the issue. There shouldn't be null property for {}", key);
LOGGER.warn("Please report the issue. There shouldn't be null property for " + key);
} else {
final CodegenProperty cp = fromProperty(key, prop);
cp.required = mandatory.contains(key);
@@ -5099,7 +4963,7 @@ public class DefaultCodegen implements CodegenConfig {
*/
@SuppressWarnings("static-method")
public String removeNonNameElementToCamelCase(String name) {
return removeNonNameElementToCamelCase(name, "[-_:;#" + removeOperationIdPrefixDelimiter + "]");
return removeNonNameElementToCamelCase(name, "[-_:;#]");
}
/**
@@ -5119,13 +4983,11 @@ public class DefaultCodegen implements CodegenConfig {
return result;
}
@Override
public String apiFilename(String templateName, String tag) {
String suffix = apiTemplateFiles().get(templateName);
return apiFileFolder() + File.separator + toApiFilename(tag) + suffix;
}
@Override
public String modelFilename(String templateName, String modelName) {
String suffix = modelTemplateFiles().get(templateName);
return modelFileFolder() + File.separator + toModelFilename(modelName) + suffix;
@@ -5138,7 +5000,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param tag tag
* @return the API documentation file name with full path
*/
@Override
public String apiDocFilename(String templateName, String tag) {
String docExtension = getDocExtension();
String suffix = docExtension != null ? docExtension : apiDocTemplateFiles().get(templateName);
@@ -5152,69 +5013,43 @@ public class DefaultCodegen implements CodegenConfig {
* @param tag tag
* @return the API test file name with full path
*/
@Override
public String apiTestFilename(String templateName, String tag) {
String suffix = apiTestTemplateFiles().get(templateName);
return apiTestFileFolder() + File.separator + toApiTestFilename(tag) + suffix;
}
@Override
public boolean shouldOverwrite(String filename) {
return !(skipOverwrite && new File(filename).exists());
}
@Override
public boolean isSkipOverwrite() {
return skipOverwrite;
}
@Override
public void setSkipOverwrite(boolean skipOverwrite) {
this.skipOverwrite = skipOverwrite;
}
@Override
public boolean isRemoveOperationIdPrefix() {
return removeOperationIdPrefix;
}
@Override
public boolean isSkipOperationExample() {
return skipOperationExample;
}
@Override
public void setRemoveOperationIdPrefix(boolean removeOperationIdPrefix) {
this.removeOperationIdPrefix = removeOperationIdPrefix;
}
public String getRemoveOperationIdPrefixDelimiter() {
return removeOperationIdPrefixDelimiter;
}
public void setRemoveOperationIdPrefixDelimiter(String removeOperationIdPrefixDelimiter) {
this.removeOperationIdPrefixDelimiter = removeOperationIdPrefixDelimiter;
}
public int getRemoveOperationIdPrefixCount() {
return removeOperationIdPrefixCount;
}
public void setRemoveOperationIdPrefixCount(int removeOperationIdPrefixCount) {
this.removeOperationIdPrefixCount = removeOperationIdPrefixCount;
}
@Override
public void setSkipOperationExample(boolean skipOperationExample) {
this.skipOperationExample = skipOperationExample;
}
@Override
public boolean isHideGenerationTimestamp() {
return hideGenerationTimestamp;
}
@Override
public void setHideGenerationTimestamp(boolean hideGenerationTimestamp) {
this.hideGenerationTimestamp = hideGenerationTimestamp;
}
@@ -5225,7 +5060,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @return the supported libraries
*/
@Override
public Map<String, String> supportedLibraries() {
return supportedLibraries;
}
@@ -5235,7 +5069,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @param library Library template
*/
@Override
public void setLibrary(String library) {
if (library != null && !supportedLibraries.containsKey(library)) {
StringBuilder sb = new StringBuilder("Unknown library: " + library + "\nAvailable libraries:");
@@ -5256,7 +5089,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @return Library template
*/
@Override
public String getLibrary() {
return library;
}
@@ -5275,7 +5107,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @param gitHost Git host
*/
@Override
public void setGitHost(String gitHost) {
this.gitHost = gitHost;
}
@@ -5285,7 +5116,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @return Git host
*/
@Override
public String getGitHost() {
return gitHost;
}
@@ -5295,7 +5125,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @param gitUserId Git user ID
*/
@Override
public void setGitUserId(String gitUserId) {
this.gitUserId = gitUserId;
}
@@ -5305,7 +5134,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @return Git user ID
*/
@Override
public String getGitUserId() {
return gitUserId;
}
@@ -5315,7 +5143,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @param gitRepoId Git repo ID
*/
@Override
public void setGitRepoId(String gitRepoId) {
this.gitRepoId = gitRepoId;
}
@@ -5325,7 +5152,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @return Git repo ID
*/
@Override
public String getGitRepoId() {
return gitRepoId;
}
@@ -5335,7 +5161,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @param releaseNote Release note
*/
@Override
public void setReleaseNote(String releaseNote) {
this.releaseNote = releaseNote;
}
@@ -5345,7 +5170,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @return Release note
*/
@Override
public String getReleaseNote() {
return releaseNote;
}
@@ -5355,7 +5179,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @return Documentation files extension
*/
@Override
public String getDocExtension() {
return docExtension;
}
@@ -5365,7 +5188,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @param userDocExtension documentation files extension
*/
@Override
public void setDocExtension(String userDocExtension) {
this.docExtension = userDocExtension;
}
@@ -5375,7 +5197,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @param httpUserAgent HTTP user agent
*/
@Override
public void setHttpUserAgent(String httpUserAgent) {
this.httpUserAgent = httpUserAgent;
}
@@ -5385,7 +5206,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @return HTTP user agent
*/
@Override
public String getHttpUserAgent() {
return httpUserAgent;
}
@@ -5405,7 +5225,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param name string to be sanitize
* @return sanitized string
*/
@Override
@SuppressWarnings("static-method")
public String sanitizeName(String name) {
return sanitizeName(name, "\\W");
@@ -5515,7 +5334,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param tag Tag
* @return Sanitized tag
*/
@Override
public String sanitizeTag(String tag) {
tag = camelize(sanitizeName(tag));
@@ -5565,11 +5383,6 @@ public class DefaultCodegen implements CodegenConfig {
} else if (Boolean.TRUE.equals(property.isInteger)) {
parameter.isInteger = true;
parameter.isPrimitiveType = true;
if (Boolean.TRUE.equals(property.isShort)) {
parameter.isShort = true;
} else if (Boolean.TRUE.equals(property.isUnboundedInteger)) {
parameter.isUnboundedInteger = true;
}
} else if (Boolean.TRUE.equals(property.isDouble)) {
parameter.isDouble = true;
parameter.isPrimitiveType = true;
@@ -5644,9 +5457,13 @@ public class DefaultCodegen implements CodegenConfig {
// handle default value for enum, e.g. available => StatusEnum.AVAILABLE
if (var.defaultValue != null) {
final String enumDefaultValue = getEnumDefaultValue(var.defaultValue, dataType);
String enumName = null;
final String enumDefaultValue;
if (isDataTypeString(dataType)) {
enumDefaultValue = toEnumValue(var.defaultValue, dataType);
} else {
enumDefaultValue = var.defaultValue;
}
for (Map<String, Object> enumVar : enumVars) {
if (enumDefaultValue.equals(enumVar.get("value"))) {
enumName = (String) enumVar.get("name");
@@ -5659,16 +5476,6 @@ public class DefaultCodegen implements CodegenConfig {
}
}
protected String getEnumDefaultValue(String defaultValue, String dataType) {
final String enumDefaultValue;
if (isDataTypeString(dataType)) {
enumDefaultValue = toEnumValue(defaultValue, dataType);
} else {
enumDefaultValue = defaultValue;
}
return enumDefaultValue;
}
protected List<Map<String, Object>> buildEnumVars(List<Object> values, String dataType) {
List<Map<String, Object>> enumVars = new ArrayList<>();
int truncateIdx = 0;
@@ -5755,7 +5562,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @return a string of the full path to an override ignore file.
*/
@Override
public String getIgnoreFilePathOverride() {
return ignoreFilePathOverride;
}
@@ -5765,7 +5571,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @param ignoreFileOverride The full path to an ignore file
*/
@Override
public void setIgnoreFilePathOverride(final String ignoreFileOverride) {
this.ignoreFilePathOverride = ignoreFileOverride;
}
@@ -5946,17 +5751,14 @@ public class DefaultCodegen implements CodegenConfig {
}
}
@Override
public CodegenType getTag() {
return null;
}
@Override
public String getName() {
return null;
}
@Override
public String getHelp() {
return null;
}
@@ -6545,7 +6347,6 @@ public class DefaultCodegen implements CodegenConfig {
* @param file file to be processed
* @param fileType file type
*/
@Override
public void postProcessFile(File file, String fileType) {
LOGGER.debug("Post processing file {} ({})", file, fileType);
}
@@ -6555,7 +6356,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @return true if the option is enabled
*/
@Override
public boolean isEnablePostProcessFile() {
return enablePostProcessFile;
}
@@ -6565,7 +6365,6 @@ public class DefaultCodegen implements CodegenConfig {
*
* @param enablePostProcessFile true to enable post-processing file
*/
@Override
public void setEnablePostProcessFile(boolean enablePostProcessFile) {
this.enablePostProcessFile = enablePostProcessFile;
}

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