mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-06 14:36:09 +00:00
Compare commits
5 Commits
update-dat
...
ranjanp75-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a502aab8d | ||
|
|
fa242fcb46 | ||
|
|
17a184c2b0 | ||
|
|
0cee6d9419 | ||
|
|
b40e4d81b4 |
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
Please follow the issue template below for bug reports and feature requests.
|
||||
Also please indicate in the issue title which language/library is concerned. E.g.: [JAVA] Bug generating foo with bar
|
||||
Also please indicate in the issue title which language/library is concerned. Eg: [JAVA] Bug generating foo with bar
|
||||
-->
|
||||
|
||||
##### Description
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -18,7 +18,7 @@ assignees: ''
|
||||
|
||||
<!--
|
||||
Please follow the issue template below for bug reports.
|
||||
Also please indicate in the issue title which language/library is concerned. E.g.: [BUG][JAVA] Bug generating foo with bar
|
||||
Also please indicate in the issue title which language/library is concerned. Eg: [BUG][JAVA] Bug generating foo with bar
|
||||
-->
|
||||
|
||||
##### Description
|
||||
|
||||
1
.github/workflows/gradle-plugin-tests.yaml
vendored
1
.github/workflows/gradle-plugin-tests.yaml
vendored
@@ -19,7 +19,6 @@ jobs:
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
|
||||
1
.github/workflows/gradle-test.yaml
vendored
1
.github/workflows/gradle-test.yaml
vendored
@@ -37,7 +37,6 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
cache: gradle
|
||||
# Cache Gradle Dependencies
|
||||
- name: Setup Gradle Dependencies Cache
|
||||
uses: actions/cache@v4
|
||||
|
||||
12
.github/workflows/linux.yaml
vendored
12
.github/workflows/linux.yaml
vendored
@@ -27,7 +27,6 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: ${{ matrix.java }}
|
||||
cache: gradle
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
@@ -45,12 +44,12 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v5
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
gradle-version: '8.14.3'
|
||||
|
||||
- name: Setup Maven
|
||||
uses: s4u/setup-maven-action@v1.19.0
|
||||
uses: s4u/setup-maven-action@v1.18.0
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
maven-version: 3.8.8
|
||||
@@ -62,7 +61,7 @@ jobs:
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
||||
|
||||
- name: Upload Maven build artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v4
|
||||
if: matrix.java == '11' && matrix.os == 'ubuntu-latest'
|
||||
with:
|
||||
name: artifact
|
||||
@@ -92,13 +91,12 @@ jobs:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
- name: Setup Maven
|
||||
uses: s4u/setup-maven-action@v1.19.0
|
||||
uses: s4u/setup-maven-action@v1.18.0
|
||||
with:
|
||||
java-version: 11
|
||||
maven-version: 3.8.8
|
||||
cache: gradle
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v6
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: artifact
|
||||
- name: Run Ensures Script
|
||||
|
||||
10
.github/workflows/openapi-generator.yaml
vendored
10
.github/workflows/openapi-generator.yaml
vendored
@@ -21,7 +21,6 @@ jobs:
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
@@ -42,7 +41,7 @@ jobs:
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
||||
- run: ls -la modules/openapi-generator-cli/target
|
||||
- name: Upload openapi-generator-cli.jar artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
|
||||
@@ -60,7 +59,6 @@ jobs:
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
@@ -81,7 +79,7 @@ jobs:
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
||||
- name: Publish unit test reports
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: surefire-test-results
|
||||
path: '**/surefire-reports/TEST-*.xml'
|
||||
@@ -99,7 +97,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
- name: Download openapi-generator-cli.jar artifact
|
||||
uses: actions/download-artifact@v6
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target
|
||||
@@ -138,7 +136,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
- name: Download openapi-generator-cli.jar artifact
|
||||
uses: actions/download-artifact@v6
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target
|
||||
|
||||
1
.github/workflows/samples-groovy.yaml
vendored
1
.github/workflows/samples-groovy.yaml
vendored
@@ -26,7 +26,6 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
|
||||
@@ -118,7 +118,6 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
|
||||
@@ -42,7 +42,6 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
|
||||
51
.github/workflows/samples-javascript.yaml
vendored
51
.github/workflows/samples-javascript.yaml
vendored
@@ -1,51 +0,0 @@
|
||||
name: Samples JS clients
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
#- samples/client/petstore/javascript-flowtyped/**
|
||||
- samples/client/petstore/javascript-es6/**
|
||||
- samples/client/petstore/javascript-promise-es6/**
|
||||
pull_request:
|
||||
paths:
|
||||
#- samples/client/petstore/javascript-flowtyped/**
|
||||
- samples/client/petstore/javascript-es6/**
|
||||
- samples/client/petstore/javascript-promise-es6/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build projects
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
- "18.x"
|
||||
- "20.x"
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/petstore/javascript-es6/
|
||||
- samples/client/petstore/javascript-promise-es6/
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
ports:
|
||||
- 80:8080
|
||||
env:
|
||||
SWAGGER_HOST: http://petstore.swagger.io
|
||||
SWAGGER_BASE_PATH: /v2
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Add hosts to /etc/hosts
|
||||
run: |
|
||||
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
|
||||
- name: Use Node.js 20.x
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: 'npm' # Or 'yarn'
|
||||
- name: npm install
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: npm install
|
||||
- name: npm test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: npm test
|
||||
5
.github/workflows/samples-jaxrs.yaml
vendored
5
.github/workflows/samples-jaxrs.yaml
vendored
@@ -20,7 +20,10 @@ jobs:
|
||||
- samples/server/petstore/jaxrs/jersey2-useTags
|
||||
- samples/server/petstore/jaxrs-jersey
|
||||
- samples/server/petstore/jaxrs-spec
|
||||
- samples/server/petstore/jaxrs-spec-withxml
|
||||
- samples/server/petstore/jaxrs-spec-interface
|
||||
- samples/server/petstore/jaxrs-spec-interface-response
|
||||
- samples/server/petstore/jaxrs-jersey
|
||||
- samples/server/petstore/jaxrs-spec
|
||||
- samples/server/petstore/jaxrs-spec-interface
|
||||
- samples/server/petstore/jaxrs-spec-interface-response
|
||||
- samples/server/petstore/jaxrs-datelib-j8
|
||||
|
||||
1
.github/workflows/samples-kotlin-client.yaml
vendored
1
.github/workflows/samples-kotlin-client.yaml
vendored
@@ -77,7 +77,6 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
|
||||
@@ -26,7 +26,6 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
|
||||
@@ -52,7 +52,6 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
|
||||
@@ -32,7 +32,6 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 21
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
|
||||
3
.github/workflows/samples-kotlin-server.yaml
vendored
3
.github/workflows/samples-kotlin-server.yaml
vendored
@@ -59,8 +59,7 @@ jobs:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
cache: gradle
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
|
||||
142
.github/workflows/samples-typescript-client.yaml
vendored
142
.github/workflows/samples-typescript-client.yaml
vendored
@@ -1,142 +0,0 @@
|
||||
name: Samples TS clients
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/others/typescript-angular/**
|
||||
# comment out angular released before Nov 2023
|
||||
#- samples/client/petstore/typescript-angular-v12-provided-in-root/**
|
||||
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
|
||||
#- samples/client/petstore/typescript-angular-v14-provided-in-root/**
|
||||
#- samples/client/petstore/typescript-angular-v15-provided-in-root/**
|
||||
- samples/client/petstore/typescript-angular-v16-provided-in-root/**
|
||||
- samples/client/petstore/typescript-angular-v17-provided-in-root/**
|
||||
- samples/client/petstore/typescript-angular-v18-provided-in-root/**
|
||||
- samples/client/petstore/typescript-angular-v19-provided-in-root/**
|
||||
- samples/client/petstore/typescript-angular-v20-provided-in-root/**
|
||||
- samples/openapi3/client/petstore/typescript/builds/default/**
|
||||
# comment out due to build failure
|
||||
#- samples/openapi3/client/petstore/typescript/tests/default/**
|
||||
- samples/openapi3/client/petstore/typescript/builds/jquery/**
|
||||
# comment out due to build failure
|
||||
#- samples/openapi3/client/petstore/typescript/tests/jquery/**
|
||||
- samples/openapi3/client/petstore/typescript/builds/object_params/**
|
||||
# comment out due to build failure
|
||||
#- samples/openapi3/client/petstore/typescript/tests/object_params/**
|
||||
#- samples/openapi3/client/petstore/typescript/builds/inversify/**
|
||||
#- samples/openapi3/client/petstore/typescript/tests/inversify/**
|
||||
#- samples/openapi3/client/petstore/typescript/tests/deno/**
|
||||
- samples/openapi3/client/petstore/typescript/builds/browser/**
|
||||
# comment out due to build failure
|
||||
#- samples/openapi3/client/petstore/typescript/tests/browser/**
|
||||
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/**
|
||||
- samples/client/petstore/typescript-fetch/builds/default/**
|
||||
- samples/client/petstore/typescript-fetch/builds/es6-target/**
|
||||
- samples/client/petstore/typescript-fetch/builds/with-npm-version/**
|
||||
- samples/client/petstore/typescript-fetch/tests/default/**
|
||||
# comment out due to build failure
|
||||
#- samples/client/petstore/typescript-node/npm/**
|
||||
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/**
|
||||
- samples/client/petstore/typescript-axios/builds/with-npm-version/**
|
||||
# comment out due to build failure
|
||||
#- samples/client/petstore/typescript-axios/tests/default/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/others/typescript-angular/**
|
||||
#- samples/client/petstore/typescript-angular-v12-provided-in-root/**
|
||||
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
|
||||
#- samples/client/petstore/typescript-angular-v14-provided-in-root/**
|
||||
#- samples/client/petstore/typescript-angular-v15-provided-in-root/**
|
||||
- samples/client/petstore/typescript-angular-v16-provided-in-root/**
|
||||
- samples/client/petstore/typescript-angular-v17-provided-in-root/**
|
||||
- samples/client/petstore/typescript-angular-v18-provided-in-root/**
|
||||
- samples/client/petstore/typescript-angular-v19-provided-in-root/**
|
||||
- samples/client/petstore/typescript-angular-v20-provided-in-root/**
|
||||
- samples/openapi3/client/petstore/typescript/builds/default/**
|
||||
#- samples/openapi3/client/petstore/typescript/tests/default/**
|
||||
- samples/openapi3/client/petstore/typescript/builds/jquery/**
|
||||
#- samples/openapi3/client/petstore/typescript/tests/jquery/**
|
||||
- samples/openapi3/client/petstore/typescript/builds/object_params/**
|
||||
#- samples/openapi3/client/petstore/typescript/tests/object_params/**
|
||||
#- samples/openapi3/client/petstore/typescript/builds/inversify/**
|
||||
#- samples/openapi3/client/petstore/typescript/tests/inversify/**
|
||||
#- samples/openapi3/client/petstore/typescript/tests/deno/**
|
||||
- samples/openapi3/client/petstore/typescript/builds/browser/**
|
||||
#- samples/openapi3/client/petstore/typescript/tests/browser/**
|
||||
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/**
|
||||
- samples/client/petstore/typescript-fetch/builds/default/**
|
||||
- samples/client/petstore/typescript-fetch/builds/es6-target/**
|
||||
- samples/client/petstore/typescript-fetch/builds/with-npm-version/**
|
||||
- samples/client/petstore/typescript-fetch/tests/default/**
|
||||
#- samples/client/petstore/typescript-node/npm/**
|
||||
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/**
|
||||
- samples/client/petstore/typescript-axios/builds/with-npm-version/**
|
||||
#- samples/client/petstore/typescript-axios/tests/default/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build projects
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
ports:
|
||||
- 80:8080
|
||||
env:
|
||||
SWAGGER_HOST: http://petstore.swagger.io
|
||||
SWAGGER_BASE_PATH: /v2
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
#- "18.x"
|
||||
- "20.x"
|
||||
sample:
|
||||
- samples/client/others/typescript-angular/
|
||||
#- samples/client/petstore/typescript-angular-v12-provided-in-root/
|
||||
#- samples/client/petstore/typescript-angular-v13-provided-in-root/
|
||||
#- samples/client/petstore/typescript-angular-v14-provided-in-root/
|
||||
#- samples/client/petstore/typescript-angular-v15-provided-in-root/
|
||||
- samples/client/petstore/typescript-angular-v16-provided-in-root/
|
||||
- samples/client/petstore/typescript-angular-v17-provided-in-root/
|
||||
- samples/client/petstore/typescript-angular-v18-provided-in-root/
|
||||
- samples/client/petstore/typescript-angular-v19-provided-in-root/
|
||||
- samples/client/petstore/typescript-angular-v20-provided-in-root/
|
||||
- samples/openapi3/client/petstore/typescript/builds/default/
|
||||
#- samples/openapi3/client/petstore/typescript/tests/default/
|
||||
- samples/openapi3/client/petstore/typescript/builds/jquery/
|
||||
#- samples/openapi3/client/petstore/typescript/tests/jquery/
|
||||
- samples/openapi3/client/petstore/typescript/builds/object_params/
|
||||
#- samples/openapi3/client/petstore/typescript/tests/object_params/
|
||||
#- samples/openapi3/client/petstore/typescript/builds/inversify/
|
||||
#- samples/openapi3/client/petstore/typescript/tests/inversify/
|
||||
#- samples/openapi3/client/petstore/typescript/tests/deno/
|
||||
- samples/openapi3/client/petstore/typescript/builds/browser/
|
||||
#- samples/openapi3/client/petstore/typescript/tests/browser/
|
||||
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/
|
||||
- samples/client/petstore/typescript-fetch/builds/default/
|
||||
- samples/client/petstore/typescript-fetch/builds/es6-target/
|
||||
- samples/client/petstore/typescript-fetch/builds/with-npm-version/
|
||||
- samples/client/petstore/typescript-fetch/tests/default/
|
||||
#- samples/client/petstore/typescript-node/npm/
|
||||
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/
|
||||
- samples/client/petstore/typescript-axios/builds/with-npm-version/
|
||||
#- samples/client/petstore/typescript-axios/tests/default/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Add hosts to /etc/hosts
|
||||
run: |
|
||||
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '17' # Specify your desired Java version
|
||||
distribution: 'temurin' # Or 'adopt', 'oracle', etc.
|
||||
cache: maven # Cache Maven dependencies for faster builds
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: 'npm' # Or 'yarn'
|
||||
- name: mvn integration-test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: mvn integration-test
|
||||
34
.github/workflows/samples-typescript-server.yaml
vendored
34
.github/workflows/samples-typescript-server.yaml
vendored
@@ -1,34 +0,0 @@
|
||||
name: Samples TS servers
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/server/petstore/typescript-nestjs-server/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/server/petstore/typescript-nestjs-server/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build projects
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
- "18.x"
|
||||
- "20.x"
|
||||
sample:
|
||||
- samples/server/petstore/typescript-nestjs-server/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Use Node.js 20.x
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: 'npm' # Or 'yarn'
|
||||
- name: npm install
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: npm install
|
||||
- name: npm test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: npm test
|
||||
3
.github/workflows/windows.yaml
vendored
3
.github/workflows/windows.yaml
vendored
@@ -24,7 +24,6 @@ jobs:
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
@@ -40,7 +39,7 @@ jobs:
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
- name: Setup Maven
|
||||
uses: s4u/setup-maven-action@v1.19.0
|
||||
uses: s4u/setup-maven-action@v1.18.0
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
maven-version: 3.8.8
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -49,8 +49,6 @@ nb-configuration.xml
|
||||
*.xml~
|
||||
*.t~
|
||||
|
||||
**/.angular
|
||||
|
||||
/target
|
||||
/generated-files
|
||||
test-output/
|
||||
|
||||
@@ -11,15 +11,43 @@ export NODE_ENV=test
|
||||
|
||||
if [ "$NODE_INDEX" = "1" ]; then
|
||||
echo "Running node $NODE_INDEX ..."
|
||||
java -version
|
||||
|
||||
sudo apt-get -y install cpanminus
|
||||
|
||||
# install rust
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source "$HOME/.cargo/env"
|
||||
|
||||
echo "Testing perl"
|
||||
(cd samples/client/petstore/perl && /bin/bash ./test.bash)
|
||||
|
||||
echo "Testing ruby"
|
||||
(cd samples/client/petstore/ruby && mvn integration-test)
|
||||
(cd samples/client/petstore/ruby-faraday && mvn integration-test)
|
||||
(cd samples/client/petstore/ruby-httpx && mvn integration-test)
|
||||
(cd samples/client/petstore/ruby-autoload && mvn integration-test)
|
||||
|
||||
echo "Testing rust"
|
||||
(cd samples/server/petstore/rust-axum && mvn integration-test)
|
||||
|
||||
elif [ "$NODE_INDEX" = "2" ]; then
|
||||
echo "Running node $NODE_INDEX to test cpp-restsdk"
|
||||
echo "Running node $NODE_INDEX to test Go"
|
||||
# install haskell
|
||||
#curl -sSLk https://get.haskellstack.org/ | sh
|
||||
#stack upgrade
|
||||
#stack --version
|
||||
|
||||
# install curl
|
||||
#sudo apt-get -y build-dep libcurl4-gnutls-dev
|
||||
#sudo apt-get -y install libcurl4-gnutls-dev
|
||||
|
||||
# Install golang version 1.18
|
||||
go version
|
||||
sudo mkdir /usr/local/go1.18
|
||||
wget -c https://dl.google.com/go/go1.18.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.18
|
||||
export PATH="/usr/local/go1.18/go/bin:$PATH"
|
||||
go version
|
||||
|
||||
# install cpprestsdk
|
||||
sudo apt-get install libcpprest-dev
|
||||
@@ -34,15 +62,58 @@ elif [ "$NODE_INDEX" = "3" ]; then
|
||||
|
||||
echo "Running node $NODE_INDEX ... "
|
||||
|
||||
echo "Testing ruby"
|
||||
(cd samples/client/petstore/ruby && mvn integration-test)
|
||||
(cd samples/client/petstore/ruby-faraday && mvn integration-test)
|
||||
(cd samples/client/petstore/ruby-httpx && mvn integration-test)
|
||||
(cd samples/client/petstore/ruby-autoload && mvn integration-test)
|
||||
# Install node@stable (for angular 6)
|
||||
set +e
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
|
||||
export NVM_DIR="/opt/circleci/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
#nvm install stable
|
||||
# install v16 instead of the latest stable version
|
||||
nvm install 18
|
||||
nvm alias default 18
|
||||
node --version
|
||||
|
||||
# Each step uses the same `$BASH_ENV`, so need to modify it
|
||||
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
|
||||
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
|
||||
|
||||
(cd samples/client/others/typescript-angular && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-angular-v12-provided-in-root && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-angular-v13-provided-in-root && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-angular-v14-provided-in-root && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-angular-v15-provided-in-root && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-angular-v16-provided-in-root && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-angular-v17-provided-in-root && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-angular-v18-provided-in-root && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-angular-v19-provided-in-root && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/builds/default && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/tests/default && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/builds/jquery && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/tests/jquery && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/builds/object_params && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/tests/object_params && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/builds/inversify && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/tests/inversify && mvn integration-test)
|
||||
#(cd samples/openapi3/client/petstore/typescript/tests/deno && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/builds/browser && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/tests/browser && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/builds/nullable-enum && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-fetch/builds/default && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-fetch/builds/es6-target && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-fetch/builds/with-npm-version && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-fetch/tests/default && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-node/npm && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-rxjs/builds/with-npm-version && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-axios/builds/with-npm-version && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-axios/tests/default && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-axios/tests/with-complex-headers && mvn integration-test)
|
||||
(cd samples/client/petstore/javascript-flowtyped && mvn integration-test)
|
||||
(cd samples/client/petstore/javascript-es6 && mvn integration-test)
|
||||
(cd samples/client/petstore/javascript-promise-es6 && mvn integration-test)
|
||||
(cd samples/server/petstore/typescript-nestjs-server && mvn integration-test)
|
||||
|
||||
else
|
||||
echo "Running node $NODE_INDEX ..."
|
||||
java -version
|
||||
./mvnw clean install
|
||||
|
||||
fi
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
generatorName: jaxrs-spec
|
||||
outputDir: samples/server/petstore/jaxrs-spec-withxml/
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec
|
||||
additionalProperties:
|
||||
artifactId: jaxrs-spec-withxml-petstore-server
|
||||
serializableModel: "true"
|
||||
hideGenerationTimestamp: "true"
|
||||
generateBuilders: "true"
|
||||
withXml: true
|
||||
@@ -7,6 +7,7 @@ additionalProperties:
|
||||
packageName: petstore_api
|
||||
mapNumberTo: float
|
||||
poetry1: true
|
||||
enumUnknownDefaultCase: true
|
||||
nameMappings:
|
||||
_type: underscore_type
|
||||
type_: type_with_underscore
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
generatorName: typescript-angular
|
||||
outputDir: samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
|
||||
additionalProperties:
|
||||
ngVersion: 19.0.0
|
||||
supportsES6: true
|
||||
enumNameMappings:
|
||||
delivered: SHIPPED
|
||||
@@ -1,9 +0,0 @@
|
||||
generatorName: typescript-angular
|
||||
outputDir: samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
|
||||
additionalProperties:
|
||||
ngVersion: 20.0.0
|
||||
supportsES6: true
|
||||
enumNameMappings:
|
||||
delivered: SHIPPED
|
||||
@@ -1,7 +0,0 @@
|
||||
generatorName: typescript-fetch
|
||||
outputDir: samples/client/others/typescript-fetch/infinite-recursion-issue
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/infinite-recursion-issue.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript-fetch
|
||||
additionalProperties:
|
||||
enumPropertyNaming: "original"
|
||||
enumUnknownDefaultCase: true
|
||||
@@ -5,11 +5,11 @@ Running `./save_dart_keywords.sh` from this directory will generate `dart-keywor
|
||||
|
||||
## When should the keywords be generated?
|
||||
|
||||
`save_dart_keywords.sh` should be run when a new version of Dart is released to update the keywords file.
|
||||
`save_dart_keywords.sh` should be run when a new version of Dart is release to update the keywords file.
|
||||
|
||||
The last Dart version that was used to generate the keywords can be found in `dart-version.txt`.
|
||||
|
||||
## What does the shell script do?
|
||||
## What does the shellscript do?
|
||||
|
||||
1. run the dart app
|
||||
- `dart run save-dart-keywords.dart`
|
||||
|
||||
@@ -59,6 +59,6 @@
|
||||
sha256: 45cdaba3d2adc212cd4f0184ad475419a95e2326254c2ef84175e210c922b2f3
|
||||
# rust axum test files
|
||||
- filename: "samples/server/petstore/rust-axum/output/rust-axum-oneof/tests/oneof_with_discriminator.rs"
|
||||
sha256: b2093528aac971193f2863a70f46eea45cf8bda79120b133a614599e80d8b46d
|
||||
sha256: 2d4f5a069fdcb3057bb078d5e75b3de63cd477b97725e457079df24bd2c30600
|
||||
- filename: "samples/server/petstore/rust-axum/output/openapi-v3/tests/oneof_untagged.rs"
|
||||
sha256: 1d3fb01f65e98290b1d3eece28014c7d3e3f2fdf18e7110249d3c591cc4642ab
|
||||
|
||||
@@ -538,7 +538,6 @@ OpenAPI Normalizer transforms the input OpenAPI doc/spec (which may not perfectl
|
||||
|
||||
- SIMPLIFY_ONEOF_ANYOF
|
||||
- SIMPLIFY_BOOLEAN_ENUM
|
||||
- REFACTOR_ALLOF_WITH_PROPERTIES_ONLY
|
||||
|
||||
(One can use `DISABLE_ALL=true` to disable all the rules)
|
||||
|
||||
@@ -646,7 +645,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
|
||||
|
||||
- `FILTER`
|
||||
|
||||
The `FILTER` parameter allows selective inclusion of API operations based on specific criteria. It applies the `x-internal: true` property to operations that do **not** match the specified values, preventing them from being generated. Multiple filters can be separated by a semicolon.
|
||||
The `FILTER` parameter allows selective inclusion of API operations based on specific criteria. It applies the `x-internal: true` property to operations that do **not** match the specified values, preventing them from being generated.
|
||||
|
||||
### Available Filters
|
||||
|
||||
@@ -659,9 +658,6 @@ The `FILTER` parameter allows selective inclusion of API operations based on spe
|
||||
- **`tag`**
|
||||
When set to `tag:person|basic`, operations **not** tagged with `person` or `basic` will be marked as internal (`x-internal: true`), and will not be generated.
|
||||
|
||||
- **`path`**
|
||||
When set to `path:/v1|/v2`, operations on paths **not** starting with `/v1` or with `/v2` will be marked as internal (`x-internal: true`), and will not be generated.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```sh
|
||||
@@ -669,7 +665,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
|
||||
-g java \
|
||||
-i modules/openapi-generator/src/test/resources/3_0/petstore.yaml \
|
||||
-o /tmp/java-okhttp/ \
|
||||
--openapi-normalizer FILTER="operationId:addPet|getPetById ; tag:store"
|
||||
--openapi-normalizer FILTER="operationId:addPet|getPetById"
|
||||
```
|
||||
|
||||
- `SET_CONTAINER_TO_NULLABLE`: When set to `array|set|map` (or just `array`) for example, it will set `nullable` in array, set and map to true.
|
||||
|
||||
@@ -5,7 +5,7 @@ title: Debugging
|
||||
|
||||
## Generation
|
||||
|
||||
As a user there may be times when generated outputs don't match your expectations and it's unclear why. The CLI supports a `--dry-run` option which may be used to inspect the anticipated file operations without making changes to the file system.
|
||||
As a user there may be times when generated outputs don't match your expectations it's unclear why. The CLI supports a `--dry-run` option which may be used to inspect the anticipated file operations without making changes to the file system.
|
||||
|
||||
Suppose you generate using the `--minimal-update` option, and you notice on subsequent generations of a client that no files have changed. This is by design.
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ id: generators
|
||||
title: Generators List
|
||||
---
|
||||
|
||||
[main] INFO o.o.c.l.PythonFastAPIServerCodegen - Skipping sorting of path operations, order matters, let the developer decide via their specification file.
|
||||
The following generators are available:
|
||||
|
||||
## CLIENT generators
|
||||
|
||||
@@ -95,7 +95,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|sourceFolder|source folder for generated code| |src/main/java|
|
||||
|springApiVersion|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).| |null|
|
||||
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|
||||
|title|server title name or client service name| |OpenAPI Spring|
|
||||
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
|
||||
@@ -133,10 +132,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|x-spring-paginated|Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object.|OPERATION|false
|
||||
|x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|OPERATION_PARAMETER|null
|
||||
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-size-message|Add this property whenever you need to customize the invalidation error message for the size or length of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-spring-api-version|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).|OPERATION|null
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
@@ -67,9 +67,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null
|
||||
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-size-message|Add this property whenever you need to customize the invalidation error message for the size or length of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-kotlin-implements|Ability to specify interfaces that model must implement|MODEL|empty array
|
||||
|x-kotlin-implements-fields|Specify attributes that are implemented by the interface(s) added via `x-kotlin-implements`|MODEL|empty array
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|dateFormat|date format for query parameters| |%Y-%m-%d|
|
||||
|datetimeFormat|datetime format for query parameters| |%Y-%m-%dT%H:%M:%S%z|
|
||||
|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|
|
||||
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.| |false|
|
||||
|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false|
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||
|lazyImports|Enable lazy imports.| |false|
|
||||
|
||||
@@ -27,7 +27,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|packageName|Rust package name (convention: lowercase).| |openapi|
|
||||
|packageVersion|Rust package version.| |1.0.0|
|
||||
|preferUnsignedInt|Prefer unsigned integers where minimum value is >= 0| |false|
|
||||
|reqwestDefaultFeatures|Default features for the reqwest dependency (comma-separated). Use empty for no defaults. This option is for 'reqwest' and 'reqwest-trait' library only.| |native-tls|
|
||||
|supportAsync|If set, generate async function call instead. This option is for 'reqwest' library only| |true|
|
||||
|supportMiddleware|If set, add support for reqwest-middleware. This option is for 'reqwest' and 'reqwest-trait' library only| |false|
|
||||
|supportMultipleResponses|If set, return type wraps an enum of all possible 2xx schemas. This option is for 'reqwest' and 'reqwest-trait' library only| |false|
|
||||
|
||||
@@ -88,7 +88,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|sourceFolder|source folder for generated code| |src/main/java|
|
||||
|springApiVersion|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).| |null|
|
||||
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|
||||
|title|server title name or client service name| |OpenAPI Spring|
|
||||
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
|
||||
@@ -126,10 +125,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|x-spring-paginated|Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object.|OPERATION|false
|
||||
|x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|OPERATION_PARAMETER|null
|
||||
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-size-message|Add this property whenever you need to customize the invalidation error message for the size or length of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null
|
||||
|x-spring-api-version|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).|OPERATION|null
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
@@ -44,7 +44,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|supportsES6|Generate code that conforms to ES6.| |false|
|
||||
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false|
|
||||
|useSquareBracketsInArrayNames|Setting this property to true will add brackets to array attribute names, e.g. my_values[].| |false|
|
||||
|withAWSV4Signature|whether to include AWS v4 signature support| |false|
|
||||
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|
||||
|withNodeImports|Setting this property to true adds imports for NodeJS| |false|
|
||||
|withSeparateModelsAndApi|Put the model and api in separate folders and in separate classes. This requires in addition a value for 'apiPackage' and 'modelPackage'| |false|
|
||||
@@ -292,7 +291,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|
||||
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
|
||||
|SignatureAuth|✗|OAS3
|
||||
|AWSV4Signature|✓|ToolingExtension
|
||||
|AWSV4Signature|✗|ToolingExtension
|
||||
|
||||
### Wire Format Feature
|
||||
| Name | Supported | Defined By |
|
||||
|
||||
@@ -29,7 +29,6 @@ import io.airlift.airline.Arguments;
|
||||
import io.airlift.airline.Command;
|
||||
import io.airlift.airline.Option;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.ClientOptInput;
|
||||
import org.openapitools.codegen.CodegenConfig;
|
||||
@@ -249,7 +248,7 @@ public class GenerateBatch extends OpenApiGeneratorCommand {
|
||||
Path filesMeta = Paths.get(outDir.toAbsolutePath().toString(), ".openapi-generator", "FILES");
|
||||
if (filesMeta.toFile().exists()) {
|
||||
FileUtils.readLines(filesMeta.toFile(), StandardCharsets.UTF_8).forEach(relativePath -> {
|
||||
if (!Strings.CS.startsWith(relativePath, ".")) {
|
||||
if (!StringUtils.startsWith(relativePath, ".")) {
|
||||
Path file = outDir.resolve(relativePath).toAbsolutePath();
|
||||
// hack: disallow directory traversal outside of output directory. we don't want to delete wrong files.
|
||||
if (file.toString().startsWith(outDir.toAbsolutePath().toString())) {
|
||||
|
||||
@@ -456,31 +456,4 @@ public class CodegenConstants {
|
||||
public static final String USE_DEFAULT_VALUES_FOR_REQUIRED_VARS = "useDefaultValuesForRequiredVars";
|
||||
|
||||
public static final String DEFAULT_TO_EMPTY_CONTAINER = "defaultToEmptyContainer";
|
||||
|
||||
// Vendor extensions
|
||||
public static final String X_INTERNAL = "x-internal";
|
||||
public static final String X_PARENT = "x-parent";
|
||||
public static final String X_COMPOSED_DATA_TYPE = "x-composed-data-type";
|
||||
public static final String X_BASE_NAME = "x-base-name";
|
||||
public static final String X_IS_VALUE_TYPE = "x-is-value-type";
|
||||
public static final String X_IS_REFERENCE_TYPE = "x-is-reference-type";
|
||||
public static final String X_IS_NULLABLE_TYPE = "x-is-nullable-type";
|
||||
public static final String X_IS_BASE_OR_NEW_DISCRIMINATOR = "x-is-base-or-new-discriminator";
|
||||
public static final String X_ENUM_BYTE = "x-enum-byte";
|
||||
public static final String X_HTTP_STATUS = "x-http-status";
|
||||
public static final String X_HTTP_STATUSES_WITH_RETURN = "x-http-statuses-with-return";
|
||||
public static final String X_SET_COOKIE = "x-set-cookie";
|
||||
public static final String X_DUPLICATES = "x-duplicates";
|
||||
public static final String X_HTTP_STATUS_IS_DEFAULT = "x-http-status-is-default";
|
||||
public static final String X_ONLY_DEFAULT = "x-only-default";
|
||||
public static final String X_HTTP_STATUS_RANGE = "x-http-status-range";
|
||||
public static final String X_NOT_NULLABLE_REFERENCE_TYPES = "x-not-nullable-reference-types";
|
||||
public static final String X_HAS_NOT_NULLABLE_REFERENCE_TYPES = "x-has-not-nullable-reference-types";
|
||||
public static final String X_NULLABLE_VALUE_TYPE = "x-nullable-value-type";
|
||||
public static final String X_NULLABLE_TYPE = "x-nullable-type";
|
||||
public static final String X_CSHARP_VALUE_TYPE = "x-csharp-value-type";
|
||||
public static final String X_REGEX = "x-regex";
|
||||
public static final String X_MODIFIERS = "x-modifiers";
|
||||
public static final String X_MODIFIER_PREFIX = "x-modifier-";
|
||||
public static final String X_MODEL_IS_MUTABLE = "x-model-is-mutable";
|
||||
}
|
||||
|
||||
@@ -88,7 +88,8 @@ import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.*;
|
||||
import static org.openapitools.codegen.CodegenConstants.DEFAULT_TO_EMPTY_CONTAINER;
|
||||
import static org.openapitools.codegen.CodegenConstants.UNSUPPORTED_V310_SPEC_MSG;
|
||||
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
|
||||
import static org.openapitools.codegen.utils.OnceLogger.once;
|
||||
import static org.openapitools.codegen.utils.StringUtils.*;
|
||||
@@ -5196,7 +5197,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
String method = p.getKey();
|
||||
Operation op = p.getValue();
|
||||
|
||||
if (op.getExtensions() != null && Boolean.TRUE.equals(op.getExtensions().get(X_INTERNAL))) {
|
||||
if (op.getExtensions() != null && Boolean.TRUE.equals(op.getExtensions().get("x-internal"))) {
|
||||
// skip operation if x-internal sets to true
|
||||
LOGGER.info("Operation ({} {} - {}) not generated since x-internal is set to true",
|
||||
method, expression, op.getOperationId());
|
||||
@@ -5734,7 +5735,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
cs.name = key;
|
||||
cs.description = securityScheme.getDescription();
|
||||
cs.type = securityScheme.getType().toString();
|
||||
cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = cs.isOpenId = cs.isOAuth = false;
|
||||
cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = cs.isOpenId = false;
|
||||
cs.isHttpSignature = false;
|
||||
cs.isBasicBasic = cs.isBasicBearer = false;
|
||||
cs.scheme = securityScheme.getScheme();
|
||||
|
||||
@@ -61,7 +61,6 @@ import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.removeStart;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_INTERNAL;
|
||||
import static org.openapitools.codegen.utils.OnceLogger.once;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@@ -487,7 +486,7 @@ public class DefaultGenerator implements Generator {
|
||||
|
||||
Schema schema = ModelUtils.getSchemas(this.openAPI).get(name);
|
||||
|
||||
if (schema.getExtensions() != null && Boolean.TRUE.equals(schema.getExtensions().get(X_INTERNAL))) {
|
||||
if (schema.getExtensions() != null && Boolean.TRUE.equals(schema.getExtensions().get("x-internal"))) {
|
||||
LOGGER.info("Model {} not generated since x-internal is set to true", name);
|
||||
continue;
|
||||
} else if (ModelUtils.isFreeFormObject(schema, openAPI)) { // check to see if it's a free-form object
|
||||
@@ -1565,7 +1564,7 @@ public class DefaultGenerator implements Generator {
|
||||
final List<SecurityRequirement> globalSecurities = openAPI.getSecurity();
|
||||
for (Tag tag : tags) {
|
||||
try {
|
||||
if (operation.getExtensions() != null && Boolean.TRUE.equals(operation.getExtensions().get(X_INTERNAL))) {
|
||||
if (operation.getExtensions() != null && Boolean.TRUE.equals(operation.getExtensions().get("x-internal"))) {
|
||||
// skip operation if x-internal sets to true
|
||||
LOGGER.info("Operation ({} {} - {}) not generated since x-internal is set to true",
|
||||
httpMethod, resourcePath, operation.getOperationId());
|
||||
|
||||
@@ -37,8 +37,6 @@ import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_INTERNAL;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_PARENT;
|
||||
import static org.openapitools.codegen.utils.ModelUtils.simplifyOneOfAnyOfWithOnlyOneNonNullSubSchema;
|
||||
import static org.openapitools.codegen.utils.StringUtils.getUniqueString;
|
||||
|
||||
@@ -49,7 +47,7 @@ public class OpenAPINormalizer {
|
||||
|
||||
private TreeSet<String> anyTypeTreeSet = new TreeSet<>();
|
||||
|
||||
protected static final Logger LOGGER = LoggerFactory.getLogger(OpenAPINormalizer.class);
|
||||
protected final Logger LOGGER = LoggerFactory.getLogger(OpenAPINormalizer.class);
|
||||
|
||||
Set<String> ruleNames = new TreeSet<>();
|
||||
Set<String> rulesDefaultToTrue = new TreeSet<>();
|
||||
@@ -129,10 +127,15 @@ public class OpenAPINormalizer {
|
||||
|
||||
// when set to true, remove x-internal: true from models, operations
|
||||
final String REMOVE_X_INTERNAL = "REMOVE_X_INTERNAL";
|
||||
final String X_INTERNAL = "x-internal";
|
||||
boolean removeXInternal;
|
||||
|
||||
// when set (e.g. operationId:getPetById|addPet), filter out (or remove) everything else
|
||||
final String FILTER = "FILTER";
|
||||
HashSet<String> operationIdFilters = new HashSet<>();
|
||||
HashSet<String> methodFilters = new HashSet<>();
|
||||
|
||||
HashSet<String> tagFilters = new HashSet<>();
|
||||
|
||||
// when set (e.g. operationId:getPetById|addPet), filter out (or remove) everything else
|
||||
final String SET_CONTAINER_TO_NULLABLE = "SET_CONTAINER_TO_NULLABLE";
|
||||
@@ -211,7 +214,6 @@ public class OpenAPINormalizer {
|
||||
rules.put(SIMPLIFY_ONEOF_ANYOF, true);
|
||||
rules.put(SIMPLIFY_BOOLEAN_ENUM, true);
|
||||
rules.put(SIMPLIFY_ONEOF_ANYOF_ENUM, true);
|
||||
rules.put(REFACTOR_ALLOF_WITH_PROPERTIES_ONLY, true);
|
||||
|
||||
processRules(inputRules);
|
||||
|
||||
@@ -272,7 +274,30 @@ public class OpenAPINormalizer {
|
||||
|
||||
if (inputRules.get(FILTER) != null) {
|
||||
rules.put(FILTER, true);
|
||||
// actual parsing is delayed to allow customization of the Filter processing
|
||||
|
||||
String[] filterStrs = inputRules.get(FILTER).split(":");
|
||||
if (filterStrs.length != 2) { // only support operationId with : at the moment
|
||||
LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3` or `method:get|post|put` or `tag:tag1|tag2|tag3`: {}", inputRules.get(FILTER));
|
||||
} else {
|
||||
if ("operationId".equals(filterStrs[0])) {
|
||||
operationIdFilters = Arrays.stream(filterStrs[1].split("[|]"))
|
||||
.filter(Objects::nonNull)
|
||||
.map(String::trim)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
} else if ("method".equals(filterStrs[0])) {
|
||||
methodFilters = Arrays.stream(filterStrs[1].split("[|]"))
|
||||
.filter(Objects::nonNull)
|
||||
.map(String::trim)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
} else if ("tag".equals(filterStrs[0])) {
|
||||
tagFilters = Arrays.stream(filterStrs[1].split("[|]"))
|
||||
.filter(Objects::nonNull)
|
||||
.map(String::trim)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
} else {
|
||||
LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3` or `method:get|post|put` or `tag:tag1|tag2|tag3`: {}", inputRules.get(FILTER));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inputRules.get(SET_CONTAINER_TO_NULLABLE) != null) {
|
||||
@@ -318,19 +343,6 @@ public class OpenAPINormalizer {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the filter to process the FILTER normalizer.
|
||||
* Override this to create a custom filter normalizer.
|
||||
*
|
||||
* @param openApi Contract used in the filtering (could be used for customization).
|
||||
* @param filters full FILTER value
|
||||
*
|
||||
* @return a Filter containing the parsed filters.
|
||||
*/
|
||||
protected Filter createFilter(OpenAPI openApi, String filters) {
|
||||
return new Filter(filters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes the OpenAPI input, which may not perfectly conform to
|
||||
* the specification.
|
||||
@@ -392,15 +404,15 @@ public class OpenAPINormalizer {
|
||||
"trace", PathItem::getTrace
|
||||
);
|
||||
|
||||
if (Boolean.TRUE.equals(getRule(FILTER))) {
|
||||
String filters = inputRules.get(FILTER);
|
||||
Filter filter = createFilter(this.openAPI, filters);
|
||||
if (filter.parse()) {
|
||||
// Iterates over each HTTP method in methodMap, retrieves the corresponding Operations from the PathItem,
|
||||
// and marks it as internal (`x-internal=true`) if the method/operationId/tag/path is not in the filters.
|
||||
filter.apply(pathsEntry.getKey(), path, methodMap);
|
||||
// Iterates over each HTTP method in methodMap, retrieves the corresponding Operation from the PathItem,
|
||||
// and marks it as internal (`x-internal`) if the method is not in methodFilters.
|
||||
methodMap.forEach((method, getter) -> {
|
||||
Operation operation = getter.apply(path);
|
||||
if (operation != null && !methodFilters.isEmpty()) {
|
||||
LOGGER.info("operation `{}` marked internal only (x-internal: `{}`) by the method FILTER", operation.getOperationId(), !methodFilters.contains(method));
|
||||
operation.addExtension("x-internal", !methodFilters.contains(method));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Include callback operation as well
|
||||
for (Operation operation : path.readOperations()) {
|
||||
@@ -417,6 +429,22 @@ public class OpenAPINormalizer {
|
||||
normalizeParameters(path.getParameters());
|
||||
|
||||
for (Operation operation : operations) {
|
||||
if (operationIdFilters.size() > 0) {
|
||||
if (operationIdFilters.contains(operation.getOperationId())) {
|
||||
operation.addExtension("x-internal", false);
|
||||
} else {
|
||||
LOGGER.info("operation `{}` marked as internal only (x-internal: true) by the operationId FILTER", operation.getOperationId());
|
||||
operation.addExtension("x-internal", true);
|
||||
}
|
||||
} else if (!tagFilters.isEmpty()) {
|
||||
if (operation.getTags().stream().anyMatch(tagFilters::contains)) {
|
||||
operation.addExtension("x-internal", false);
|
||||
} else {
|
||||
LOGGER.info("operation `{}` marked as internal only (x-internal: true) by the tag FILTER", operation.getOperationId());
|
||||
operation.addExtension("x-internal", true);
|
||||
}
|
||||
}
|
||||
|
||||
normalizeOperation(operation);
|
||||
normalizeRequestBody(operation);
|
||||
normalizeParameters(operation.getParameters());
|
||||
@@ -695,17 +723,15 @@ public class OpenAPINormalizer {
|
||||
if (skipNormalization(schema, visitedSchemas)) {
|
||||
return schema;
|
||||
}
|
||||
|
||||
if (ModelUtils.isNullTypeSchema(openAPI, schema)) {
|
||||
return schema;
|
||||
}
|
||||
|
||||
markSchemaAsVisited(schema, visitedSchemas);
|
||||
|
||||
if (ModelUtils.isArraySchema(schema)) { // array
|
||||
Schema result = normalizeArraySchema(schema);
|
||||
normalizeSchema(result.getItems(), visitedSchemas);
|
||||
return result;
|
||||
} else if (schema.getAdditionalProperties() instanceof Schema) { // map
|
||||
normalizeMapSchema(schema);
|
||||
normalizeSchema((Schema) schema.getAdditionalProperties(), visitedSchemas);
|
||||
} else if (ModelUtils.isOneOf(schema)) { // oneOf
|
||||
return normalizeOneOf(schema, visitedSchemas);
|
||||
} else if (ModelUtils.isAnyOf(schema)) { // anyOf
|
||||
@@ -742,9 +768,6 @@ public class OpenAPINormalizer {
|
||||
return schema;
|
||||
} else if (schema.getProperties() != null && !schema.getProperties().isEmpty()) {
|
||||
normalizeProperties(schema.getProperties(), visitedSchemas);
|
||||
} else if (schema.getAdditionalProperties() instanceof Schema) { // map
|
||||
normalizeMapSchema(schema);
|
||||
normalizeSchema((Schema) schema.getAdditionalProperties(), visitedSchemas);
|
||||
} else if (schema instanceof BooleanSchema) {
|
||||
normalizeBooleanSchema(schema, visitedSchemas);
|
||||
} else if (schema instanceof IntegerSchema) {
|
||||
@@ -826,20 +849,6 @@ public class OpenAPINormalizer {
|
||||
}
|
||||
for (Map.Entry<String, Schema> propertiesEntry : properties.entrySet()) {
|
||||
Schema property = propertiesEntry.getValue();
|
||||
|
||||
// remove x-internal if needed (same logic as normalizeComponentsSchemas)
|
||||
if (property.getExtensions() != null && getRule(REMOVE_X_INTERNAL)) {
|
||||
Object xInternalValue = property.getExtensions().get(X_INTERNAL);
|
||||
boolean isInternal = false;
|
||||
if (xInternalValue instanceof Boolean) {
|
||||
isInternal = (Boolean) xInternalValue;
|
||||
} else if (xInternalValue instanceof String) {
|
||||
isInternal = Boolean.parseBoolean((String) xInternalValue);
|
||||
}
|
||||
if (isInternal) {
|
||||
property.getExtensions().remove(X_INTERNAL);
|
||||
}
|
||||
}
|
||||
Schema newProperty = normalizeSchema(property, new HashSet<>());
|
||||
propertiesEntry.setValue(newProperty);
|
||||
}
|
||||
@@ -1002,7 +1011,6 @@ public class OpenAPINormalizer {
|
||||
if (schema.getAnyOf() == null) {
|
||||
return schema;
|
||||
}
|
||||
|
||||
for (int i = 0; i < schema.getAnyOf().size(); i++) {
|
||||
// normalize anyOf sub schemas one by one
|
||||
Object item = schema.getAnyOf().get(i);
|
||||
@@ -1075,10 +1083,10 @@ public class OpenAPINormalizer {
|
||||
refSchema.setExtensions(new HashMap<>());
|
||||
}
|
||||
|
||||
if (refSchema.getExtensions().containsKey(X_PARENT)) {
|
||||
if (refSchema.getExtensions().containsKey("x-parent")) {
|
||||
// doing nothing as x-parent already exists
|
||||
} else {
|
||||
refSchema.getExtensions().put(X_PARENT, true);
|
||||
refSchema.getExtensions().put("x-parent", true);
|
||||
}
|
||||
|
||||
LOGGER.debug("processUseAllOfRefAsParent added `x-parent: true` to {}", refSchema);
|
||||
@@ -1100,7 +1108,7 @@ public class OpenAPINormalizer {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Boolean.parseBoolean(String.valueOf(operation.getExtensions().get(X_INTERNAL)))) {
|
||||
if (Boolean.parseBoolean(String.valueOf(operation.getExtensions().get("x-internal")))) {
|
||||
operation.getExtensions().remove(X_INTERNAL);
|
||||
}
|
||||
}
|
||||
@@ -1334,7 +1342,7 @@ public class OpenAPINormalizer {
|
||||
*
|
||||
* @param schema Schema to modify
|
||||
* @param subSchemas List of sub-schemas to check
|
||||
* @param composedType Type of composed schema ("oneOf" or "anyOf")
|
||||
* @param schemaType Type of composed schema ("oneOf" or "anyOf")
|
||||
* @return Simplified schema
|
||||
*/
|
||||
protected Schema simplifyComposedSchemaWithEnums(Schema schema, List<Object> subSchemas, String composedType) {
|
||||
@@ -1803,164 +1811,4 @@ public class OpenAPINormalizer {
|
||||
}
|
||||
|
||||
// ===================== end of rules =====================
|
||||
|
||||
protected static class Filter {
|
||||
public static final String OPERATION_ID = "operationId";
|
||||
public static final String METHOD = "method";
|
||||
public static final String TAG = "tag";
|
||||
public static final String PATH = "path";
|
||||
private final String filters;
|
||||
protected Set<String> operationIdFilters = Collections.emptySet();
|
||||
protected Set<String> methodFilters = Collections.emptySet();
|
||||
protected Set<String> tagFilters = Collections.emptySet();
|
||||
protected Set<String> pathStartingWithFilters = Collections.emptySet();
|
||||
private boolean hasFilter;
|
||||
|
||||
protected Filter(String filters) {
|
||||
this.filters = filters.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform the parsing of the filter string.
|
||||
*
|
||||
* @return true if filters need to be processed
|
||||
*/
|
||||
public boolean parse() {
|
||||
if (StringUtils.isEmpty(filters)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
doParse();
|
||||
return hasFilter();
|
||||
} catch (RuntimeException e) {
|
||||
String message = String.format(Locale.ROOT, "FILTER rule [%s] must be in the form of `%s:name1|name2|name3` or `%s:get|post|put` or `%s:tag1|tag2|tag3` or `%s:/v1|/v2`. Error: %s",
|
||||
filters, Filter.OPERATION_ID, Filter.METHOD, Filter.TAG, Filter.PATH, e.getMessage());
|
||||
// throw an exception. This is a breaking change compared to pre 7.16.0
|
||||
// Workaround: fix the syntax!
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
private void doParse() {
|
||||
for (String filter : filters.split(";")) {
|
||||
filter = filter.trim();
|
||||
String[] filterStrs = filter.split(":");
|
||||
if (filterStrs.length != 2) { // only support filter with : at the moment
|
||||
throw new IllegalArgumentException("filter with no value not supported :[" + filter + "]");
|
||||
} else {
|
||||
String filterKey = filterStrs[0].trim();
|
||||
String filterValue = filterStrs[1];
|
||||
Set<String> parsedFilters = splitByPipe(filterValue);
|
||||
hasFilter = true;
|
||||
if (OPERATION_ID.equals(filterKey)) {
|
||||
operationIdFilters = parsedFilters;
|
||||
} else if (METHOD.equals(filterKey)) {
|
||||
methodFilters = parsedFilters;
|
||||
} else if (TAG.equals(filterKey)) {
|
||||
tagFilters = parsedFilters;
|
||||
} else if (PATH.equals(filterKey)) {
|
||||
pathStartingWithFilters = parsedFilters;
|
||||
} else {
|
||||
parse(filterKey, filterValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Split the filterValue by pipe.
|
||||
*
|
||||
* @return the split values.
|
||||
*/
|
||||
protected Set<String> splitByPipe(String filterValue) {
|
||||
return Arrays.stream(filterValue.split("[|]"))
|
||||
.filter(Objects::nonNull)
|
||||
.map(String::trim)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse non default filters.
|
||||
*
|
||||
* Override this method to add custom parsing logic.
|
||||
*
|
||||
* By default throws IllegalArgumentException.
|
||||
*
|
||||
* @param filterName name of the filter
|
||||
* @param filterValue value of the filter
|
||||
*/
|
||||
protected void parse(String filterName, String filterValue) {
|
||||
parseFails(filterName, filterValue);
|
||||
}
|
||||
|
||||
protected void parseFails(String filterName, String filterValue) {
|
||||
throw new IllegalArgumentException("filter not supported :[" + filterName + ":" + filterValue + "]");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if the OpenAPI contract match an extra filter.
|
||||
*
|
||||
* Override this method to add custom logic.
|
||||
*
|
||||
* @param operation Openapi Operation
|
||||
* @param path Path of the operation
|
||||
*
|
||||
* @return true if the operation of path match the filter
|
||||
*/
|
||||
protected boolean hasCustomFilterMatch(String path, Operation operation) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasFilter() {
|
||||
return hasFilter;
|
||||
}
|
||||
|
||||
public void apply(String path, PathItem pathItem, Map<String, Function<PathItem, Operation>> methodMap) {
|
||||
methodMap.forEach((method, getter) -> {
|
||||
Operation operation = getter.apply(pathItem);
|
||||
if (operation != null) {
|
||||
boolean found = false;
|
||||
found |= logIfMatch(PATH, operation, hasPathStarting(path));
|
||||
found |= logIfMatch(TAG, operation, hasTag(operation));
|
||||
found |= logIfMatch(OPERATION_ID, operation, hasOperationId(operation));
|
||||
found |= logIfMatch(METHOD, operation, hasMethod(method));
|
||||
found |= hasCustomFilterMatch(path, operation);
|
||||
|
||||
operation.addExtension(X_INTERNAL, !found);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected boolean logIfMatch(String filterName, Operation operation, boolean filterMatched) {
|
||||
if (filterMatched) {
|
||||
logMatch(filterName, operation);
|
||||
}
|
||||
return filterMatched;
|
||||
}
|
||||
|
||||
protected void logMatch(String filterName, Operation operation) {
|
||||
getLogger().info("operation `{}` marked as internal only (x-internal: true) by the {} FILTER", operation.getOperationId(), filterName);
|
||||
}
|
||||
|
||||
protected Logger getLogger() {
|
||||
return OpenAPINormalizer.LOGGER;
|
||||
}
|
||||
|
||||
private boolean hasPathStarting(String path) {
|
||||
return pathStartingWithFilters.stream().anyMatch(filter -> path.startsWith(filter));
|
||||
}
|
||||
|
||||
private boolean hasTag( Operation operation) {
|
||||
return operation.getTags() != null && operation.getTags().stream().anyMatch(tagFilters::contains);
|
||||
}
|
||||
|
||||
private boolean hasOperationId(Operation operation) {
|
||||
return operationIdFilters.contains(operation.getOperationId());
|
||||
}
|
||||
|
||||
private boolean hasMethod(String method) {
|
||||
return methodFilters.contains(method);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ public enum VendorExtension {
|
||||
X_KOTLIN_IMPLEMENTS("x-kotlin-implements", ExtensionLevel.MODEL, "Ability to specify interfaces that model must implement", "empty array"),
|
||||
X_KOTLIN_IMPLEMENTS_FIELDS("x-kotlin-implements-fields", ExtensionLevel.MODEL, "Specify attributes that are implemented by the interface(s) added via `x-kotlin-implements`", "empty array"),
|
||||
X_SPRING_PAGINATED("x-spring-paginated", ExtensionLevel.OPERATION, "Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object.", "false"),
|
||||
X_SPRING_API_VERSION("x-spring-api-version", ExtensionLevel.OPERATION, "Value for 'version' attribute in @RequestMapping (for Spring 7 and above).", null),
|
||||
X_SPRING_PROVIDE_ARGS("x-spring-provide-args", ExtensionLevel.OPERATION, "Allows adding additional hidden parameters in the API specification to allow access to content such as header values or properties", "empty array"),
|
||||
X_DISCRIMINATOR_VALUE("x-discriminator-value", ExtensionLevel.MODEL, "Used with model inheritance to specify value for discriminator that identifies current model", ""),
|
||||
X_SETTER_EXTRA_ANNOTATION("x-setter-extra-annotation", ExtensionLevel.FIELD, "Custom annotation that can be specified over java setter for specific field", "When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value"),
|
||||
@@ -27,10 +26,8 @@ public enum VendorExtension {
|
||||
X_OPERATION_EXTRA_ANNOTATION("x-operation-extra-annotation", ExtensionLevel.OPERATION, "List of custom annotations to be added to operation", null),
|
||||
X_VERSION_PARAM("x-version-param", ExtensionLevel.OPERATION_PARAMETER, "Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false", null),
|
||||
X_PATTERN_MESSAGE("x-pattern-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable", null),
|
||||
X_SIZE_MESSAGE("x-size-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the size or length of a variable", null),
|
||||
X_MINIMUM_MESSAGE("x-minimum-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the minimum value of a variable", null),
|
||||
X_MAXIMUM_MESSAGE("x-maximum-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the maximum value of a variable", null),
|
||||
X_ZERO_BASED_ENUM("x-zero-based-enum", ExtensionLevel.MODEL, "When used on an enum, the index will not be generated and the default numbering will be used, zero-based", "false");
|
||||
X_ZERO_BASED_ENUM("x-zero-based-enum", ExtensionLevel.MODEL, "When used on an enum, the index will not be generated and the default numbering will be used, zero-based", "false"),
|
||||
;
|
||||
|
||||
private final String name;
|
||||
private final List<ExtensionLevel> levels;
|
||||
|
||||
@@ -46,7 +46,6 @@ import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.*;
|
||||
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
|
||||
import static org.openapitools.codegen.utils.ModelUtils.getSchemaItems;
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
@@ -117,9 +116,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
// A cache to efficiently lookup schema `toModelName()` based on the schema Key
|
||||
private final Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
|
||||
|
||||
// A cache to efficiently lookup CodegenModel `fromModel(codegenModelName, parentModelSchema)` based on the pair of model name and schema
|
||||
private final Map<Map.Entry<String, Schema>, CodegenModel> codegenModelNameAndSchemaKeyToCodegenModelCache = new HashMap<>();
|
||||
|
||||
public AbstractCSharpCodegen() {
|
||||
super();
|
||||
|
||||
@@ -547,7 +543,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
if (dataTypeSet.contains(oneOfProperty.dataType)) {
|
||||
// add "x-duplicated-data-type" to indicate if the dataType already occurs before
|
||||
// in other sub-schemas of allOf/anyOf/oneOf
|
||||
oneOfProperty.vendorExtensions.putIfAbsent(X_COMPOSED_DATA_TYPE, true);
|
||||
oneOfProperty.vendorExtensions.putIfAbsent("x-composed-data-type", true);
|
||||
} else {
|
||||
dataTypeSet.add(oneOfProperty.dataType);
|
||||
}
|
||||
@@ -561,7 +557,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
if (dataTypeSet.contains(anyOfProperty.dataType)) {
|
||||
// add "x-duplicated-data-type" to indicate if the dataType already occurs before
|
||||
// in other sub-schemas of allOf/anyOf/oneOf
|
||||
anyOfProperty.vendorExtensions.putIfAbsent(X_COMPOSED_DATA_TYPE, true);
|
||||
anyOfProperty.vendorExtensions.putIfAbsent("x-composed-data-type", true);
|
||||
} else {
|
||||
dataTypeSet.add(anyOfProperty.dataType);
|
||||
}
|
||||
@@ -623,7 +619,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
continue;
|
||||
}
|
||||
|
||||
model.vendorExtensions.put(X_MODEL_IS_MUTABLE, modelIsMutable(model, null));
|
||||
model.vendorExtensions.put("x-model-is-mutable", modelIsMutable(model, null));
|
||||
|
||||
CodegenComposedSchemas composedSchemas = model.getComposedSchemas();
|
||||
if (composedSchemas != null) {
|
||||
@@ -643,7 +639,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
patchProperty(enumRefs, model, property);
|
||||
property.name = patchPropertyName(model, property, camelize(property.baseType), composedPropertyNames);
|
||||
property.isNullable = true;
|
||||
property.vendorExtensions.put(X_BASE_NAME, model.name.substring(model.name.lastIndexOf('_') + 1));
|
||||
property.vendorExtensions.put("x-base-name", model.name.substring(model.name.lastIndexOf('_') + 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,7 +650,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
patchProperty(enumRefs, model, property);
|
||||
property.name = patchPropertyName(model, property, camelize(property.baseType), composedPropertyNames);
|
||||
property.isNullable = true;
|
||||
property.vendorExtensions.put(X_BASE_NAME, model.name.substring(model.name.lastIndexOf('_') + 1));
|
||||
property.vendorExtensions.put("x-base-name", model.name.substring(model.name.lastIndexOf('_') + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -788,10 +784,10 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
|
||||
private void patchPropertyVendorExtensions(CodegenProperty property) {
|
||||
boolean isValueType = isValueType(property);
|
||||
property.vendorExtensions.put(X_IS_VALUE_TYPE, isValueType);
|
||||
property.vendorExtensions.put(X_IS_REFERENCE_TYPE, !isValueType);
|
||||
property.vendorExtensions.put(X_IS_NULLABLE_TYPE, this.getNullableReferencesTypes() || isValueType);
|
||||
property.vendorExtensions.put(X_IS_BASE_OR_NEW_DISCRIMINATOR, (property.isDiscriminator && !property.isInherited) || (property.isDiscriminator && property.isNew));
|
||||
property.vendorExtensions.put("x-is-value-type", isValueType);
|
||||
property.vendorExtensions.put("x-is-reference-type", !isValueType);
|
||||
property.vendorExtensions.put("x-is-nullable-type", this.getNullableReferencesTypes() || isValueType);
|
||||
property.vendorExtensions.put("x-is-base-or-new-discriminator", (property.isDiscriminator && !property.isInherited) || (property.isDiscriminator && property.isNew));
|
||||
}
|
||||
|
||||
protected void patchPropertyIsInherited(CodegenModel model, CodegenProperty property) {
|
||||
@@ -892,7 +888,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
// Because C# uses nullable primitives for datatype, and datatype is used in DefaultCodegen for determining enum-ness, guard against weirdness here.
|
||||
if (var.isEnum) {
|
||||
if ("byte".equals(var.dataFormat)) {// C# Actually supports byte and short enums.
|
||||
var.vendorExtensions.put(X_ENUM_BYTE, true);
|
||||
var.vendorExtensions.put("x-enum-byte", true);
|
||||
var.isString = false;
|
||||
var.isLong = false;
|
||||
var.isInteger = false;
|
||||
@@ -913,7 +909,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
}
|
||||
|
||||
private void postProcessResponseCode(CodegenResponse response, String status, Set<String> httpStatusesWithReturn) {
|
||||
response.vendorExtensions.put(X_HTTP_STATUS, status);
|
||||
response.vendorExtensions.put("x-http-status", status);
|
||||
if (response.dataType != null) {
|
||||
httpStatusesWithReturn.add(status);
|
||||
}
|
||||
@@ -946,11 +942,11 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
}
|
||||
|
||||
private void postProcessOperations(OperationMap operations, List<ModelMap> allModels) {
|
||||
Set<String> httpStatusesWithReturn = additionalProperties.get(X_HTTP_STATUSES_WITH_RETURN) instanceof Set<?>
|
||||
? (Set<String>) additionalProperties.get(X_HTTP_STATUSES_WITH_RETURN)
|
||||
Set<String> httpStatusesWithReturn = additionalProperties.get("x-http-statuses-with-return") instanceof Set<?>
|
||||
? (Set<String>) additionalProperties.get("x-http-statuses-with-return")
|
||||
: new HashSet<String>();
|
||||
|
||||
additionalProperties.put(X_HTTP_STATUSES_WITH_RETURN, httpStatusesWithReturn);
|
||||
additionalProperties.put("x-http-statuses-with-return", httpStatusesWithReturn);
|
||||
|
||||
HashMap<String, CodegenModel> modelMaps = ModelMap.toCodegenModelMap(allModels);
|
||||
|
||||
@@ -959,7 +955,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
for (CodegenOperation operation : ops) {
|
||||
String duplicates = duplicateOf.get(operation.operationId);
|
||||
if (duplicates != null) {
|
||||
operation.vendorExtensions.put(X_DUPLICATES, duplicates);
|
||||
operation.vendorExtensions.put("x-duplicates", duplicates);
|
||||
} else {
|
||||
duplicateOf.put(operation.operationId, operations.getClassname());
|
||||
}
|
||||
@@ -968,13 +964,13 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
|
||||
if (response.returnProperty != null) {
|
||||
Boolean isValueType = isValueType(response.returnProperty);
|
||||
response.vendorExtensions.put(X_IS_VALUE_TYPE, isValueType);
|
||||
response.vendorExtensions.put(X_IS_REFERENCE_TYPE, !isValueType);
|
||||
response.vendorExtensions.put("x-is-value-type", isValueType);
|
||||
response.vendorExtensions.put("x-is-reference-type", !isValueType);
|
||||
}
|
||||
|
||||
if (response.headers != null && response.headers.stream().anyMatch(h -> h.baseName.equals("Set-Cookie"))) {
|
||||
response.vendorExtensions.put(X_SET_COOKIE, true);
|
||||
operation.vendorExtensions.put(X_SET_COOKIE, true);
|
||||
response.vendorExtensions.put("x-set-cookie", true);
|
||||
operation.vendorExtensions.put("x-set-cookie", true);
|
||||
}
|
||||
|
||||
String code = response.code.toLowerCase(Locale.ROOT);
|
||||
@@ -982,9 +978,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
case "default":
|
||||
case "0":
|
||||
postProcessResponseCode(response, "Default", httpStatusesWithReturn);
|
||||
response.vendorExtensions.put(X_HTTP_STATUS_IS_DEFAULT, true);
|
||||
response.vendorExtensions.put("x-http-status-is-default", true);
|
||||
if ((long) operation.responses.size() == 1) {
|
||||
response.vendorExtensions.put(X_ONLY_DEFAULT, true);
|
||||
response.vendorExtensions.put("x-only-default", true);
|
||||
}
|
||||
break;
|
||||
case "100":
|
||||
@@ -1165,23 +1161,23 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
postProcessResponseCode(response, "NetworkAuthenticationRequired", httpStatusesWithReturn);
|
||||
break;
|
||||
case "1xx":
|
||||
response.vendorExtensions.put(X_HTTP_STATUS_RANGE, 1);
|
||||
response.vendorExtensions.put("x-http-status-range", 1);
|
||||
postProcessResponseCode(response, "HttpStatusCode1XX", httpStatusesWithReturn);
|
||||
break;
|
||||
case "2xx":
|
||||
response.vendorExtensions.put(X_HTTP_STATUS_RANGE, 2);
|
||||
response.vendorExtensions.put("x-http-status-range", 2);
|
||||
postProcessResponseCode(response, "HttpStatusCode2XX", httpStatusesWithReturn);
|
||||
break;
|
||||
case "3xx":
|
||||
response.vendorExtensions.put(X_HTTP_STATUS_RANGE, 3);
|
||||
response.vendorExtensions.put("x-http-status-range", 3);
|
||||
postProcessResponseCode(response, "HttpStatusCode3XX", httpStatusesWithReturn);
|
||||
break;
|
||||
case "4xx":
|
||||
response.vendorExtensions.put(X_HTTP_STATUS_RANGE, 4);
|
||||
response.vendorExtensions.put("x-http-status-range", 4);
|
||||
postProcessResponseCode(response, "HttpStatusCode4XX", httpStatusesWithReturn);
|
||||
break;
|
||||
case "5xx":
|
||||
response.vendorExtensions.put(X_HTTP_STATUS_RANGE, 5);
|
||||
response.vendorExtensions.put("x-http-status-range", 5);
|
||||
postProcessResponseCode(response, "HttpStatusCode5XX", httpStatusesWithReturn);
|
||||
break;
|
||||
default:
|
||||
@@ -1282,9 +1278,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
patchParameter(model, parameter);
|
||||
}
|
||||
|
||||
List<CodegenParameter> referenceTypes = operation.allParams.stream().filter(p -> p.vendorExtensions.get(X_IS_VALUE_TYPE) == null && !p.isNullable).collect(Collectors.toList());
|
||||
operation.vendorExtensions.put(X_NOT_NULLABLE_REFERENCE_TYPES, referenceTypes);
|
||||
operation.vendorExtensions.put(X_HAS_NOT_NULLABLE_REFERENCE_TYPES, referenceTypes.size() > 0);
|
||||
List<CodegenParameter> referenceTypes = operation.allParams.stream().filter(p -> p.vendorExtensions.get("x-is-value-type") == null && !p.isNullable).collect(Collectors.toList());
|
||||
operation.vendorExtensions.put("x-not-nullable-reference-types", referenceTypes);
|
||||
operation.vendorExtensions.put("x-has-not-nullable-reference-types", referenceTypes.size() > 0);
|
||||
processOperation(operation);
|
||||
|
||||
// Remove constant params from allParams list and add to constantParams
|
||||
@@ -1295,7 +1291,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
|
||||
protected void patchVendorExtensionNullableValueType(CodegenParameter parameter) {
|
||||
if (parameter.isNullable && !parameter.isContainer && (this.getValueTypes().contains(parameter.dataType) || parameter.isEnum)) {
|
||||
parameter.vendorExtensions.put(X_NULLABLE_VALUE_TYPE, true);
|
||||
parameter.vendorExtensions.put("x-nullable-value-type", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1311,15 +1307,15 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
*/
|
||||
protected void patchVendorExtensionNullableValueTypeLegacy(CodegenParameter parameter) {
|
||||
if (parameter.isNullable && !parameter.isContainer && (this.getNullableTypes().contains(parameter.dataType) || parameter.isEnum)) {
|
||||
parameter.vendorExtensions.put(X_NULLABLE_VALUE_TYPE, true);
|
||||
parameter.vendorExtensions.put("x-nullable-value-type", true);
|
||||
}
|
||||
}
|
||||
|
||||
private void patchParameter(CodegenModel model, CodegenParameter parameter) {
|
||||
patchVendorExtensionNullableValueType(parameter);
|
||||
|
||||
if (this.getNullableReferencesTypes() || (parameter.vendorExtensions.get(X_NULLABLE_VALUE_TYPE) != null)) {
|
||||
parameter.vendorExtensions.put(X_NULLABLE_TYPE, true);
|
||||
if (this.getNullableReferencesTypes() || (parameter.vendorExtensions.get("x-nullable-value-type") != null)) {
|
||||
parameter.vendorExtensions.put("x-nullable-type", true);
|
||||
}
|
||||
|
||||
if (!isSupportNullable()) {
|
||||
@@ -1366,12 +1362,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
parameter.isEnum = true;
|
||||
parameter.allowableValues = model.allowableValues;
|
||||
parameter.isPrimitiveType = true;
|
||||
parameter.vendorExtensions.put(X_CSHARP_VALUE_TYPE, true);
|
||||
parameter.vendorExtensions.put("x-csharp-value-type", true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!parameter.isContainer && this.getNullableTypes().contains(parameter.dataType)) {
|
||||
parameter.vendorExtensions.put(X_CSHARP_VALUE_TYPE, true);
|
||||
parameter.vendorExtensions.put("x-csharp-value-type", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1381,12 +1377,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
parameter.isEnum = true;
|
||||
parameter.allowableValues = model.allowableValues;
|
||||
parameter.isPrimitiveType = true;
|
||||
parameter.vendorExtensions.put(X_IS_VALUE_TYPE, true);
|
||||
parameter.vendorExtensions.put("x-is-value-type", true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!parameter.isContainer && this.getValueTypes().contains(parameter.dataType)) {
|
||||
parameter.vendorExtensions.put(X_IS_VALUE_TYPE, true);
|
||||
parameter.vendorExtensions.put("x-is-value-type", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1628,7 +1624,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
Schema<?> target = ModelUtils.isGenerateAliasAsModel() ? p : schema;
|
||||
if (ModelUtils.isArraySchema(target)) {
|
||||
Schema<?> items = getSchemaItems(schema);
|
||||
return typeMapping.get("array") + "<" + getTypeDeclarationForArray(items) + ">";
|
||||
return getSchemaType(target) + "<" + getTypeDeclarationForArray(items) + ">";
|
||||
} else if (ModelUtils.isMapSchema(p)) {
|
||||
// Should we also support maps of maps?
|
||||
Schema<?> inner = ModelUtils.getAdditionalProperties(p);
|
||||
@@ -1707,17 +1703,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
return toModelName(name) + "Tests";
|
||||
}
|
||||
|
||||
protected CodegenModel getCodegenModel(String codegenModelName, Schema schema){
|
||||
var key = new AbstractMap.SimpleEntry<>(codegenModelName, schema);
|
||||
if(codegenModelNameAndSchemaKeyToCodegenModelCache.containsKey(key)){
|
||||
return codegenModelNameAndSchemaKeyToCodegenModelCache.get(key);
|
||||
}
|
||||
|
||||
CodegenModel model = super.fromModel(codegenModelName, schema);
|
||||
codegenModelNameAndSchemaKeyToCodegenModelCache.put(key, model);
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setNullableReferenceTypes(final Boolean nullReferenceTypesFlag) {
|
||||
this.nullReferenceTypesFlag = nullReferenceTypesFlag;
|
||||
additionalProperties.put("nullableReferenceTypes", nullReferenceTypesFlag);
|
||||
@@ -2065,13 +2050,13 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
||||
} else if (c == 'l') {
|
||||
modifiers.remove("CultureInvariant");
|
||||
} else {
|
||||
vendorExtensions.put(X_MODIFIER_PREFIX + c, c);
|
||||
vendorExtensions.put("x-modifier-" + c, c);
|
||||
}
|
||||
}
|
||||
|
||||
String regex = pattern.substring(start, end).replace("\"", "\"\"");
|
||||
vendorExtensions.put(X_REGEX, regex);
|
||||
vendorExtensions.put(X_MODIFIERS, modifiers);
|
||||
vendorExtensions.put("x-regex", regex);
|
||||
vendorExtensions.put("x-modifiers", modifiers);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ import org.slf4j.LoggerFactory;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_ENUM_BYTE;
|
||||
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||
@@ -434,7 +433,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
||||
if (model.dataType.startsWith("byte")) {
|
||||
// F# Actually supports byte and short enums, swagger spec only supports byte.
|
||||
isByte = true;
|
||||
model.vendorExtensions.put(X_ENUM_BYTE, true);
|
||||
model.vendorExtensions.put("x-enum-byte", true);
|
||||
} else if (model.dataType.startsWith("int32")) {
|
||||
isInteger = true;
|
||||
model.vendorExtensions.put("x-enum-integer", true);
|
||||
@@ -488,7 +487,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
||||
// Because C# uses nullable primitives for datatype, and datatype is used in DefaultCodegen for determining enum-ness, guard against weirdness here.
|
||||
if (var.isEnum) {
|
||||
if ("byte".equals(var.dataFormat)) {// C# Actually supports byte and short enums.
|
||||
var.vendorExtensions.put(X_ENUM_BYTE, true);
|
||||
var.vendorExtensions.put("x-enum-byte", true);
|
||||
var.isString = false;
|
||||
var.isLong = false;
|
||||
var.isInteger = false;
|
||||
|
||||
@@ -40,8 +40,6 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_MODIFIERS;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_REGEX;
|
||||
import static org.openapitools.codegen.utils.StringUtils.*;
|
||||
|
||||
|
||||
@@ -1355,9 +1353,9 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
|
||||
}
|
||||
}
|
||||
|
||||
vendorExtensions.put(X_REGEX, regex.replace("\"", "\\\""));
|
||||
vendorExtensions.put("x-regex", regex.replace("\"", "\\\""));
|
||||
vendorExtensions.put("x-pattern", pattern.replace("\"", "\\\""));
|
||||
vendorExtensions.put(X_MODIFIERS, modifiers);
|
||||
vendorExtensions.put("x-modifiers", modifiers);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||
import io.swagger.v3.oas.models.parameters.RequestBody;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||
@@ -47,8 +46,6 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_MODIFIERS;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_REGEX;
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
|
||||
public abstract class AbstractPythonConnexionServerCodegen extends AbstractPythonCodegen implements CodegenConfig {
|
||||
@@ -602,7 +599,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho
|
||||
@Override
|
||||
public String toModelImport(String name) {
|
||||
String modelImport;
|
||||
if (Strings.CS.startsWithAny(name, "import", "from")) {
|
||||
if (StringUtils.startsWithAny(name, "import", "from")) {
|
||||
modelImport = name;
|
||||
} else {
|
||||
modelImport = "from ";
|
||||
@@ -746,8 +743,8 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho
|
||||
}
|
||||
}
|
||||
|
||||
vendorExtensions.put(X_REGEX, regex);
|
||||
vendorExtensions.put(X_MODIFIERS, modifiers);
|
||||
vendorExtensions.put("x-regex", regex);
|
||||
vendorExtensions.put("x-modifiers", modifiers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,6 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_MODIFIERS;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_REGEX;
|
||||
import static org.openapitools.codegen.utils.StringUtils.*;
|
||||
|
||||
public abstract class AbstractPythonPydanticV1Codegen extends DefaultCodegen implements CodegenConfig {
|
||||
@@ -1917,9 +1915,9 @@ public abstract class AbstractPythonPydanticV1Codegen extends DefaultCodegen imp
|
||||
}
|
||||
}
|
||||
|
||||
vendorExtensions.put(X_REGEX, regex.replace("\"", "\\\""));
|
||||
vendorExtensions.put("x-regex", regex.replace("\"", "\\\""));
|
||||
vendorExtensions.put("x-pattern", pattern.replace("\"", "\\\""));
|
||||
vendorExtensions.put(X_MODIFIERS, modifiers);
|
||||
vendorExtensions.put("x-modifiers", modifiers);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ import java.net.URL;
|
||||
import java.util.*;
|
||||
|
||||
import static java.util.UUID.randomUUID;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_CSHARP_VALUE_TYPE;
|
||||
|
||||
public class AspNetServerCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
@@ -348,7 +347,7 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen {
|
||||
protected void updateCodegenParameterEnum(CodegenParameter parameter, CodegenModel model) {
|
||||
super.updateCodegenParameterEnumLegacy(parameter, model);
|
||||
|
||||
if (!parameter.required && parameter.vendorExtensions.get(X_CSHARP_VALUE_TYPE) != null) { //optional
|
||||
if (!parameter.required && parameter.vendorExtensions.get("x-csharp-value-type") != null) { //optional
|
||||
parameter.dataType = parameter.dataType + "?";
|
||||
}
|
||||
}
|
||||
@@ -628,7 +627,7 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen {
|
||||
super.patchProperty(enumRefs, model, property);
|
||||
|
||||
if (!property.isContainer && (this.getNullableTypes().contains(property.dataType) || property.isEnum)) {
|
||||
property.vendorExtensions.put(X_CSHARP_VALUE_TYPE, true);
|
||||
property.vendorExtensions.put("x-csharp-value-type", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isEmpty;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_CSHARP_VALUE_TYPE;
|
||||
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||
@@ -410,7 +409,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
super.updateCodegenParameterEnumLegacy(parameter, model);
|
||||
|
||||
if (!parameter.required && parameter.vendorExtensions.get(X_CSHARP_VALUE_TYPE) != null) { //optional
|
||||
if (!parameter.required && parameter.vendorExtensions.get("x-csharp-value-type") != null) { //optional
|
||||
parameter.dataType = parameter.dataType + "?";
|
||||
}
|
||||
}
|
||||
@@ -437,7 +436,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
if (allDefinitions != null && codegenModel != null && codegenModel.parent != null) {
|
||||
final Schema<?> parentModel = allDefinitions.get(toModelName(codegenModel.parent));
|
||||
if (parentModel != null) {
|
||||
final CodegenModel parentCodegenModel = getCodegenModel(codegenModel.parent, parentModel);
|
||||
final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, parentModel);
|
||||
if (codegenModel.hasEnums) {
|
||||
codegenModel = this.reconcileInlineEnums(codegenModel, parentCodegenModel);
|
||||
}
|
||||
@@ -1627,7 +1626,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
if (!GENERICHOST.equals(getLibrary())) {
|
||||
if (!property.isContainer && (this.getNullableTypes().contains(property.dataType) || property.isEnum)) {
|
||||
property.vendorExtensions.put(X_CSHARP_VALUE_TYPE, true);
|
||||
property.vendorExtensions.put("x-csharp-value-type", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ import java.net.URL;
|
||||
import java.util.*;
|
||||
|
||||
import static java.util.UUID.randomUUID;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_CSHARP_VALUE_TYPE;
|
||||
|
||||
public class CSharpFunctionsServerCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
@@ -288,7 +287,7 @@ public class CSharpFunctionsServerCodegen extends AbstractCSharpCodegen {
|
||||
super.patchProperty(enumRefs, model, property);
|
||||
|
||||
if (!property.isContainer && (this.getNullableTypes().contains(property.dataType) || property.isEnum)) {
|
||||
property.vendorExtensions.put(X_CSHARP_VALUE_TYPE, true);
|
||||
property.vendorExtensions.put("x-csharp-value-type", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +295,7 @@ public class CSharpFunctionsServerCodegen extends AbstractCSharpCodegen {
|
||||
protected void updateCodegenParameterEnum(CodegenParameter parameter, CodegenModel model) {
|
||||
super.updateCodegenParameterEnumLegacy(parameter, model);
|
||||
|
||||
if (!parameter.required && parameter.vendorExtensions.get(X_CSHARP_VALUE_TYPE) != null) { //optional
|
||||
if (!parameter.required && parameter.vendorExtensions.get("x-csharp-value-type") != null) { //optional
|
||||
parameter.dataType = parameter.dataType + "?";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isEmpty;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_CSHARP_VALUE_TYPE;
|
||||
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||
@@ -351,7 +350,7 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen {
|
||||
super.patchProperty(enumRefs, model, property);
|
||||
|
||||
if (!property.isContainer && (this.getNullableTypes().contains(property.dataType) || property.isEnum)) {
|
||||
property.vendorExtensions.put(X_CSHARP_VALUE_TYPE, true);
|
||||
property.vendorExtensions.put("x-csharp-value-type", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +358,7 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen {
|
||||
protected void updateCodegenParameterEnum(CodegenParameter parameter, CodegenModel model) {
|
||||
super.updateCodegenParameterEnumLegacy(parameter, model);
|
||||
|
||||
if (!parameter.required && parameter.vendorExtensions.get(X_CSHARP_VALUE_TYPE) != null) { //optional
|
||||
if (!parameter.required && parameter.vendorExtensions.get("x-csharp-value-type") != null) { //optional
|
||||
parameter.dataType = parameter.dataType + "?";
|
||||
}
|
||||
}
|
||||
@@ -381,7 +380,7 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen {
|
||||
if (allDefinitions != null && codegenModel != null && codegenModel.parent != null) {
|
||||
final Schema parentModel = allDefinitions.get(toModelName(codegenModel.parent));
|
||||
if (parentModel != null) {
|
||||
final CodegenModel parentCodegenModel = getCodegenModel(codegenModel.parent, parentModel);
|
||||
final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, parentModel);
|
||||
if (codegenModel.hasEnums) {
|
||||
codegenModel = this.reconcileInlineEnums(codegenModel, parentCodegenModel);
|
||||
}
|
||||
|
||||
@@ -226,7 +226,6 @@ public class ElixirClientCodegen extends DefaultCodegen {
|
||||
typeMapping.put("date", "Date.t");
|
||||
typeMapping.put("date-time", "DateTime.t");
|
||||
// other
|
||||
typeMapping.put("AnyType", "any()");
|
||||
typeMapping.put("ByteArray", "binary()");
|
||||
typeMapping.put("DateTime", "DateTime.t");
|
||||
typeMapping.put("UUID", "String.t");
|
||||
|
||||
@@ -1012,9 +1012,6 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
extensions.add(VendorExtension.X_DISCRIMINATOR_VALUE);
|
||||
extensions.add(VendorExtension.X_FIELD_EXTRA_ANNOTATION);
|
||||
extensions.add(VendorExtension.X_PATTERN_MESSAGE);
|
||||
extensions.add(VendorExtension.X_SIZE_MESSAGE);
|
||||
extensions.add(VendorExtension.X_MINIMUM_MESSAGE);
|
||||
extensions.add(VendorExtension.X_MAXIMUM_MESSAGE);
|
||||
extensions.add(VendorExtension.X_KOTLIN_IMPLEMENTS);
|
||||
extensions.add(VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS);
|
||||
return extensions;
|
||||
|
||||
@@ -20,7 +20,7 @@ package org.openapitools.codegen.languages;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
import org.openapitools.codegen.meta.Stability;
|
||||
@@ -153,6 +153,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
|
||||
cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC).defaultValue("false"));
|
||||
cliOptions.add(new CliOption(POETRY1_FALLBACK, "Fallback to formatting pyproject.toml to Poetry 1.x format."));
|
||||
cliOptions.add(new CliOption(LAZY_IMPORTS, "Enable lazy imports.").defaultValue(Boolean.FALSE.toString()));
|
||||
cliOptions.add(new CliOption(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE_DESC).defaultValue("false"));
|
||||
|
||||
supportedLibraries.put("urllib3", "urllib3-based client");
|
||||
supportedLibraries.put("asyncio", "asyncio-based client");
|
||||
@@ -271,6 +272,10 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
|
||||
additionalProperties.put(LAZY_IMPORTS, Boolean.valueOf(additionalProperties.get(LAZY_IMPORTS).toString()));
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE)) {
|
||||
setEnumUnknownDefaultCase(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE).toString()));
|
||||
}
|
||||
|
||||
String modelPath = packagePath() + File.separatorChar + modelPackage.replace('.', File.separatorChar);
|
||||
String apiPath = packagePath() + File.separatorChar + apiPackage.replace('.', File.separatorChar);
|
||||
|
||||
@@ -355,7 +360,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
|
||||
@Override
|
||||
public String toModelImport(String name) {
|
||||
String modelImport;
|
||||
if (Strings.CS.startsWithAny(name, "import", "from")) {
|
||||
if (StringUtils.startsWithAny(name, "import", "from")) {
|
||||
modelImport = name;
|
||||
} else {
|
||||
modelImport = "from ";
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
@@ -90,11 +89,6 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen {
|
||||
public PythonFastAPIServerCodegen() {
|
||||
super();
|
||||
|
||||
// Skip sorting of operations to preserve the order found in the OpenAPI spec file. See
|
||||
// https://fastapi.tiangolo.com/tutorial/path-params/?h=path#order-matters for details on why order matters.
|
||||
LOGGER.info("Skipping sorting of path operations, order matters, let the developer decide via their specification file.");
|
||||
setSkipSortingOperations(true);
|
||||
|
||||
modifyFeatureSet(features -> features.includeSecurityFeatures(
|
||||
SecurityFeature.OAuth2_AuthorizationCode,
|
||||
SecurityFeature.OAuth2_Password
|
||||
@@ -204,7 +198,7 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen {
|
||||
@Override
|
||||
public String toModelImport(String name) {
|
||||
String modelImport;
|
||||
if (Strings.CS.startsWithAny(name, "import", "from")) {
|
||||
if (StringUtils.startsWithAny(name, "import", "from")) {
|
||||
modelImport = name;
|
||||
} else {
|
||||
modelImport = "from ";
|
||||
|
||||
@@ -20,7 +20,6 @@ package org.openapitools.codegen.languages;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
@@ -354,7 +353,7 @@ public class PythonPydanticV1ClientCodegen extends AbstractPythonPydanticV1Codeg
|
||||
@Override
|
||||
public String toModelImport(String name) {
|
||||
String modelImport;
|
||||
if (Strings.CS.startsWithAny(name, "import", "from")) {
|
||||
if (StringUtils.startsWithAny(name, "import", "from")) {
|
||||
modelImport = name;
|
||||
} else {
|
||||
modelImport = "from ";
|
||||
|
||||
@@ -648,7 +648,7 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
}
|
||||
|
||||
private void postProcessPolymorphism(final List<ModelMap> allModels) {
|
||||
final HashMap<String, List<CodegenDiscriminator>> discriminatorsForModel = new HashMap<>();
|
||||
final HashMap<String, List<String>> discriminatorsForModel = new HashMap<>();
|
||||
|
||||
for (final ModelMap mo : allModels) {
|
||||
final CodegenModel cm = mo.getModel();
|
||||
@@ -656,17 +656,15 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
final CodegenComposedSchemas cs = cm.getComposedSchemas();
|
||||
if (cs != null) {
|
||||
final List<CodegenProperty> csOneOf = cs.getOneOf();
|
||||
CodegenDiscriminator discriminator = cm.getDiscriminator();
|
||||
|
||||
if (csOneOf != null) {
|
||||
processPolymorphismDataType(csOneOf, discriminator);
|
||||
processPolymorphismDataType(csOneOf);
|
||||
cs.setOneOf(csOneOf);
|
||||
cm.setComposedSchemas(cs);
|
||||
}
|
||||
|
||||
final List<CodegenProperty> csAnyOf = cs.getAnyOf();
|
||||
if (csAnyOf != null) {
|
||||
processPolymorphismDataType(csAnyOf, discriminator);
|
||||
processPolymorphismDataType(csAnyOf);
|
||||
cs.setAnyOf(csAnyOf);
|
||||
cm.setComposedSchemas(cs);
|
||||
}
|
||||
@@ -674,14 +672,14 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
|
||||
if (cm.discriminator != null) {
|
||||
for (final String model : cm.oneOf) {
|
||||
final List<CodegenDiscriminator> discriminators = discriminatorsForModel.getOrDefault(model, new ArrayList<>());
|
||||
discriminators.add(cm.discriminator);
|
||||
final List<String> discriminators = discriminatorsForModel.getOrDefault(model, new ArrayList<>());
|
||||
discriminators.add(cm.discriminator.getPropertyName());
|
||||
discriminatorsForModel.put(model, discriminators);
|
||||
}
|
||||
|
||||
for (final String model : cm.anyOf) {
|
||||
final List<CodegenDiscriminator> discriminators = discriminatorsForModel.getOrDefault(model, new ArrayList<>());
|
||||
discriminators.add(cm.discriminator);
|
||||
final List<String> discriminators = discriminatorsForModel.getOrDefault(model, new ArrayList<>());
|
||||
discriminators.add(cm.discriminator.getPropertyName());
|
||||
discriminatorsForModel.put(model, discriminators);
|
||||
}
|
||||
}
|
||||
@@ -691,11 +689,11 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
for (ModelMap mo : allModels) {
|
||||
final CodegenModel cm = mo.getModel();
|
||||
|
||||
final List<CodegenDiscriminator> discriminators = discriminatorsForModel.get(cm.getSchemaName());
|
||||
final List<String> discriminators = discriminatorsForModel.get(cm.getSchemaName());
|
||||
if (discriminators != null) {
|
||||
// If the discriminator field is not a defined attribute in the variant structure, create it.
|
||||
if (!discriminating(discriminators, cm)) {
|
||||
final CodegenDiscriminator discriminator = discriminators.get(0);
|
||||
final String discriminator = discriminators.get(0);
|
||||
|
||||
CodegenProperty property = new CodegenProperty();
|
||||
|
||||
@@ -712,18 +710,17 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
property.isDiscriminator = true;
|
||||
|
||||
// Attributes based on the discriminator value
|
||||
property.baseName = discriminator.getPropertyBaseName();
|
||||
property.name = discriminator.getPropertyName();
|
||||
property.nameInCamelCase = camelize(discriminator.getPropertyName());
|
||||
property.baseName = discriminator;
|
||||
property.name = discriminator;
|
||||
property.nameInCamelCase = camelize(discriminator);
|
||||
property.nameInPascalCase = property.nameInCamelCase.substring(0, 1).toUpperCase(Locale.ROOT) + property.nameInCamelCase.substring(1);
|
||||
property.nameInSnakeCase = underscore(discriminator.getPropertyName()).toUpperCase(Locale.ROOT);
|
||||
property.nameInSnakeCase = underscore(discriminator).toUpperCase(Locale.ROOT);
|
||||
property.getter = String.format(Locale.ROOT, "get%s", property.nameInPascalCase);
|
||||
property.setter = String.format(Locale.ROOT, "set%s", property.nameInPascalCase);
|
||||
property.defaultValueWithParam = String.format(Locale.ROOT, " = data.%s;", property.name);
|
||||
|
||||
// Attributes based on the model name
|
||||
property.defaultValue = String.format(Locale.ROOT, "r#\"%s\"#.to_string()", cm.getSchemaName());
|
||||
property.discriminatorValue = getDiscriminatorValue(cm.getClassname(), discriminator);
|
||||
property.jsonSchema = String.format(Locale.ROOT, "{ \"default\":\"%s\"; \"type\":\"string\" }", cm.getSchemaName());
|
||||
|
||||
cm.vars.add(property);
|
||||
@@ -746,27 +743,14 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
}
|
||||
}
|
||||
|
||||
private static String getDiscriminatorValue(String modelName, CodegenDiscriminator discriminator) {
|
||||
if (discriminator == null || discriminator.getMappedModels() == null) {
|
||||
return modelName;
|
||||
}
|
||||
return discriminator
|
||||
.getMappedModels()
|
||||
.stream()
|
||||
.filter(m -> m.getModelName().equals(modelName) && m.getMappingName() != null)
|
||||
.map(CodegenDiscriminator.MappedModel::getMappingName)
|
||||
.findFirst()
|
||||
.orElse(modelName);
|
||||
}
|
||||
|
||||
private static boolean discriminating(final List<CodegenDiscriminator> discriminatorsForModel, final CodegenModel cm) {
|
||||
private static boolean discriminating(final List<String> discriminatorsForModel, final CodegenModel cm) {
|
||||
resetDiscriminatorProperty(cm);
|
||||
|
||||
// Discriminator will be presented as enum tag -> One and only one tag is allowed
|
||||
int countString = 0;
|
||||
int countNonString = 0;
|
||||
for (final CodegenProperty var : cm.vars) {
|
||||
if (discriminatorsForModel.stream().anyMatch(discriminator -> var.baseName.equals(discriminator.getPropertyBaseName()) || var.name.equals(discriminator.getPropertyName()))) {
|
||||
if (discriminatorsForModel.stream().anyMatch(discriminator -> var.baseName.equals(discriminator) || var.name.equals(discriminator))) {
|
||||
if (var.isString) {
|
||||
var.isDiscriminator = true;
|
||||
++countString;
|
||||
@@ -789,7 +773,7 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
}
|
||||
}
|
||||
|
||||
private static void processPolymorphismDataType(final List<CodegenProperty> cp, CodegenDiscriminator discriminator) {
|
||||
private static void processPolymorphismDataType(final List<CodegenProperty> cp) {
|
||||
final HashSet<String> dedupDataTypeWithEnum = new HashSet<>();
|
||||
final HashMap<String, Integer> dedupDataType = new HashMap<>();
|
||||
|
||||
@@ -799,7 +783,6 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
// Mainly needed for primitive types.
|
||||
model.datatypeWithEnum = camelize(model.dataType.replaceAll("(?:\\w+::)+(\\w+)", "$1")
|
||||
.replace("<", "Of").replace(">", "")).replace(" ", "").replace(",", "");
|
||||
model.discriminatorValue = getDiscriminatorValue(model.datatypeWithEnum, discriminator);
|
||||
if (!dedupDataTypeWithEnum.add(model.datatypeWithEnum)) {
|
||||
model.datatypeWithEnum += ++idx;
|
||||
}
|
||||
@@ -878,24 +861,6 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
}
|
||||
|
||||
if (op.bodyParam != null) {
|
||||
final var dataType = op.bodyParam.dataType;
|
||||
if (dataType.startsWith(vecType + "<String")) {
|
||||
op.bodyParam.vendorExtensions.put("is-vec-string", true);
|
||||
} else if (dataType.startsWith(vecType + "<models::")) {
|
||||
op.bodyParam.vendorExtensions.put("is-vec-nested", true);
|
||||
} else if (dataType.startsWith(mapType + "<String, String")) {
|
||||
op.bodyParam.vendorExtensions.put("is-map-string", true);
|
||||
} else if (dataType.startsWith(mapType + "<String, models::")) {
|
||||
op.bodyParam.vendorExtensions.put("is-map-nested", true);
|
||||
} else if (dataType.startsWith(mapType + "<String")) {
|
||||
op.bodyParam.vendorExtensions.put("is-map", true);
|
||||
} else if (dataType.startsWith("models::")) {
|
||||
op.bodyParam.isModel = true;
|
||||
} else if (dataType.equals("String")) {
|
||||
op.bodyParam.isString = true;
|
||||
op.bodyParam.vendorExtensions.put("is-string", true);
|
||||
}
|
||||
|
||||
if (consumesJson) {
|
||||
op.bodyParam.vendorExtensions.put("x-consumes-json", true);
|
||||
} else if (consumesFormUrlEncoded) {
|
||||
|
||||
@@ -58,7 +58,6 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
@Setter private boolean preferUnsignedInt = false;
|
||||
@Setter private boolean bestFitInt = false;
|
||||
@Setter private boolean avoidBoxedModels = false;
|
||||
private List<String> reqwestDefaultFeatures = Arrays.asList("native-tls");
|
||||
|
||||
public static final String PACKAGE_NAME = "packageName";
|
||||
public static final String EXTERN_CRATE_NAME = "externCrateName";
|
||||
@@ -78,7 +77,6 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
public static final String TOP_LEVEL_API_CLIENT = "topLevelApiClient";
|
||||
public static final String MOCKALL = "mockall";
|
||||
public static final String BON_BUILDER = "useBonBuilder";
|
||||
public static final String REQWEST_DEFAULT_FEATURES = "reqwestDefaultFeatures";
|
||||
|
||||
@Setter protected String packageName = "openapi";
|
||||
@Setter protected String packageVersion = "1.0.0";
|
||||
@@ -229,8 +227,6 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
.defaultValue(Boolean.FALSE.toString()));
|
||||
cliOptions.add(new CliOption(BON_BUILDER, "Use the bon crate for building parameter types. This option is for the 'reqwest-trait' library only", SchemaTypeUtil.BOOLEAN_TYPE)
|
||||
.defaultValue(Boolean.FALSE.toString()));
|
||||
cliOptions.add(new CliOption(REQWEST_DEFAULT_FEATURES, "Default features for the reqwest dependency (comma-separated). Use empty for no defaults. This option is for 'reqwest' and 'reqwest-trait' library only.")
|
||||
.defaultValue("native-tls"));
|
||||
|
||||
supportedLibraries.put(HYPER_LIBRARY, "HTTP client: Hyper (v1.x).");
|
||||
supportedLibraries.put(HYPER0X_LIBRARY, "HTTP client: Hyper (v0.x).");
|
||||
@@ -435,21 +431,6 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
}
|
||||
writePropertyBack(AVOID_BOXED_MODELS, getAvoidBoxedModels());
|
||||
|
||||
if (additionalProperties.containsKey(REQWEST_DEFAULT_FEATURES)) {
|
||||
Object value = additionalProperties.get(REQWEST_DEFAULT_FEATURES);
|
||||
if (value instanceof List) {
|
||||
reqwestDefaultFeatures = (List<String>) value;
|
||||
} else if (value instanceof String) {
|
||||
String str = (String) value;
|
||||
if (str.isEmpty()) {
|
||||
reqwestDefaultFeatures = new ArrayList<>();
|
||||
} else {
|
||||
reqwestDefaultFeatures = Arrays.asList(str.split(",\\s*"));
|
||||
}
|
||||
}
|
||||
}
|
||||
additionalProperties.put(REQWEST_DEFAULT_FEATURES, reqwestDefaultFeatures);
|
||||
|
||||
additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
|
||||
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
|
||||
additionalProperties.put(EXTERN_CRATE_NAME, getExternCrateName());
|
||||
|
||||
@@ -1408,7 +1408,6 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
*
|
||||
* @deprecated Avoid using this - use a different mechanism instead.
|
||||
*/
|
||||
@Deprecated
|
||||
private static String stripNullable(String type) {
|
||||
if (type.startsWith("swagger::Nullable<") && type.endsWith(">")) {
|
||||
return type.substring("swagger::Nullable<".length(), type.length() - 1);
|
||||
|
||||
@@ -1408,7 +1408,6 @@ public class RustServerCodegenDeprecated extends AbstractRustCodegen implements
|
||||
*
|
||||
* @deprecated Avoid using this - use a different mechanism instead.
|
||||
*/
|
||||
@Deprecated
|
||||
private static String stripNullable(String type) {
|
||||
if (type.startsWith("swagger::Nullable<") && type.endsWith(">")) {
|
||||
return type.substring("swagger::Nullable<".length(), type.length() - 1);
|
||||
|
||||
@@ -100,7 +100,6 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
public static final String OPTIONAL_ACCEPT_NULLABLE = "optionalAcceptNullable";
|
||||
public static final String USE_SPRING_BUILT_IN_VALIDATION = "useSpringBuiltInValidation";
|
||||
public static final String USE_DEDUCTION_FOR_ONE_OF_INTERFACES = "useDeductionForOneOfInterfaces";
|
||||
public static final String SPRING_API_VERSION = "springApiVersion";
|
||||
|
||||
@Getter
|
||||
public enum RequestMappingMode {
|
||||
@@ -287,7 +286,6 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
optionalAcceptNullable));
|
||||
|
||||
cliOptions.add(CliOption.newBoolean(USE_DEDUCTION_FOR_ONE_OF_INTERFACES, "whether to use deduction for generated oneOf interfaces", useDeductionForOneOfInterfaces));
|
||||
cliOptions.add(CliOption.newString(SPRING_API_VERSION, "Value for 'version' attribute in @RequestMapping (for Spring 7 and above)."));
|
||||
supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application.");
|
||||
supportedLibraries.put(SPRING_CLOUD_LIBRARY,
|
||||
"Spring-Cloud-Feign client with Spring-Boot auto-configured settings.");
|
||||
@@ -568,8 +566,12 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
(sourceFolder + File.separator + apiPackage).replace(".", java.io.File.separator), "ApiUtil.java"));
|
||||
}
|
||||
|
||||
if (!delegatePattern || delegateMethod) {
|
||||
additionalProperties.put("jdk8-no-delegate", true);
|
||||
}
|
||||
|
||||
if (delegatePattern && !delegateMethod) {
|
||||
additionalProperties.put("isDelegate", true);
|
||||
additionalProperties.put("isDelegate", "true");
|
||||
apiTemplateFiles.put("apiDelegate.mustache", "Delegate.java");
|
||||
}
|
||||
|
||||
@@ -853,8 +855,6 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
}
|
||||
|
||||
private void prepareVersioningParameters(List<CodegenOperation> operations) {
|
||||
Object apiVersion = additionalProperties.get(SPRING_API_VERSION);
|
||||
boolean hasApiVersion = apiVersion != null;
|
||||
for (CodegenOperation operation : operations) {
|
||||
if (operation.getHasHeaderParams()) {
|
||||
List<CodegenParameter> versionParams = operation.headerParams.stream()
|
||||
@@ -877,9 +877,6 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
operation.hasVersionQueryParams = !versionParams.isEmpty();
|
||||
operation.vendorExtensions.put("versionQueryParamsList", versionParams);
|
||||
}
|
||||
if (hasApiVersion) {
|
||||
operation.vendorExtensions.putIfAbsent(VendorExtension.X_SPRING_API_VERSION.getName(), apiVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -984,11 +981,6 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
codegenModel.imports.remove("ApiModel");
|
||||
}
|
||||
|
||||
if (getAnnotationLibrary() != AnnotationLibrary.SWAGGER2) {
|
||||
// remove swagger imports
|
||||
codegenModel.imports.remove("Schema");
|
||||
}
|
||||
|
||||
return codegenModel;
|
||||
}
|
||||
|
||||
@@ -1213,10 +1205,6 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
extensions.add(VendorExtension.X_SPRING_PAGINATED);
|
||||
extensions.add(VendorExtension.X_VERSION_PARAM);
|
||||
extensions.add(VendorExtension.X_PATTERN_MESSAGE);
|
||||
extensions.add(VendorExtension.X_SIZE_MESSAGE);
|
||||
extensions.add(VendorExtension.X_MINIMUM_MESSAGE);
|
||||
extensions.add(VendorExtension.X_MAXIMUM_MESSAGE);
|
||||
extensions.add(VendorExtension.X_SPRING_API_VERSION);
|
||||
return extensions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,9 +461,6 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
||||
}
|
||||
}
|
||||
|
||||
// backup path in extensions
|
||||
op.vendorExtensions.put("x-path-from-spec", op.path);
|
||||
|
||||
// Overwrite path to TypeScript template string, after applying everything we just did.
|
||||
op.path = pathBuffer.toString();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege
|
||||
public static final String USE_SQUARE_BRACKETS_IN_ARRAY_NAMES = "useSquareBracketsInArrayNames";
|
||||
public static final String AXIOS_VERSION = "axiosVersion";
|
||||
public static final String DEFAULT_AXIOS_VERSION = "^1.6.1";
|
||||
public static final String WITH_AWSV4_SIGNATURE = "withAWSV4Signature";
|
||||
|
||||
@Getter @Setter
|
||||
protected String npmRepository = null;
|
||||
@@ -61,7 +60,6 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege
|
||||
|
||||
@Getter @Setter
|
||||
protected String axiosVersion = DEFAULT_AXIOS_VERSION;
|
||||
protected boolean withAWSV4Signature = false;
|
||||
|
||||
private String tsModelPackage = "";
|
||||
|
||||
@@ -73,7 +71,7 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege
|
||||
|
||||
modifyFeatureSet(features -> features
|
||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||
.includeSecurityFeatures(SecurityFeature.BearerToken, SecurityFeature.AWSV4Signature));
|
||||
.includeSecurityFeatures(SecurityFeature.BearerToken));
|
||||
|
||||
// clear import mapping (from default generator) as TS does not use it
|
||||
// at the moment
|
||||
@@ -96,7 +94,6 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege
|
||||
this.cliOptions.add(new CliOption(IMPORT_FILE_EXTENSION_SWITCH, IMPORT_FILE_EXTENSION_SWITCH_DESC, SchemaTypeUtil.STRING_TYPE).defaultValue(this.importFileExtension));
|
||||
this.cliOptions.add(new CliOption(USE_SQUARE_BRACKETS_IN_ARRAY_NAMES, "Setting this property to true will add brackets to array attribute names, e.g. my_values[].", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
|
||||
this.cliOptions.add(new CliOption(AXIOS_VERSION, "Use this property to override the axios version in package.json").defaultValue(DEFAULT_AXIOS_VERSION));
|
||||
this.cliOptions.add(new CliOption(WITH_AWSV4_SIGNATURE, "whether to include AWS v4 signature support", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
|
||||
// Templates have no mapping between formatted property names and original base names so use only "original" and remove this option
|
||||
removeOption(CodegenConstants.MODEL_PROPERTY_NAMING);
|
||||
}
|
||||
@@ -185,10 +182,6 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege
|
||||
setAxiosVersion(additionalProperties.get(AXIOS_VERSION).toString());
|
||||
}
|
||||
additionalProperties.put("axiosVersion", getAxiosVersion());
|
||||
if (additionalProperties.containsKey(CodegenConstants.WITH_AWSV4_SIGNATURE_COMMENT)) {
|
||||
this.setWithAWSV4Signature(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.WITH_AWSV4_SIGNATURE_COMMENT).toString()));
|
||||
}
|
||||
additionalProperties.put(CodegenConstants.WITH_AWSV4_SIGNATURE_COMMENT, withAWSV4Signature);
|
||||
|
||||
}
|
||||
|
||||
@@ -314,10 +307,6 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege
|
||||
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
public void setWithAWSV4Signature(boolean withAWSV4Signature) {
|
||||
this.withAWSV4Signature = withAWSV4Signature;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overriding toRegularExpression() to avoid escapeText() being called,
|
||||
* as it would return a broken regular expression if any escaped character / metacharacter were present.
|
||||
|
||||
@@ -100,8 +100,6 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp
|
||||
private final DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE;
|
||||
private final DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME;
|
||||
|
||||
protected String apiDocPath = "docs/";
|
||||
|
||||
public TypeScriptClientCodegen() {
|
||||
super();
|
||||
|
||||
@@ -402,11 +400,6 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp
|
||||
return objs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiDocFileFolder() {
|
||||
return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
private List<Map<String, String>> toTsImports(CodegenModel cm, Set<String> imports) {
|
||||
List<Map<String, String>> tsImports = new ArrayList<>();
|
||||
for (String im : imports) {
|
||||
@@ -439,8 +432,6 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp
|
||||
apiPackage = this.apiPackage + ".apis";
|
||||
testPackage = this.testPackage + ".tests";
|
||||
|
||||
additionalProperties.put("apiDocPath", apiDocPath);
|
||||
|
||||
additionalProperties.putIfAbsent(FRAMEWORK_SWITCH, FRAMEWORKS[0]);
|
||||
supportingFiles.add(new SupportingFile("index.mustache", "index.ts"));
|
||||
|
||||
|
||||
@@ -73,8 +73,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
protected boolean withoutRuntimeChecks = false;
|
||||
protected boolean stringEnums = false;
|
||||
protected String fileNaming = PASCAL_CASE;
|
||||
protected String apiDocPath = "docs";
|
||||
protected String modelDocPath = "docs";
|
||||
|
||||
// "Saga and Record" mode.
|
||||
public static final String SAGAS_AND_RECORDS = "sagasAndRecords";
|
||||
@@ -109,12 +107,10 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
// at the moment
|
||||
importMapping.clear();
|
||||
|
||||
outputFolder = "generated-code" + File.separator + "typescript-fetch";
|
||||
outputFolder = "generated-code/typescript-fetch";
|
||||
embeddedTemplateDir = templateDir = "typescript-fetch";
|
||||
|
||||
this.apiTemplateFiles.put("apis.mustache", ".ts");
|
||||
this.apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
||||
this.modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||
|
||||
this.addExtraReservedWords();
|
||||
|
||||
@@ -142,11 +138,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
return convertUsingFileNamingConvention(super.toModelFilename(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toModelDocFilename(String name) {
|
||||
return toModelName(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the original name according to the current <code>fileNaming</code> strategy.
|
||||
*
|
||||
@@ -251,10 +242,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
this.apiPackage = sourceDir + "apis";
|
||||
this.modelPackage = sourceDir + "models";
|
||||
|
||||
// make api and model doc path available in mustache template
|
||||
additionalProperties.put("apiDocPath", apiDocPath);
|
||||
additionalProperties.put("modelDocPath", modelDocPath);
|
||||
|
||||
supportingFiles.add(new SupportingFile("index.mustache", sourceDir, "index.ts"));
|
||||
supportingFiles.add(new SupportingFile("runtime.mustache", sourceDir, "runtime.ts"));
|
||||
|
||||
@@ -329,16 +316,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
convertPropertyToBooleanAndWriteBack(VALIDATION_ATTRIBUTES, this::setGenerateValidationAttributes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiDocFileFolder() {
|
||||
return (outputFolder + File.separator + apiDocPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelDocFileFolder() {
|
||||
return (outputFolder + File.separator + modelDocPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toEnumDefaultValue(String value, String datatype) {
|
||||
if (this.getSagasAndRecords()) {
|
||||
@@ -1522,16 +1499,11 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
public Set<String> oneOfArrays = new TreeSet<>();
|
||||
@Getter @Setter
|
||||
public Set<CodegenProperty> oneOfPrimitives = new HashSet<>();
|
||||
@Getter @Setter
|
||||
public CodegenDiscriminator.MappedModel selfReferencingDiscriminatorMapping;
|
||||
|
||||
|
||||
public boolean isEntity; // Is a model containing an "id" property marked as isUniqueId
|
||||
public String returnPassthrough;
|
||||
public boolean hasReturnPassthroughVoid;
|
||||
|
||||
public boolean hasSelfReferencingDiscriminatorMapping(){
|
||||
return selfReferencingDiscriminatorMapping != null;
|
||||
}
|
||||
|
||||
public boolean isDateType() {
|
||||
return isDate && "Date".equals(dataType);
|
||||
}
|
||||
@@ -1625,17 +1597,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
this.setAdditionalProperties(cm.getAdditionalProperties());
|
||||
this.setIsModel(cm.getIsModel());
|
||||
this.setComposedSchemas(cm.getComposedSchemas());
|
||||
if (this.discriminator != null) {
|
||||
Set<CodegenDiscriminator.MappedModel> mappedModels = this.discriminator.getMappedModels();
|
||||
for(CodegenDiscriminator.MappedModel mappedModel : mappedModels) {
|
||||
if(mappedModel.getModelName().equals(cm.classname)) {
|
||||
this.selfReferencingDiscriminatorMapping = mappedModel;
|
||||
}
|
||||
}
|
||||
if(this.selfReferencingDiscriminatorMapping != null) {
|
||||
this.discriminator.getMappedModels().remove(this.selfReferencingDiscriminatorMapping);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,7 +56,6 @@ import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_PARENT;
|
||||
import static org.openapitools.codegen.utils.OnceLogger.once;
|
||||
|
||||
public class ModelUtils {
|
||||
@@ -1717,7 +1716,7 @@ public class ModelUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object xParent = schema.getExtensions().get(X_PARENT);
|
||||
Object xParent = schema.getExtensions().get("x-parent");
|
||||
if (xParent == null) {
|
||||
return false;
|
||||
} else if (xParent instanceof Boolean) {
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "{{classname}}.h"
|
||||
|
||||
#define MAX_NUMBER_LENGTH 16
|
||||
#define MAX_BUFFER_LENGTH 4096
|
||||
#define MAX_NUMBER_LENGTH_LONG 21
|
||||
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
@@ -231,16 +229,10 @@ end:
|
||||
// query parameters
|
||||
{{^isArray}}
|
||||
char *keyQuery_{{{paramName}}} = NULL;
|
||||
{{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}char *{{/isLong}}{{#isInteger}}char *{{/isInteger}}{{#isDouble}}char *{{/isDouble}}{{#isFloat}}char *{{/isFloat}}{{#isBoolean}}char *{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}} valueQuery_{{{paramName}}} {{#isString}}{{^isEnum}}= NULL{{/isEnum}}{{/isString}}{{#isInteger}}= NULL{{/isInteger}}{{#isBoolean}}= NULL{{/isBoolean}}{{#isDouble}}= NULL{{/isDouble}}{{#isFloat}}= NULL{{/isFloat}};
|
||||
{{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}char *{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}char *{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}} valueQuery_{{{paramName}}} {{#isString}}{{^isEnum}}= NULL{{/isEnum}}{{/isString}}{{#isInteger}}= NULL{{/isInteger}}{{#isBoolean}}= NULL{{/isBoolean}};
|
||||
keyValuePair_t *keyPairQuery_{{paramName}} = 0;
|
||||
{{/isArray}}
|
||||
{{^isLong}}
|
||||
{{^isFloat}}
|
||||
{{^isDouble}}
|
||||
if ({{paramName}})
|
||||
{{/isDouble}}
|
||||
{{/isFloat}}
|
||||
{{/isLong}}
|
||||
{
|
||||
{{#isArray}}
|
||||
list_addElement(localVarQueryParameters,{{paramName}});
|
||||
@@ -251,43 +243,17 @@ end:
|
||||
valueQuery_{{{paramName}}} = calloc(1,MAX_NUMBER_LENGTH);
|
||||
snprintf(valueQuery_{{{paramName}}}, MAX_NUMBER_LENGTH, "%d", *{{{paramName}}});
|
||||
{{/isInteger}}
|
||||
{{#isFloat}}
|
||||
int s = snprintf(NULL, 0, "%.7e", {{{paramName}}});
|
||||
if (s >= 0)
|
||||
{
|
||||
valueQuery_{{{paramName}}} = calloc(1,s+1);
|
||||
snprintf(valueQuery_{{{paramName}}}, s+1, "%.7e", {{{paramName}}});
|
||||
}
|
||||
{{/isFloat}}
|
||||
{{#isDouble}}
|
||||
int s = snprintf(NULL, 0, "%.16e", {{{paramName}}});
|
||||
if (s >= 0)
|
||||
{
|
||||
valueQuery_{{{paramName}}} = calloc(1,s+1);
|
||||
snprintf(valueQuery_{{{paramName}}}, s+1, "%.16e", {{{paramName}}});
|
||||
}
|
||||
{{/isDouble}}
|
||||
{{#isLong}}
|
||||
valueQuery_{{{paramName}}} = calloc(1,MAX_NUMBER_LENGTH_LONG);
|
||||
snprintf(valueQuery_{{{paramName}}}, MAX_NUMBER_LENGTH_LONG, "%d", {{{paramName}}});
|
||||
{{/isLong}}
|
||||
{{#isBoolean}}
|
||||
valueQuery_{{{paramName}}} = calloc(1,MAX_NUMBER_LENGTH);
|
||||
snprintf(valueQuery_{{{paramName}}}, MAX_NUMBER_LENGTH, "%d", *{{{paramName}}});
|
||||
{{/isBoolean}}
|
||||
{{^isInteger}}
|
||||
{{^isBoolean}}
|
||||
{{^isFloat}}
|
||||
{{^isDouble}}
|
||||
{{^isLong}}
|
||||
valueQuery_{{{paramName}}} = {{#isString}}{{^isEnum}}strdup({{/isEnum}}{{/isString}}({{{paramName}}}){{#isString}}{{^isEnum}}){{/isEnum}}{{/isString}};
|
||||
{{/isLong}}
|
||||
{{/isDouble}}
|
||||
{{/isFloat}}
|
||||
{{/isBoolean}}
|
||||
{{/isInteger}}
|
||||
keyPairQuery_{{paramName}} = keyValuePair_create(keyQuery_{{{paramName}}}, {{#isEnum}}strdup({{{operationId}}}_{{enumName}}_ToString(
|
||||
{{/isEnum}}{{^isString}}{{^isInteger}}{{^isFloat}}{{^isDouble}}{{^isLong}}{{^isBoolean}}&{{/isBoolean}}{{/isLong}}{{/isDouble}}{{/isFloat}}{{/isInteger}}{{/isString}}valueQuery_{{{paramName}}}{{#isEnum}})){{/isEnum}});
|
||||
{{/isEnum}}{{^isString}}{{^isInteger}}{{^isBoolean}}&{{/isBoolean}}{{/isInteger}}{{/isString}}valueQuery_{{{paramName}}}{{#isEnum}})){{/isEnum}});
|
||||
list_addElement(localVarQueryParameters,keyPairQuery_{{paramName}});
|
||||
{{/isArray}}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
{{#useBeanValidation}}
|
||||
|
||||
@@ -117,7 +117,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
httpclient_version = "5.1.3"
|
||||
|
||||
@@ -354,7 +354,7 @@
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
|
||||
@@ -107,7 +107,7 @@ ext {
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{/jackson}}
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
feign_version = "13.5"
|
||||
|
||||
@@ -416,7 +416,7 @@
|
||||
<gson-version>2.10.1</gson-version>
|
||||
{{/gson}}
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
|
||||
@@ -101,7 +101,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
google_api_client_version = "1.32.2"
|
||||
|
||||
@@ -313,7 +313,7 @@
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#joda}}
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
|
||||
@@ -1299,9 +1299,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
try {
|
||||
response = sendRequest(method, invocationBuilder, entity);
|
||||
|
||||
final int statusCode = response.getStatusInfo().getStatusCode();
|
||||
|
||||
{{#hasOAuthMethods}}
|
||||
// If OAuth is used and a status 401 is received, renew the access token and retry the request
|
||||
if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
|
||||
if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
|
||||
for (String authName : authNames) {
|
||||
Authentication authentication = authentications.get(authName);
|
||||
if (authentication instanceof OAuth) {
|
||||
@@ -1315,10 +1317,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{{/hasOAuthMethods}}
|
||||
final int statusCode = response.getStatusInfo().getStatusCode();
|
||||
|
||||
{{/hasOAuthMethods}}
|
||||
Map<String, List<String>> responseHeaders = buildResponseHeaders(response);
|
||||
|
||||
if (statusCode == Status.NO_CONTENT.getStatusCode()) {
|
||||
|
||||
@@ -107,7 +107,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
{{#useBeanValidation}}
|
||||
|
||||
@@ -24,7 +24,7 @@ lazy val root = (project in file(".")).
|
||||
{{/joda}}
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.19.2" % "compile",
|
||||
{{#openApiNullable}}
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.8" % "compile",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7" % "compile",
|
||||
{{/openApiNullable}}
|
||||
{{#hasOAuthMethods}}
|
||||
"com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",
|
||||
|
||||
@@ -407,7 +407,7 @@
|
||||
<jersey-version>2.37</jersey-version>
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
<beanvalidation-version>3.0.2</beanvalidation-version>
|
||||
|
||||
@@ -1299,9 +1299,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
try {
|
||||
response = sendRequest(method, invocationBuilder, entity);
|
||||
|
||||
final int statusCode = response.getStatusInfo().getStatusCode();
|
||||
|
||||
{{#hasOAuthMethods}}
|
||||
// If OAuth is used and a status 401 is received, renew the access token and retry the request
|
||||
if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
|
||||
if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
|
||||
for (String authName : authNames) {
|
||||
Authentication authentication = authentications.get(authName);
|
||||
if (authentication instanceof OAuth) {
|
||||
@@ -1317,8 +1319,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
}
|
||||
|
||||
{{/hasOAuthMethods}}
|
||||
final int statusCode = response.getStatusInfo().getStatusCode();
|
||||
|
||||
Map<String, List<String>> responseHeaders = buildResponseHeaders(response);
|
||||
|
||||
if (statusCode == Status.NO_CONTENT.getStatusCode()) {
|
||||
|
||||
@@ -102,7 +102,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "2.1.0"
|
||||
{{#useBeanValidation}}
|
||||
|
||||
@@ -24,7 +24,7 @@ lazy val root = (project in file(".")).
|
||||
{{/joda}}
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.19.2" % "compile",
|
||||
{{#openApiNullable}}
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.8" % "compile",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7" % "compile",
|
||||
{{/openApiNullable}}
|
||||
{{#hasOAuthMethods}}
|
||||
"com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",
|
||||
|
||||
@@ -407,7 +407,7 @@
|
||||
<jersey-version>3.1.1</jersey-version>
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
<beanvalidation-version>3.0.2</beanvalidation-version>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{^isUuid}}{{#pattern}} @Pattern(regexp="{{{.}}}"){{/pattern}}{{!
|
||||
{{#pattern}} @Pattern(regexp="{{{.}}}"){{/pattern}}{{!
|
||||
minLength && maxLength set
|
||||
}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{!
|
||||
minLength set, maxLength not
|
||||
@@ -17,4 +17,4 @@ isInteger set
|
||||
isLong set
|
||||
}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{!
|
||||
Not Integer, not Long => we have a decimal value!
|
||||
}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{.}}"){{/minimum}}{{#maximum}} @DecimalMax("{{.}}"){{/maximum}}{{/isLong}}{{/isInteger}}{{/isUuid}}
|
||||
}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{.}}"){{/minimum}}{{#maximum}} @DecimalMax("{{.}}"){{/maximum}}{{/isLong}}{{/isInteger}}
|
||||
@@ -223,7 +223,7 @@
|
||||
<swagger.core.version>1.5.18</swagger.core.version>
|
||||
<jetty.version>9.2.9.v20150224</jetty.version>
|
||||
<junit.version>5.10.2</junit.version>
|
||||
<logback.version>1.5.19</logback.version>
|
||||
<logback.version>1.5.13</logback.version>
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation.version>3.0.2</beanvalidation.version>
|
||||
{{/useBeanValidation}}
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
<swagger.core.version>1.5.18</swagger.core.version>
|
||||
<jetty.version>9.2.9.v20150224</jetty.version>
|
||||
<junit.version>5.10.2</junit.version>
|
||||
<logback.version>1.5.19</logback.version>
|
||||
<logback.version>1.5.13</logback.version>
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation.version>3.0.1</beanvalidation.version>
|
||||
{{/useBeanValidation}}
|
||||
|
||||
@@ -102,7 +102,7 @@ dependencies {
|
||||
implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||||
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
|
||||
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
|
||||
implementation "org.openapitools:jackson-databind-nullable:0.2.8"
|
||||
implementation "org.openapitools:jackson-databind-nullable:0.2.7"
|
||||
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
|
||||
{{#useBeanValidation}}
|
||||
implementation "jakarta.validation:jakarta.validation-api:$beanvalidation_version"
|
||||
|
||||
@@ -300,7 +300,7 @@
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
<beanvalidation-version>3.0.2</beanvalidation-version>
|
||||
|
||||
@@ -132,7 +132,7 @@ dependencies {
|
||||
implementation 'io.gsonfire:gson-fire:1.9.0'
|
||||
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
|
||||
{{#openApiNullable}}
|
||||
implementation 'org.openapitools:jackson-databind-nullable:0.2.8'
|
||||
implementation 'org.openapitools:jackson-databind-nullable:0.2.7'
|
||||
{{/openApiNullable}}
|
||||
{{#withAWSV4Signature}}
|
||||
implementation 'software.amazon.awssdk:auth:2.20.157'
|
||||
|
||||
@@ -16,7 +16,7 @@ lazy val root = (project in file(".")).
|
||||
"org.apache.commons" % "commons-lang3" % "3.18.0",
|
||||
"jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6",
|
||||
{{#openApiNullable}}
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.8",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7",
|
||||
{{/openApiNullable}}
|
||||
{{#withAWSV4Signature}}
|
||||
"software.amazon.awssdk" % "auth" % "2.20.157",
|
||||
|
||||
@@ -416,7 +416,7 @@
|
||||
<gson-version>2.10.1</gson-version>
|
||||
<commons-lang3-version>3.18.0</commons-lang3-version>
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#joda}}
|
||||
<jodatime-version>2.12.0</jodatime-version>
|
||||
|
||||
@@ -109,7 +109,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
{{/jackson}}
|
||||
{{#gson}}
|
||||
|
||||
@@ -18,7 +18,7 @@ lazy val root = (project in file(".")).
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.19.2",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.19.2",
|
||||
{{#openApiNullable}}
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.8",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7",
|
||||
{{/openApiNullable}}
|
||||
{{#withXml}}
|
||||
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.13.4.1",
|
||||
|
||||
@@ -354,7 +354,7 @@
|
||||
{{#jackson}}
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/jackson}}
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
|
||||
@@ -106,7 +106,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
spring_web_version = "6.1.21"
|
||||
jakarta_annotation_version = "2.1.1"
|
||||
|
||||
@@ -350,7 +350,7 @@
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
{{#joda}}
|
||||
|
||||
@@ -101,7 +101,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
threetenbp_version = "2.9.10"
|
||||
|
||||
@@ -301,7 +301,7 @@
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
|
||||
@@ -118,7 +118,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
spring_web_version = "6.2.8"
|
||||
|
||||
@@ -364,7 +364,7 @@
|
||||
<jackson-version>2.19.2</jackson-version>
|
||||
<jackson-databind-version>2.19.2</jackson-databind-version>
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
<spring-web-version>6.2.8</spring-web-version>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user